【问题标题】:RichFaces 4.5 - Weblogic 11g - ReferenceErrorRichFaces 4.5 - Weblogic 11g - ReferenceError
【发布时间】:2015-04-08 14:24:44
【问题描述】:

我正在开发一个使用 Struts 和 JSF 2 和 RichFaces 4.5.4 的应用程序。

当应用程序在 Tomcat(7) 服务器上运行时,一切正常。但是当我在 WebLogic(11gR1-10.3.6) 服务器上运行它时,没有加载 JS 资源。

rich:popupPanel 得到错误:ReferenceError: RichFaces is not defined 当我尝试运行 jQuery 脚本时,我得到:ReferenceError: jQuery is not defined

我使用的是<h:head> 而不是<head>,我的web.xml 中有这个参数:

<context-param>
    <param-name>org.richfaces.LoadStyleStrategy</param-name>
    <param-value>ALL</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.LoadScriptStrategy</param-name>
    <param-value>ALL</param-value>
</context-param>

【问题讨论】:

  • 那些上下文参数是针对 RichFaces 3.x 的,它们在这里什么都不做。
  • 感谢@Makhiel 的评论。这些都是我已经尝试过的东西,唯一的目的是不建议同样的东西。
  • 你在项目的 lib 文件夹中添加了富面孔 jars 吗?
  • 是的@Erick。该项目在 tomcat 服务器上运行良好。
  • 但是在生产环境中我们使用WebLogic。

标签: jquery oracle weblogic richfaces weblogic11g


【解决方案1】:

嗯,ResourceServlet 似乎没有自动注册。

正如here 解释的那样,ResourceServlet 会在 Servlet 3.0 及更高版本的环境中自动注册。

在Servlet 2.5及更低的环境下,需要在WEB-INF/web.xml配置文件中手动注册ResourceServlet:

<servlet>
  <servlet-name>Resource Servlet</servlet-name>
  <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
  <servlet-name>Resource Servlet</servlet-name>
  <url-pattern>/org.richfaces.resources/*</url-pattern>
</servlet-mapping>
<context-param>
    <param-name>org.richfaces.resourceOptimization.enabled</param-name>
    <param-value>true</param-value>
</context-param>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-26
    • 2013-01-20
    • 1970-01-01
    • 2019-07-23
    • 2012-05-12
    • 2018-01-09
    • 1970-01-01
    • 2011-01-16
    相关资源
    最近更新 更多