Forums de discussion
How To use <navigation-rule> in icefaces
anton law, modifié il y a 16 années.
How To use <navigation-rule> in icefaces
New Member Publications: 20 Date d'inscription: 02/07/07 Publications récentes
hi all,
I use icefaces 1.6.2 to create icefaces portlet in liferay 4.3.3. I have 3 jspx files. the structure like this :
book_ice_portlet
|
|
----images
|
---- WEB-INF
|
|
---- index.jspx
|
---- new.jspx
|
---- update.jspx
I have the code in index.jspx to call page new.jspx like this :
<ice:commandButton image="/images/newtask.png" action="#{book.newPages}" immediate="true"/>
and bean like this :
public String newPages(){
return "new";
}
My web.xml configuration like this :
and my faces-config.xml like this :
and the problems are :
When i click thats image for call new.jspx pages i get the error in Html pages like this :
is there something wrong with my configuration in web.xml or faces-config.xml, if there some wrong what i must do ??
and
can anyone / someone give me the sample how to use <navigation-rule> in icafaces ???
Please... Help me
Thanxs
Anton
I use icefaces 1.6.2 to create icefaces portlet in liferay 4.3.3. I have 3 jspx files. the structure like this :
book_ice_portlet
|
|
----images
|
---- WEB-INF
|
|
---- index.jspx
|
---- new.jspx
|
---- update.jspx
I have the code in index.jspx to call page new.jspx like this :
<ice:commandButton image="/images/newtask.png" action="#{book.newPages}" immediate="true"/>
and bean like this :
public String newPages(){
return "new";
}
My web.xml configuration like this :
<!--?xml version="1.0" encoding="UTF-8"?-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>book_ice_portlet</display-name>
<context-param>
<param-name>company_id</param-name>
<param-value>liferay.com</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-hibernate.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.compressResources</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.delegateNonIface</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.uploadDirectory</param-name>
<param-value>/home/liferay/upload</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.uploadDirectoryAbsolute</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.uploadMaxFileSize</param-name>
<param-value>10485760</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.hiddenPortletAttributes</param-name>
<param-value>javax.portlet.config,javax.portlet.userinfo,THEME_DISPLAY</param-value>
</context-param>
<listener>
<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
</listener>
<servlet>
<servlet-name>book_ice_portlet</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>com.icesoft.faces.webapp.http.portlet.MainPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>BookIcePortlet</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>com.icesoft.faces.webapp.http.portlet.MainPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>book_ice_portlet</servlet-name>
<url-pattern>/book_ice_portlet/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>BookIcePortlet</servlet-name>
<url-pattern>/BookIcePortlet/*</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
</jsp-config>
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
and my faces-config.xml like this :
<!--?xml version="1.0" encoding="UTF-8"?-->
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<factory>
<faces-context-factory>com.icesoft.faces.context.FacesContextFactoryImpl</faces-context-factory>
</factory>
<converter>
<converter-id>PhoneNumberConverter</converter-id>
<converter-class>org.liferay.util.jsf.PhoneNumberConverter</converter-class>
</converter>
<managed-bean>
<managed-bean-name>ICEfacesAjaxPushRenderManager</managed-bean-name>
<managed-bean-class>com.icesoft.faces.async.render.RenderManager</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>book</managed-bean-name>
<managed-bean-class>org.liferay.ui.BookIceBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>bookbean</managed-bean-name>
<managed-bean-class>org.liferay.ui.TaskIceBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>PortalUser</managed-bean-name>
<managed-bean-class>org.liferay.util.jsf.PortalUserManagedBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ResumeUploader</managed-bean-name>
<managed-bean-class>org.liferay.util.icefaces.FileUploadManagedBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>renderManager</property-name>
<value>#{ICEfacesAjaxPushRenderManager}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<navigation-case>
<from-outcome>myself</from-outcome>
<to-view-id>/index.iface</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>new</from-outcome>
<to-view-id>/new.ifacesx</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>update</from-outcome>
<to-view-id>/update.iface</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<validator>
<validator-id>EmailAddressValidator</validator-id>
<validator-class>org.liferay.util.jsf.EmailAddressValidator</validator-class>
</validator>
</faces-config>
and the problems are :
When i click thats image for call new.jspx pages i get the error in Html pages like this :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.ClassCastException: com.icesoft.faces.env.PortletEnvironmentRenderRequest
com.icesoft.faces.context.View.differentURI(View.java:145)
com.icesoft.faces.context.View$6.servlet(View.java:102)
com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:203)
com.icesoft.faces.context.View.updateOnRequest(View.java:100)
com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:44)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:110)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
is there something wrong with my configuration in web.xml or faces-config.xml, if there some wrong what i must do ??
and
can anyone / someone give me the sample how to use <navigation-rule> in icafaces ???
Please... Help me
Thanxs
Anton
petar banicevic, modifié il y a 15 années.
RE: How To use <navigation-rule> in icefaces
Junior Member Publications: 73 Date d'inscription: 27/05/08 Publications récentes
Icefaces forum has plenty resources for this kind of question.
Lari Tuominen, modifié il y a 15 années.
RE: How To use <navigation-rule> in icefaces
Expert Publications: 283 Date d'inscription: 07/11/07 Publications récentes
Hi Anton.
Is this correct <to-view-id>/new.ifacesx</to-view-id>.....?
- Lari
Is this correct <to-view-id>/new.ifacesx</to-view-id>.....?
- Lari