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.***"/>

Spring MVC 使用问题与解决--HTTP Status 500 - Servlet.init() for servlet springmvc threw exception的更多相关文章

  1. 项目中访问controller报错:HTTP Status 500 - Servlet.init() for servlet spring threw exception

    直接访问controller路径http://localhost:8080/index报错: HTTP Status 500 - Servlet.init() for servlet spring t ...

  2. 深圳宝安图书馆官网错误 HTTP Status 500 - Servlet.init() for servlet spring threw exception

    停留了一段时间没有动 打开https://www.balib.cn/balib/category/152 *********************************************** ...

  3. HTTP Status 500 - Servlet.init() for servlet htmlWebConfig threw exception

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

  4. Tomcat报错:HTTP Status 500 - Wrapper cannot find servlet class

    HTTP Status 500 - Wrapper cannot find servlet class com.servlet.servlet.RegServlet or a class it dep ...

  5. Spring MVC RedirectAttributes的用法解决办法

    Spring MVC RedirectAttributes的用法很久没发过技术贴了,今天对于一个问题纠结了2小时,遂放弃研究用另一种方法解决,奈何心中一直存在纠结,发帖求解 我先解释下什么是Redir ...

  6. Spring MVC配置CORS(解决跨域请求)

    1. CORS 简介 同源策略(same origin policy)是浏览器安全的基石.在同源策略的限制下,非同源的网站之间不能发送 ajax 请求的. 为了解决这个问题,w3c 提出了跨源资源共享 ...

  7. spring mvc 文件下载 get请求解决中文乱码问题

    方案简写,自己或有些基础的可以看懂,因为没时间写的那么详细 方案1 spring mvc解决get请求中文乱码问题, 在tamcat中server.xml文件 URIEncoding="UT ...

  8. Spring MVC请求参数绑定 自定义类型转化 和获取原声带额servlet request response信息

    首先还在我们的框架的基础上建立文件 在domian下建立Account实体类 import org.springframework.stereotype.Controller; import org. ...

  9. 解决 HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException:

    HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException: The foll ...

随机推荐

  1. 阿里巴巴JAVA开发手册

    Java编程规约 (一)命名风格      1. [强制] 代码中的命名均不能以下划线或美元符号开始,也不能以下划线或美元符号结束.           反例: _name / __name / $O ...

  2. configparser_配置解析器

    configparser:配置解析器 import configparser config = configparser.ConfigParser() #配置文件 config[', 'Compres ...

  3. ASP.NET MVC5学习系列——身份验证、授权

    一.什么是身份验证和授权 人们有时对用户身份验证和用户授权之间的区别感到疑惑.用户身份验证是指通过某种形式的登录机制(包括用户名/密码.OpenID.OAuth等说明身份的项)来核实用户的身份.授权验 ...

  4. 总结JAVA----IO流中的File类

    对于IO流中File类的总结 File类的基本概念 File类只能用于完成对于文件属性(是否存在.可读性.长度)的一些操作,不能用于文件的访问. File类的对象 File类的对象存储的是文件的绝对路 ...

  5. .net core iis配置

    微软官方教程: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x 在vs中创建.net cor ...

  6. 监控redis

    [4ajr@redis1 scripts]$ cat redismonitor.sh #!/bin/bash #想要什么监控项再添加 rediscli="/soft/redis/bin/re ...

  7. 基于vue-simple-uploader封装文件分片上传、秒传及断点续传的全局上传插件

    目录 1. 前言 2. 关于vue-simple-uploader 3. 基于vue-simple-uploader封装全局上传组件 4. 文件上传流程概览 5. 文件分片 6. MD5的计算过程 7 ...

  8. 在 .NET Core 中结合 HttpClientFactory 使用 Polly(中篇)

    译者:王亮作者:Polly 团队原文:http://t.cn/EhZ90oq声明:我翻译技术文章不是逐句翻译的,而是根据我自己的理解来表述的(包括标题).其中可能会去除一些不影响理解但本人实在不知道如 ...

  9. fetch和axios获取数据

    fetch("/api/goods") .then(res => { return res.json(); }) .then(response => { console ...

  10. Linux(Ubuntu 16) 下Java开发环境的配置(二)------Tomcat的配置及常见问题

    前言 相比于java JDK的配置,Tomcat的配置简单的多,简直就相当于直接运行了,本文以Tomcat8.0为例进行配置   1.Tomcat的下载 地址:https://tomcat.apach ...