JSF Simple Page Communication

Hi All,
I have a question about how is the best way to create a simple search page, I have one but I must not understand the page Lifecycle because it acts wierd...? Here is what I want
2 Pages -
Page 1 Default.jspx has two inputTexts for first and last name and one commandLink which calls an action in the SearchBean managed request bean
Page 2 has an ADF Table bound to a Table of search results Plus more inputTexts which are used to filter the results.
What I am doing.
When the link calls getSearchResults i have the following method in the bean
public String searchEmployees()
String fname = this.itFirstName.getValue() != null ? this.itFirstName.getValue().toString() : "";
String lname = this.itLastName.getValue() != null ? this.itLastName.getValue().toString() : "";
JSFUtils.storeOnSession("fname",fname);
JSFUtils.storeOnSession("lname",lname);
JSFUtils.storeOnSession("SearchType","Simple");
return "gotoEmployeeResults";
the return is used for JSF Navigation to send the App to the Results page where the Databound Table calls the getEmployees method
public List<Employee> getEmployees()
try
String searchType = (String)JSFUtils.getFromSession("SearchType") != null ? (String)JSFUtils.getFromSession("SearchType") : "Simple" ;
if(!"".equals(searchType) && searchType != null && searchType.equals("Filter"))
FilterEmployeeSearch();
else
simpleEmployeeSearch();
catch(Exception e)
return this.employees;
Now the user can use the filters and submit a new request using another commandLink which calls the following method
public String filterSearchEmployees(){
String fname = this.itFilterFirstName.getValue() != null ? this.itFilterFirstName.getValue().toString() : "";
String lname = this.itFilterLastName.getValue() != null ? this.itFilterLastName.getValue().toString() : "";
String site = this.itFilterSite.getValue() != null ? this.itFilterSite.getValue().toString() : "";
String dept = this.itFilterDepartment.getValue() != null ? this.itFilterDepartment.getValue().toString() : "";
String ext = this.itFilterExtension.getValue() != null ? this.itFilterExtension.getValue().toString() : "";
JSFUtils.storeOnSession("fname",fname);
JSFUtils.storeOnSession("lname",lname);
JSFUtils.storeOnSession("site",site);
JSFUtils.storeOnSession("dept",dept);
JSFUtils.storeOnSession("ext",ext);
JSFUtils.storeOnSession("SearchType","Filter");
return "gotoEmployeeResults";
and the Table gets the employees again
The problem is that not only does the get employees method get called a ton of times but my filterSearchEmployees is never called hence my session SearchType never gets set to filter and the filter search never runs.
I Guess the main question here is am I going about this the right way? Passing session values and using JSF Navigation? I am a .NET guy and it seems like this is much simpler in .NET so I hope there is an easier approach for JSF?
Thanks in advance for any help.

Hi,
Your pages are semi-correct. From the code snippet, I see that you're probably using the "binding" attribute instead of EL to bind the field values. As for the multiple method calls, it's normal, hence why the getter should cache the result for the current request in an instance variable of the managed bean. So I would see:
public class SearchFilter implements Serializable
    private String firstName;
    private String lastName;
    // Add missing fields
    public String getFirstName()
        return firstName;
    public String getLastName()
        return lastName;
    public void setFirstName(String firstName)
        this.firstName = firstName;
    public void setLastName(String lastName)
        this.lastName = lastName;
public class EmployeeManager
    private SearchFilter filter;
    private transient List<Employee> filteredList;
    public SearchFilter getSearchFilter()
        return lastName;
    public void setSearchFilter(SearchFilter filter)
        this.filter = filter;
    public List<Employee> getEmployees()
        if (filteredList == null)
            // Get the full list and apply the filter on it then cache the result in filteredList
        return filteredList;
}The searchFilter bean should be pageFlow scoped (or session) while the manager should be backingBean scoped (or request). The filter should be injected in the manager by JSF
Regards,
~ Simon

