怎么解决,这个报错

怎么解决,这个报错

http://img1.sycdn.imooc.com//climg/5dd2278609d0639709390627.jpg

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
		this is maven project!!!!
		
		<fmt:formatNumber value="123456789.54321" pattern="0,000.00"></fmt:formatNumber>
</body>
</html>

严重: Servlet.service() for servlet [jsp] in context with path [/maven] threw exception [无法在web.xml或使用此应用程序部署的jar文件中解析绝对uri:[http://java.sun.com/jsp/jstl/fmt]] with root cause

org.apache.jasper.JasperException: 无法在web.xml或使用此应用程序部署的jar文件中解析绝对uri:[http://java.sun.com/jsp/jstl/fmt]

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)

at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:293)

at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:80)

at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)

at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)

at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)

at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:489)

at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1445)

at org.apache.jasper.compiler.Parser.parse(Parser.java:144)

at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)

at org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)

at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:202)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:350)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)

at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:595)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Unknown Source)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.imooc</groupId>
  <artifactId>maven</artifactId>
  <version>1.0.0-RELEASE</version>
  
  <dependencies>
  	<dependency>
  	<groupId>javax.servlet</groupId>
 	 <artifactId>jstl</artifactId>
 	 <version>1.2</version>
	</dependency>
  </dependencies>
  
</project>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕阿莹 2019-11-18 17:09:54

同学你好,建议同学在项目名上点击右键,选择properties,然后出现如下界面,选择Deployment Assembly,如:

http://img1.sycdn.imooc.com//climg/5dd25f8a0915d17306270558.jpg

点击add,然后选中: Java Build Path Entries ,再点击 Next,如:

http://img1.sycdn.imooc.com//climg/5dd25fa00904852705210444.jpg

选中 Maven Dependencies ,然后 Finish 。

http://img1.sycdn.imooc.com//climg/5dd25fbb09664ecf05210443.jpg

最后重启项目再试试。

在运行jsp页面时,并没有加载到jstl的包,所以需要将其加入到tomcat的lib下,所以按照如上方式添加maven Dependencies的jstl包试试。

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师