JSF PhaseListener and NavigationHandler

Some questions, while going through JSF, please help:-
1) If I write a custom PhaseListener and add it in faces_config.xml, then will the existing phaselisteners and my phaselistener will be working in cascade ? What order?
2) What is the exact difference between a PhaseListener and NavigationHandler ? I can see that a NavigationHandler is invoked during all "INVOKE APPLICATION" phase. But a PHASELISTENER is invoked before and after every lifecycle. So if I need to write something which is applicable to all invocations, should it be in NavigationHandler or should it be in PhaseListener? One of my colleagues told that , for some events, PhaseListener will not be called, but a NavigationHandler is called. Can you please help on this internal?
Please help, thanks a million.
Thanks and regards,
Shankar

1) If I write a custom PhaseListener and add it in
faces_config.xml, then will the existing
phaselisteners and my phaselistener will be working
in cascade ? What order?The same order as they are declared in the faces-config.
2) What is the exact difference between a
PhaseListener and NavigationHandler ? A NavigationHandler handles, yes, navigation and a PhaseListener is kind of a Filter which can act on different phases.
So if I need to
write something which is applicable to all
invocations, should it be in NavigationHandler or
should it be in PhaseListener? One of my colleagues
told that , for some events, PhaseListener will not
be called, but a NavigationHandler is called. Can you
please help on this internal?Just let the PhaseListener listen on PhaseId.INVOKE_APPLICATION.

