问题描述
在将应用程序升级到在Spring3和Jsf1.0中创建的Jsf2.0(myfaces)时,我面临以下一些问题.
While upgrading application to Jsf2.0 created in Spring3 and Jsf1.0 (myfaces), i am facing some issues mentioned below.
我已经按照以下步骤升级了应用程序.
I have done following steps to upgrade the application.
从IntelliJ IDEA:
From IntelliJ IDEA:
* Open project settings/Monitor/Dependencies
* Removed facelet*jar, el*.jars, myfaces* jars from project
* Added jsf2.0.x ri mojarra jars and tomahawk1.1.9.jar
* Open project settings/monitor/web settings
* Under "modules and libs to package": remove el-.jars,facelet-jar and myfaces jars
* Added jsf2.0.x ri mojarra jars and tomahawk1.1.9.jar
* Removed erroneous class usages from our classes Lists.java and RegExValidator.java. In Lists.java, replace import with org.apache.commons.lang.LocaleUtils. In RegExValidator, replace import with "org.apache.myfaces.shared_tomahawk.util.MessageUtils".
编辑Web.xml:
* facelets.VIEW_MAPPINGS -> javax.faces.FACELETS_VIEW_MAPPINGS
* facelets.LIBRARIES -> javax.faces.FACELETS_LIBRARIES
* Change Faces Servlet to <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
* Change header to:
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
编辑faces-config.xml:
Edit faces-config.xml:
* Add header:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
* Remove line "<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>"
完成上述所有步骤后,出现以下错误:
After doing all the steps mentioned above getting the following error:
实际上Jsf2.0 el表达式#{myBean.property}没有得到解决,这就是为什么它显示上述错误的原因.
Actually Jsf2.0 el expressions #{myBean.property} are not getting resolved thats why its showing the above error.
任何人都可以指导我,缺少什么,以便我可以成功地将应用程序迁移到Jsf2.0
Can anybody guide me, what is missing, so that i can successfully migrate application to Jsf2.0
在此先感谢您,迪伦
推荐答案
将web-app version="3.0"
升级到最新版本.解决了升级到3.0版本的问题后,以前的网络应用版本为2.5版本.
Upgrade web-app version="3.0"
to latest. Previously web-app version is 2.5 at that time I got error, after upgrade to 3.0 issue resolved.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
这篇关于将Jsf1.0升级到Jsf2.0时出现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!