1.
if run startup.bat
in cmd
can not see in web
apache-tomcat-6.0.30\webapps\AbstractCommandDemo\WebContent\WEB-INF\index.html
apache-tomcat-6.0.30\webapps\AbstractCommandDemo\WebContent\WEB-INF\jsp\userInfo.jsp
localhost:8080/AbstractCommandDemo/userInfo.jsp
localhost:8080/AbstractCommandDemo/user.do
localhost:8080/AbstractCommandDemo/WEB-INF/jsp/userInfo.jsp
can see in web
apache-tomcat-6.0.30\webapps\AbstractCommandDemo\index.html
2.
Moreover, if running through eclipse, worse than above situation, can not see index.html
in http://localhost:8080/
which is apache-tomcat-6.0.30\webapps\AbstractCommandDemo\index.html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>AbstractCommandController Demo</title>
</head>
<body>
<h1>name:${userInfo['name']}</h1>
<h1>password:${userInfo['password']}</h1>
</body>
</html>
web.xml
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/mvcconfig.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
mvcconfig.xml
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/user.do">userController</prop>
</props>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<bean id="userController"
class="onlyfun.caterpillar.UserController">
<property name="userPage" value="userInfo"/>
</bean>