Similar Messages

  • JSF-based Pages do not render in IE

    I have an application with a core sequence of pages that is deployed on two separate Tomcat 5.0.x (testing and production) and the Sun App server bundled with Creator. I am seeing the following behavior with all servers from my Windows XP Client machine:
    All pages show up fine with Firefox 1.0.
    In Internet Explorer 6.0 only two simple pages are displayed. When I navigate or type in the URL to the other pages, the browser window is blank. BUT when I view the html source, it seems to contain all the expected html. In fact if I save the page in IE, and open it Firefox, it displays correctly.
    I do not see any server error messages - it seems it is an IE problem. Does anyone know what in the html-rendered-jsf/jsp that IE does not like? Has anyone seen this before?
    Any help would be much appreciated.

    Basic pages does work - can you show what the HTML
    from "View Source" in IE is?
    Thank you for your reply. Here is the HTML:
    <html xml:lang="en-US" lang="en-US">
    <head>
    <meta http-equiv="Cache-Control" content="no-cache"/><meta http-equiv="Pragma" content="no-cache"/>
    <title>Step 1: Presenter Information</title>
    <link type="text/css" rel="stylesheet" href="resources/stylesheet.css"/>
    <link type="text/css" rel="stylesheet" href="resources/apc.css"/>
    <script type="text/javascript" src="resources/util.js"/>
    </head>
    <body style="-rave-layout: grid">
    <form id="form1" method="post" action="/symposium/faces/PresenterInfo.jsp" enctype="application/x-www-form-urlencoded">
    <label id="form1:componentLabel1" for="form1:firstNameTF" style="left: 120px; top: 240px; position: absolute">
    <span id="form1:componentLabel1Text" class="generic_lbl">First Name*</span></label>
    <label id="form1:componentLabel2" for="form1:middleTF" style="left: 432px; top: 240px; position: absolute">
    <span id="form1:componentLabel2Text" class="generic_lbl">Middle</span></label>
    <label id="form1:componentLabel3" for="form1:lastNameTF" style="left: 120px; top: 288px; position: absolute">
    <span id="form1:componentLabel3Text" class="generic_lbl">Last Name*</span></label>
    <label id="form1:componentLabel4" for="form1:degreesTF" style="left: 432px; top: 288px; position: absolute">
    <span id="form1:componentLabel4Text" class="generic_lbl">Degrees</span></label>
    <label id="form1:componentLabel5" for="form1:emailTF" style="left: 120px; top: 528px; position: absolute">
    <span id="form1:componentLabel5Text" class="generic_lbl">Email*</span></label>
    <label id="form1:componentLabel6" for="form1:departmentTF" style="left: 120px; top: 336px; position: absolute">
    <span id="form1:componentLabel6Text" class="generic_lbl">Department*</span></label>
    <label id="form1:componentLabel7" for="form1:affilliationTF" style="left: 120px; top: 384px; position: absolute">
    <span id="form1:componentLabel7Text" class="generic_lbl">Affilliation*</span></label>
    <span id="form1:outputText1" style="font-family: 'Helvetica'; font-size: 18pt; height: 24px; left: 72px; top: 144px; position: absolute; width: 382px">Step 1: Presenter Information Form</span>
    <input id="form1:firstNameTF" type="text" name="form1:firstNameTF" maxlength="25" style="left: 216px; top: 240px; position: absolute" tabindex="1" />
    <input id="form1:phoneTF" type="text" name="form1:phoneTF" maxlength="25" style="left: 216px; top: 432px; position: absolute" tabindex="8" /><input id="form1:departmentTF" type="text" name="form1:departmentTF" maxlength="20" style="left: 216px; top: 336px; position: absolute" tabindex="5" />
    <input id="form1:emailTF" type="text" name="form1:emailTF" maxlength="30" style="left: 216px; top: 528px; position: absolute" tabindex="10" />
    <input id="form1:lastNameTF" type="text" name="form1:lastNameTF" maxlength="25" style="left: 216px; top: 288px; position: absolute" tabindex="3" title="" />
    <label id="form1:componentLabel8" for="form1:phoneTF" style="left: 120px; top: 432px; position: absolute">
    <span id="form1:componentLabel8Text" class="generic_lbl">Phone</span></label>
    <label id="form1:componentLabel9" for="form1:extensionTF" style="left: 120px; top: 480px; position: absolute">
    <span id="form1:componentLabel9Text" class="generic_lbl">Extension</span></label>
    <input id="form1:extensionTF" type="text" name="form1:extensionTF" maxlength="10" style="left: 216px; top: 480px; position: absolute" tabindex="9" />
    <input id="form1:affilliationTF" type="text" name="form1:affilliationTF" maxlength="35" style="left: 216px; top: 384px; position: absolute" tabindex="7" />
    <table id="form1:statusBtnLst" style="height: 178px; position: absolute; font-family: Arial,Helvetica,sans-serif; width: 168px; left: 497px; top: 336px">
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Faculty" tabindex="6"> Faculty</input></label></td>
         </tr>
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Fellow" tabindex="6"> Fellow</input></label></td>
         </tr>
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Grad Student" tabindex="6"> Grad Student</input></label></td>
         </tr>
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Med Student" tabindex="6"> Med Student</input></label></td>
         </tr>
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Resident" tabindex="6"> Resident</input></label></td>
         </tr>
         <tr>
    <td>
    <label><input type="radio" name="form1:statusBtnLst" value="Other" tabindex="6"> Other</input></label></td>
         </tr>
    </table>
    <label id="form1:componentLabel10" for="form1:componentLabel10" style="left: 432px; top: 336px; position: absolute">
    <span id="form1:componentLabel10Text" class="generic_lbl">Status*</span></label>
    <input id="form1:middleTF" type="text" name="form1:middleTF" maxlength="25" style="left: 504px; top: 240px; position: absolute" tabindex="2" />
    <input id="form1:degreesTF" type="text" name="form1:degreesTF" maxlength="15" style="left: 504px; top: 288px; position: absolute" tabindex="4" />
    <span id="form1:outputText2" style="font-style: italic; left: 96px; top: 192px; position: absolute">*Indicates Required Field</span>
    <div id="banner"><img width="205" src="resources/pavilions.jpg" height="90"/></div>
    <input id="form1:confirmHF" type="hidden" name="form1:confirmHF" value="no" />
    <table id="form1:gridPanel1" style="height: 53px; position: absolute; padding-bottom: 15px; left: 216px; top: 576px" width="288">
    <tbody>
    <tr>
    <td><input id="form1:cancelBtn" type="submit" name="form1:cancelBtn" value="Start Over" onclick="" tabindex="11" title="Clear All Data and Start Over" /></td>
    <td><input id="form1:nextBtn" type="submit" name="form1:nextBtn" value="Next Step" tabindex="12" title="Go to Next Step" /></td>
    <td><input id="form1:reviewBtn" type="submit" name="form1:reviewBtn" value="Review Data" tabindex="13" title="Return to Review Page" disabled="disabled" /></td>
    </tr>
    </tbody>
    </table>
    <input type="hidden" name="form1" value="form1" />
    </form>
    </body>
    </html>

  • Session in JSF JSP page

    Hi All,
    I am using JSF JSP pages. One such page is login.jsp I have backing object backing_login
    On successful login, listUser.jsp page is displayed. In this page, I have a HTML --- Commons Hyperlink component as follows.
      <tr>
                  <td height="17">
                    <a href="http://129.212.139.36:8991/GeminiLogin-ViewController-context-root/faces/listUsers.jsp">
                      Manage Users
                    </a>
                    <afh:script binding="#{backing_createModify.script1}"
                                id="script1"/>
                  </td>
                </tr>
    Now the question:---
    I do get to know the UserType in the backing_login object (either 'cma' or 'ea').
    Now, if it is cma I want the above link tobe dispalyed in listUser.jsp else DO NOT display the link.
    How can I do that ? I dont know, how to pass UserType information available in baking_login to the listUser.jsp and
    second, how can conditionally use that info to either hide or display that hyperlink ?
    Your help appreaciated.
    thanks in advance
    pp

    You can use an ADF Faces link component and condition the display attribute for it on the value of your backing bean
    There are some samples of conditional display in the posts from Grant here:
    http://groundside.com/blog/GrantRonald.php?m=200512

  • Create jsf jsp page / page implementation / third option is not visible

    The third option (check box) for page implementation settings in the create jsf jsp page is not visible. The window is not resizable.

    I see the option radio button and text "Automatically Expose UI Components in an Existing Managed Bean" that is disabled but i see only partially the label what is a disabled input text field i suppose just below the radio button.
    I see also the Directory input field and Browse button a little bit truncated at the bottom (1-2 pixels missing).
    I see also the Render in Mobile Device check box and combo box ... cutted by the half when i expand the page implementation part.
    As said the window is not resizable.
    Let me know a location i can send you a hard copy of the screen.

  • 'session' is undefined - javascript error in my JSF/JSP page

    I have the following JSF/JSP page. In onLoad() I invoke a javascript function func(). In this method, I attempt to lookup an attribute from the Http Session. When I run my application, my page is loaded with but the icon on the lower left corner of the browser indicated that there was an error. When I viewed the error, it read : 'session' is undefined.
    The 'session' variable is available in a JSP page.
    So why does my code not work from within a JSF application.
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://www.sun.com/web/ui">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>   
        <f:view>
            <ui:page binding="#{bean.page1}" id="page1">
                <ui:html binding="#{bean.html1}" id="html1">
                    <ui:head binding="#{bean.head1}" id="head1">
                        </ui:head>
                    <ui:body binding="#{bean.body1}" onLoad="func()" id="body1" style="-rave-layout: grid">
                        <ui:form binding="#{bean.form1}" id="form1">                       
                            <h:inputText binding="#{bean.inputText}" id="inputText"/>
                        </ui:form>
                    </ui:body>
                </ui:html>
            </ui:page>
        </f:view>
        <script type="text/javascript">
            function func(){                  
                    alert("in func()");
                    var y = session.getAttribute("test");
                    alert(y);
        </script>
    </jsp:root>thanks,
    tsc

    Because :
    Session.getAtrribute is java-code that can only run on the server
    and
    var y = session.getAttribute is javascript-code run on the client.

  • [Q] simple page with calculations

    Hi everybody,
    i'm completly new to Oracle APEX and i tested some things with a very simple Applikation at first.
    I can view, edit, delete my data. I tested simple reporting with Diagrams. Everything is working fine.
    Now i thought about a simple Page with some Calculations. I want to select my Data through Comboboxes
    and then doing some simple calculations with a button press.
    Like..
    Selecting a Country -> showing me some values for that contry.. (sales, whatever) -> entering 5% in a textbox
    ->pressing calculate -> and its showing me the result on the screen
    Now I'm completly lost on "How to start"... Is this even possible? I dont want a complete walkthrough..
    Maybe someone can give me just a hint "How to start"..
    Greetings

    Consider placing a LOV to select Country codes and a Text item to capture your percentage within your Report region.
    Then your code would mimic this code where p1_letter would be your Text item and p1_state would be your LOV.
    SELECT a.state_name
      FROM demo_states a
    WHERE     a.state_name LIKE '%' || UPPER (:p1_letter) || '%'
           AND a.st LIKE '%' || UPPER (:p1_state) || '%'Jeff

  • Adobe reader page commune à plusieurs dossier

    Bonjour,
    Notre entreprise à ces dossiers techniques au format PDF (dossier contenant de 15 à25 pages) sur les produits que nous fabriquons.
    Ma question : Est-il possible d'avoir une page commune entre plusieurs dossiers?
    ( exemple: nous inscrivons une modification ( cette page en commune à plusieurs dossiers), donc toutes les autres dossiers ont cette modifications en live).
    Sébastien BREBION

    Bonjour.
    Ce n'est pas possible comme ça (en mise à jour dynamique).
    Ce qui serait possible c'est d'avoir un même PDF contenant des champs de formulaire dans plusieurs dossiers.
    Ensuite, à chaque modification, un script et/ou une Action d'Acrobat peut pousser les nouvelles informations dans les champs de tous les PDF concernés dans chaque dossier en un tournemain.

  • Problem with JSF Beehive Page Flow

    Hi
    I created a JSF Beehive Page Flow and if i prove it outside a portal it works fine. The problem begins when I create a page flow portlet and put it in a portal. With debuging i saw that the begin method of the pageflow is executed and the oncreate of the JSF backing bean too, but the page is not displayed.
    The begin method looks some like this:
         @Jpf.Action(forwards = {
    @Jpf.Forward(name="success", path="/Index.faces")
         protected Forward begin() {
              return new Forward("success");
    If anyone has any suggestions or working samples, they would be greatly appreciated.
    Thanks.

    If you created the portlet from pageflow, it won't work.
    But you can try create portlet from "new->portlet->JSF portlet" and give the beginning faces page to the content path, (for your case "/Index.faces"). It will work. I have tried this way, it works on WLP 10
    Jiameng Yu

  • Do we write one model bean for every JSF UI page?

    First, Please excuse my minimal knowledge in JSF, I am just starting to crawl :)
    Is my understanding about JSF that you will be writing one model bean class for every JSP page you have, CORRECT? (this is just my understanding, I may be wrong)
    This will be getting hard for large application.
    Ideal scenario: Say you have a JSP page A.jsp to associate an action reference you write a model bean class and have appropriate get method to return an Action object.
    Can we write an Action class, separated from the model bean class. I tried to create 2 different packages and one which just had a simple model bean and the other package had a Action class. I was not able to get this working as it was bouncing back with a Method innovation/Illegal argument exceptions. I am very confused here is it a necessity to write the action method in model bean or can we separate it? If we can separate it can we package it in to different packages?
    I may be confusing in explaining my questions but to put it black and white
    A)
    1 JSP Page (uses JSF components) = 1 model bean class (?)
    or
    B)
    1..n JSP pages (uses JSF components) = 1 or may be 2 model bean class (?)
    If B is possible how do we get the action classes towards this architecture and how can we get access to the various model bean objects in a single action class.
    Sorry for my vagueness....
    Thanks
    Ram

    In the particular case of your separate Action class,
    you still need a getter method for it somewhere. I
    find it easiest to include this getter in the same
    model bean that contains the data, but it doesn't have
    to be. Craig,
    It seems to be the consensus that a getter is required, but I've had perfect luck registering a single Action class in the application scope:
    <managed-bean>
      <managed-bean-name>fooAction</managed-bean-name>    
      <managed-bean-class>org.bar.FooAction</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>And then referencing it directly:
    <h:command_button commandName="foo" actionRef="fooAction"/>This feels more like the Struts approach to me, as there's a single instance available. (If I wanted thread saftey, however, I could declare it in the request scope instead). I use this approach when there's no data associated with the Action (like a LogoutAction).
    Kito D. Mann

  • Jsf pluggable pages?

    I have jsf application, written using facelets. I want it to be extedable with custom modules.
    Module is simple jar with faces-context.xml in it. I can place it in /WEB-INF/lib directory, register somehow in my app, for example by specifying main class of module, so later, after deploy, I can reach all resources from this jar.
    As specified in spec, I can add managed beans and custom navigation rules into module's faces-context.xml. But what about jsp pages? How can I add them and later tell my main app to use them? For example, I have rule:
    <navigation-rule>
       <from-view-id>/modules/test/foo.jsp</from-view-id>
       <navigation-case>
          <from-action>#{moduleBean.doSmth}</from-action>
          <to-view-id>/modules/test/foo1.jsp</to-view-id>
       </navigation-case>
    </navigation-rule>(let's say, that every module must use /modules/<module_name> prefix). Both foo.jsp and foo1.jsp are located in module_test.jar, which is (as Imentioned before) in /WEB-INF/lib folder of my main app. So how will main app understand that it must load jsp's from module_test.jar?

    I fogot to mention that i use facelets. So here is the solution.
    create class
    package util;
    import com.sun.facelets.impl.DefaultResourceResolver;
    import java.net.URL;
    public class ModuledFaceletResourceResolver extends DefaultResourceResolver {
        public URL resolveUrl(String path) {
            if (path.startsWith("/modules")) {
                String resource = path.replaceAll("^/modules", "");
                try {
                    ClassLoader loader = Thread.currentThread().getContextClassLoader();
                    Class<?> cl = loader.loadClass("module.test.TestEntry");
                    return cl.getResource(resource);
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                    return null;
            return super.resolveUrl(path);
    }add to web.xml:
        <context-param>
            <param-name>facelets.RESOURCE_RESOLVER</param-name>
            <param-value>util.ModuledFaceletResourceResolver</param-value>
        </context-param>create jar test.jar, put test.xhtml in the root of jar. Create class module.test.TestEntry in it. Compile, deploy.
    Now go to http://localhost/modules/test.jsf. You'll see result of test.xhtml page.

  • How to scope beans for a JSF Confirmation Page

    I have a web form with corresponding backing bean for each input field. I have two buttons on the form. Here is some of the page:
    <h:inputText id="clientName" value="#{clientBean.company}" required="true"/>
    <h:inputText id="clientContact" value="#{clientBean.contact}"/>
    <h:commandButton id="btn_Submit" value="Submit" action="#clientBean.save}"/>
    <h:commandButton id="btn_Cancel" value="Cancel" immediate="true" action="cancel"/>
    Navigation rules display a confirmation page with the inputs the user has entered, and the cancel button brings them back to a simple menu screen (where they can click a link and re-visit this web form).
    IF THE MANAGED-BEAN-SCOPE for clientBean is set to REQUEST, I cannot use the bean attributes to populate outputText elements on a confirmation page (they are no longer in the current request). (I'm OK with this....)
    IF I SET THE MANAGED-BEAN-SCOPE for clientBean to SESSION, I can use the attributes of the managed-bean to drive the confirmation page, HOWEVER... if the user fills in the form and clicks CANCEL, then re-visits the web form, the values they entered prior to clicking Cancel are pre-populated in the web form.
    I've even gone as far as to have the Cancel button fire a cancel() method on the clientBean where I set all backing attributes to empty strings. That doesn't work either.
    Is there a way I can remove a managed-bean instance from the session scope entirely when the user clicks Cancel? Or is there a preferred method of ensuring that form values make it to the confirmation page using request scoped beans?

    I'd the same problem ever.
    It's not a good way to do these clear in the cancel button,
    for users maybe not click the cancel button, but click others links on the page
    and quit, after a while, then goto the form, there will be the previous data
    displayed as click back on the confirm page.
    at last i resolve the problem by adding a page before the form page.
    all links to the form page are linked to the new page,
    in the new page,
    1st, clear the state of the managed-ben(clientBean),
    there were a few ways to do this,
    (1), change all the properties of the clientbean to a default value.
    (2), remove the clientbean from the session(JSF will create an new instance when it remove from the session)
    2nd, redirect the request to the form page.
    You may write only one page (the clear-state and forword page) for all form in the application by passing the managed-bean to be cleared as a parameter.
    Hope be helpful for you.

  • Simple Page Structure with DynNavigation and ContentPages - Best Practise??

    Hi ...
    actually I am going to develop a simple JSF Application(my first) :-|
    Simple Description
    User logs in - next View(JSF Page) consists an user(rigths spezific)menu and a content part witch consists of formbased use cases which have to be solved by the application. The parts for its own is not my problem. But how to bring them together ...
    Question
    I am looking for a best practise Solution for the described problem. Which tag/technology I should use. Is it possible to solve this problem by simple using JSF or am I forced to use MyFaces, Tiles or somthing else ...
    I think this is normal use of JSF or am I wrong with that. I am reading several tutorials but did not find a solution for this global / abstract problem.
    I hope my "english" is readable :)) thanks in advance

    Connect the phone to the PC. Open the folder you want to copy using windows explorer. Copy music files. Right click & select send to Windows Phone. For help regarding Playlists go to the link below:
    Playlist WP8
    Please mark the post as solution if it solves your problem.
    Current Device - Nokia Lumia 1020/920

  • Unable to show custom jsf error page !

    Hi all,
    I have a major problem displaying my custom errorpages. That is, they do not show at all!
    I also tried this in a simple project where I have only 1 jsf page, but the behaviour is the same.
    However, If I use a plain jsp page as erropage, then the error page is displayed as expected.
    My web.xml:
    <error-page>
    <error-code>404</error-code>
    <location>/jspErrorPage.jsp</location>
    </error-page>
    <!--error-page>
    <error-code>404</error-code>
    <location>/errorPage.jspx</location>
    </error-page-->
    If I remove all jsf and adf components from the adf-faces error page it does work correctly.
    For some reason the adf and jsf components can not be used in an error page.
    If I try this in the FOD demo application the behaviour is exactly the same !
    No errorpage is shown unless I remove all jsf and adf components.
    Luc
    Edited by: lucbors on Mar 6, 2009 11:28 AM

    hi Johan
    It looks like the filter-mapping/dispatcher element in web.xml is relevant here.
    Default the "adfFaces" filter seems to be mapped like this ...
    <filter-mapping>
      <filter-name>adfFaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
    </filter-mapping>If I also add a dispatcher element with ERROR value like ...
      <dispatcher>ERROR</dispatcher>... the behaviour of my application starts to change.
    With such a dispatcher element configured, I can get an error-page configuration like this to "work":
         <error-page>
              <error-code>500</error-code>
              <location>/faces/internalServerErrorFaces.jspx</location>
         </error-page>Using JDeveloper 10.1.3.4.0 I created an example application for this,
    see http://verveja.footsteps.be/~verveja/files/oracle/FacesErrorPageApp-v0.01.zip
    The screenshots in FacesErrorPageApp.png show the page with the buttons that cause exceptions and the error page I get.
    The thing is, this seems to work only te first time (for the first session). So, navigating back and clicking another button only shows the same page again and not the error page.
    If I try something similar in a web-module that does not use ADF Faces, things seem to be OK.
    (The example application has a ViewControllerNoADFFaces project with an errorButtonPageNoADFFaces.jspx page with buttons that will cause an exception and show the internalServerErrorNoADFFaces.jspx page. From that error page I can navigate back an click a different button to cause a different exception to end up on the error page again.)
    Given that this at least looks like an ADF Faces issue, I think a reply from someone from Oracle in this forum thread could be useful. (And you could always create a service request on metalink.oracle.com for this.)
    regards
    Jan Vervecken

  • How i can display data from backing bean from jsf adf page

    Hi all
    I am creating a adf bc jsf application i am referring hr schema employee table
    in my jsf page i have a inputtext with label employee number if i enter employee number and press tab i should get employee name and jobid and salary for this purpose i am doing like as follows
    my view object query is as follows
    SELECT EMPLOYEE_ID,FIRST_NAME,JOB_ID,SALARY
    FROM EMPLOYEES
    WHERE EMPLOYEE_ID=:EMP_NO
    and my backing bean for my jsf page is as follows
    package view.backing;
    import javax.faces.component.html.HtmlForm;
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.faces.component.core.input.CoreInputText;
    import oracle.adf.view.faces.component.core.output.CoreOutputText;
    import oracle.adf.view.faces.component.html.HtmlBody;
    import oracle.adf.view.faces.component.html.HtmlHead;
    import oracle.adf.view.faces.component.html.HtmlHtml;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    public class BindTest3
    private HtmlHtml html1;
    private HtmlHead head1;
    private HtmlBody body1;
    private HtmlForm testForm;
    private CoreInputText employeeId;
    private CoreOutputText firstName;
    private CoreOutputText jobId;
    private CoreOutputText salary;
    public void setHtml1(HtmlHtml html1)
    this.html1 = html1;
    public HtmlHtml getHtml1()
    return html1;
    public void setHead1(HtmlHead head1)
    this.head1 = head1;
    public HtmlHead getHead1()
    return head1;
    public void setBody1(HtmlBody body1)
    this.body1 = body1;
    public HtmlBody getBody1()
    return body1;
    public void setTestForm(HtmlForm form1)
    this.testForm = form1;
    public HtmlForm getTestForm()
    return testForm;
    public void setEmployeeId(CoreInputText inputText1)
    this.employeeId = inputText1;
    public CoreInputText getEmployeeId()
    return employeeId;
    public void changeMethod(ValueChangeEvent event)
    String EmployeeId=(String)event.getNewValue();
    CheckForBind check=new CheckForBind();
    System.out.println(check.getEmployeeNo());
    String amDef = "model.AppModule";
    String config = "AppModuleLocal";
    ApplicationModule am =
    Configuration.createRootApplicationModule(amDef,config);
    ViewObject vo = am.findViewObject("EmployeeBindViewObj1");
    vo.setNamedWhereClauseParam("EMP_NO",EmployeeId);
    System.out.println("Query will return "+
    vo.getEstimatedRowCount()+" rows...");
    vo.executeQuery();
    while (vo.hasNext()) {
    Row curUser = vo.next();
    System.out.println(vo.getCurrentRowIndex()+" "+
    curUser.getAttribute("EmployeeId")+" "+
    curUser.getAttribute("FirstName")+" " curUser.getAttribute("JobId")" "+curUser.getAttribute("Salary"));
    //firstName =(String)curUser.getAttribute("EmployeeId");
    //setFirstName(curUser.getAttribute("EmployeeId"));
    firstName.setValue((String)curUser.getAttribute("FirstName"));
    //jobId.setValue((CoreOutputText) curUser.getAttribute("FirstName"));
    // salary.setValue((CoreOutputText)curUser.getAttribute("Salary"));
    // values.setJobId((CoreOutputText)curUser.getAttribute("JobId"));
    // values.setFirstName((CoreOutputText) curUser.getAttribute("FirstName"));
    //values.setSalary((CoreOutputText)curUser.getAttribute("Salary"));
    Configuration.releaseRootApplicationModule(am,true);
    public void setFirstName(CoreOutputText outputText1)
    this.firstName = outputText1;
    public CoreOutputText getFirstName()
    return firstName;
    public void setJobId(CoreOutputText outputText2)
    this.jobId = outputText2;
    public CoreOutputText getJobId()
    return jobId;
    public void setSalary(CoreOutputText outputText3)
    this.salary = outputText3;
    public CoreOutputText getSalary()
    return salary;
    and my jsf page is as follows
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
    <afh:html binding="#{backing_BindTest3.html1}" id="html1">
    <afh:head title="Home" binding="#{backing_BindTest2.head1}" id="head1">
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <style type="text/css">
    body {
    background-color: #f7f7f7;
    </style>
    </afh:head>
    <afh:body binding="#{backing_BindTest3.body1}" id="body1">
    <h:form binding="#{backing_BindTest3.testForm}" id="testForm">
    <af:inputText label="Employee No" binding="#{backing_BindTest3.employeeId}"
    id="employeeId" valueChangeListener="#{backing_BindTest3.changeMethod}" autoSubmit="true"/>
    <af:outputText value="#{backing_BindTest3.firstName.value}"
    binding="#{backing_BindTest3.firstName}"
    id="firstName"/>
    <af:outputText value="outputText2"
    binding="#{backing_BindTest3.jobId}"
    id="jobId"/>
    <af:outputText value="outputText3"
    binding="#{backing_BindTest3.salary}"
    id="salary"/>
    </h:form>
    </afh:body>
    </afh:html>
    </f:view>
    <%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_BindTest2--%>
    but i am getting result in console but i cant get the value of firstname into my jsf page
    can any one can tell me for get the value to jsf page what i can do
    and what are the changes i can do in my jsf page

    hi,
    i tried to set value like as follows
    name=(CoreOutputText)curUser.getAttribute("FirstName");
    but that time i getting exception like as follows
    ec 22, 2007 2:17:27 PM com.sun.faces.lifecycle.ProcessValidationsPhase execute
    SEVERE: java.lang.ClassCastException: java.lang.String
    javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.String
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
         at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:363)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: java.lang.String
         at view.backing.ChangeValue.changeMethod(ChangeValue.java:49)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    What will be the resion please help it is very critical for me

  • Error  while parsing JSF jspx page when including javascript  loops

    Hi All,
    I have a jspx document which contains jsf tags including trinidad tags. I have added a javascript function in the page, which contains a for loop statement, however when I run the page I get an error
    com.sun.facelets.FaceletException: Error Parsing /xAdvisorWeb/bundles/receivetask/manageinbox.jspx: Error Traced[line: 48] The content of elements must consist of well-formed character data or markup.
    at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
    at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)
    at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:93)
    at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:178)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:995)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:326)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:290)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:213)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:90)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
    Please note that normal javascript code has worked in my jsf page, this problem only occurs only when I add for loop or while loop in the javascript function. Can we not add javascript loops in a jsf page? Is there something else I need to include?
    This is the relevant code snippet :
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:tr="http://myfaces.apache.org/trinidad"
    xmlns:ch="http://www.chordiant.com/jsf"
    xmlns:chrd="http://chordiant.com/jsf/chrd">
    <f:view locale="#{preferLocale.locale}">
    <f:verbatim escape="true">
    <script>
    function validateInput(){
    for(int i=0;i<3;i++)
    alert('Hi');
    return false;
    </script>
    </f:verbatim>
    <tr:commandLink styleClass="ttmBtnCmdLink" onclick="return validateInput();"
    action="#{manageInbox.executeTaskForAssignedWorkItems}">
    <tr:outputText value="#{msgs.execute_btn}"
    styleClass="ttmBtnOutTxt" />
    </tr:commandLink>
    Any help will be much appreciated.
    Thanks in advance,
    Debajyoti

    M-Y wrote:
    replace "<" with "& l t ;"
    remove spaces in "& l t ;" when u paste it in ur code
    in my previous 2 replies i entered it with out spaces and it was getting converted to "<"The forum engine parses HTML entities. So just replace the & by its HTML entity &amp; and it will work: &lt;.
    But no, this is not going to work. JavaScript doesn't recognize HTML entities as operators.
    Follow the suggestion rlubke gave. Or, even better, put all Javascripts in its own .js file and include this file in the HTML head.

Maybe you are looking for

  • FPB7 Create Payment Lot after loading Manual Bank Statement

    Hello Everyone, My question is can we create payment lot after loading Manual Bank Statement(FF67). Thanks,

  • Switch from AI CS3 to AI CS5

    Hi to all, I worked in Adobe Illustrator (AI) CS3 before installing the trial version of AI CS5 and i was created some files with FZ BASIC 18 font. And now when i open this files and save that to pdf format isn't the same font. Is like  'bold' and th

  • Report/Concurrent Request shortcut on desktop..

    Hi All I want to create a shortcut for a report/concurrent request which I use frequently. I dont want to login into Oracle Apps. I just want to run the report/concurrent request by clicking on the shortcut and giving the parameters. Is it possible i

  • Retrieving field from original records based on current related records transaction date

    Post Author: Barbara W CA Forum: Data Connectivity and SQL I've been working with Crystal for awhile but am having trouble figuring out how to tell CR what I need to pull from a ledger table I am working with. I need to identify fees and costs writte

  • Edit tag in "Contact" results in crash

    System: iOS 8.1.3 Device: iPhone 5S Description: I tried to edit the tag of phone number of contacts. In the contact, I edited someone then stroked a tag of phone number, here came the list of tags, including the default tags and my customized tags.