如何为 JSP 页面启用 debug_mode

发布于 2024-07-15 05:57:48 字数 376 浏览 6 评论 0原文

当您在编写 JSP 页面并在 Oracle OC4J 或应用程序服务器下运行时遇到严重的编译错误时,您最终可能会在屏幕上显示以下内容:

500 内部服务器错误 OracleJSP: 发生错误。 咨询您的 应用程序/系统管理员 支持。 程序员应该考虑 将 init-param debug_mode 设置为 “true”查看完整的异常 消息。

我看到了关于如何/在哪里设置 debug_mode init-param 的不同建议。 有什么选择?

另外,这是 Oracle 特有的,还是 JSP 标准功能? 该技术对于其他应用程序服务器有何不同?

when you hit a serious compilation error while writing JSP pages and running under Oracle OC4J or Application Server, you can end up with the following displayed on screen:

500 Internal Server Error OracleJSP:
An error occurred. Consult your
application/system administrator for
support. Programmers should consider
setting the init-param debug_mode to
"true" to see the complete exception
message.

I've seen varying advice on how/where to set the debug_mode init-param. What are the options?

Also, is this specific to Oracle, or is this a JSP standard feature? How would the technique be different for other application servers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

逆光飞翔i 2024-07-22 05:57:48

到目前为止的解决方案...

选项 1:将 debug_mode 参数添加到 OC4J global-web-application.xml

  • 该设置将应用于 OC4J 容器中的所有应用程序
  • 有关详细信息,请参阅 @Mork0075 的响应
    (除了请注意 OC4J 容器
    名称和应用程序名称是
    具体到启用的示例
    Oracle Secure Enterprise 的调试
    搜索)

选项 2:添加到应用程序的 web.xml

  • 显然,允许进行更多本地更改
  • 还有其他设置(developer_mode、encode_to_java、emit_debuginfo)也可能有用

例如:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
    <param-name>debug_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>developer_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>encode_to_java</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>emit_debuginfo</param-name>
    <param-value>true</param-value>
</init-param>
</servlet> 

因为这些选项是为类 oracle 设置的.jsp.runtimev2.JspServlet,它显然是专门用于 Oracle OC4J/应用服务器安装的。

Solution so far...

Option 1: add the debug_mode parameter to the OC4J global-web-application.xml

  • the setting will apply to all applications in the OC4J container
  • See the response from @Mork0075 for details
    (except note that the OC4J container
    name and application names are
    specific to an example of enabling
    debug for Oracle's Secure Enterprise
    Search)

Option 2: add to your application's web.xml

  • Obviously, allows for a more local change
  • There are additional settings (developer_mode,encode_to_java,emit_debuginfo) which may be of use also

For example:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
    <param-name>debug_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>developer_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>encode_to_java</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>emit_debuginfo</param-name>
    <param-value>true</param-value>
</init-param>
</servlet> 

Since these options are being set for the class oracle.jsp.runtimev2.JspServlet, it is obviously specific for Oracle OC4J/Application Server installations.

猫七 2024-07-22 05:57:48

请转至 $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/config/global-web-application.xml 以

这种方式扩展 servlet 节点:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
<param-name>debug_mode</param-name>
<param-value>true</param-value>
</init-param>

重新启动 OC4J 就可以了。 另请查看 $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/application-deployments/ses_query/application.log

Please go to $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/config/global-web-application.xml

Extend the servlet node this way:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
<param-name>debug_mode</param-name>
<param-value>true</param-value>
</init-param>

Restart OC4J and thats should be it. Also have a look at $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/application-deployments/ses_query/application.log

鲸落 2024-07-22 05:57:48

假设您使用 Eclipse,如果您不想经历配置 jsps 调试的痛苦,那么 MyEclipse 插件附带了非常好的开箱即用的 JSP 调试功能。

Assuming you're using Eclipse, MyEclipse plugin comes with very good JSP debugging capabilities out of the box if you don't want to go through the pain of configuring debugging for jsps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文