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. 0109 ubuntu nginx ssl

    1. sudo apt-get install openssl libssl-dev # ./configure --with-http_stub_status_module --with-http_ ...

  2. element 关闭弹窗时清空表单信息

    关闭弹窗时清空表单信息: // 弹框关闭时清空信息 closeDialog () { this.$nextTick(() => { this.$refs['createModelForm'].c ...

  3. Django路由(url)

    1.基本配置 from django.conf.urls import url from . import views urlpatterns = [ url(r'^articles/2003/$', ...

  4. PHP利用MySQL保存session

    实现环境: PHP 5.4.24 MySQL 5.6.19 OS X 10.9.4/Apache 2.2.26 一.代码 CREATE TABLE `session` ( `skey` ) CHARA ...

  5. C#中指针使用总结(转载)

    C#为了类型安全,默认并不支持指针.但是也并不是说C#不支持指针,我们可以使用unsafe关键词,开启不安全代码(unsafe code)开发模式.在不安全模式下,我们可以直接操作内存,这样就可以使用 ...

  6. mysql8 安装笔记

    环境 redhat6.8 ,官网下载 rpm x64 Bund 安装包 安装 rpm -ivh xxx.rpm 安装一系列的rpm. mysql 会创建 mysql 用户及组./etc/my.cnf ...

  7. flask(一)之路由和视图

    01-介绍 Flask 是一个 Python 实现的 Web 开发微框架,同时具有很强的扩展能力. 02-第一个flask程序 # 初始化 from flask import Flask, url_f ...

  8. sass的使用

    1.声明变量-全局声明-局部声明 中划线或下划线两种用法相互兼容  $nav-color: #F90; $highlight-border: 1px solid $nav-color;  nav{ $ ...

  9. MyBatis基础:MyBatis关联查询(4)

    1. MyBatis关联查询简介 MyBatis中级联分为3中:association.collection及discriminator. ◊ association:一对一关联 ◊ collecti ...

  10. MySQL之 InnoDB记录结构(转自掘金小册 MySQL是怎样运行的,版权归作者所有!)

    以下内容来自掘金小册 MySQL 是怎样运行的:从根儿上理解 MySQL 版权归原作者所有! 页是MySQL中磁盘和内存交互的基本单位,也是MySQL是管理存储空间的基本单位. 指定和修改行格式的语法 ...