一个关于JSP的问题

来源:百度知道 编辑:UC知道 时间:2024/05/11 16:26:14
我今天装了TOMCAT,打开JSP文件的时候会提示类似的错误type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: File "/nestingtag" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:159)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserCont

从这句话:The server encountered an internal error () that prevented it from fulfilling this request.
看出是你的程序有错误,没有跳转成功;
--------------------------
从这句话:org.apache.jasper.JasperException: File "/nestingtag" not found 看出系统没有找到tag;也就是你的tag没有配置正确;
首先 在jsp中用的tag需要在web.xml中进行配置,如下配置
<taglib> <taglib-uri>http://www.neusoft.com/ehr</taglib-uri>
<taglib-location>/WEB-INF/tld/ehr.tld</taglib-location>
</taglib>

其中还要在/WEB-INF/tld 下有ehr.tld文件;
描述如下:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd&q