当我运行我的jsp文件时,java脚本无法正常工作,我无法理解为什么我使用jstl标签而且我将我的jsp文件放在ressource下。任何人都告诉我有什么问题谢谢
的web.xml
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
分配器一小服务程序
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
JSP文件 “&GT;
<script type="text/javascript" src="<c:url value="/resources/bower_components/metisMenu/dist/metisMenu.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/resources/bower_components/datatables/media/js/jquery.dataTables.min.js"/>"></script>
答案 0 :(得分:0)
不要使用JSTL标记。
<script type="text/javascript" src="/resources/bower_components/metisMenu/dist/metisMenu.min.js"></script>
<script type="text/javascript" src="/resources/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>