How to sort view object in backing bean

Hello all ,
I want to dispaly read only table in sortable way depending on one of attribute value.
in backing bean I am trying to execute query by executeQuery method but it didn't work
I have put column sort property to true but it does not work..
please help me..
I am using Jdevloper 11.1.1.2.0
If any one required more details please post

Hi,
One way to achieve this is, add a method in your vo which does something like this
  public void customSortBy(String columnName){
  this.setOrderByClause(columnName);
  this.executeQuery();
  }Expose this method as client interface and add it to your pagedef as method binding.
Once you are done, you can execute method from backing bean by passing the sorting parameter according to your need.
-Arun

Similar Messages

  • How to access query based view object in backing bean

    Hi
    I am using JDev11.1.2.1.0
    I want to use the query result of query based view object in backing bean.
    How can i do the same
    Please Solve this
    Thanks

    Hi,
    Assuming ADF is in the picture
    1. Create a PageDef file for the page (right mouse click "Go to Page Definition")
    2. In the Executable section, create an iterator for the View Object
    3. In the managed bean:
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("name of Iterator");
    iter.execute();
    // ... navigate the iterator rows ...//
    Frank

  • Getting data from view object into backing bean

    Hi,
    My requirement is explained below -
         I have a ADF editable table in a jsf page which is connected to backend database table. In the table there are 6 columns and only 2 are editable. So when user inputs a value in first input column an event is triggered such that the data for all the remaining columns should be fetched from another database table.
    Typically if we are not using ADF development environment. We would have had a simple business method which creates the sql query by taking the input from textbox with simple where clause and I would have got the data. I am not getting any idea how to do this in ADF. I have the second table as view object but how to access the view object from backing bean and get data based on the input given.

    Hi,
    step 1) Expose a method on the ViewObject Impl class
    step 2) define arguments for the method as needed to identify the row to read data from
    step 3) retrieve the row from the VO that holds the data you want to add and return a HashMap with this information
    step 4) expose the method on the client interface (Java menu selection on the View Object)
    step 5) In the PageDef file, create a method binding to the method you exposed on the ViewObjectImpl
    step 6) Call the method binding from the managed bean like
    OperationBinding getDataFromVO = (OperationBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("Name of method binding);
    getDataFromVO.getParamsMap().put("name of arguments1", value1);
    getDataFromVO.getParamsMap().put("name of arguments2", value2);
    Object retData = getDataFromVO.execute();
    if(retData != null && getDataFromVO.getErrors().size()==0){
      HashMap retDataMap = (HashMap) retData;
    ... follow the rest of your logic ....
    Frank

  • Modifying where clauses for View Objects in Backing Beans

    In studying the RichTable class I saw no get/set methods that would allow me to manipulate the underlying view instance and rowset for the table in the Backing Bean. I know there is a way to do it, but I having great difficulty in finding it. The tutorials show how to build view objects and display them, but I haven't seen a tutorial that show how to respond to events from the Web page and directly change the data model and what is displayed via the backing bean.
    Can some one point to a tutorial or give me an example on how I can change a view object via a backing bean?

    What you want to do is add a method to your View Object Implementation class that changes the WHERE clause with setWhereClause or addWhereClause. Expose the method to your client. Then call the method from your page by binding it to a commandButton or commandLink. You can bind it through a pageDef file or a backing bean.

  • How to decide when to keep backing bean in request and session.Pros/cons

    How to decide when to keep backing bean in request and session.Pros/cons

    Depends on where the bean data must be available. Start with request scope. If you need the data in session scope, then think twice about impacts (memory usage, multiple browser tabs, etc) unless the data is obviously targeted on the session scope (loggedin user, user settings, dropdown data, etc).

  • 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

  • How to track PropertyChangeEvent for the backing beans?

    Hello
    I'm working on JSF 1.2 + JDK 1.6. Would like to know wether any direct support for tacking the PropertyChangeEvent for the backing bean. Objective is to keep track of the modified entities ( backing bean) and update the corresponding Database records at later stage with the modified attribute/record.
    E.g:
    Assume a datatable is populated with list, and 3 rows alone is modified, So the DB update is supposed to happen only for those rows. I prefer to have the PropertyChange tracking logic in one place. Dont want to add PropertyChangeListener for all backing beans.
    Can anybody help me on this.
    Thanks in advance
    Jobinesh
    Edited by: JobineshP on Jun 20, 2008 6:52 AM

    This is no direct support in JSF for PropertyChangeEvents.
    As for other solutions to your problem, first looking specifically at the database updates, Hibernate tracks modifications to fields and can be configured to only update the needed columns (see the dynamic-update attribute). So perhaps Hibernate can suit your needs or you could use their techniques to solve your problem.
    Taking a wider view of the general problem of adding PropertyChangeListeners to managed beans, I would be inclined to use Spring and AOP to add the PropertyChangeEvents to all the setters. Spring might also help the configuration of the PropertyChangeListeners. Although I have to say that I think that PropertyChangeEvents are of limited use in a web application.
    Another approach might be to hook into the JSF EL expression engine. You could add a special ELResolver whose purpose is to discover when the property changes happen. The drawback is that all the setting must be done via the EL in order for this to work.

  • H:inputText ; How To initialize value Property from back/bean method?

    Hello Guys at Sun Forums.
    I am a newbie at using JSF. and I'm having a bit of a Problem.
    I don't know how to initialize the value property of a h:inputText from a method inside a backing bean that returns a String data type.
    My Method inside the Backing bean is this:
    public String getLastDate()
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            Date DateCapt = null;
            String DateConv= null;
            try{
                Class.forName("com.sybase.jdbc2.jdbc.SybDrive").newInstance();
                con = DriverManager.getConnection("jdbc:sybase:Tds:localhost/BAN_PRO_SNP", "xxxx", "xxxx");
                if(!con.isClosed()){
                    stmt = con.createStatement();
                    stmt.executeQuery ("SELECT TOP 1 CONVERT(VARCHAR(10), fec_parametro, 103) fec_parametro FROM snp_sei_parametros" +
                    "     WHERE cod_parametro = 'FECHA'" +
                    "     ORDER BY fec_parametro DESC");
                    rs = stmt.getResultSet();
                    while (rs.next())
                                DateCapt = rs.getDate("fec_parametro");
                rs.close();  
                stmt.close(); 
            catch (Exception ex)
                        System.out.println("COULD NOT LOAD THE DRIVER!!!!");
                        System.out.println(ex);
                    DateConv = String.valueOf(DateCapt).toString();
        return DateConv;
    }As you can see the Method returns a String data type, and all I want to know is how put that returned String as the initial value of a h:inputText. when the jsf-jsp page loads.
    Please Help Me.

    You should be able to do
       <h:inputText value="#{bean.lastDate}"/>Where 'bean' is the managed bean name containing
    the method getLastDate().
    When the view is rendered, the getter (getLastDate())
    will be called to display whatever value is returned.

  • Sort view object rows with transient attributes

    Hi ,
    Is it possible to sort the results of a view object based on the populated transient attributes ?
    Best regards
    K

    K,
    Have you had a look at section 27.5 of the ADF Developer's Guide for Forms/4GL Developers ("Performing In-Memory Sorting and Filtering of Row Sets") - I've not tried it with transient attributes, but it does describe how to do in-memory sorting, as opposed to the normal way of sorting which is to send an ORDER BY to the database.
    Hope this helps,
    John

  • How to filter View Objects on Main Page - Unbounded Task Flow

    Hi All,
    Version: 11.1.1.4
    I have a scenario where I am trying to filter the Employee information by EmployeeID and show their related Items. I can do this if I encapsulate Employee and / or Items in bounded task flows and expose their view Criteria in methods that I am setting on the App Module. I could also add the bind variable to the View Object queries. The problem I am having is that I want to display a pop up based on the item they select. My issue is that I can't seem to figure out how to either grab the item row selected and pass it to the pop up (Can't create a control flow from a page fragment to a page - which as far as I can understand the pop up in the task flow has to be a page and not a page fragment) or drop the employee view object and item view object on the main page and have them be filtered.
    So basically two issues:
    1. If I use the Employee and Item bounded task flows and place them as regions on the main page then I am having difficulties passing the row selection (item selected) and pass it to my pop up window (another task flow).
    2. If I place the employee and item view objects on my main page the original methods I am using to filter the data are not getting called at all. I have tried placing them in the adf-config task flow prior to my main page view and going into my main page page def and adding them as method calls in the binding.
    I am sure I am doing something wrong or maybe even creating an invalid approach, but I should be able to filter my employee and item data on load within my unbounded task flow or use the data within my bounded task flows and generate a popup with data I am collecting from my item row.
    As always greatly appreciate the feedback....still really ignorant with ADF.
    --S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I figured out the issue Shay. I didn't have my pageFlowScope value set on the task-flow-call. So I had the parameter name and value set on the input of my downstream bounded task flow, but when I add the control to call the task flow I didn't have the task-flow call value set. That piece was not intuitive to me. It makes sense that it would have to know how to pass the value.....just wasn't sure where it should be set.
    --S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to access an object in a bean

    I am looking for a way to access an object in a bean and make available to the page.
    for example if i have a Bean called User and it contains an attribute Called Company as an attribute in User. Now I have User.getCompany(). and I can do this
    <%User user = request.getUser();
    Company company = user.getCompany();
    request.setAttribute("comp", company); %>
    how do I do this with useBean ?

    I am looking for a way to access an object in a bean
    and make available to the page.
    for example if i have a Bean called User and it
    contains an attribute Called Company as an attribute
    in User. Now I have User.getCompany(). and I can do
    this
    <%User user = request.getUser();
    Company company = user.getCompany();
    request.setAttribute("comp", company); %>
    how do I do this with useBean ?You can access a JavaBean Object property of another JavaBean inside the JSP with the use of EL (Expression Language)
    So if you are using JSP 2.0 or higher try this:
    <jsp:useBean id="user" class="your.package.User" scope="request"/>
    ${user.company.id}I tested the above and it works.
    Note that you need to set the Company object in the User object before trying to access it inside the JSP.
    You can also set it in the JSP if you want, (before trying to access it), but its cleaner to do it in a Servlet.
    Both User and Company must follow JavaBeans notation.
    So in the above case the User object is something like this:
    package your.package;
    public class User{
       private Customer customer;
       public User(){}
       public Customer getCustomer(){
          return customer;
       public void setCustomer(Customer customer){
         this.customer = customer;
    }And your Customer JavaBean is something like this:
    package your.package;
    public class Customer{
       private int id;
       public Customer(){}
       public int getId(){
         return this.id;
       public void setId(int id){
         this.id = id;
    }

  • How to use view objects in entity impls?

    Hi!
    I would like to access a view object to implement business logic
    in an entity impl class method. How can this be done? More
    precisely I would of course like to do this in the context of
    the "current" Application Module the Entity "lives" in. I think
    this has to be possible because you can use a list validator for
    an entity objects attribute, which gets it's data out of a view
    object.
    Any help would be very welcome!
    Regards
    Stefan

    Stephan,
    Just to make things clear, View Objects access Entity Objects
    and you should implement your busines logic in the entity
    objects. This is the way BC4J was designed. It allows for
    reuse of your components and build different views (View
    Objects) ontop of Entity Objects.
    View objects do query the database and populate the entity
    objects. However, it is from the cached data in the entity
    objects where DML occurs (insert, update, delete). You want to
    put your validation at this level because you do not want to
    make a trip to the database if it does not validate.
    I recommend reading a whitepaper on J2EE development and
    BC4J. The URL
    http://otn.oracle.com/products/jdev/htdocs/j2ee_with_bc4j/j2ee_wi
    th_bc4j.html.
    Happy Reading!
    Hi!
    I would like to access a view object to implement business logic
    in an entity impl class method. How can this be done? More
    precisely I would of course like to do this in the context of
    the "current" Application Module the Entity "lives" in. I think
    this has to be possible because you can use a list validator for
    an entity objects attribute, which gets it's data out of a view
    object.
    Any help would be very welcome!
    Regards
    Stefan

  • HT4865 How can I view what was backed up in icloud

    How can I view my stuff that was backed up in icloud

    You are wrong. The data shown at www.icloud.com is not the contents of an iCloud backup. That is the data which is 'synced' between devices and computers - it is not a backup.
    You should learn the difference between an iCloud backup data, and iCloud synced data. They are not the same.
    Read http://support.apple.com/kb/HT4859 about what an iCloud backup is and what it contains.

  • Is it recommended to instantiate Model object from Backing Bean

    Wondering what are the best practices in developing JSF,Spring, Hibernate application.
    Appfuse/Equinox example instantiate Model Object i.e. POJO in the Backing bean. Here is the snippet
    UserForm.java (Backing Bean)
    public class UserForm {
    public User user = new User();
    public UserManager mgr;
    // Getter & Setter methods for user & mgr
    //Persistence
    public String save() {
    mgr.saveUser(getUser());
    addMessage("user.saved", getUser().getFullName());
    return "success";
    I undertand the purpose of having UserManager defined in backing bean but wondering why do we need to have Model (i.e. User) defined in backing bean . Is this a best practice?
    Is it recommended to populate model object with data in the backing bean and then call for business methods like mgr.saveUser(getUser());
    Regards
    Bansi

    Here is some more info
    UserForm is a JSF managed bean,
    User is a hibernate mapped POJO, and
    UserManager is manager class in Spring
    I am wondering about perfomance issues i.e. making DB calls from backing bean getters or setters. DB calls can mean a performance hit, and JSF will call the getters and setters multiple times per page request (which means you'll be doing multiple DB calls).

  • How to handle exception on a backing bean constructor ?

    Hello,
    I would like to handle the exceptions throw on the constructor of a backing bean, and redirect the user to a "service not available" page.
    When I use "request.sendRedirect()" method to redirect the user to such page, I logically got an "IllegalStateException: Cannot forward a response that is already committed".
    Do you have any idea how can I redirect or forward a user to a page when the response is already commited? Is it possible to use servlet filter and do a forward after the doFilter()?
    Thank you.

    Just throw the exception and map an error page in the web.xml.
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>error.jsp</location>
    </error-page>

Maybe you are looking for