Interfere into JSF lifecycle

Hello,
I was wondering how i can interfere into the render response phase. The problem is that i'm using a richfaces component responsible for polling. When changing the contents of a div (it's a wizard-like behaviour) the reponse is added/rendered into the new page under its regular content. Any suggestions how to stop the render response? thanks

i want to realize a table with monitoring functionality, which means that data should be requested let's say every 4seconds. this works fine. the whole thing is placed within a wizard that supports partial page reload. the problem appears when the user changes the currently loaded content (i.e. goes back) and a request is being processed at the same time. if this is the case the polling content is rendered underneath the newly loaded content.

Similar Messages

  • Problem with JSF lifecycle

    1> Create a index.html page which loads menu.jsp in frame 1 and search.jsp in frame 2
    2> menu.jsp --- define target as frame 2. Insert a command button, the action event of which re-loads search.jsp in frame 2
    3> search.jsp ---- insert one input text box.
    4> Start server and execute index.html on the server
    5> Click on command button in menu.jsp, it loads search.jsp in frame 2...ok...no problem....
    6> Keep on clicking the command link....after X number of clicks the menu.jsp gets loaded into frame 2.
    7> Click again and the cycle starts again...again after X number of clicks the menu.jsp gets loaded into frame 2.
    I have found that whenever the menu.jsp gets loaded in frame 2, the "Apply Request Values" phase and subsequent phases till the "Invoke Application" phase is not called.....Basically the menu.jsp page is not posted. In my case the X always turned out to be 18. I am testing on Websphere 5.1.2.
    Is this is bug in JSF lifecycle implementation OR a Webshere issue ?
    Appreciate any help in this regard.

    Thanks.
    Does anyone know if there is a patch available for WAS 5.1.2 to fix this problem ? OR is there any other solution because our company will not move to RAD 6 in the near future...Thks

  • Slow performance during Apply Request Values Phase of JSF lifecycle

    Dear all,
    I found that my application is sucked at the Apply Request Values Phase of JSF lifecycle when I submit the page. (Totally spend 1 min to pass this phase)
    In the application, there is around 300 input fields in the page. Who know how can I ehance the performace?
    Thanks.

    Thanks a lot for your help. Maybe I explain more about my current structure
    I need to develop a input form for course instructor to input students' assignment / examination result (max 9 assignments and 1 examination).
    so that I have below coding:
    *1. bean to store marks of a student*
    public class Mark {
    private String studentID = "";
    private String mark1 = "";
    private String mark9 = "";
    private String markExam = "";
    //getter & setter of above properties
    public void setMark1(String mark1) {
    this.mark1 = mark1;
    public String getMark1() {
    return this.mark1;
    *2. backing bean*
    public class markHandler {
    ArrayList<Mark> marks = new ArrayList<Mark>();
    //getter & setter of above property
    //method to retrieve list of student (this will be the action before go in mark input page)
    public void getStudentList() {
    //get student list from database
    for(int i = 0 ; i < studentCount; i++){
    //initial mark of student
    Mark mark = new Mark();
    mark.setStudentID(studentID);
    mark.setMark1("");
    mark.setMarkExam("");
    //put into arraylist
    marks.add(mark);
    *3. mark input page*
    <html>
    <h:dataTable value="#{markHandler.marks}" var="e">
    <column>
    <h:output value="#{e.studentID}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.mark1}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.markExam}" />
    </column>
    </h:dataTable>
    <h:commandButton action="#{markHandler.save} />
    </html>
    When I submit the page, It seems that there is a long time spent at the input field of datatable at Apply Request Values Phase. (I use Phase Listeners to test the time difference before & after phase)
    Pls help. Thanks.
    Edited by: Daniel_problem on Aug 15, 2008 10:34 AM
    Edited by: Daniel_problem on Aug 15, 2008 10:36 AM

  • Simple component binding/JSF lifecycle question

    As a JSF newbie, I ran into an unexpected component binding state/JSF lifecycle issue. Given this JSP code:
    <h:inputText id="boundinput" binding="#{UserBean.boundInput}">and this Java setter code:
           private UIInput boundInput = new UIInput();
            public void setBoundInput(UIInput aBoundInput) {
                this.boundInput = aBoundInput;
                String value = aBoundInput.getValue();
            }the result of 'value' is the previous value of the input text field when the form is submitted. The component is bound, but why isn't the new value available?
    It seems to get the 'current' value of the bound component, a valueChangeListener has to be implemented? I may be missing something fundamental, so any help is appreciated.

    If you only want to get and set values, use valuebinding instead.
    If you're debugging the setBoundInput after form input, then yes, it is correct that the old value is still in there. This would be updated at a later JSF phase yet.
    Check http://balusc.xs4all.nl/srv/dev-jep-djl.html to get some insights in the JSF lifecycle.

  • High cpu usage during JSF lifecycle phase execution

    In our performance test we encountered a high cpu usage (100%) and the thread dumps indicated that most of the times the threads are either executing restore view or render response phase of the JSF lifecycle or they are blocked while accessing the jar files which containing the xhtml pages.
    One of the thread dump of a runnable thread is
    java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.get(HashMap.java:317)
    at javax.faces.component.ComponentStateHelper.get(ComponentStateHelper.java:174)
    at javax.faces.component.ComponentStateHelper.add(ComponentStateHelper.java:216)
    at javax.faces.component.UIComponent.setValueExpression(UIComponent.java:436)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler$CompositeComponentRule$CompositeExpressionMetadata.applyMetadata(CompositeComponentTagHandler.java:631)
    at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81)
    at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.setAttributes(CompositeComponentTagHandler.java:246)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:184)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)while a thread trace for a blocked thread is
    java.lang.Thread.State: BLOCKED (on object monitor)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:302)
    - waiting to lock <0x00000000c0f678f8> (a java.util.jar.JarFile)
    at java.util.jar.JarFile.getEntry(JarFile.java:225)
    at java.util.jar.JarFile.getJarEntry(JarFile.java:208)
    at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:817)
    at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:795)
    at sun.misc.URLClassPath.findResource(URLClassPath.java:172)
    at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
    at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
    at java.lang.ClassLoader.getResource(ClassLoader.java:1138)
    at java.lang.ClassLoader.getResource(ClassLoader.java:1133)
    at org.glassfish.web.loader.WebappClassLoader.getResource(WebappClassLoader.java:1156)
    at org.glassfish.web.loader.WebappClassLoader.getResourceFromJars(WebappClassLoader.java:1111)
    at org.apache.catalina.core.StandardContext.getMetaInfResource(StandardContext.java:7586)
    at org.apache.catalina.core.StandardContext.getResource(StandardContext.java:6979)
    at org.apache.catalina.core.ApplicationContext.getResource(ApplicationContext.java:382)
    at org.apache.catalina.core.ApplicationContextFacade.getResource(ApplicationContextFacade.java:260)
    at com.sun.faces.context.ExternalContextImpl.getResource(ExternalContextImpl.java:502)
    at com.sun.faces.application.resource.WebappResourceHelper.getURL(WebappResourceHelper.java:119)
    at com.sun.faces.application.resource.ResourceImpl.getURL(ResourceImpl.java:190)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyCompositeComponent(CompositeComponentTagHandler.java:366)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:191)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
    at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:223)
    at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
    at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)
    at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)We use glassfish 3.1.1 as our application and the project_stage property is set to System_test. I would like to get suggestions on how should I investigate this further. Is this a normal behavior? Does glassfish provide an alternative for resolving blocked threads like some caching mechanism for resources etc?
    Thanks in advance

    Nik wrote:
    Even if it is legal, have you tried moving them out of there (just to pinpoint a possible bug since the stacktrace indicates a wait on a jar file)?Indeed. If that clears up the issue it is good information to put in a JSF bug report (which may even cascade to the Glassfish level).
    Putting resources in a jar file is only really useful when you want to share those resources among different web applications, which should be a rare case. Even when it happens I would probably still choose to simply copy the resources so they are individually managed and you don't get unnecessary dependencies between applications. Just because something is technically possible doesn't make it a good idea.

  • What does the scriptcollector do and how does it related to jsf lifecycle?

    hi,
    i want to know what does the scriptcollector do and how does it related to jsf lifecycle? and also in the scriptcollector if i call this,
    preRender=#{myBean.onPageLoadBegin}
    postRender=#{myBean.onPageLoadEnd}
    how my page will react?

    The hx:scriptCollector is part of the IBM Faces Client Framework and has nothing to do with Sun JSF RI.
    Lot of the hx components require specific Javascript and those hx components should be placed inside a single hx:scriptCollector which on its turn checks the nested hx components and renders the desired Javascript for it at the end of the tag. Check the HTML source for that Javascript.

  • Configuring velocity to use into JSF pages

    Hello to all,
    I am newer with JSF and, I don't know how to insert Velocity code into JSF page. Is it possible? How I must configure my webapp to use Velocity+JSF?
    This is an example of a JSF page that I would be using:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="/WEB-INF/tld/veltag.tld" prefix="vel"%>
    <html>
    <f:view>
         <head>
         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
         <title>Login</title>
         <f:loadBundle basename="com.tutorial.messages" var="msg" />
         </head>
         <body>     
         #set( $imperial = ["Munetaka","Koreyasu","Hisakira","Morikune"] )  
            #foreach( $shogun in $imperial )
                   $shogun
            #end
         <h:form>
              <h:outputLabel rendered="true" value="#{msg.name}"></h:outputLabel>
         </h:form>
         </body>
    </f:view>
    </html>I'm sorry by my poor English
    Thanks and best regards,
    Shaggy

    Hi,
    I am also trying to develop a similar application but I dont know how to do. Can you please help me regarding that?
    I need to get user's smartcard based certificate to store in server.

  • Has anyone really understood the JSF LifeCycle

    I have created my own phase listener :
    public class MyPhaseListner implements PhaseListener {
    public void afterPhase(PhaseEvent evt) {
    System.out.println("EXITING : " + evt.getPhaseId());
    public void beforePhase(PhaseEvent evt) {      
    System.out.println("ENTERING : " + evt.getPhaseId());
    public PhaseId getPhaseId() {
    return PhaseId.ANY_PHASE;
    When i display my page first time I am getting the following output :
    ENTERING : RESTORE_VIEW 1
    EXITING : RESTORE_VIEW 1
    ENTERING : RENDER_RESPONSE 6
    Inside Constructor
    Managed Bean Created.......
    Thank you !!!!
    EXITING : RENDER_RESPONSE 6
    ENTERING : RESTORE_VIEW 1
    EXITING : RESTORE_VIEW 1
    ENTERING : RENDER_RESPONSE 6
    EXITING : RENDER_RESPONSE 6
    ENTERING : RESTORE_VIEW 1
    EXITING : RESTORE_VIEW 1
    ENTERING : RENDER_RESPONSE 6
    ENTERING : RESTORE_VIEW 1
    EXITING : RESTORE_VIEW 1
    ENTERING : RENDER_RESPONSE 6
    EXITING : RENDER_RESPONSE 6
    EXITING : RENDER_RESPONSE 6
    As per my knowledge I can understand first 4 statements(before "*****") outputted.
    An empty view is created and then render response phase is reached skipping all intermediate steps being the first request to JSF page.
    However I can not understand further calls made by JSF lifecycle.
    Can anyone elaborate me more on this?
    Also I am very much interested in some strange number displayed after every phaseId !!!!!

    Hi Sergy !
    Thanks for your reply.!!!!
    Well actually I have some style-sheets and images on my page.
    I think JSF even treats these elements to be a seapare entity.
    So all other statements were for these elements.
    Well I have modified my phase Listener to reflect the view Id as well.
    Below is the class...if anyone is interested !!!
    package util;
    import javax.faces.component.UIViewRoot;
    import javax.faces.event.PhaseEvent;
    import javax.faces.event.PhaseId;
    import javax.faces.event.PhaseListener;
    public class MyPhaseListner implements PhaseListener {
         public void afterPhase(PhaseEvent evt) {
         UIViewRoot root = evt.getFacesContext().getViewRoot();
         if(root == null){
              System.out.println("EXITING : " + evt.getPhaseId());
         }else{
              System.out.println("EXITING : " + evt.getPhaseId() + root.getViewId());
         public void beforePhase(PhaseEvent evt) {
              UIViewRoot root = evt.getFacesContext().getViewRoot();
              if(root != null){
                   System.out.println("ENTERING : " + evt.getPhaseId() + root.getViewId());
              }else{
                   System.out.println("ENTERING : " + evt.getPhaseId());
         public PhaseId getPhaseId() {
              return PhaseId.ANY_PHASE;
    }

  • Making the most of the JSF lifecycle

    I have read through some documenation for the JSF lifecycle, I am wondering though how you would really take advantage of it?
    One of the purposes of JSF was to insulate the developer from having too know much about HTTP. However, how much do they really need to know about JSF lifecycle and what cool things are there that really show the usefullness of this lifecycle being exposed?
    Thanks.

    beginner2 wrote:
    I have read through some documenation for the JSF lifecycle, I am wondering though how you would really take advantage of it?You don't. The phases of the lifecycle are just how JSF ticks; they are not there to make your life easier, they are a design choice you have to know about and have to know how to design around. Not knowing about them is eventually going to lead to unexpected behavior caused by wrong assumptions.
    One of the purposes of JSF was to insulate the developer from having too know much about HTTP. Utter nonsense, IMO. To use JSF, you should be incredibly familiar with HTTP, HTML and Javascript. Sticking your head in the sand and not taking the time to know the very foundation you are working on is going to make you step in a pothole and hurt yourself badly sooner rather than later.
    Of course, that does not stop people from trying. If you want to meet them, they regularly post "how do I do this", "why does this happen" and "bug in JSF?" questions right here in this forum.
    However, how much do they really need to know about JSF lifecycleKnow what each phase of the lifecycle does and in which order they are executed. Know when a phase will be skipped. That is in my opinion what you should know to avoid the gotchas.
    and what cool things are there that really show the usefullness of this lifecycle being exposed?See previous statements.

  • Where in the JSF lifecycle does submittedValue, localVaue, value get set?

    Where in the JSF lifecycle does submittedValue, localVaue and value get set? I was looking at those values on a hidden input field and it was not clear to me in what phases the various values get set. It seemed like sometimes one was set, sometimes the other was set. It was not clear to me how to know where to look for the value (other than try one if that was null try another).
    Brian

    BHiltbrunner wrote:
    Where in the JSF lifecycle does submittedValueIt will be set during the apply request values phase, in the decode() method of the HtmlBasicRenderer.
    It will be reset to null during the process validations phase, in the validate() method of the UIInput.
    localValue and value get set? Those will be set during the process validations phase, in the validate() method of the UIInput.
    The difference is that 'localValue' represents the actual and unevaluated value, and 'value' represents the outcome of the evaluated ValueExpression value.
    I was looking at those values on a hidden input field and it was not clear to me in what phases the various values get set. It seemed like sometimes one was set, sometimes the other was set. It was not clear to me how to know where to look for the value (other than try one if that was null try another).Depends on the where and when you're going to check them.

  • ValueChangeListener fires in JSF lifecycle on a typical actionListener?

    Why does a valueChangeListener on a selectOneChoice fire in the JSF Lifecycle when I click on a separate non-related commandButton that runs an actionListener?
    How do I prevent a valueChangeListener to not fire when I click on a commandButton that runs an actionListener?
    <af:selectOneChoice id="overrideDevice"
    label="#{common.labelOverrideDevice}"
    required="true"
    unselectedLabel="#{common.selectionRequired}"
    value="#{resend.overrideDevice}"
    autoSubmit="true"
    immediate="true"
    valueChangeListener="#{resend.valueChanged}"
    binding="#{resend.overrideDeviceSelect}">
    <f:selectItems value="#{resend.overrideDeviceList}" />
    </af:selectOneChoice>
    and
    <af:commandButton id="bSearch"
    text="#{common.tbFind}"
    actionListener="#{resend.doSearch}"/>
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    That caused a blank page to be rendered. After the user clicked on the commandButton and fired the actionListener, the valueChangeListener fired; the JSF Lifecycle jumped from APPLY_REQUEST to termination as soon as the APPLY_REQUEST phased completed.
    I can see this happening as I debug the application.
    I'm still at a lost of why a valueChangeListener would fire..?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Iframe shortcircuits JSF Lifecycle

    I need to find out why using an <iframe> element in my jsp page under JSF (with or without a <verbatim> tag
    SHORT-CIRCUITS THE JSF LIFECYCLE?
    ie: it goes right to after renderresponse completely bypassing validation and data binding!!
    PLEASE HELP!!!

    Hi,
    The following are the steps I followed:
    1. Create a new project
    2. Drag and drop a textField
    3. In the properties sheet check the required property for the textField
    4. Drag and drop a button and an outputText
    5. Right click on the session bean in the Project Navigator and add a property named txtVal
    6. Double click on the button and in the button_action method enter the following lines of code
    getSessionBean1().setTxtVal((String)textField1.getValue());
    outputText1.setValue(getSessionBean1().getTxtVal());
    7. Click on the jsp tab for the page1.jsp and add the following lines of code inside the form tags
    <iframe align="right" height="80" src="http://www.yahoo.com" style="left: 48px; top: 264px; position: absolute" width="40%">
    <p>See our newsflashes.</p>
    </iframe>
    8. Switch to the design view of Page1.jsp
    9. Drag and drop a message list component onto Page1.jsp
    10. Drag and drop a datatable
    11. Drag and drop the PERSON table from the travel database
    12. Save and run the application
    On clicking on the button without entering a value we see that an error message " Validation Error: Value is required." is displayed by the message component. Also the rest of the components like the datatable also display tthe expected values.
    Hope this helps
    Cheers
    Giri :-)

  • JSF lifecycle : render view

    Was just having look at logs of a JSF application, below are the output's from PhaseListener
    RESTORE_VIEW(1)
    APPLY_REQUEST_VALUES(2)
    RESTORE_VIEW(1)
    RENDER_RESPONSE(6)
    How come RESTORE_VIEW is called after APPLY_REQUEST_VALUES, from JSF lifecycle it seems
    that they are executed in certain order(although some can be skipped)
    Regards,
    Joshua

    Multiple requests?
    Without an SSCCE it's only guessing to an answer.

  • Jstl variables into jsf

    How can I pass variable from jstl into jsf
    for example size="<c:out value='25'/>"
    if it is possible?
    <h:inputText id="userid" size="25" required="false" value="#{FacesLogon.loginName}" >
    <f:validateLength minimum="0" maximum="7" />
    </h:inputText>

    Dear rlubke,
    I'm getting the following exception:
    500 Internal Server Error
    javax.servlet.jsp.JspException
    at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:117)
    at seguridad.Login._jspService(Login.jsp:5)
    [seguridad/Login.jsp]
    I'm getting it very often, in several JSPs, in a randomly fashion. I'm using JSF 1.1_01, running on Oracle OC4J.
    I downloaded the JSF 1.1 source code and started to research it. I found that ViewTag.java is calling the doStartTag() method from UIComponentTag.java. In the latest class, there are 3 cases where am exception is being thrown. Two of them show a "PENDING - i18n" comment.
    I found you CVS developer ID in the source code, so I thought about searching for you on the sun forums and write you. Luckily, I found you.
    Question: This is a bug, right? Is this related to i18n? I'm running my JSF pages on Spanish (<f:view locale="es-es">), so I guess this is in fact an i18n.
    What can I do to avoid this situation? Is there a fix?
    PLEASE help me, we are developing a very critical app
    Brian

  • How to apply a simple javascript into JSF

    Hi everyone. This is my first time using JSF and i am abit confuse in applying some simple javascript into my JSF. Actually, i just want to add a simple function that is to disable user from input some certain textfield (h:inputText) based on the selection in the combo box (h:selectOneMenu).
    The javascipt that i would like to apply in the JSF coding is shown as below:-
    <HTML>
    <TITLE>Example of onChange Event Handler</TITLE>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function textField()
    if(document.myform.mcDonald.value=="disable")
    document.myform.data.disabled=true;
    if(document.myform.mcDonald.value=="enable")
    document.myform.data.disabled=false;
    </SCRIPT>
    </HEAD>
    <BODY>
    <H3>Example of onChange Event Handler</H3>
    <form name="myform">
    <SELECT NAME="mcDonald" onChange="textField()">
    <OPTION VALUE="enable">Enable
    <OPTION VALUE="disable">Disable
    </SELECT>
    <input type="text" name="data" value="10" size=10 disabled="true" >
    </form>
    </BODY>
    </HTML>

    You need to use the id's of the components in the hierarchy. This is actual working code:
    // Javascript
              function actionedStatus_onchange(formObj, fieldValue) {
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].disabled = (fieldValue != 'all');
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].checked = (fieldValue == 'all');
    // JSF
                   <x:selectOneMenu id="actionedStatus" styleClass="detailBondField" value="#{exceptionsBean.actionedStatus}"
                             onchange="actionedStatus_onchange(this.form, this.value)">
                        <f:selectItems value="#{lookupBean.actionedStatusList}"/>
                   </x:selectOneMenu>
    In this case, the root component form is 'foureye' (a subview), followed by 'tabExceptions' (a form), followed by a checkbox 'unresolvedOnly' that I want to manipulate. Here I am disabling the checkbox and setting the value dependent on the value of the selectOneMenu

Maybe you are looking for

  • Populating Historical Data

    Folks, In my report there are columns where different amounts are populated wrt different value types. Now i have some historical data and i want those values to be populated in the amount columns. Any advise would be helpful. Thanks

  • Dir 10 projector - sudden errors on MacBook Pro

    Yesterday a coupe of users had script errors after installing an interactive on both a MacBook and MacBookPro, when starting an application that I've been distributing for several years now. It is a 10.1.1 projector (all the latest updates), using a

  • Exporting from PREMIERE to ENCORE (Correct Settings for crisp and clear DVD playback)

    Please help. I have tried exporting a Premiere CS6 movie project to Encore, and when I play the burnt Encore DVD on my DVD player, it plays back fuzzy and it actually bounces. Here is my question: What are the correct Premeire CS6 export settings/ En

  • How do you fill objects?

    In school, we are using CS3, but at home, I am using CS4, anyway at school, when I click on the rectangle tool, the default is set to: Line none, color, none, but theres icons on top so I can change them, however in CS4, there are no icons, and takin

  • Trying Remote Console causes reboot...

    On some of my users' workstations, when I attempt to remote control, the workstation reboots and I get a 1853 error. Anyone heard of this...? Thanks in advance... Delon E. Weuve Senior Network Engineer Office of Auditor of State State of Iowa