• Spring MVC 使用问题与解决--HTTP Status 500


    1.HTTP Status 500 - Servlet.init() for servlet springmvc threw exception


    解决
    使用jre1.7 Spring4.3

    2.springMVC无法访问JSP报404,但是又能访问controller

    第一种原因:

    mvc
    org.springframework.web.servlet.DispatcherServlet

    contextConfigLocation
    classpath*:/mvc.xml

    1

     <servlet-mapping>
         <servlet-name>mvc</servlet-name>
         <url-pattern>/*</url-pattern>
     </servlet-mapping>
    

    将url-pattern中/*改为/
    配置对所有请求进行了拦截,controller对视图进行分发的时候又拦截。

    第二种原因:

    当时把jsp文件放到WEB-INF中了,但tomcat默认访问网页的目录是WEB-INF的父目录,正确的目录应该类似以下:

    3.

    a.No mapping found for HTTP request with URI [/sam_170309Web/user/register.action] in DispatcherServlet with name 'DispatcherServlet'
    b.No Spring WebApplicationInitializer types detected on classpath

    解决

    检查控制器中的@Controller以及mvcContext.xml中的Action注册:<context:component-scan base-package="pers.ryan.***"/>

    随心所欲不逾矩.
  • 相关阅读:
    rjust()方法
    rindex()方法
    rfind()方法
    replace()方法
    min(S)函数
    max(S)函数
    maketrans()方法
    lstrip()方法
    lower()方法
    eclipse Tomcat 启动报错
  • 原文地址:https://www.cnblogs.com/Ryan-Leo/p/6525074.html
Copyright © 2020-2023  润新知