首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

TOMCAT6.0+JSP本地调试有关问题:

2013-09-11 
TOMCAT6.0+JSP本地调试问题:急~~~~本人是JSP菜鸟没什么基础就会照抄现在遇见这样的问题:用CUTFTP把所有WEB

TOMCAT6.0+JSP本地调试问题:急~~~~
本人是JSP菜鸟没什么基础就会照抄现在遇见这样的问题:
用CUTFTP把所有WEB文件从外网服务器下载到本地的c:\Program   Files\Apache   Software   Foundation\Tomcat   6.0\webapps\ROOT的文件夹下
浏览器输入http://localhost:8080/html/index.htm和外网的效果一样
然后在这个文件夹下新建一个TEST.JSP内容为显示HELLO   WORLD浏览器输入http://localhost:8080/test.jsp也能正常显示
但是我点击http://localhost:8080/html/index.htm上一个导航链接,链接到http://localhost:8080/html/zhengce/index.jsp就报错了错误内容为以下代码:(在文章最后)

然后我点击另外一个导航链接,链接到http://localhost:8080/html/zhuanjia/index.htm则能够正常显示

后来我发现只要是JSP文件都不能显示且报HTTP500错误,HTM文件都能显示,并且这些导航链接在外网服务器上点没有任何问题,为什么下到本地就不能显示JSP文件了呢?再说我的test.jsp都能显示啊,我承认我是菜鸟而且刚刚自学接触JSP,希望各位达人能解决我的问题,不胜感激!!!!

我的环境是JDK6.0+TOMCAT6.0


HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

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

exception  

org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP:  

An   error   occurred   at   line:   49   in   the   jsp   file:   /html/zhengce/index.jsp
News   cannot   be   resolved   to   a   type
46:   <body   background= "../tu/jpg.jpg ">
47:   <%
48:   try{
49:                   News   news=new   News();
50:                   String   id= " ",title= " ",author= " ",c,date= " ";
51:                   int   priority=0;
52:   String[]   pp_arr={ "新闻动态 ", "上级文件 ", "管委会文件 ", "相关文件 ", "培训计划 ", "授权培训机构 ", "培训教材 ", "继续教育 ", "考试大纲与办法 ", "考试信息 ", "习题解答 ", "专业文章 ", "技术推广 ", "试卷分析 ", "专家答疑 "};


An   error   occurred   at   line:   49   in   the   jsp   file:   /html/zhengce/index.jsp
News   cannot   be   resolved   to   a   type
46:   <body   background= "../tu/jpg.jpg ">
47:   <%
48:   try{
49:                   News   news=new   News();
50:                   String   id= " ",title= " ",author= " ",c,date= " ";
51:                   int   priority=0;
52:   String[]   pp_arr={ "新闻动态 ", "上级文件 ", "管委会文件 ", "相关文件 ", "培训计划 ", "授权培训机构 ", "培训教材 ", "继续教育 ", "考试大纲与办法 ", "考试信息 ", "习题解答 ", "专业文章 ", "技术推广 ", "试卷分析 ", "专家答疑 "};


An   error   occurred   at   line:   201   in   the   jsp   file:   /html/zhengce/index.jsp
tool   cannot   be   resolved
198:                   {                 //id,noticedate,title,content,priority
199:                   String   list[]=(String[])list1.elementAt(k);


200:                   id=list[0];
201:                   title=list[1];if(title!=null||!title.equals( " "))title=tool.UNHTMLEscape(title);
202:                   //author=list[2];
203:                   priority=Integer.parseInt(list[3]);
204:                   //content=list[4];


An   error   occurred   at   line:   221   in   the   jsp   file:   /html/zhengce/index.jsp
tool   cannot   be   resolved
218:                                   }                
219:   %>
220:                                                                                                                                   <TD   width=40> <div   align= "center "> <img   src= "../tu/d.gif "   width= "7 "   height= "7 "> </div> </TD>
221:                                                                                                                                   <td> <A   HREF= "../../jsp/newscontent.jsp?id= <%=id%> "> <%=tool.GB8859toGBK(title)%> </A> </td>
222:                                                                                                                                   <TD   align=middle   width=40>   </TD>
223:                                                                                                                                   <TD   align=right   width=60> <FONT   color=#999999> <%=date%> </FONT> </TD>
224:                                                                                                                   </tr>




Stacktrace:
                org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
                org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
                org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
                org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
                org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
                org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
                org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
                org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
                org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
                org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/6.0.13   logs.


--------------------------------------------

Apache   Tomcat/6.0.13


[解决办法]
zhengce目录下有没有WEB-INF目录?
[解决办法]
zhengce下建个WEB-INF目录,重启Tomcat应该就好了
[解决办法]
顶楼上的,WEB-INF里有没有web.xml


[解决办法]
顶一下了

搞个配置文件 就好了
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html

热点排行