jsf myfaces1.1.4几个警告

本文解决了JSF中 faces-config.xml 被重复加载的问题,并介绍了如何设置默认语言及支持的语言列表。此外,还提供了调整MyFaces行为的配置示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

警告: /WEB-INF/faces-config.xml has been specified in the javax.faces.CONFIG_FILES context parameter of the deployment descriptor. This should be removed, as it will be loaded twice.  See JSF spec 1.1, 10.3.2

jsf1.1中把/WEB-INF/faces-config.xml作为默认的文件了,因此如果在web.xml存在的话,会警告,并且警告managebean加载两次

去掉web.xml中的

<context-param>

xml 代码
 
<context-param>       <param-name>javax.faces.CONFIG_FILES</param-name>       <param-value>/WEB-INF/faces-config.xml</param-value>     </context-param>  

  </context-param>

2

警告: Locale name in faces-config.xml null or empty, setting locale to default locale : zh_CN

faces-config.xml中增加

<application>
  

xml 代码
 
<application>           <locale-config>               <default-locale>zh_CN</default-locale>               <supported-locale>en_US</supported-locale>               <supported-locale>de_DE</supported-locale>               <supported-locale>fr_FR</supported-locale>           </locale-config>       </application>  
</application>

3

信息: No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, u
sing default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
2006-12-28 13:42:35 org.apache.myfaces.shared_tomahawk.config.MyfacesConfig getB
ooleanInitParameter
信息: No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' fou
nd, using default value true

web.xml中加入

<param-name><context-param></context-param>

xml 代码
 
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>       <param-value>true</param-value>     </context-param>     <context-param>       <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>       <param-value>false</param-value>     </context-param>     <context-param>       <param-name>org.apache.myfaces.PRETTY_HTML</param-name>       <param-value>true</param-value>     </context-param>     <context-param>       <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>       <param-value>true</param-value>     </context-param>  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值