一只丶鱼 2016-07-06 03:31 采纳率: 0%
浏览 6985

Did not find handler method for [/index.jsp]。。。。

新手,我只是页面访问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";
    }

}图片说明

  • 写回答

3条回答

  • 一只丶鱼 2016-07-06 03:35
    关注

    ce-servlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
    default-lazy-init="true">




    /WEB-INF/i18n/app/messages
    /WEB-INF/i18n/frame/messages
























    /loginInit.do
    /register.do
    /login.do
    /logout.do











    /error/requiredParameter
    /error/mismatchParameter
    /error/bindException
    /error/integrityViolation









    context:annotation-config/

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler