编译后的 JSP Java (*__jsp.java) 文件在哪里? [英] Where are compiled JSP Java (*__jsp.java) files?

查看:18
本文介绍了编译后的 JSP Java (*__jsp.java) 文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站试图呈现的其中一个 jsp 文件 (survey.jsp) 中收到一个 javax.servlet.jsp.JspException.但是,堆栈跟踪并没有给我在 jsp 中失败的特定行,而是在 (survey_jsp.java:787) 中失败的行号,这似乎是编译后的 JSP 文件.我在哪里可以找到这样的文件,以便我知道哪一行抛出了这个异常?

I am getting a javax.servlet.jsp.JspException in one of the jsp files that my website is trying to render (survey.jsp). However, the stack trace does not give me the the specific line in jsp where it fails but rather the line number where it fails in (survey_jsp.java:787), which seems to be the compiled JSP file. Where do I find such files, so that I know what line is throwing this exception?

谢谢

如果您按照 Will 在下面评论中的建议使用 tomcat,这些文件位于 /work 目录中.

These files live in the /work directory if you are using tomcat as Will suggested in the comment below.

推荐答案

编译后的 JSP 文件默认位于 Tomcat 环境的 /work 文件夹中.应该有一个子文件夹 Catalina,而该子文件夹又包含一个代表域名的子文件夹,默认为 localhost.反过来应该有项目文件夹,该文件夹又包含包层次结构org.apache.jsp,其中包含已编译的 JSP 文件.

The compiled JSP files are by default available in the /work folder of the Tomcat environment. There should be a subfolder Catalina which in turn has a subfolder representing the domain name which defaults to localhost. There in turn should be the project folder which in turn contains package hierarchy org.apache.jsp with therein the compiled JSP files.

Tomcat
 |-- backup
 |-- bin
 |-- conf
 |-- lib
 |-- logs
 |-- temp
 |-- webapps
 `-- work
      `-- Catalina
           `-- localhost
                `-- projectname
                     `-- org
                          `-- apache
                               `-- jsp
                                    |-- survey_jsp.class
                                    `-- survey_jsp.java    <--- here

<小时>

与具体问题无关JspException 的堆栈跟踪中应该有一个根本原因 部分,它通常包含有关问题的真正根源.在堆栈跟踪中进一步阅读.顺便说一句,你知道将原始 Java 代码放在 JSP 文件中被认为是 不好的做法?您现在遇到的问题更难调试.


Unrelated to the concrete problem, there should be a root cause part in the stacktrace of the JspException which usually contains more detail about the real root cause of the problem. Read a bit further in the stacktrace. By the way, do you know that putting raw Java code in JSP files is considered a bad practice? It makes problems harder to debug as you encounter now.

这篇关于编译后的 JSP Java (*__jsp.java) 文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