刚刚开始学习spring,第一个例子就老走不通!烦!!
报错如下:
The requested resource (/login.do) is not available.web.xml如下:<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> applicationContext.xml如下: <bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<property name="viewClass">
<value>
org.springframework.web.servlet.view.JstlView
</value>
</property>
<property name="prefix">
<value>
/WEB-INF/
</value>
</property>
<property name="suffix">
<value>
.jsp
</value>
</property>
</bean
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/login.do">LoginAction</prop>
</props>
</property>
</bean> <bean id="LoginAction"
class="com.spring.LoginAction">
<property name="commandClass">
<value>
com.spring.LoginInfo
</value>
</property>
<property name="fail_view">
<value>
loginfail
</value>
</property>
<property name="success_view">
<value>
main
</value>
</property>
</bean>
报错如下:
The requested resource (/login.do) is not available.web.xml如下:<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> applicationContext.xml如下: <bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<property name="viewClass">
<value>
org.springframework.web.servlet.view.JstlView
</value>
</property>
<property name="prefix">
<value>
/WEB-INF/
</value>
</property>
<property name="suffix">
<value>
.jsp
</value>
</property>
</bean
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/login.do">LoginAction</prop>
</props>
</property>
</bean> <bean id="LoginAction"
class="com.spring.LoginAction">
<property name="commandClass">
<value>
com.spring.LoginInfo
</value>
</property>
<property name="fail_view">
<value>
loginfail
</value>
</property>
<property name="success_view">
<value>
main
</value>
</property>
</bean>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货