新手,我只是页面访问http://localhost:8080/ce2/eq/userAction/loginInit.do 能到action就是 renturn “index”提示找不到 页面404
preHandle方法名:loginInit
11:15:52.754 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.InternalResourceView: name 'index'; URL [/eq/index.jsp]] in DispatcherServlet with name 'ce'
11:15:52.755 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Added model object 'locale' of type [java.lang.String] to request in view with name 'index'
11:15:52.756 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Forwarding to resource [/eq/index.jsp] in InternalResourceView 'index'
11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'ce' processing GET request for [/ce2/eq/index.jsp]
11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /index.jsp
11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/index.jsp]
11:15:52.762 [http-bio-8080-exec-3] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/ce2/eq/index.jsp] in DispatcherServlet with name 'ce'
11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
afterCompletion方法名:loginInit
11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter
11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session
web.xml
<?xml version="1.0" encoding="UTF-8"?>
contextConfigLocation
classpath:conf/spring.xml
<!--
webAppRootKey
ce2
-->
encoding
org.springframework.web.filter.CharacterEncodingFilter
encoding
UTF-8
forceEncoding
true
osivFilter
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
encoding
.do
osivFilter
.do
encoding
.jsp
osivFilter
.jsp
encoding
.action
org.springframework.web.context.ContextLoaderListener
org.springframework.web.util.IntrospectorCleanupListener
ce
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:conf/spring/ce-servlet.xml
1
ce
/eq/
30
index.jsp
spring.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
location='WEB-INF/setup.properties' />
classpath*:conf/hbm/*.hbm.xml
true
true
true
com.ce.util.SqlServer2008Dialect
false
false
org.hibernate.cache.EhCacheProvider
false
true
20
classpath:conf/spring/ehcache-application.xml
/WEB-INF/cache/application
UserAction
package com.ce.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.ce.biz.UserBiz;
import com.ce.entity.User;
import com.ce.web.ParentsControl;
/**
-
用户action
*/
@Controller
public class UserAction extends ParentsControl{
private static final Logger log = LoggerFactory.getLogger(UserAction.class);private User user;
@Autowired
private UserBiz userBiz;
@RequestMapping(value={"userAction/loginInit.do"},method={ RequestMethod.GET})
public String loginInit(HttpServletRequest request, HttpServletResponse response){
// String root=request.getSession().getServletContext().getRealPath("/");
// request.setAttribute("ctx", root);
return "index";
}
}