How To Customize displaying  of JSP page From Backing Bean

I would like to customize the displaying of jsp page from backing bean based on user Roles
For example
- if the Role is Admin then backing bean should display Admin.jsp
- if the Role is Guest then backing bean should display Guest.jsp
Any pointers/suggestions will be highly appreciated
Regards
Bansi

Thanks to all for providing thoughts
I wanna make it more Dynamic. In the sense
"Backing Beans should drive the rendering of first jsp page in the application " and not jsp page driving the backing bean or not to put some kind of hard coding in jsp page to see if its admin user then display certain set of UI Components or certain set of other UI components for other users.
As we have atleast 10 different Roles and there can be Composite Roles i.e. combination of two roles. In this case how does the Backing Bean drives the rendering of jsp page?
Regards
Bansi

Similar Messages

  • HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH

    Hi,
    HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH?
    Thanks

    emekaco wrote:
    Hi,
    HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH?
    ThanksSTOP SHOUTING!
    now, while displaying the form generate some random number, or take the current time in millis or whatever. Put that number in a hidden field. Insert that unique number along with the real data into the database, but before you do check if the number already exists. If it does you can be pretty sure this is a resubmit of the same data, so don't allow it. This is one way of many to prevent resubmission of existing data.
    A good way to prevent a refresh from resubmitting altogether is to do a redirect to a result page right after you deal with the POST request. When the user presses refresh then, he/she will refresh the redirect and not the form submit.

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • How to develop and Run .jsp page from Jdeveloper 10g

    Dear All,
    I need to develop one small JSP page using Jdeveloper10g. pls share information How to develop and Run .jsp page from Jdeveloper 10g.
    Thanks in Advance,
    Hanimi.

    Hi Gyan,
    Any Idea how to get DB connection for JSP Pages.
    Our Java guys developed one JSP page for Login page.
    After Log in instead of standard responsibilites page we calling custom jsp page, For getting DB connection they defined one properties file and hard coded DB details on that file and calling, but client is not accepting hard coding.
    Pls give any idea for getting DB connection directly in JSP pages.
    Hanimi.

  • How to set title of jsp page from resource bundle

    hi ,
    How to set title of jsp page from resource bundle....

    Depends on how you configured and declared the resourcebundle in your JSP. The usual way is just<title>${resourceBundle.messageKey}</title>

  • How can i call a taskflow methode from backing bean ??

    Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    i like to call a Methode (taskflow) from backing bean!
    my bean code :
        public void imageLinkActionListner(ActionEvent actionEvent) {
            String              id      = actionEvent.getComponent().getId();
            int                 linkID  = Integer.parseInt(id.substring(4));
            DCBindingContainer  bc      = (DCBindingContainer)ADFUtils.getBindingContainer();
            DCTaskFlowBinding   tf      = null;
            System.out.println("Region Change...."+id+" INT "+linkID);
            switch (linkID) {
                case LINK_CALENDAR_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("calendartaskflowPage");                   
                break;
                case LINK_MAIL_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("mailtaskflowPage");                   
                break;
              case LINK_ADDRESS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("addresstaskflowPage");                   
              break;
              case LINK_BLOGS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("blogstaskflowPage");                   
              break;
              case LINK_MAPS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("mapstaskflowPage");                   
              break;
            default:
                return;
            if (tf != null){
                uiMainRegion.setRegionModel(tf.getRegionModel());
                uiMainRegion.setValue(tf.getRegionModel());
                tf.getExecutableBindings();
                AdfFacesContext.getCurrentInstance().addPartialTarget(uiMainRegion);
        }i like to call *#{backingBeanScope.mapBean.initMap}*
    my taskflow source
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="map-task-flow">
        <default-activity id="__1">map</default-activity>
        <view id="map">
          <page>/map/map.jsff</page>
        </view>
        <method-call id="initMap">
          <method>#{backingBeanScope.mapBean.initMap}</method>
          <outcome id="__7">
            <fixed-outcome>init</fixed-outcome>
          </outcome>
        </method-call>
        <control-flow-rule id="__2">
          <from-activity-id id="__3">initMap</from-activity-id>
          <control-flow-case id="__5">
            <from-outcome id="__6">init</from-outcome>
            <to-activity-id id="__4">map</to-activity-id>
          </control-flow-case>
        </control-flow-rule>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>

    Hi,
    to call the bean, use the EL in Java and reference #{backingBeanScope.mapBean.initMap} as a method expression. If you try and access the bean directly then chances are that the instance is not available. Using EL from Java always guarantees this
    Frank

  • How to reset RichSelectOneChoice in JSF form from backing bean method?

    resetValue() is not working in this case. So any other method to reset from backing bean?

    Did you store the component instance on a bean by selecting a “Binding” property of the “RichSelectOneChoice” component?
    yourPage.jspx:
       <af:selectOneChoice
    binding="#{myBean._selectOneChoice}">
      </af:selectOneChoice>myBean.java:
        private RichSelectOneChoice _selectOneChoice;
        public void set_selectOneChoice(RichSelectOneChoice _selectOneChoice) {
            this._selectOneChoice = _selectOneChoice;
        public RichSelectOneChoice get_selectOneChoice() {
            return _selectOneChoice;
        private void rerenderSelectOneChoice() {
            AdfFacesContext.getCurrentInstance().addPartialTarget(this._selectOneChoice);
    }

  • How to customize an existing OAF page from Oracle, change it and reload it

    Hello all Oracle Developers,
    I am having a question regarding to customization, basically I am going to follow a very simple example.
    We have form: APXVDMVD and OAF web Page AP_APXVDMVD.
    Applying all our custom code via forms personnalisation is piece of cake. However trying to apply the same code to OAF web Page AP_APXVDMVD
    is a total back box for us.
    The basic example seems like this: Suppose that in the Suppliers/Vendors Page we type the supplier name and then right after that we populate in consequence all the fields:
    Taxpayer ID, Tax Registration Number, DUNS Number
    We want to grab the OAF Web page from oracle apply the custom code in java code or whatever necessary to make it work and deploy it onto the server.
    Is this achievable, if so how we can do it??? Can we grab the web page extend the classes that are necessary and deploy the solution. The demo provided from Oracle
    is showing how to create pages from zero, however Oracle have not provided how to grab an existing applications page, put the code and the deploy it
    Let me know any inputs, whatever you did and surely we will be sharing the same stuff all migration R12 long :-)

    Hi,
    You can extend OA framework pages and customize them. There is also a section for customizations in the OA Framework Developer's guide. IF this requires extensive customizations, Iwould advice to be very careful as any extensions should not interfere with the base logic of the pages. Please post here if you need more details.
    The following blog is a good one for some examples.
    http://oracle.anilpassi.com/oa-framework-extending-controller-steps-2.html
    There is also a course for the same if you are interested.
    http://education.oracle.co.uk/html/oracle/15946US/D18280GC10.htm
    Hope this helps..

  • How to assign and display an attribute value from backing bean?

    Hello all,
    I am using Jdev 11g. I have a form page which has two inputText attributes The first one implements a valueChangeListener feature. When the user enters a value in the first field, a backing bean function will be invoked through the valueChangeListener . In this backing bean function, based on the value in the first field, I want to assign the value to the second field and display it on the page. Can somebody help me how to achieve this?
    Thanks,
    John

    Hi John,
    Here is small example.
    Create two string variables in your backing bean and generate accessors for them.
        private String text;
        private String text1;
        public void setText(String text) {
            this.text = text;
        public String getText() {
            return text;
        public void setText1(String text1) {
            this.text1 = text1;
        public String getText1() {
            return text1;
        }Bind this variables to the value property of the input texts you have. Add the valuechangedlistener for the first input text (and also set autosubmit to true for that item). Also, add the id of the first input text as partial triggers for the second input text. Like,
            <af:inputText label="Label 1"
                          binding="#{backingBeanScope.backing_untitled1.it1}"
                          id="it1"
                          valueChangeListener="#{backingBeanScope.backing_untitled1.textValueChanged}" autoSubmit="true"
                          value="#{backingBeanScope.backing_untitled1.text}"/>
            <af:inputText label="Label 2"
                          binding="#{backingBeanScope.backing_untitled1.it2}"
                          id="it2"
                          value="#{backingBeanScope.backing_untitled1.text1}"
                          partialTriggers="it1"/>Finally, put the logic on your value changed listener. Like,
        public void textValueChanged(ValueChangeEvent vce){
            this.setText1("Hi " + vce.getNewValue());
        }Now, when you run the page and enter your name in the first input text, the second input text will display Hi <your_name>
    HTH.
    -Arun

  • Target Servlet in page from backing bean.

    Hi,
    How do I render a servlet in a page from a backing bean instead of a new page as it currently doing.
    the backing bean consists of...
    String url = "/ScriptOutputServlet?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().dispatch(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I suppose my question is how do I add a target into the URL to render back into a frame on the original page for example?
    Thanks in advance

    First off, let me thank you for all your replies, your help is much appreciated.
    What I'm trying to achieve is for the user to be able to click a command link which is a shell script and have the stdout of the script returned to the same page. Please let me know what info/code you need.
    From the jsf page...
    <h:commandLink action="#{executeBean.executeScript}" immediate="true" styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" actionListener="#{t.setNodeSelected}" >
                                                <t:graphicImage value="../images/document.png" border="0"/>
                                                <h:outputText value="#{node.description}"/>
                                                <f:param name="docNum" value="#{node.description}"/>
                                            </h:commandLink>
                                        </h:panelGroup>
                                    </f:facet>
                                </t:tree2>
                                <jsp:include page="/ScriptOutputServlet" />
    public void doExecute(String command)
            String url = "/faces/private/main.jsp?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().redirect(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I'm hoping I'm making some more sense...
    Many thanks again,
    nick
    Edited by: nickbeenham on Dec 26, 2007 9:38 AM

  • To add components in JSF page from backing bean

    I am trying to display list of available files under a directory using HtmlSelectOneMenu. In constructor of backing bean i have the following code
    directory = new File("C:\\files");
        files = directory.list();
        String[] fileList = this.getFiles();
        List valueList = new ArrayList();
        for (int i=0; i < fileList.length; i++) {
            SelectItem item = new SelectItem(fileList);
    valueList.add(item);
    UISelectItems items = new UISelectItems();
    items.setId("items"+sessionVariable);
    items.setValue(valueList);
    listbox = new HtmlSelectOneMenu();
    listbox.setId("listbox"+sessionVariable);
    listbox.getChildren().add(items);
    getPanelGrid1().getChildren().add(listbox);
    and my jsf looks like this <!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"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>Employee</title>
    <link type="text/css" rel="stylesheet" href="resources.css"/>
    <style type="text/css">
    body {
    background-color: #ffffff;
    a:link { color: #000000; }
    </style>
    </head>
    <body><h:form binding="#{backing_SampleEdit.form1}" id="form1">
    <h:panelGrid columns="2" binding="#{backing_SampleEdit.panelGrid1}"
    id="panelGrid1" >
    <h:outputLabel value="Template Name"
    binding="#{backing_SampleEdit.outputLabel1}"
    id="outputLabel1"/>
    </h:panelGrid>
    </h:form></body>
    </html>
    </f:view>
    <%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_SampleEdit--%>
    I am getting an exception like "Cant instantiate the class exception"..
    please help me out in this..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The Stacktrace looks like this
    SEVERE: Managedbean backing_SampleEdit could not be created Can't instantiate class: 'com.backing.SampleEdit'.. class com.backing.SampleEdit : java.lang.NullPointerException
    javax.faces.FacesException: Can't instantiate class: 'com.backing.SampleEdit'.. class com.backing.SampleEdit : java.lang.NullPointerException
         at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:229)
         at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:282)
         at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:97)
         at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:145)
         at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:166)
         at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
         at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
         at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:406)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1019)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1046)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:761)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:451)
         at com.sun.faces.taglib.html_basic.FormTag.doStartTag(FormTag.java:345)
         at SampleEdit.jspService(_SampleEdit.java:60)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
    Caused by: java.lang.ClassNotFoundException: class com.backing.SampleEdit : java.lang.NullPointerException
         at java.beans.Beans.instantiate(Beans.java:208)
         at java.beans.Beans.instantiate(Beans.java:48)
         at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:223)
         ... 45 more
    Caused by: java.lang.NullPointerException
         at com.backing.SampleEdit.<init>(SampleEdit.java:53)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at java.lang.Class.newInstance0(Class.java:350)
         at java.lang.Class.newInstance(Class.java:303)
         at java.beans.Beans.instantiate(Beans.java:204)
         ... 47 more

  • How to directly call business object class from backing bean class

    I woul like to call business object class directly from the backing bean class and implement methods in BO. If possible can anyone give an example code.
    Thanks in advance

    Which problems are you occurring then? I really don't see problems. You're just free to access and invoke them.

  • How to open a JSP page from a form ??? plz help

    hi ..
    i want to know how to open a jsp page from a oracle apps form using a button .
    the requirement is that whenever we click on the button created on the form, it opens a jsp page.
    plz help me ..its urgent !! :-(

    In portlet project, to navigate between pages, you should not use the URL property to link to a page. Instead, portlets use navigation via action handling. You use the Page Navigation editor to set up links to pages; that is, the navigation editor sets the action property.
    Here is an example to hyperlink ans button to open a new page:
    # From within the IDE, create a new portlet project. This action creates the project and one page, PortletPage1.jsp.
    # Create a second portlet page, called PortletPage2.jsp, for the project.
    # Drop a Hyperlink component onto the first portlet page, PortletPage1. (You can drop the Hyperlink on the page in the Design window or on the PortletPage1 node in the Outline window.) Change the Hyperlink's text property to Next Page.
    # Drop a Button component (found in the Basic section of the Palette) onto the second portlet page, PortletPage2.
    # Open the Page Navigation Editor. It displays the two pages (PortletPage1.jsp and PortletPage2.jsp) of the application.
    # Click the PortletPage1.jsp icon in the Navigation window to expand it, and then drag a connector from hyperlink1 to PortletPage2.jsp. Change the name of the connector from case1 to Page2.
    # Click the PortletPage2.jsp icon in the Navigation window to expand it, and then drag a connector from button1 to PortletPage1.jsp. Change the name of the connector from case1 to Page1.
    # Run and deploy the portlet. The browser displays PortletPage1 and you should see the Next Page hyperlink. When you click the Next Page hyperlink, the Apache Pluto Portal server displays PortletPage2. Click the Page2 button to return to PortletPage1.
    Sherry
    Creator Team

  • How to invoke a jsp page from java which does not use Servlets?

    Hello,
    I am working in Documentum. I am trying to invoke a jsp page from another java page which does not use Servlets.
    I tried doing this by just instantiating the java class related to the jsp page from my present java class.In my java class related to the jsp page, I have defined onInit() and onRender() methods.
    Now, I am trying to call the jsp page from my present java class by just instantiating the java class related to the jsp page. This throws a java.lang.NullPointerException.
    Any comments or suggestions on this.Any help would be appreciated.
    Thanks,
    Ranjith M.V

    RanjithM.V wrote:
    Hello,
    Thanks for the reply. One important thing I forgot to mention. I am also using xml component.And?
    As this is the standard way used for coding in Documentum, I do not want to use Beans.Well, JSP's should, in and of themselves, contain no functional code. It should all be only display.
    Without that is it not possible?What did I say? I said,
    masijade wrote:
    It is possible, but I very, very, very, much doubt, that it would be worth the effort.And, if you don't know how, a forum is not truely going to be able to help you implement it (at least not in less than a few years time, at which point it would be outdated).
    >
    Appreciate your understanding and help.
    Thanks,
    Ranjith M.V

  • How can I link to a jsp page from another jsp page within websphere portal?

    Afternoon all,
    I have a websphere portlet which displays a jsp page. I want to put a hyperlink on the jsp page which when clicked will open another jsp page.
    Does anyone know how to do this?
    Thanks,
    Alex

    The anchor tag is the correct one for generating clickable links.
    <jsp:forward> is for transferring control at the server end. Its when you decide to change which page you want to show the user. ie check user is logged in. If not then forward them to login page, else display current page.
    I tried that. It does open the jsp page
    but the place and page links in the portal theme get screwed up.Whats mucked up about them? Do they point where they shouldn't?
    You might try using a <base> tag to set where relative links are resolved from.
    Cheers,
    evnafets

Maybe you are looking for

  • Error message when transferring purchases

    When I try to transfer my ringtone purchases to itunes from my 3GS I get a error message..." Attempting to copy to the disk 'Macintosh HD' Failed. The Disk could not be read to or written from". My ringtones were purchased directly from the iTunes st

  • Multiple sections, each section different first/next page headers

    Hi, Ï'm developing a PO (purchase order)-document. This document has 2 sections. First sections contains PO-documents. Second section contains PO-copies. First section has different header for first page and next pages for each seperate PO. So multip

  • How do i copy and paste signature to pdf file

    how do i copy and paste my signature to a pdf. file

  • New to computers New to programing New to java

    I downloaded jdk1.3.1 and it installed itself into C:\jdk1.3.1, I followed the tutorial on this site `your first cup of java` but the first example would'nt compile. The tutorial suggested typing in the path manually to javac which I did and got the

  • Using PDF files on my 5320

    Hello guys, I uploaded a couple of pdf files on my 5320 for the first time a couple of days ago but Im having a problem. When I try to open them on the phone nothing happens.  Can anybody help me with this?