JSF Navigation

i'm returning a string value for navigation in an action method.
Actually, i need to know which page we will go with the returning value. Is there a way to do this?
for example;
public String doAddAction() {
     String nextPage = getNextPage("pageedit");
     if (user.isAllowed(nextPage)) {
          initForEdit();
          getRequestScope().remove("pageid");
          return "pageedit";
     else {
          createInfo("", "You aren't allowed to do this operation!");
          return null;
in this method, i have to implemet getNextPage() function!
thanks for advance.

This doesn't address your specific question, but offers a workaround -- enable/disable controls right at the beginning, depending on the user's role. As a user I would find it frustrating to be presented with many, apparently-live controls, of which many say "you are not allowed to do this" when Iselect them. I would far prefer to be presented just those controls I am, in fact, permitted to use.
--A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • H:commandButton - jsf navigation problem

    Dear All,
    I changed the first page of my application from pageA.jsf to pageB.jsf in the index.jsp file:
    <jsp:forward page="/pages/pageB.jsf" />
    The pageB.jsp is a new page that I just created.
    (I have
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    in the web.xml )
    in the B.jsp I have two "h:commandButton" :
    <td><h:commandButton id="submitB1" value="Upload" action="submitB1"/></td>
    <td><h:commandButton id="submitB2" value="Search" action="submitB2"/></td>
    and in the face-config.xml I have
    <navigation-rule>
    <from-view-id>/pages/pageB.jsp</from-view-id>
    <navigation-case>
    <from-outcome>submitB1</from-outcome>
    <to-view-id>/pages/pageB1.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>submitB2</from-outcome>
    <to-view-id>/pages/pageB2.jsp</to-view-id>
    </navigation-case>
    I can load the pageB but cannot be navigated to pageB1 or B2. Before I changed pageA.jsf to pageB.jsf, the nevigation worked well.
    Anyone has any idea of what would be the cause please help me out.
    Thank you very much in advance for your help

    In the future, please use code tags to post code. This way they will be nicely formatted and (much) better readable, otherwise likely everyone will ignore it. Press the CODE button to get them and use Preview tab to preview.
    However on the new page it seems there is no view root. The bean for the new page is never accessed as it cannot be found.What does the appserver logs say?

  • JSF navigation rules sent me to different page, with same URL

    Hello everybody,
    Have a newbie question on JSF, if anyone can help me. I am using JSF for a web application, and i have a small problem.
    If i define a navigation rule, from one page to another, and i am having a button that should send me to another page,
    the browser URL remains the same, although the page content IS correctly changed.
    Thanks,
    Andrei

    You're welcome.
    Though I should have added that the advantage of the redirect after a POST request is that refreshing the request or navigating back and forward by browser history doesn't cause a re-submit of the POST request anymore. This way you avoid duplication of submitted data. This is called POST-redirect-GET pattern. Refreshing the request after a redirect (which is always a GET request) would only cause the redirect being refreshed, not the initiating POST request.
    The disadvantage of a forward is less or more obvious: the URL remains the same and it is not really good for the user experience. If one copypasted the URL in a new window (a new GET request), one wouldn't see the forwarded page, but the originating page. That's why I would recommend to avoid navigation cases and just use the same page to postback the POST request to. For normal page-to-page navigation within a website, I would recommend just using outputlinks and not commandlinks with navigation cases. It's all better for the user experience.

  • JSF Navigation issue with Webcenter OC4J and Open Portal JSF Bridge

    Hi All,
    I was wondering if anybody had experienced the same issue as per below:
    I have a problem using the Open Portal JSF Portlet Bridge within a oracle webcenter OC4J. I have a trivial application with 2 jsps. The first has a single button, which when pushed navigates to the second screen.
    This app works fine as a stand alone web app and also via the Oracle Faces Bridge using the OC4J. However, when I deploy using the jsfportletbridge 1.1.4 (I'm using the JSF 1.1) - it will not navigate from the first page. It simply refreshes the first page when clicked.
    It looks like there is a problem with navigation. I have traced out the application (which I will include in full below), however the entries which looked relevant were (this occured after the first page was rendered):
    07/06/05 23:49:19 [DEBUG] StateManagerImpl - Begin restoring view in session for viewId /hello.jsp
    07/06/05 23:49:19 [DEBUG] StateManagerImpl - Session Available, but View State does not exist for viewId: /hello.jsp
    07/06/05 23:49:19 [TRACE] LifecycleImpl - Creating new view '/hello.jsp'
    My gut feel is that state is not being retained between requests, so it is just recreating the same view, however I'm at a loss to explain why
    Attached below are the files used & trace log:
    Chris,
    hello.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <h:form>
    <h:commandButton value="commandButton1" action="success"/>
    <h:messages/>
    </h:form>
    </f:view>
    world.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>world</title>
    </head>
    <body><h:form>
    <h:outputText value="Hello World"/>
    </h:form></body>
    </html>
    </f:view>
    faces-config
    <?xml version="1.0" encoding="windows-1252"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <navigation-rule>
    <from-view-id>/hello.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/world.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>
    portlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
    http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description>JSF Sample Portlet</description>
    <portlet-name>jsfsampleportlet</portlet-name>
    <display-name>JSF Sample Portlet</display-name>
    <!-- You must use this Portlet implementation class -->
    <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
    <!-- This is a required parameter and must point to the first page of the JSF Application -->
    <init-param>
    <description>Portlet init view page</description>
    <name>com.sun.faces.portlet.INIT_VIEW</name>
    <value>/hello.jsp</value>
    </init-param>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>VIEW</portlet-mode>
    <portlet-mode>EDIT</portlet-mode>
    <portlet-mode>HELP</portlet-mode>
    </supports>
    <portlet-info>
    <title>JSF Sample Portlet</title>
    <short-title>jsfsampleportlet</short-title>
    </portlet-info>
    </portlet>
    </portlet-app>
    Log Trace:
    07/06/05 23:48:10 [DEBUG] ApplicationFactoryImpl - Created ApplicationFactory
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - Created Application instance
    07/06/05 23:48:10 [DEBUG] ApplicationFactoryImpl - Created Application instance com.sun.faces.application.ApplicationImpl@dc1165
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set ActionListener Instance to com.sun.faces.application.ActionListenerImpl@177cbf7
    07/06/05 23:48:10 [DEBUG] NavigationHandlerImpl - Created NavigationHandler instance
    07/06/05 23:48:10 [DEBUG] NavigationHandlerImpl - Created NavigationHandler instance
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set NavigationHandler Instance to com.sun.faces.application.NavigationHandlerImpl@1efda65
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set PropertyResolver Instance to com.sun.faces.el.PropertyResolverImpl@7c329d
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set StateManager Instance to com.sun.faces.application.StateManagerImpl@6d006c
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set VariableResolver Instance to com.sun.faces.el.VariableResolverImpl@36b7cc
    07/06/05 23:48:10 [DEBUG] ViewHandlerImpl - Created ViewHandler instance
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set ViewHandler Instance to com.sun.faces.application.ViewHandlerImpl@10b4509
    07/06/05 23:48:10 [DEBUG] ViewHandlerImpl - Delegating to 'com.sun.faces.application.ViewHandlerImpl@10b4509'
    07/06/05 23:48:10 [DEBUG] ApplicationImpl - set ViewHandler Instance to com.sun.faces.portlet.ViewHandlerImpl@da1b43
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type PortletComponent class com.sun.faces.portlet.PortletComponent
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Column class javax.faces.component.UIColumn
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Command class javax.faces.component.UICommand
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Data class javax.faces.component.UIData
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Form class javax.faces.component.UIForm
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Graphic class javax.faces.component.UIGraphic
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlCommandButton class javax.faces.component.html.HtmlCommandButton
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlCommandLink class javax.faces.component.html.HtmlCommandLink
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlDataTable class javax.faces.component.html.HtmlDataTable
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlForm class javax.faces.component.html.HtmlForm
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlGraphicImage class javax.faces.component.html.HtmlGraphicImage
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlInputHidden class javax.faces.component.html.HtmlInputHidden
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlInputSecret class javax.faces.component.html.HtmlInputSecret
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlInputText class javax.faces.component.html.HtmlInputText
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlInputTextarea class javax.faces.component.html.HtmlInputTextarea
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlMessage class javax.faces.component.html.HtmlMessage
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlMessages class javax.faces.component.html.HtmlMessages
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlOutputFormat class javax.faces.component.html.HtmlOutputFormat
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlOutputLabel class javax.faces.component.html.HtmlOutputLabel
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlOutputLink class javax.faces.component.html.HtmlOutputLink
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlOutputText class javax.faces.component.html.HtmlOutputText
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlPanelGrid class javax.faces.component.html.HtmlPanelGrid
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlPanelGroup class javax.faces.component.html.HtmlPanelGroup
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectBooleanCheckbox class javax.faces.component.html.HtmlSelectBooleanCheckbox
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectManyCheckbox class javax.faces.component.html.HtmlSelectManyCheckbox
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectManyListbox class javax.faces.component.html.HtmlSelectManyListbox
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectManyMenu class javax.faces.component.html.HtmlSelectManyMenu
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectOneListbox class javax.faces.component.html.HtmlSelectOneListbox
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectOneMenu class javax.faces.component.html.HtmlSelectOneMenu
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.HtmlSelectOneRadio class javax.faces.component.html.HtmlSelectOneRadio
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Input class javax.faces.component.UIInput
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Message class javax.faces.component.UIMessage
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Messages class javax.faces.component.UIMessages
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.NamingContainer class javax.faces.component.UINamingContainer
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Output class javax.faces.component.UIOutput
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Panel class javax.faces.component.UIPanel
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.Parameter class javax.faces.component.UIParameter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.SelectBoolean class javax.faces.component.UISelectBoolean
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.SelectItem class javax.faces.component.UISelectItem
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.SelectItems class javax.faces.component.UISelectItems
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.SelectMany class javax.faces.component.UISelectMany
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.SelectOne class javax.faces.component.UISelectOne
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added component of type javax.faces.ViewRoot class javax.faces.component.UIViewRoot
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.BooleanConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ByteConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.CharacterConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.DoubleConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.FloatConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.IntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.LongConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ShortConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.BooleanConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ByteConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.CharacterConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.DoubleConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.FloatConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.IntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.LongConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ShortConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.BigDecimalConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.BigIntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.BooleanConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ByteConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.CharacterConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.DoubleConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.FloatConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.IntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.LongConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of class type javax.faces.convert.ShortConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.BigDecimal and class javax.faces.convert.BigDecimalConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.BigInteger and class javax.faces.convert.BigIntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Boolean and class javax.faces.convert.BooleanConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Byte and class javax.faces.convert.ByteConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Character and class javax.faces.convert.CharacterConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.DateTime and class javax.faces.convert.DateTimeConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Double and class javax.faces.convert.DoubleConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Float and class javax.faces.convert.FloatConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Integer and class javax.faces.convert.IntegerConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Long and class javax.faces.convert.LongConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Number and class javax.faces.convert.NumberConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added converter of type javax.faces.Short and class javax.faces.convert.ShortConverter
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added validator of type javax.faces.DoubleRange class javax.faces.validator.DoubleRangeValidator
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added validator of type javax.faces.Length class javax.faces.validator.LengthValidator
    07/06/05 23:48:10 [TRACE] ApplicationImpl - added validator of type javax.faces.LongRange class javax.faces.validator.LongRangeValidator
    07/06/05 23:48:10 [DEBUG] LifecycleFactoryImpl - Created Default Lifecycle
    07/06/05 23:48:10 [TRACE] LifecycleFactoryImpl - Created LifecycleFactory com.sun.faces.portlet.LifecycleFactoryImpl@1776f79
    07/06/05 23:48:11 [TRACE] LifecycleImpl - Created Lifecycle com.sun.faces.portlet.LifecycleImpl@bc9065
    07/06/05 23:48:11 [TRACE] LifecycleFactoryImpl - Added LifecycleId DEFAULT
    07/06/05 23:48:11 [TRACE] LifecycleFactoryImpl - Returned com.sun.faces.portlet.LifecycleImpl@bc9065 for lifecycleId DEFAULT
    07/06/05 23:48:11 Oracle Containers for J2EE 10g (10.1.3.1.1) initialized
    07/06/05 23:48:53 [TRACE] FacesPortlet - Begin FacesPortlet.init()
    07/06/05 23:48:53 [TRACE] FacesPortlet - End FacesPortlet.init()
    07/06/05 23:48:53 [TRACE] FacesPortlet - Begin FacesPortlet.render()
    07/06/05 23:48:53 [TRACE] FacesPortlet - Retrieved facesContextFactory com.sun.faces.portlet.FacesContextFactoryImpl@1c6395b
    07/06/05 23:48:53 [TRACE] FacesPortlet - Retrieved lifecycleFactory com.sun.faces.portlet.LifecycleFactoryImpl@1776f79
    07/06/05 23:48:53 [DEBUG] FacesPortlet - lifecycleId null
    07/06/05 23:48:53 [TRACE] LifecycleFactoryImpl - Returned com.sun.faces.portlet.LifecycleImpl@bc9065 for lifecycleId DEFAULT
    07/06/05 23:48:53 [TRACE] FacesPortlet - Retrieved lifecycle from lifecycleFactory com.sun.faces.portlet.LifecycleImpl@bc9065
    07/06/05 23:48:53 [TRACE] ExternalContextImpl - Created ExternalContext com.sun.faces.portlet.ExternalContextImpl@df8f81
    07/06/05 23:48:53 [TRACE] FacesContextFactoryImpl - Created FacesContext com.sun.faces.portlet.FacesContextImpl@19e7719
    07/06/05 23:48:53 [TRACE] FacesPortlet - Begin executing RenderResponse phase
    07/06/05 23:48:53 [DEBUG] LifecycleImpl - render(com.sun.faces.portlet.FacesContextImpl@19e7719)
    07/06/05 23:48:53 [TRACE] LifecycleImpl - restore(com.sun.faces.portlet.FacesContextImpl@19e7719,false)
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - Created new view for /hello.jsp
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - Locale for this view as determined by calculateLocale en_US
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - RenderKitId for this view as determined by calculateRenderKitId HTML_BASIC
    07/06/05 23:48:53 [DEBUG] LifecycleImpl - Created new ViewRoot with View Id/hello.jsp
    07/06/05 23:48:53 [TRACE] LifecycleImpl - phase(RENDER_RESPONSE 6,com.sun.faces.portlet.FacesContextImpl@19e7719)
    07/06/05 23:48:53 [DEBUG] LifecycleImpl - Begin RenderResponsePhase
    07/06/05 23:48:53 [DEBUG] LifecycleImpl - About to render view /hello.jsp
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - About to render view /hello.jsp
    07/06/05 23:48:53 [WARN] ViewHandlerImpl - Unable to determine FaceServlet mapping for servlet path 'null'.
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - URL pattern of the FacesServlet executing the current request null
    07/06/05 23:48:53 [DEBUG] ViewHandlerImpl - Found no URL patterns mapping to FacesServlet
    07/06/05 23:48:53 [TRACE] ViewHandlerImpl - Before dispacthMessage to newViewId /hello.jsp
    07/06/05 23:48:53 [TRACE] ExternalContextImpl - dispatchMessage(/hello.jsp)
    07/06/05 23:48:53 [DEBUG] ExternalContextImpl - response content type text/html
    07/06/05 23:48:53 [TRACE] ApplicationImpl - Created component javax.faces.HtmlForm
    07/06/05 23:48:53 [TRACE] FormRenderer - Begin encoding component _id0
    07/06/05 23:48:53 [TRACE] ViewHandlerImpl - Action URL:wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-mode=wsrp%3Aview&wsrp-windowState=wsrp%3Anormal&wsrp-secureURL=false&wsrp-navigationParameters=&wsrp-navigationalState=com.sun.faces.portlet.VIEW_ID%3D%252Fhello.jsp/wsrp_rewrite
    07/06/05 23:48:53 [TRACE] ApplicationImpl - Created component javax.faces.HtmlCommandButton
    07/06/05 23:48:53 [TRACE] ButtonRenderer - Begin encoding component _id1
    07/06/05 23:48:53 [TRACE] ButtonRenderer - End encoding component _id1
    07/06/05 23:48:53 [TRACE] ApplicationImpl - Created component javax.faces.HtmlMessages
    07/06/05 23:48:53 [TRACE] MessagesRenderer - End encoding component _id2
    07/06/05 23:48:53 [TRACE] ViewHandlerImpl - Begin writing state to response for viewId/hello.jsp
    07/06/05 23:48:53 [TRACE] ViewHandlerImpl - End writing state to response for viewId/hello.jsp
    07/06/05 23:48:53 [TRACE] FormRenderer - End encoding component _id0
    07/06/05 23:48:53 [DEBUG] StateManagerImpl - Begin creating serialized view for /hello.jsp
    07/06/05 23:48:53 [DEBUG] StateManagerImpl - End creating serialized view /hello.jsp
    07/06/05 23:48:53 [TRACE] ViewHandlerImpl - After dispacthMessage to newViewId /hello.jsp
    07/06/05 23:48:53 [DEBUG] LifecycleImpl - End RenderResponsePhase
    07/06/05 23:48:53 [TRACE] LifecycleImpl - save(com.sun.faces.portlet.FacesContextImpl@19e7719,false)
    07/06/05 23:48:53 [TRACE] FacesPortlet - End executing RenderResponse phase
    07/06/05 23:48:53 [TRACE] FacesPortlet - End FacesPortlet.render()
    07/06/05 23:49:19 [TRACE] FacesPortlet - Begin FacesPortlet.processAction()
    07/06/05 23:49:19 [TRACE] ExternalContextImpl - Created ExternalContext com.sun.faces.portlet.ExternalContextImpl@1fee2b4
    07/06/05 23:49:19 [TRACE] FacesContextFactoryImpl - Created FacesContext com.sun.faces.portlet.FacesContextImpl@d5cfd6
    07/06/05 23:49:19 [TRACE] FacesPortlet - Begin Executing phases
    07/06/05 23:49:19 [DEBUG] LifecycleImpl - execute(com.sun.faces.portlet.FacesContextImpl@d5cfd6)
    07/06/05 23:49:19 [TRACE] LifecycleImpl - restore(com.sun.faces.portlet.FacesContextImpl@d5cfd6,true)
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - Created new view for /hello.jsp
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - Locale for this view as determined by calculateLocale en_US
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - RenderKitId for this view as determined by calculateRenderKitId HTML_BASIC
    07/06/05 23:49:19 [DEBUG] LifecycleImpl - Created new ViewRoot with View Id/hello.jsp
    07/06/05 23:49:19 [TRACE] LifecycleImpl - phase(RESTORE_VIEW 1,com.sun.faces.portlet.FacesContextImpl@d5cfd6)
    07/06/05 23:49:19 [DEBUG] LifecycleImpl - Begin RestoreViewPhase
    07/06/05 23:49:19 [WARN] ViewHandlerImpl - Unable to determine FaceServlet mapping for servlet path 'null'.
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - URL pattern of the FacesServlet executing the current request null
    07/06/05 23:49:19 [DEBUG] StateManagerImpl - Begin restoring view in session for viewId /hello.jsp
    07/06/05 23:49:19 [DEBUG] StateManagerImpl - Session Available, but View State does not exist for viewId: /hello.jsp
    07/06/05 23:49:19 [TRACE] LifecycleImpl - Creating new view '/hello.jsp'
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - Created new view for /hello.jsp
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - Using locale from previous view en_US
    07/06/05 23:49:19 [DEBUG] ViewHandlerImpl - Using renderKitId from previous view HTML_BASIC
    07/06/05 23:49:19 [DEBUG] LifecycleImpl - End RestoreViewPhase
    07/06/05 23:49:19 [TRACE] LifecycleImpl - save(com.sun.faces.portlet.FacesContextImpl@d5cfd6,true)
    07/06/05 23:49:19 [TRACE] FacesPortlet - End Executing phases
    07/06/05 23:49:19 [TRACE] FacesPortlet - End FacesPortlet.processAction()
    07/06/05 23:49:20 [TRACE] FacesPortlet - Begin FacesPortlet.render()
    07/06/05 23:49:20 [TRACE] ExternalContextImpl - Created ExternalContext com.sun.faces.portlet.ExternalContextImpl@179eb02
    07/06/05 23:49:20 [TRACE] FacesContextFactoryImpl - Created FacesContext com.sun.faces.portlet.FacesContextImpl@133e7a1
    07/06/05 23:49:20 [TRACE] FacesPortlet - Begin executing RenderResponse phase
    07/06/05 23:49:20 [DEBUG] LifecycleImpl - render(com.sun.faces.portlet.FacesContextImpl@133e7a1)
    07/06/05 23:49:20 [TRACE] LifecycleImpl - restore(com.sun.faces.portlet.FacesContextImpl@133e7a1,false)
    07/06/05 23:49:20 [TRACE] LifecycleImpl - End restore()
    07/06/05 23:49:20 [TRACE] LifecycleImpl - phase(RENDER_RESPONSE 6,com.sun.faces.portlet.FacesContextImpl@133e7a1)
    07/06/05 23:49:20 [DEBUG] LifecycleImpl - Begin RenderResponsePhase
    07/06/05 23:49:20 [DEBUG] LifecycleImpl - About to render view /hello.jsp
    07/06/05 23:49:20 [DEBUG] ViewHandlerImpl - About to render view /hello.jsp
    07/06/05 23:49:20 [WARN] ViewHandlerImpl - Unable to determine FaceServlet mapping for servlet path 'null'.
    07/06/05 23:49:20 [DEBUG] ViewHandlerImpl - URL pattern of the FacesServlet executing the current request null
    07/06/05 23:49:20 [DEBUG] ViewHandlerImpl - Found no URL patterns mapping to FacesServlet
    07/06/05 23:49:20 [TRACE] ViewHandlerImpl - Before dispacthMessage to newViewId /hello.jsp
    07/06/05 23:49:20 [TRACE] ExternalContextImpl - dispatchMessage(/hello.jsp)
    07/06/05 23:49:20 [DEBUG] ExternalContextImpl - response content type text/html
    07/06/05 23:49:20 [TRACE] FormRenderer - Begin encoding component _id0
    07/06/05 23:49:20 [TRACE] ViewHandlerImpl - Action URL:wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-mode=wsrp%3Aview&wsrp-windowState=wsrp%3Anormal&wsrp-secureURL=false&wsrp-navigationParameters=&wsrp-navigationalState=com.sun.faces.portlet.VIEW_ID%3D%252Fhello.jsp/wsrp_rewrite
    07/06/05 23:49:20 [TRACE] ButtonRenderer - Begin encoding component _id1
    07/06/05 23:49:20 [TRACE] ButtonRenderer - End encoding component _id1
    07/06/05 23:49:20 [TRACE] MessagesRenderer - End encoding component _id2
    07/06/05 23:49:20 [TRACE] ViewHandlerImpl - Begin writing state to response for viewId/hello.jsp
    07/06/05 23:49:20 [TRACE] ViewHandlerImpl - End writing state to response for viewId/hello.jsp
    07/06/05 23:49:20 [TRACE] FormRenderer - End encoding component _id0
    07/06/05 23:49:20 [DEBUG] StateManagerImpl - Begin creating serialized view for /hello.jsp
    07/06/05 23:49:20 [DEBUG] StateManagerImpl - End creating serialized view /hello.jsp
    07/06/05 23:49:20 [TRACE] ViewHandlerImpl - After dispacthMessage to newViewId /hello.jsp
    07/06/05 23:49:20 [DEBUG] LifecycleImpl - End RenderResponsePhase
    07/06/05 23:49:20 [TRACE] LifecycleImpl - save(com.sun.faces.portlet.FacesContextImpl@133e7a1,false)
    07/06/05 23:49:20 [TRACE] FacesPortlet - End executing RenderResponse phase
    07/06/05 23:49:20 [TRACE] FacesPortlet - End FacesPortlet.render()

    I'm missing some things in your portlet.xml deployment descriptor.
    It looks like your application doesn't make use of a JSF binding layer, so it should be enough to initialize a Faces lifecycle listener like this:
    <init-param>
    <name>DefaultPage.view</name>
    <value>/index.jspx</value>
    </init-param>
    <init-param>
    <name>BridgeLifecycleListeners</name>
    <value>
    oracle.portlet.server.bridges.jsf.adf.ADFFacesBridgeLifecycleListener
    </value>
    </init-param>
    The DefaultPage.view parameter specifies the default page of the application to use as the View mode for the portlet. Its location is relative to the web-app-context-root and always start with a /.
    The BridgeLifecycleListeners parameter specifies the filter classes to use. You must ensure that your portlet.xml file is configured to match the filters specified in your web.xml file. If you do not have the proper classes defined in portlet.xml, then you will receive a missing class error. You specify the classes in the BridgeLifecycleListeners init-param in your portlet.xml file:
    <init-param>
    <name>BridgeLifecycleListeners</name>
    <value>listener_class_n[,listener_class_n+1,...]</value>
    </init-param>
    For example, suppose that your application includes AdfFacesFilter filter in its web.xml:
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    You would then need to include the following class in your portlet.xml:
    <init-param>
    <name>BridgeLifecycleListeners</name>
    <value>oracle.portlet.server.bridges.jsf.adf.ADFFacesBridgeLifecycleListener
    </value>
    </init-param>
    Similarly, suppose that ADFBindingFilter filter is defined in web.xml as follows:
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    You would then need to include the following in your portlet.xml:
    <init-param>
    <name>BridgeLifecycleListeners</name>
    <value>oracle.portlet.server.bridges.jsf.adf.ADFFacesBridgeLifecycleListener,
    oracle.portlet.server.bridges.jsf.adf.BindingFacesBridgeLifecycleListener
    </value>
    </init-param>

  • JSF Navigation: Unexepcted value for action in h:form tag

    Hi
    I am running simple JSF application and when I click the button, it stays in the same page rather than the output page.
    I found that the resulting Html code has form action and that action is referring to current page.
    here is my JSF code...
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <f:loadBundle basename="gov.ca.dmv.dmvar.bundle.messages" var="msg"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
       <f:view>
         <h1>
          <h:outputText value="#{msg.inputname_header}"/>
         </h1>
         <h:form id="helloForm">
          <h:outputText value="#{msg.prompt}"/>
          <h:inputText value="#{personBean.personName}" />
          <h:commandButton action="#{personBean.clickSearch}" value="#{msg.button_text}"></h:commandButton>
         </h:form>
       </f:view>
    </body>
    </html> Here is my html source
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
         <h1>
          Welcome to EASE
         </h1>
         <form id="helloForm" method="post" action="/RSample/index.jsf;jsessionid=5AD3913EE84D54EF78A6F46B2AFFFB79" enctype="application/x-www-form-urlencoded">
          Tell us your name:
          <input type="text" name="helloForm:_id2" />
          <input type="submit" name="helloForm:_id3" value="ENTER" />
         <input type="hidden" name="helloForm" value="helloForm" /></form>
    </body>
    </html> I am giving the action for a button and its not attaching the action for the button ..but its assiging to the form action with wrong value.
    Anything I missed here?
    --Varma                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I am using JSF1.2
    I found in html code ...
    <form id="helloForm" method="post" action="/RSample/index.jsf;jsessionid=5AD3913EE84D54EF78A6F46B2AFFFB79" enctype="application/x-www-form-urlencoded">My index.jsp file is just forwarding to 'inputname.jsp'
    In 'inputname.jsp' i have created a text box and a button.
    <html>
    <body>
    <jsp:forward page="/pages/inputname.jsp"></jsp:forward>
    </body>
    </html>inputname.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <f:loadBundle basename="gov.ca.dmv.dmvar.bundle.messages" var="msg"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
       <f:view>
         <h1>
          <h:outputText value="#{msg.inputname_header}"/>
         </h1>
         <h:form id="helloForm">
          <h:outputText value="#{msg.prompt}"/>
          <h:inputText value="#{personBean.personName}" />
          <h:commandButton id="button1" onclick="#{personBean.clickSearch}" value="#{msg.button_text}"></h:commandButton>
         </h:form>
       </f:view>
    </body>
    </html> PersonBean.java
    package gov.ca.dmv.dmvar.common;
    public class PersonBean {
            String personName;
            * @return Person Name
            public String getPersonName() {
               return personName;
            * @param Person Name
            public void setPersonName(String name) {
               personName = name;
            public String clickSearch(){
                 return "greeting";
         }faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC
        "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
        "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <navigation-rule>
       <from-view-id>/pages/inputname.jsf</from-view-id>
        <navigation-case>
         <from-outcome>greeting</from-outcome>
         <to-view-id>/pages/greeting.jsf</to-view-id>
       </navigation-case>
      </navigation-rule>
      <managed-bean>
        <managed-bean-name>personBean</managed-bean-name>
        <managed-bean-class>gov.ca.dmv.dmvar.common.PersonBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </faces-config>There are no errors after submitting. My only doubt is I am binding the commondButton action to bean method. But in the html code the <form action is referring to index.jsp?

  • JSF Navigation and page access out-of-order issue

    I've been searching the web and the forums for an answer to what I thought would be at least a well-documented issue with JSF, but have been coming up empty. (which to me might mean its not an issue and just a lack of understanding on my part)
    Lets say I have two pages, one (license.jsf) that has a simple form that presents the user with a license agreement along with two commandButtons with actions "accept" and "decline".
    The other page is a landing page, lets call it "results.jsf" which the user gets navigated to should they choose to accept the license agreement.
    The problem I have is whats to stop a user from just typing in results.jsf. Granted my controller can store a value somewhere as to whether they have accepted the terms of the license and not display the content on the results.jsf page, but what I'd really like to do is intercept that initial request to results.jsf and redirect them to the license.jsf page.
    I can fathom a bunch of different "hacks" to make this work, but I'm really hoping that somebody knows of some more elegant solution for addressing this whether its in JSF directly or using some support framework like a SEAM or Spring(?) (I'm vaguely familiar with SEAM and I'm figuring since its got a workflow on the back end, its kinda hard to drop into the middle of a process flow, so maybe it addresses that some how). Or I'll happily take any suggested URL's to other threads/websites that offer advice on this subject.
    Thanks.

    Yes, I've tried that. It really is puzzling. I am also fighting the battle of the counters (trying to get them to stay centered, and (as mentioned in a separate post) trying to figure out why I have a duplicate entry in my RSS feed.
    I wonder if that problem is connected to this one?

  • Change JSF navigation-rule not begin with "root"

    Dear all,
    I have a web application, call myApp, run in PC1. There is a navigation rule to control page1 jump to page2.
    normally, after deploy and run my application, url for it is: [ http://{color:#0000ff}pc1:8080{color}/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ], and click something in my page1, it will go to [ http://{color:#0000ff}pc1:8080{color}/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ].
    I have another machine, named PC2, and create a mapping and forward request to PC1. Therefore, if anyone type the url: [ http://*{color:#0000ff}pc2{color}*/subSection/{color:#008000}myApp{color}/{color:#ff6600}*page1.jsf*{color} ] , actuality, they are looking for [ http://{color:#0000ff}*pc1:8080*{color}/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ].
    Now, I have a problem is that, when people browse a page [ http://{color:#0000ff}*pc2*{color}/*{color:#ff00ff}subSection{color}*/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ] and click something, it will go to another page [ http://{color:#0000ff}*pc2*{color}/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ], not go to [ http://{color:#0000ff}*pc2*{color}/*{color:#ff00ff}subSection{color}*/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ]. Therefore, it makes "404 Not Found" exception.
    Does anyone help me?
    Thank you
    Kevin Tang.

    SuperCEO wrote:
    My application server is Apache Tomcat.
    May be my problem is related to Tomcat context path problem.
    I wanna to know can I modify my program, such as faces-config.xml, to fix my problem, or I need to modify my Tomcat setting ?I am suggesting you do not need to modify your program, but the configuration of whatever is doing the forwarding.

  • Relation between URL and content in JSF navigation

    Hello,
    I've tried lots of JSF examples and there always occoured a strange kind of navigation to me:
    The URL you see in the browser's address bar has nothing to do with the actually displayed JSP. Instead of that, the URL is always pointing to the previously called JSP - where the call to the current JSP comes from.
    I know where this comes from:
    If the form tags don't define an action, they are pointing to the current page itself.
    And the actually called navigation case is chosen by a (hidden) post parameter.
    So the JSF controller servlet doesn't actually care, which URL is called - it just regards the mentioned parameter.
    This kind of navigation seems quite confusing, especcially since JSF claims to make navigation clearer.
    One of the basic demands of the web applications we are developing is, to have a clear relation between URL and page content.
    E.g. it must be possible to index the pages with search engines. Or to simply bookmark distinct pages in the browsers favourites.
    Another problem about this navigation concept is, that it always works with forms and with post method (you can't choose get method), even if you just have simple links - e.g. detail view of a single item after selecting it from a list of items. That way it's not possible to ever use the back button of your browser.
    I'm new to JSF, so my question:
    Is this the (one-and-only) navigation concept of JSF, or are there alternative concepts as well?
    I would be surprised, since the mentioned demands are basic web standard - although I didn't find any alternatives so far.
    Thanks,
    Chily

    Thanks for the answer!
    I'm not sure, if using a redirect on every single call is very achieveable and in the purpose of the JSF design.
    E.g. it is generating a lot of traffic overhead.
    (Identifying the navigation case by the page name instead of a hidden parameter would help a lot.)
    Or the history of the browser doesn't work with it, so you can't identify visited links.
    But anyways, there are also internal problems with it in most cases: I've inserted the <redirect/> tag in the navigation cases of a few examples. This just causes a call of the <to-view-id> page, without any parameters. So I probably have to add some non-standard-processing around the call to make it work:
    If e.g. I have the standard case of a list of items (let's say in a dataTable), which are identified by an id. And each item uses a commandLink to call it's detail view.
    * How do I get the identifier (id) as a parameter into the redirect URL?
    * And how do I access this parameter in the destination form bean to choose the item to be displayed? (see also http://forum.java.sun.com/thread.jspa?threadID=607505)
    Thanks for help,
    Chily

  • Navigation issue using jsf, tiles, tomahawk  :loosing faces context

    Hi all,
    I enhanced my webapp using tomahawks jscookmenu.
    Triggering 1 menuItem the wanted pages displays correctly but the next click anywhere in the application shows this error:
    org.apache.jasper.JasperException: javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to  *.jsf (with the <servlet-mapping>-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.The web config is like that:
    <?xml version="1.0"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
         <context-param>
              <description>Tiles MyFaces Config</description>
              <param-name>tiles-definitions</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
         </context-param>
         <context-param> 
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name> 
              <param-value>.jsp</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
              <param-value>off</param-value>
         </context-param>
         <!-- context-params mafaces -->
         <context-param>
              <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.STRICT_XHTML_LINKS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
              <param-value>this is a bug in myfaces</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
              <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
              <param-value>/faces/myFacesExtensionResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
              <param-value>true</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>
         <context-param>
              <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
              <param-value>false</param-value>
         </context-param>
         <!-- StartupServletContextListener -->
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
              </listener-class>
         </listener>
         <!-- Faces MyFacesExtensionsFilter -->
         <filter>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <filter-class>
                   org.apache.myfaces.webapp.filter.ExtensionsFilter
              </filter-class>
              <init-param>
                   <param-name>uploadMaxFileSize</param-name>
                   <param-value>1m</param-value>
              </init-param>
         </filter>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>/faces/*</url-pattern>
         </filter-mapping>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
         <!-- Faces Servlet -->
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <!-- Faces Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>imageServlet</servlet-name>
              <servlet-class>my.com.xplorer.gui.v.ImageServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>imageServlet</servlet-name>
              <url-pattern>/image/*</url-pattern>
         </servlet-mapping>
    </web-app>So I lost the faces context using the jscookmenu, I believe.
    My webapp uses tiles, and there is 2 navigation possibilities: tomahawaks jscookmenu and tomahawaks commandNavigation.
    Latter one runs ok, I do use
    <t:panelNavigation id="nav" styleClass="navigation"
         itemClass="navitem" separatorClass="navseparator" 
         activeItemClass="navitem_active" openItemClass="navitem_open">
         <t:commandNavigation action="#{newsHandler.userRequest}" value="#{newsHandler.rss_source_name[0]}">
              <f:param name="navigator"  value="/jsf/news.jsp" />
         </t:commandNavigation>
    </t:panelNavigation>for this kind of navigation I do not use any navigation rules in faces config. To dynamically include the desired faces page I do that:
    <%
         String s = (String)request.getParameter("navigator");
         if (s == null || s.length() == 0 ) {
              s =  "/jsf/explorer.jsp";
    %>
    <jsp:include page="<%=s %>" />That does work.
    Now like I said I did enhance the app by adding tomahawks jscookmenu.
    Therefore I use the following in another tile:
    <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="resources/css">
              <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
                 Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
                 respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
            */%>
      <t:navigationMenuItem id="nav_0" itemLabel="#{localz.Xplorer}" action="Xplorer" />
    </t:jscookMenu>For this kind of navigation I tried to use navigation rules and the following show the config:
         <navigation-rule>
           <from-view-id>/jsf/*</from-view-id>
            <navigation-case>
                <from-outcome>Xplorer</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/explorer.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>Tabs</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/tab.jsp</to-view-id>
            </navigation-case>
         </navigation-rule>That works for the first click. The desired page is shown. The nect click anywhere in the app then show the mentioned error.
    Using tiles I use this view-handler
    <view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>One question is: can I use another view-handler on top of the above one? So I could extend com.sun.facelets.FaceletViewHandler and try my luck with this? Or is the solution pointed out just a millisecond from being ok, I just don�t see it?
    Maybe you need to know a bit more on how I use tiles:
    That is the page I start with. It inserts the tile shown underneath.
    <f:view locale="#{userLocale}">
         <f:loadBundle var="localz" basename="my.com.xplorer.gui.v.Lokalization" />
         <f:loadBundle var="bundle" basename="my.com.xplorer.gui.v.messages" />
         <f:subview id="tileMain">
              <h:form id="myJsfForm" styleClass="standard">
                        <tiles:insert definition="template" flush="false" />
              </h:form>
         </f:subview>
         <h:messages />
    </f:view>
    </html>The foolowing is the tile structure.
    The bodi tile is the dynamic part. Above you see that I dynamically load the pages into it.
    <t:htmlTag value="div" styleClass="pageLayout">
         <h:panelGrid columns="2" align="center" styleClass="pageContent">
              <f:facet name="header">
                   <f:subview id="header">
                        <tiles:insert attribute="header" flush="false" />
                   </f:subview>
              </f:facet>
              <t:htmlTag value="div" styleClass="pageMenu">
                   <f:subview id="menu">
                        <tiles:insert attribute="menu" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <t:htmlTag value="div" styleClass="pageContentWoMenu">
                   <f:subview id="bodi">
                        <tiles:insert attribute="bodi" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <f:facet name="footer">
                   <f:subview id="footer">
                        <tiles:insert attribute="footer" flush="false" />
                   </f:subview>
              </f:facet>
         </h:panelGrid>
    </t:htmlTag>Maybe you also need to know the tiles config?
    <tiles-definitions>
       <definition name="template" path="/jsf/tileTemplate.jsp">
              <put name="header"  value="/jsf/header.jsp"/>
          <put name="menu"    value="/jsf/menu.jsp"/>
          <put name="bodi"    value="/jsf/bodi.jsp"/>
          <put name="footer"    value="/jsf/footer.jsp"/>
       </definition>
       <definition name="/jsf/news.tiles" extends="template">
              <put name="bodi"  value="/jsf/news.jsp"/>
       </definition>
       <definition name="/jsf/explorer.tiles" extends="template">
              <put name="bodi"  value="/jsf/explorer.jsp"/>
       </definition>
       <definition name="/jsf/tab.tiles" extends="template">
              <put name="bodi"  value="/jsf/tab.jsp"/>
       </definition>If you have read until here: thanks very much.
    There seems to be a sort of gap regarding jsf navigation documentation.
    I mean the ordinary way is covered everywhere (the book I have covers that too), but jscookmenu seems not to fit in too good. I also tried it with an actionslistener in the jscookmenu but that failed, too. So a link to documents telling the truth on jsf navigation I would appreciate very much.
    Kind regards
    Belle Ile En Mer

    This is the error i am getting into now..
    exception
    org.apache.jasper.JasperException: An exception occurred processing JSP page /welcomeJSF.jsp at line 19
    16: This file is an entry point for JavaServer Faces application.
    17: --%>
    18: <body>
    19: <f:view>
    20: <h3><h:outputText value="CHOULTRY'S IN BANGALORE" /></h3>
    21: <h:form>
    22: <table border="0">
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.RuntimeException: Cannot find FacesContext
         javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
         javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
         org.apache.jsp.welcomeJSF_jsp._jspx_meth_f_005fview_005f0(welcomeJSF_jsp.java:112)
         org.apache.jsp.welcomeJSF_jsp._jspService(welcomeJSF_jsp.java:86)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  • Issue with broken navigation when implementing a SSO filter

    Hello
    I'm facing an issue when integrating the Jasig CAS SSO with Siebel Self-Service (which is an Oracle ADF application). When applying the CAS Authentication Filters, the navigation rules and page flows in the Self-Service application cease to work.
    The Siebel Self-Service application is using adfFaces filter, adfBindings filter and the SelfServiceFilter as controllers for the pages.
    For the integration with the Jasig CAS, a client lib is installed in the Self-Service OC4J. This CAS Client provides an "Authentication Filter" that is defined in the web.xml. The pages in Self-Service that are to be protected by this authentication filter (the pages that needs user authentication in order to be accessed) are also mapped in the web.xml. This authentication filter checks the user against the CAS Server and sends back a ticket parameter with the URL if the user is logged in. This parameter is used to validate the login attempt, and on successful validation, the CAS server provides the username of the user to a bean called by the SelfServiceFilter in the Self-Service app.
    My problem is that any JSF navigation on a page (navigation rules and page flows) cease to work as soon as a page is protected by the Authentication filter. One example would be during the check out process (which consists of several steps - several jspx pages). When you click “Next” on the first check out step, you are not redirected to step no 2, but to the same check out page as you started on.
    Since the Authentication Filter protects all the pages involved, it will intercept any request to these pages, fetch the request URL, redirect to the CAS server for user authentication, and on successful authentication it will redirect the user back to the URL that was fetched by the Authentication Filter in the first place.
    I have been looking into this, and I think that the JSF navigation rules etc, cease to work because the JSF page flows are being interrupted. When clicking “next” the page would normally post information to the life cycle of the requested page (which in some cases in this app, is also a postback to the same page). This information is then used when going through the life cycle of the new page. But when the CAS Authentication Filter intercepts the request, send the user to the CAS server and then redirect back to the page, this page life cycle is interrupted, or the necessary data is not attached in this “new” request.
    Does anyone have an idea for how I can solve this issue?
    Thanks!
    Jonte

    Hi,
    JSF pages use a postback navigation model. The filter works as expected but performs a redirect to the request page, which in the case of postback is the current page you see. To change this, you need to change the navigation cases to perform "redirect" navigation itself. Its ot an ADF Faces problem but default JSF behavior
    Frank

  • Problem with forwarding to new page in jsf

    Hi
    I am facing a problem. I have a checkbox in my jsp page and 3 submit button. The two button works w r t check box and its woking fine. I am getting problem with the 3rd button. I want to fwd to next page once the button is clicked.
    For the check box i am using the method
    public String handleCheckbox2ValueChange(ValueChangeEvent valueChangedEvent)
    Can anyone help me in this regard. I need to fwd to the next page.
    Regards
    Rupesh

    This sounds like a simple JSF navigation that has nothing to do with the checkbox. Read the documentation and tutorials on navigation.

  • JSF app - open report in new Window - via JSP?

    I have been reading through this forum but no one has done quite what I am trying so I thought I'd post my own version of this problem.
    The web app I'm working on is basically a report generator. Data is formatted via XSLT to .html files - that part works great. The problem is getting the app to open this new HTML file in a new window. I want to get this working with little or no JavaScript.
    startReport.jsp (a JSF file) is the form that validates the user input. The sole h:commandButton (I do NOT want a link) works fine sending the form and JSF returns its errors or mine (if the criteria results in nothing) as it should; the action method returns "failure" so the page stays the same.
    But when the action method returns "success" the JSF navigation-rule is setup to route to showReportFile.jsp (which is NOT a JSF file). This JSP is very simple:
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.PrintWriter" %>
    <%@ page import="java.io.FileReader" %>
    <%@ page import="com.logipath.gict.cts.reporting.client.ReportClient" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <jsp:useBean id="reportClient" scope="session" class="com.logipath.gict.cts.reporting.client.ReportClient" />
    <%
    String fileName = reportClient.getReportOutputFile();
    PrintWriter writer = response.getWriter();
    char[] buffer = new char[1024];
    FileReader reader = new FileReader(fileName);
    int numRead = reader.read(buffer, 0, buffer.length);
    while ( numRead != -1 ) {
         writer.write(buffer, 0, numRead);
         numRead = reader.read(buffer, 0, buffer.length);
    reader.close();
    writer.close();
    File file = new File(fileName);
    file.delete();
    %>This works believe it or not. If I put the target="_blank" on the form tag in the startReport.jsp it even opens in a new window. Great. But with that attribute on the form element, if the page comes back in error - it shows up in a new window (as it is apt to do given the attiribute).
    Ok, the h:commandButton tag's target attribute is ignored. Fine. There has to be a way to do this but I just cannot figure it out and I'm no JSP expert.
    What I think will work is this. Since my report beans create HTML files, I've created a session bean called "currentReportBean" which holds a single attribute - the name of the HTML file to display. (This is how the JSP above works.)
    What I need to know now *(this is the question part)* is how can I flush the render response of my JSF life cycle, trigger the opening of this JSP in a new window, the restart the JSF life cycle at the begining so the "parent" page repaints normally? The JSP isn't part of the JSF page flow so I there's no "going back" or "refresh" to worry about. I would like to take the showReportFile.jsp file out of the navigation files altogether.
    I know this topic has been worked on at length, but not quite this way. Any help is greatly appreciated.

    arnieAustin wrote:
    No, the JSP resets the bean value after showing the file.My mistake; it wasn't the reload scenario that is an issue. It is when the user goes back and forth in history that this can be a problem.
    >
    But now I'm confused. JS cannot access server-based session values. How is it going to know to open the page? A cookie?Write the value to a JS variable when you render the page.

  • How-to get attributes from one JSF page redirected to another?

    How do I send information from one JSF page when the navigation rule redirects it to another?
    When JSF navigation does a forward I can use request.setAttribute() in the from-page and then use request.getAttribute() in the to-page, but this doesn't work with <redirect/>.
    Regards,
    Al Malin

    The process scope in ADF Faces solves this. See:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.adffacesguide%7Cdevguide%7CcommunicatingBetweenPages%7Ehtml/

  • Can "h:selectOneListbox" be used for navigation?

    I have an application that will be made up of several .war files. Each .war file is an application in itself.
    In other words, this is still considered as one big application, but for development purposes, each "feature" of the one big application is an application and uses it's own .war. By doing this, any changes would allow me to role out the specific .war that was needed.
    Right now, I am planning out the navigation at this point.
    There will be a menu "h:selectOneListbox" at the top of each page throughout the one big application that will allow a user to go to a different application.
    What is the best approach in planning out the faces-config.xml files?
    For example, would I just define each as:
    <navigation-rule>
    <navigation-case>
    <from-outcome>appone</from-outcome>
    <to-view-id>/application_subdirectory_a/app1.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>apptwo</from-outcome>
    <to-view-id>/application_subdirectory_b/app2.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>appthree</from-outcome>
    <to-view-id>/application_subdirectory_c/app3.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    What is the right way to approach JSF navigation using a "h:selectOneListbox"?
    Can I even do this, since "h:selectOneListbox" doesn't have an action attribute?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    If you indeed need it - you can.
    For it you should create commandLink with action, you need, for example:
    <h:commandLink id="cmdLink1"  action="#{yourBean.beanMethod}" />and create javascript function:
         function executeCommandLink(idLink,formName){            document.forms[0].elements[formName+':_link_hidden_'].value=idLink;
                if(document.forms[formName].onsubmit){
                    document.forms[formName].onsubmit();
                document.forms[0].submit();
                return false;
                }And, put this js function into onclick method of your selectOneListBox:
    <h:selectOneListbox onclick="executeCommandLink('cmdLink1','YourFormName')" />It will work for myFaces implementation of jsf - for another you should change js function a little.

  • Static footer and header pasted into all pages - the only way with JSF?

    Hello!
    What are the known patterns to deal with the use case in the subject ? Every tutorial I've seen suggest to copy and paste the header and footer into different views. Even if it is only the include statement that is being copied, I would not want to do this. I would rather do a single page with the single footer and single header and dynamically include the dynamic view. However, to achieve this, it seems the only way is to hard code all of the possible include statements for the views at compile time, using an EL's if then. This is also not a lot of fun, if one has hundreds of different views to include. Also, using this approach one would basically have to give up the JSF's navigation, which is based on the name of the jsp file. And since there will be only one main jsp file the JSF navigation will be restricted to a single one page - many outcomes navigation node. Won't be able to do anything more complex than that. Bad too.
    Any inputs would be appreciated.
    p.s. I am new to JSF, but to call it an MVC framework seems to be a stretch: navigation should happen in the controller part not in the view - and that is what is happening by virtue of describing the navigation in terms of the raw jsp-files - the view. Can anybody argue with this?

    Check out facelets, which adds useful templating and other nice features to JSF. You are still stuck with navigation-by-XML, which I agree is silly.
    These links might be useful:
    http://hookom.blogspot.com/2005/05/facelets-templating.html
    http://blog.exadel.com/?p=12
    http://members.capmac.org/~orb/blog.cgi/tech/java/Facelets_makes_JSF_.html
    http://www.jsfcentral.com/articles/facelets_1.html (and the followup article)
    The project homepage is https://facelets.dev.java.net/.

Maybe you are looking for

  • How to view and or delete smart folder in finder sidebar

    Sounds easy, but I am having a problem. I recently had my hard drive replaced at the genius bar. I have a smart File on the finder side bar that I can not open or delete. When I click on the file I get the message "the volume for (name of file) canno

  • Saving document open in external window

    Hello all, as always, I seem to be stuck ;-) I have an application that embeds the Acrobat control, opens a document and performs some operations on it using a plugin which is being "remote-controlled". The only thing I can't seem to get to work is t

  • Consuming a ES Workplace WebService in Silverlight

    Hello, I want to consume a simple ES Workplace WebService in Silverlight. The required crossdomain/clientpolicy.xml Files are already in the root of the server. I'm having the following coding:         private void button1_Click(object sender, Routed

  • SAP LSO historic load

    hi. I'm New in SAP LSO. My client is implementing SAP LSO for the first time and they want to load the historic courses that an employee has taken since 2 years ago to the present. I have tried to use transacion LSO_PV00 to create a call transaction.

  • Multiple Selection with JCombo Box

    I want to make a multiple - selection JComboBox enables the user to select many items from JComboBox and copy items from one JComboBox to another.How can I do this?