SpringMVC项目中常见问题以及解决方案

一、org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

 1、问题原因:

   缺少相关jar(jstl.jar,和standard.jar) 包

 

2、 解决方法:

在Maven仓库中http://www.mvnrepository.com/search?q=standard.jar

搜索这两个jar包,并将依赖项添加到pom.xml文件中。

 

 

二、程序运行时,报错内容如下:

The requested resource is not available.

 

 

 

  出错原因:在jsp中,action处理路径写错,如下所示:

 

正确的写法是:action=”user.do”

相应地在这里展示下控制器中路径和web.xml中的路径配置

 

三、Web工程在运行时报错“java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

原因:与JSP有关的Jar包没有导入

解决方法:

在pom.xml中导入一下内容:

<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>

</dependency>

详细内容请参考附件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值