t:saveState works great ... except when I use h:outputLink
I need to save separate state information for each open Firefox tab. Since Firefox shares the same session between all tabs I need to dream up another way besides using session. I am using Firefox 2.0. I have been experimenting with t:saveState and find it works great when I submit a form and go to another form via a rule, but I lose my state when I execute an h:outputLink. I am using Shale 1.1.0 (yesterday's snapshot) with the included Tiles. I have created a simple example, described below. The neat part of this method is that I have a single StateBean for all my tab state data and a single reference to saveState in my Tiles header. I can merrily go through my three test jsp forms for each tab with different tab state forever without losing my tab state (as test3 branches back to test1). But in my test2 I also have a h:outputLink that goes to test3, and if I click this link I lose my state. It would be great if this could work. Any help would be greatly appreciated. Here are my test details. For my test I am using the logonName in my StateBean. I added this logic to my logon Class: stateBean = new StateBean(); stateBean.setLogonName(this.getLogonName()); setStateBean(stateBean); String ab = #{requestScope.stateBean}; getApplication().createValueBinding(ab).setValue(facesContext, stateBean); My Tiles header.jsp has the saveState: ... t:saveState id=stateBeanSS value=#{stateBean}/ ... Here are the rules: navigation-rule from-view-id/systemLogon.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest1.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest2.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest2.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest3.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest3.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule And here are my jsps: testTest1.jsp ... h:form h:outputText value=Test1 stateBean = #{stateBean}, #{stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form testTest2.jsp ... h:form h:outputText value=Test2 stateBean = #{stateBean}, #{stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form h:outputLink value=#{facesContext.externalContext.requestContextPath}/testTest3.faces h:outputText value=Test3/ /h:outputLink testTest3.jsp ... h:form h:outputText value=Test3 stateBean = #{stateBean}, #{stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form Dick
Oracle ADF and Shale tiles/validator
Hello, Has anyone got running JSF application with shale Tiles or shale validator AND Oracle ADF ? I've got an application running with Shale View / Shale Tiles / Shale Validator, Myfaces 1.1.4 and Tomahawk 1.1.3 (jsp rendering engine). It's running on Websphere 6.0 (Jdk 1.4, J2EE 1.3, servlet API 2.4). I try to add ADF 10.1.3.0.4 (after removing Tomahawk components for a first test). I've got an error wherever I add shale-validator library in WEB-INF/lib, or when I add shale-tiles AND refer to my test page from a Tile definition. I think the ADF page needs to be run from the ADF View Handler and not another one (such as TilesViewHandler or ValidatorHandler). -- Here's my jsp file (a really sample one) : %@ taglib uri=http://java.sun.com/jsf/core; prefix=f% %@ include file=/common/taglibs.jsp% f:view f:loadBundle var=text basename=#{basePage.bundleName}/ h:outputText value=#{text['mainMenu.message']}/ h:form h:commandLink value=#{text['menu.user']} action=#{pc_UserForm.edit}/ h:commandLink value=#{text['menu.selectFile']} action=selectFile/ h:commandLink value=Ajax4JSF Demo action=ajax4jsf/ /h:form /f:view -- Here's my stackTrace : java.lang.NullPointerException at oracle.adfinternal.view.faces.uinode.FacesRenderingContext.setRenderingProperty(FacesRenderingContext.java:157) at oracle.adfinternal.view.faces.ui.RenderedNodeRenderingContext.setProperty(RenderedNodeRenderingContext.java:162) at oracle.adfinternal.view.faces.ui.ServletRenderingContext._setContextProperty(ServletRenderingContext.java:309) at oracle.adfinternal.view.faces.ui.ServletRenderingContext.setServletRequest(ServletRenderingContext.java:140) at oracle.adfinternal.view.faces.ui.ServletRenderingContext.setServletRequest(ServletRenderingContext.java:163) at oracle.adfinternal.view.faces.ui.ServletRenderingContext.init(ServletRenderingContext.java:113) at oracle.adfinternal.view.faces.ui.ServletRenderingContext.init(ServletRenderingContext.java:96) at oracle.adfinternal.view.faces.uinode.FacesRenderingContext.(FacesRenderingContext.java:106) at oracle.adfinternal.view.faces.uinode.FacesRenderingContext.createRenderingContext(FacesRenderingContext.java:79) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.getRenderingContext(UINodeRendererBase.java:89) at oracle.adfinternal.view.faces.uinode.FacesRenderingContext.getRenderingContext(FacesRenderingContext.java:66) at oracle.adfinternal.view.faces.uinode.FacesRenderingContext.getRenderingContext(FacesRenderingContext.java:52) at oracle.adfinternal.view.faces.renderkit.htmlBasic.UINodeRenderer.getRenderingContext(UINodeRenderer.java:79) at oracle.adfinternal.view.faces.renderkit.htmlBasic.UINodeRenderer.encodeBegin(UINodeRenderer.java:38) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:512) at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:464) at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:317) at com.ibm._jsp._sample._jspx_meth_h_form_0(_sample.java:226) at com.ibm._jsp._sample._jspx_meth_f_view_0(_sample.java:270) at com.ibm._jsp._sample._jspService(_sample.java:95) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670) at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117) at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:178) at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtensionProcessor.java:241) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:265) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234) at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157) at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176) at
Re: t:saveState works great ... except when I use h:outputLink
On 1/30/07, Dick Starr [EMAIL PROTECTED] wrote: I need to save separate state information for each open Firefox tab. Since Firefox shares the same session between all tabs I need to dream up another way besides using session. I am using Firefox 2.0. I have been experimenting with t:saveState and find it works great when I submit a form and go to another form via a rule, but I lose my state when I execute an h:outputLink. I am using Shale 1.1.0 (yesterday's snapshot) with the included Tiles. I have created a simple example, described below. The neat part of this method is that I have a single StateBean for all my tab state data and a single reference to saveState in my Tiles header. I can merrily go through my three test jsp forms for each tab with different tab state forever without losing my tab state (as test3 branches back to test1). But in my test2 I also have a h:outputLink that goes to test3, and if I click this link I lose my state. It would be great if this could work. Any help would be greatly appreciated. The h:outputLink component does an HTTP GET to the new URL, instead of the usual POST, so *all* JSF state is lost when you do that. Have you tried it with h:commandLink instead? Craig Here are my test details. For my test I am using the logonName in my StateBean. I added this logic to my logon Class: stateBean = new StateBean(); stateBean.setLogonName(this.getLogonName()); setStateBean(stateBean); String ab = #{requestScope.stateBean}; getApplication().createValueBinding(ab).setValue(facesContext, stateBean); My Tiles header.jsp has the saveState: ... t:saveState id=stateBeanSS value=#{stateBean}/ ... Here are the rules: navigation-rule from-view-id/systemLogon.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest1.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest2.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest2.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest3.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest3.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule And here are my jsps: testTest1.jsp ... h:form h:outputText value=Test1 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form testTest2.jsp ... h:form h:outputText value=Test2 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form h:outputLink value=#{facesContext.externalContext.requestContextPath }/testTest3.faces h:outputText value=Test3/ /h:outputLink testTest3.jsp ... h:form h:outputText value=Test3 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form Dick
Re: Need help with SCXML transition cond syntax.
On 1/30/07, Paul Spencer [EMAIL PROTECTED] wrote: Version 1.1.0-SNAPSHOT I would like a transition to be selected when a bean's field is not empty. If the field is an empty string, , or null I do not want the transition executed. Below is the syntax in JSF EL. #{not empty dialogData.companyId} What is the equivalent in SCXML? transition ... cond= ? / snip/ ${not empty dialogData.companyId} The SCXML implementation often doesn't have the liberty of knowing anything about the expression based on the location of the expression within the document (though cond attribute values are expected to evaluate to booleans, in this particular case). The evaluator Javadoc is here [1], and lists some relevant details. -Rahul [1] http://shale.apache.org/shale-dialog-scxml/apidocs/org/apache/shale/dialog/scxml/ShaleDialogELEvaluator.html Paul Spencer
RE: saveState works great ... except when I use h:outputLink - solved
Thank you! This h:commandLink works: ... h:form h:outputText value=Test2 stateBean = #{stateBean}, #{stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ h:commandLink action=#{testTestBean.submit} value=Test3/ /h:form Dick -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Tue 1/30/2007 12:58 PM To: user@shale.apache.org Cc: Subject:Re: saveState works great ... except when I use h:outputLink On 1/30/07, Dick Starr [EMAIL PROTECTED] wrote: I need to save separate state information for each open Firefox tab. Since Firefox shares the same session between all tabs I need to dream up another way besides using session. I am using Firefox 2.0. I have been experimenting with t:saveState and find it works great when I submit a form and go to another form via a rule, but I lose my state when I execute an h:outputLink. I am using Shale 1.1.0 (yesterday's snapshot) with the included Tiles. I have created a simple example, described below. The neat part of this method is that I have a single StateBean for all my tab state data and a single reference to saveState in my Tiles header. I can merrily go through my three test jsp forms for each tab with different tab state forever without losing my tab state (as test3 branches back to test1). But in my test2 I also have a h:outputLink that goes to test3, and if I click this link I lose my state. It would be great if this could work. Any help would be greatly appreciated. The h:outputLink component does an HTTP GET to the new URL, instead of the usual POST, so *all* JSF state is lost when you do that. Have you tried it with h:commandLink instead? Craig Here are my test details. For my test I am using the logonName in my StateBean. I added this logic to my logon Class: stateBean = new StateBean(); stateBean.setLogonName(this.getLogonName()); setStateBean(stateBean); String ab = #{requestScope.stateBean}; getApplication().createValueBinding(ab).setValue(facesContext, stateBean); My Tiles header.jsp has the saveState: ... t:saveState id=stateBeanSS value=#{stateBean}/ ... Here are the rules: navigation-rule from-view-id/systemLogon.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest1.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest2.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest2.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest3.jsp/to-view-id /navigation-case /navigation-rule navigation-rule from-view-id/testTest3.jsp/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/testTest1.jsp/to-view-id /navigation-case /navigation-rule And here are my jsps: testTest1.jsp ... h:form h:outputText value=Test1 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form testTest2.jsp ... h:form h:outputText value=Test2 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form h:outputLink value=#{facesContext.externalContext.requestContextPath }/testTest3.faces h:outputText value=Test3/ /h:outputLink testTest3.jsp ... h:form h:outputText value=Test3 stateBean = #{stateBean}, #{ stateBean.logonName}/ h:commandButton action=#{testTestBean.submit} value=Submit/ /h:form Dick
My exception handling is broken
Hi, I guess I missed some changes in shale 1.0.4. I override the DefaultExceptionHandling so that my backing bean can throw to types of exceptions one of my ApplicationExceptions and the unchecked SystemExceptions. These two types were handled by the DefaultExceptionHandler. For instance, the application exception just ends up in an error message on the same view. But now there is a responseComplete within the ShaleViewRoot (Is this class new?) that prevents the rendering after exception handling. So, do I need to introduce my own ViewRoot component or what is the recommended way to handle my exceptions? Regards Ingo
Re: My exception handling is broken
Hi. I encountered the same problem. I started development with shale-1.0.4-SNAPHSOT a while ago and wrote my own ExceptionHandler, too. That worked so far. 3 weeks ago I upgraded to 1.0.4 and for example acegi exceptions didn't get propagated anymore to its ExceptionFilter. At this time I thought, it worked before because of a bug in the SNAPSHOT release and that got fixed in the final 1.0.4. Something changed in the way of handling exceptions I guess. I can't remember exactly what I changed to get it running in 1.0.4 again, but it had something todo with trowing exceptions. In the past, I think the Shale Controller threw exceptions that were queued up in the session under FacesConstants.EXCEPTIONS_LIST. Now this isn't done anymore. I had to throw the exception explicitly in my shale exception handler to get it propagated. I would be also interested in what changed exactly and what's the right way to handle exceptions in shale... regards, Veit Ingo Düppe schrieb: Hi, I guess I missed some changes in shale 1.0.4. I override the DefaultExceptionHandling so that my backing bean can throw to types of exceptions one of my ApplicationExceptions and the unchecked SystemExceptions. These two types were handled by the DefaultExceptionHandler. For instance, the application exception just ends up in an error message on the same view. But now there is a responseComplete within the ShaleViewRoot (Is this class new?) that prevents the rendering after exception handling. So, do I need to introduce my own ViewRoot component or what is the recommended way to handle my exceptions? Regards Ingo
Re: Oracle ADF and Shale tiles/validator
I saw you are using the Spring CharacterEncodingFilter. In Trinidad we saw issues when that one is in front of the Trinidad (Adf Faces) Filter I think your issue is related to the ordering of the filters. -Matthias