编译JSP Java(* __ jsp.java)文件在哪里? [英] Where are compiled JSP Java (*__jsp.java) files?
问题描述
我在我的网站试图呈现的一个jsp文件中得到 javax.servlet.jsp.JspException
( survey.jsp
)。但是,堆栈跟踪没有给我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?
谢谢
编辑:如果您使用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屋!