我用springMVC做一个小例子 在web.xml里面如下配置
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
demo_project
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath*:/resources/applicationContext.xml
demo_project
[color=red]/<!--我不想再这指定一个扩展名/*.action-->[/color]
有一个JSP
<%
String path = request.getContextPath();
System.out.println("path="+path);
%>
我在浏览器里面输入
http://localhost:8080/demo_project/index.jsp
能出来页面
但是无法引用到js
2011-02-28 18:50:16,545 WARN [http-8080-2] org.springframework.web.servlet.DispatcherServlet.noHandlerFound(931) | No mapping found for HTTP request with URI [/demo_project/test.js] in DispatcherServlet with name 'demo_project'
应用