Similar Messages

  • Why exactly is a JSF IMP and a API, what is the difference?

    Why exactly is a JSF IMP and a API, what is the difference?
    I understand that JavaServer Faces technology is a framework for building user interfaces for web applications with a set of APIs for UI components and a custom tag library for expressing a JavaServer Faces interface within a JSP page.
    But, why is there a jsf-impl.jar and a jsf-api.jar?
    A clarification would be appreciated.
    Thanks,

    CowKing: Thank you.
    In a discussion, when a developer refers to RI, they mean the jsf-api.jar only?
    I don't need the jsf-impl.jar in my compile class path nor in my SJSAS 8.2 domain library directory either?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JSF 2 and Primefaces with  WLS 11gR1(10.3.6) problem

    Hi all,
    I would like to create a web application in OEPE, which uses JSF 2 and Primefaces 3.2 and then deploy & develop onto WLS.
    I added the primefaces jar to WEB-INF/lib.
    See my publishing stacktrace below.
    (I tried using the Shared JSF libraries and including jsf-api and impl in WEB-INF/lib, but neither of these options worked.)
    Do you have any ideas what I am doing wrong? Thanks,
    András Liter
    <2012.04.14. 21:32:21 CEST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unexpected exception when attempting to tear down the Mojarra runtime
    java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
         at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
         at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
         at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:309)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200)
         at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3225)
         at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:247)
         at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461)
         at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1545)
         at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:509)
         at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141)
         at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206)
         at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184)
         at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:677)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:63)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
         at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:149)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    >
    <2012.04.14. 21:32:21 CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1334431938841' for task '32'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1520)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.FileNotFoundException: \Oracle\Middleware\Oracle_OSB1\soa\connectors\FileAdapter.rar!fileAdapter.jar (The system cannot find the file specified)
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:127)
         at java.util.jar.JarFile.<init>(JarFile.java:135)
         at java.util.jar.JarFile.<init>(JarFile.java:72)
         at com.sun.faces.facelets.util.Classpath.getAlternativeJarFile(Classpath.java:252)
         Truncated. see log file for complete stacktrace

    Hi --
    I just tried using OEPE 11.1.1.8.0 against a WLS 10.3.6.0 install to build and deploy a JSF 2.0 application and it worked successfully.
    The project is here if you want to take a look:
    http://dl.dropbox.com/u/15657493/oepe-test-jsf2.zip
    The only minor gotcha I found was that I needed to reorder the libraries on the project so that the Shared-Library[jsf] was higher than the WebLogic System Library - this then let me use the JSF 2.0 programming API successfully instead of the 1.2 version that is included in the WLS System Library.
    Here's a couple of screen shots of the facet and project as well as the overall development environment:
    http://dl.dropbox.com/u/15657493/oepe-jsf-facet.png
    http://dl.dropbox.com/u/15657493/oepe-project-libs.png
    http://dl.dropbox.com/u/15657493/oepe.png
    For that zip file error, one thing perhaps is to Check your CLASSPATH setting to see if it has an entry for that FileAdapter.rar. I don't know why it's causing that problem but if it's in the CLASSPATH try removing it and then starting the server.

  • JSF, Springs and Hibernate

    Hi,
    I am a newbie. I would like to know the books i need to refer to, inorder to learn JSF, springs and hibernate.
    Thank you,

    The_Matrix wrote:
    CeciNEstPasUnProgrammeur wrote:
    How about learning Java first?
    At least for JSPs, there are free online tutorials from Sun. There are likely to be similar resources for Spring and Hibernate.I Know Java. I am a Sun Certified Java Programmer. I also know know J2EE. I am trying to learn the new technologies. Therefore i mentioned that i am a newbie, it was pertianing to JSF, Springs and Hibernate. Not to Java.In that case:
    Core Java Server Faces (2nd edition)
    Java Persistence with Hibernate
    Pro Spring 2.5
    Expert Spring MVC and Web Flow
    Together with the product documentation those should make a decent bit of reading.

  • JSF Implementation and accessibility

    I'm using de Sun JSF Implementation and having some troubles with accessibility issues. The HTML generated by the renderers are validated to WAI (Web Accessibility Initiative)? Should I reimplement the renderers to attempt to use screen readers, for example?

    Which implementation version exactly? Which problem exactly? There were fairly a lot of fixes regarding '508 compliance' during the existence of the JSF 1.2 implementation. Pick the latest, currently 1.2_10, and see if it solves your problem.

  • Jsf-api and jsf-ri logging

    The source code is available for the jsf-api and the jsf-ri libraries. Reading through some of it, I noticed that commons-logging was being used such as log.warn and log.debug.
    How can we "turn it on"? It looks as though log.warn is already written to the SunAppServer8 log file within JSC. I changed all of the app server log levels to FINE via the server's property sheet, but it had no effect. Thanks.
    Message was edited by:
    jeff.daily

    See if this helps:
    http://wiki.java.net/bin/view/Projects/SunJSFImplFaq#TurnOnLogging
    Sandip

  • ADF Faces: is mixing JSF RI and ADF Faces tags supported?

    Hi,
    I'm looking at ADF Faces as a future possibility for our application that is currently based on JSF RI.
    When looking at the ADF Faces demo it strikes me that all pages are almost completely built up from ADF Faces tags.
    For instance
    af:form
    af:commandButton
    af:inputText
    are used instead of the equivalent core jsf tags f:form, f:commandButton and f:inputText
    I'm wondering if this is mandatory if we would like to use some ADF Faces components mixed within our existing application.
    In other words: are ADF Faces tags supported in the environment of conventional JSF tags? And mixing ADF Faces JSF components with JSF components by other vendors?
    Another thing that strikes me is that pages are constructed using ADF Faces tags for any and all markup content.
    I guess this is meant to support several different clients (normal browser applications, mobile clients, voice activation over telephone) using different renderers.
    In my experience abstracting markup this way inherently means loss of control over the exact markup that is sent to the client. This is not acceptable for all projects and customers.
    Is embedding ADF Faces tags within template HTML, within f:verbatim tags or not, supported?
    Regards,
    Joost de Vries

    You absolutely can mix JSF RI and ADF Faces tags. This is very much supported! You can swap in <h:form> and <h:commandButton> and <h:inputText>. Our versions support some features that the JSF tags do not, as described in our release notes.
    Your point about using tags to produce all markup is a very cogent one. For some projects, absolute control over HTML will be a necessary requirement, so we do support that style of development. But we believe strongly that the future does not lie in constant handcoding of HTML, but instead in building more powerful, flexible, and reusable components and assembling those into pages. This was one of the themes of a talk I gave with two coworkers at this past JavaOne.
    -- Adam Winer (JSF EG member and ADF Faces lead)

  • Training material on JSF, Spring and Hibernate

    Hi All,
    I'm new to JSF. I need some good training material on JSF, Spring and Hibernate.
    I've tried lot many tutorials online, but cannot find a real good one.
    Also I need to learn how we can integrate together JSF, Spring and Hibernate to build web applications.
    Thanks
    Payal

    As far as documentation vs examples, that depends on the individual.
    The Spring documentation is quite large, but Spring itself is very modular. So you can pretty much get away with reading the pieces you need when you need them and ignoring the rest.
    Start with inversion of control until you feel you understand the concept. At its core, the idea is simple. Suppose you have a business class, FooService, and it needs to utilize BarService to implement its business logic. The non-Spring way would be to have the FooService class be responsible for getting an instance of BarService. The Spring way is for FooService to have a setter to be given an instance of BarService:
    public class FooServiceImpl implements FooService
        private BarService barService;
        public void setBarService(BarService barService) { this.barService = barService; }
    }Then the Spring container is used to "wire together" the instances:
    <beans>
        <bean id="barService" class="BarServiceImpl" />
        <bean id="fooService" class="FooServiceImpl">
            <property name="barService" ref="barService" />
        </bean>
    </beans>Note the advantage when using the classes in different contexts, e.g. unit testing vs production.
    If I were you, I would take the sample app you have already done with JSF and try to integrate Spring into it. Move all the business logic into beans in the Spring container while keeping the view logic in the JSF layer.

  • Difference between JSF API and RI and EL API and EL RI?

    Im just looking into using facelets and in the dependency list I see this:
    JavaServer Faces RI
    The reference implementations of JSF 1.1 and JSF 1.2 are available for use with your
    application
    JavaServer Faces API
    JSF 1.2 API that works with the new EL specification. (Optionally, MyFaces Core API
    could be used.)
    EL API - The stand-alone EL utilized by both JSP and JSF.
    EL RI - The reference implementation that is used by Facelets for handling EL.
    This isnt a question about facelets but more about what the differences are between the JSF API and RI versions and likewise the EL versions.
    Its much appreciated if anyone can explain this for me.
    Jon
    Edited by: JonJackson on Jul 27, 2009 2:29 PM

    Oh, your topic title contradicts (difference between API and RI) with the actual question in the topicstart (difference between the versions).
    If the topic title represents the actual question: the API is the application programming interface, which is just an abstract specification. The RI is the reference implementation, which is the vendor's (in this case Sun) own concrete implementation of the abstract specification. In fact everyone can build an own implementation of the API which might be or not be better than the RI.

  • Dynamic JSF GUI and associated backingbeans

    I'm designing a web application using JSF. One of the main requirements is that our GUI needs to be pluggable. I have tried to understand how pluggability can be achieved in JSF but haven't found a clear solution.
    I would like the application to be packaged as a war file. Adding customer specific pages/bean classes to the war file and repackaging of the war is not an option. The customer specific pages/classes must reside outside this war. At runtime, based on configured rules, I need to load the customer pages and render them. If the pages are JSP based JSF pages, then they will also have their associated backing beans.
    Given that the backing beans must be preconfigured as managed beans in the faces-config.xml file and all JSP pages must be part of the packaged web application, I don't know how to go about doing this.
    A solution (non-ideal) that I have thought of is to have the customers design their forms as HTML pages and have them put these forms in the document root directory on the app server. The customer code that manipulates the data on the form will be packaged in a jar file. The HTML form 'action' will be set to a URL that will take them to one of my servlets. The interaction will be such:
    1. A user visits my JSF/JSP page. He clicks on a button. In the action event listener, I decide on the correct html form to forward the request to. I put the instance of the backingbean class in the HttpSession and forward the request to the HTML page.
    2. The browser displays the HTML form. The user enters data on the form and submits it. The request arrives at my servlet.
    3. My servlet instantiates the appropriate customer class (using the ClassLoader) and calls a method on it passing it all postdata; the method returns some String value. The servlet pulls out the backingbean class instance from the HttpSession and calls a setProperty(String value) on it. The servlet then gets a handle to the RequestDispatcher and forwards the request to my original JSF/JSP page.
    4. The JSF page is rendered in the browser with then new value (property set by the servlet) displayed in the right view component.
    The above approach is very messy and with many customer forms and backend classes this approach can get very ugly. I am looking for the correct solution that is recommended by JSF to achieve this kind of pluggability.
    Any thoughts, advice or feedback will be very appreciated.
    thanks,
    tsc

    I have researched my issue online for quite some time and have found nothing that jumps out except one post to this forum.
    Adam.Winer replied to a similar post on this forum over a year ago where he suggests replacing the ViewHandler, NavigationHandler and VariableResolver to be able to plugin JSP pages at runtime (See below).
    After doing some reading, I understand the function of the NavigationHandler and VariableResolver a bit better. do not understand how to replace the ViewHandler and what the new handler should do to render different JSP pages at runtime.
    Has anyone tried this approach. If yes, examples would be nice.
    I'm sure what I'm attempting has been done before many times. How have people gone about to achieve this kinda of pluggability in JSF.
    Anyone?
    From: http://forum.java.sun.com/thread.jspa?forumID=427&threadID=524937
    Re: dynamic configuration for the application
    adam.winer Registered: Dec 23, 2003 12:00 AM      May 24, 2004 9:30 PM
    A lot of what you're seeing are genuine limitations, but happily, JSF is so pluggable that you can overcome them.
    JSPs are problematic in exactly the way you describe - unless your app server has support for pulling JSPs out of a database, etc., you're SOL. JSF, however, lets you use something other than JSPs by replacing the ViewHandler. That's a fair bit of work, but it is doable.
    For navigation logic, you'd replace the NavigationHandler. As long as you're willing to write the code that can pull navigation rules from an external source, life is good.
    For managed beans, all you need to replace is the VariableResolver - again, if you can pull the rules from an external source, you have full control.
    This is all far from easy - and it's a huge amount of work for one person - but I'd imagine these pieces will become available from various sources. A core goal of JSF 1.0 was making the framework as a whole pluggable so that others can innovate on top of the framework.
    -- Adam Winer (EG member)

  • PhaseListener and Load of Page

    Hi All,
    I'm trying to create a JSF page which will dynamically create additional content as soon as it is loaded. In order to do this I have created a PhaseListener which creates a few components and attaches them to the page on the PhaseEvent. This works fine whenever I reload the page (by creating a postback), but on the initial load of the page the Listener's events aren't triggered. What do I need to do in order to have an event trigger the first time a page is loaded? My code is as follow:
    public PageBean() {
        LifecycleFactory lLifecycleFactory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        Lifecycle lLifecycle = lLifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
        lLifecycle.addPhaseListener(new OnLoadPhaseListener());
    @Override
    public void beforePhase(PhaseEvent iPhaseEvent) {
        populateComponents();
    @Override
    public PhaseId getPhaseId() {
        return PhaseId.ANY_VIEW;
    }Interesting thing is if I change the getPhaseId() to return RESTORE_VIEW, the events are never triggered.
    Any and all help is appreciated,
    Ristretto
    Ps. I tried registering the PhaseListener in the faces-config.xml instead of the code, but it didn't make a difference.

    I tried registering the phase listener in faces-config.xml this morning and for some reason it worked this time - must have something to do with the weekend ;)
    Anycase, to answer your question, I am trying to create a base class from which all other managed page beans will inherit, which will provide default functionality. One of the things I want to provide is a default PhaseListener which the child classes can just use by overriding the methods of the base class. Now, as this base class will be used by multiple JSF projects (which are contained in WARs), I would like to JAR the base class and just include it with the other projects. If I do this, however, every faces-config.xml in every WAR will be required to register the PhaseListener, instead of just being able to inherit from the class. I would like to make the JAR completely self-sustainable, you merely need to inherit from the base class in order to use its PhaseListener.
    Any ideas on how I can accomplish this?
    Ristretto

  • Transfer Object in JSF, Spring, and Hibernate

    The application on which I am working deploys the JavaServer Faces, Spring and Hibernate frameworks.
    We are going to use the "transfer object" to move data between J2EE tiers from the front end to the back end and vice versa. In addition, data "types" may need to be converted --
    At the front end, the "type" of the data that are entered by users may not match that in the database table. For example, checkboxes may be marked or left blank by users. The "type" of the checkboxes is "boolean" in the JSF backing bean. However, we have either "Y" or "N" for the corresponding field in the database table.
    The JSF backing bean holds data as well as controller functionality. Of course, the transfer object holds data only.
    With regard to class properties, Is the transfer object an exact copy of the JSF backing bean? And at which tier the data are converted to match their correspoding "types" in the database tables?
    We also have the "data objects" which are exact representation of database tables.
    Thanks for your advices.

    Small example: you can decide in the business layer
    whether to convert it to boolean or Boolean (which
    has a 3rd state: null).But it all goes back to your data model. If your data model supports null for that property, then of course boolean is a poor choice. If that case one could use Boolean. None of this has anything to do with re-usability, which was your objection.
    I think the re-usability question goes back to the data model as well. Suppose your data model says this property is boolean valued. However if your database does not support booleans natively, then you need to map the value for storage in the database. But that is the data persistence layers problem.
    OTOH, suppose your data model says that this property may be 'Y' or 'N'. Then the Java class represent the business object should not have a boolean property, we should make it match the data model.
    However, I think that most cases where people are storing 'Y' or 'N' in a field in the database fall into the first case, where the data model is a boolean and they are working around limitations in the database. There is no reason in that case to perpetuate the same limitations in the Java code.

  • JSF Actions and ActionListeners with Tiles and forms

    I�m having a problem trying to use the Tiles functionality in Struts 1.1 with JSF and was wondering if anyone could help me.
    I have defined a very simple header, menu, content Tile that doesn�t involve nesting of tiles (ExampleTile_content1Level.jsp).
    I have 3 JSP pages, the first testHarness.jsp is NOT built using Tiles and is just used to load some test data into a session scoped bean using an actionListener and then forward to a Tile generated page (ExampleTile3.jsp) using a hard-coded action �applicationSummary� when a commandLink is pressed. This works fine for both the action and actionListener.
    ExampleTile3.jsp contains another commandLink that is meant to forward to another tile ExampleTile2.jsp. This also works until I try to add the <h:form> � </h:form> tag around the outside of the <h:panelGrid> tags in ExampleContent1.jsp when the action and actionListener then fail to fire and I get an �Error on Page� message in Explorer the detail of which says �Error �com_sun_rave_web_ui_appbase_renderer_CommandLinkRendererer� is null or not an object�.
    However I need a form so that I can bind UI controls to data from the bean stored in the session scope. This is only a problem when I use Tiles to define the pages. Does anyone know what I am doing wrong?
    Any help would be much appreciated.
    Tiles.xml
       <definition name="example3" path="/pages/exampleTile_content1Level.jsp" >
              <put name="headerClass" value="someStyle"/>
              <put name="menuClass" value="someStyle"/>
              <put name="contentClass" value="someStyle"/>
              <put name="header-title" value="/pages/exampleHeader.jsp" />
              <put name="menu" value="/pages/exampleMenu.jsp" />
              <put name="content" value="/pages/exampleContent1.jsp" />
       </definition>
       <definition name="example2" path="/pages/exampleTile_content1Level.jsp" >
              <put name="headerClass" value="someStyle"/>
              <put name="menuClass" value="someStyle"/>
              <put name="contentClass" value="someStyle"/>
              <put name="header" value="/pages/exampleHeader.jsp" />
              <put name="menu" value="/pages/exampleHeader.jsp" />
              <put name="content" value="/pages/exampleContent2.jsp" />
       </definition>ExampleTile3.jsp
    <f:view>
         <h:form>
              <tiles:insert definition="example3" flush="false" />
         </h:form>
    </f:view> ExampleTile2.jsp
    <f:view>
         <h:form>
              <tiles:insert definition="example2" flush="false" />
         </h:form>
    </f:view> Faces-config.xml
    <navigation-rule>
        <from-view-id>/pages/testHarness.jsp</from-view-id>
           <navigation-case>
                <from-outcome>applicationSummary</from-outcome>
                <to-view-id>/pages/exampleTile3.jsp</to-view-id>
              <redirect/>
           </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/pages/exampleTile3.jsp</from-view-id>
           <navigation-case>
                <from-outcome>nextPage</from-outcome>
                <to-view-id>/pages/exampleTile2.jsp</to-view-id>
                <redirect/>
           </navigation-case>
    </navigation-rule> ExampleTile_content1Level.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" >
         <f:subview id="header-title">
              <tiles:insert name="header-title" flush="false" />
         </f:subview>
         <f:subview id="menu">
              <tiles:insert name="menu" flush="false" />
         </f:subview>
         <f:subview id="content">
              <tiles:insert name="content" flush="false" />
         </f:subview>
    </h:panelGrid> ExampleHeader.jsp / ExampleMenu.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" columnClasses="someSyle">
         <h:outputFormat value="This is the {0}.">
              <f:param value="Header / Menu as appropriate "/>         
         </h:outputFormat>
    </h:panelGrid> ExampleContent1.jsp
    <tiles:importAttribute scope="request"/>
    <h:form>     <----- Fails with this tag included but works without it.
    <h:panelGrid columns="1" >
              <h:outputFormat value="This is the {0}.">
                   <f:param value="Content on the FIRST page"/>
              </h:outputFormat>
              <h:commandLink action="nextPage" immediate="false">
                   <h:outputText value="Click to go to next page"/>
              </h:commandLink>
    </h:panelGrid>
    </h:form> ExampleContent2.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" >
         <h:outputFormat value="This is the {0}.">
              <f:param value="Content on the SECOND page"/>
         </h:outputFormat>
    </h:panelGrid>

    jezzica85 wrote:
    Hi everybody,
    I want to overload a method so it can take either 2 Actions, 2 ActionListeners, or one of each. The issue with this is that I'd have to make 4 overloaded signatures and almost identical methods, like this:
    method( action, action )
    method( action, listener )
    method( listener, action )
    method( listener, listener )
    Well, if you want to support that then you are just going to have to do suffer through it, the only shortcut I can recommend is that your method(action, listener) and method(listener, action) are the same so you only have to implement 1 and just use the other as a entry point to call the one you wish to contain the code.

  • Reset JSF session and the managed beans with sesison scope

    Hi,
    this is a very general question and maybe stupid for most of you. I have my jsf/facelets web application and i use inside of this application some managed beans, which are session beans. I want to know how is it possible to reset this beans. I'm asking this question beacuse i have this kind of problem: i built my web application which has a login form and i use the browser to test it. When i browse to the login page and I login with my credentials i get my customized home page. Then i open another istance of the browser and i browse to the login page again but this time i login as a different user. The result home page is the same as i got before with my login credentials, so the session is always the same. Instead i want the session and all its objects to be resetted for the new user! Do youn know which is the solution?

    The fact is that i want to have two sessions in parallel, so using the same browser and opening two tabs, i want to browse to the login page and access as two totaly different users and using in parallel the application without the problem of one user's action affecting the other user beacuse of session sharing. So I want to force the application to create two different session for the two users logins, because as i told you before as it is now, they are sharing the same sesison. And i think that if i at the login time I iterate thorugh the session and delete all the objects i will be able to have only one session per time. Isn't it?

  • Problem identified jsf component and problem of checkboxs

    hello,
    i have 2 questions:
    - 1
    I have a js function that show/don't show a tab when we chose yes/no on a SelectOneRadio:
    function display(fieldRadio,tabtohide)
    div = document.getElementById(tabtohide);
    if(fieldradio.value=='false')
    div.className='hide';
    else div.className='';
    I call this function in the radio component, like this:
    onclick="display(this,'tabid');" and it works very well.
    The problem is that i would like to replace 'this' by the id of the component (to call this function at another place).
    I'v tried the document.getElementById(JsfTagId); but it doesn't work with jsf tag.
    - 2
    I use a selectmanycheckbox like this:
    <h:selectManyCheckbox value="#{BeanDemandeur.type}" required="false">
    <f:selectItem itemValue="Nouvelleinstallation" itemLabel="Nouvelle installation"/>
    <f:selectItem itemValue="Mise�jour" itemLabel="Mise � jour"/>
    <f:attribute name="fieldRef" value="Type de demande"/>
    </h:selectManyCheckbox>
    In the bean, i use the variable type like this:
    private String[] type = new String[2];
    public String[] getType(){return type;}
    public void setType(String[] rr){type[0]=rr[0];type[1]=rr[1];}
    And finally, in th faces-config.xml:
    <managed-property>
    <property-name>type</property-name>
    <property-class>java.lang.String[]</property-class>
    <value/>
    </managed-property>
    But an error occured: Can't set managed bean property:'type';
    thx u for your help

    r u getting any connversion error !
    what is the error ru getting when u run the code

Maybe you are looking for

  • Constant expression required

    (Original thread http://forum.java.sun.com/thread.jsp?forum=31&thread=428634) Hello all, in the following class, if the comment is removed, the compiler complains that a constant expression is required. class Test { final static int A; final static i

  • Crashing after Yosemite update!

    I've run into an issue with overheating crash in the past three days after I upgraded to Yosemite. this has never happened before. normal operations of the computer are fine. within 5 minutes of playing any kind of game the computer shuts off, which

  • WARNING: inbound connection timed out (ORA-3136)

    While applying the patch i got the below error and database went down  : There are now 7638 jobs remaining (current phase=A8):     8 running, 1537 ready to run and 6093 waiting. Completed: file bencwbutils.pkb on worker  1 for product ben username BE

  • Project Management Templates fo SharePoint?

    Can you recommend SharePoint "templates" to use for Project Management? (Something for our PMO) TIA, edm2

  • Recommended number of fds on a SJES5 install

    Hello, We're in the process of moving our smtp infrastructure on SJES5 on brand new T2000 (32 cores @ 1.2GHz with 16GB RAM, running SunOS 5.10). Nowhere in the deployement guidelines or anywhere else I've seen a recommendation regarding ulimit -n and