How to access a session variable just before rendering a JSF page???

Dear Sirs...
i am using jdeveloper 10.1.3.2 with JSF and ADF faces. i want to access a session variable and perform some processing just before rendering a page. how can i achieve this????
i am a little new to jsf, so i feel a little lost
thanks for any help in advance, and best regards

<p>
Hi,
</p>
<p>
See example 60 &quot;<strong>Triggering OnPageLoad-Style Code in a JSF Backing Bean Using ADF PagePhaseListener or PageController</strong>&quot; on Steve&#39;s Muench blog.
</p>
<p>
Kuba 
</p>

Similar Messages

  • How to access the hidden variable in jsp

    hi all,
    i need help to know how to access the hidden variable in the same jsp.
    Following is the code snippet just have a look at that.
    ArrayList arrRankingSummary = (java.util.ArrayList)session.getAttribute("arrRankingSummary");
    <logic:iterate id="rankingSummary" name="arrRankingSummary">
    <input type="hidden" name="allApplicantID" value='<bean:write name="rankingSummary" property="APPLICANTID"/>' />
    <input type="hidden" name="allAdmissionRank" value='<bean:write name="rankingSummary" property="ADMISSIONRANK"/>' />
    </logic:iterate>
    <input type="hidden" name="applicantID" value='<bean:write name="rankingSummary" property="APPLICANTID"/>' />
    <TD align=center><Input type=Text name="admissionRank" class=Textverysmall size=2 value='<bean:write name="rankingSummary" property="ADMISSIONRANK"/>' maxlength="10" /> </TD>
    I want to remove the element from arraylist on these condition
    if(allApplicantID.value ==applicantID.value){
    arrRankingSummary .remove("admissionRank");
    Now the pbm is i m not getting how to access the hidden variable in jsp or how to use the values of hidden variable for the condition.
    Pls help me out.
    Thanks in adv.
    Regards,
    Ritu

    hi ram,
    as i mentioned i m creating hidden variables & i m doing some validation on form submit.
    The following is js code snippet for validation.
    for (var i = 0; i < document.forms[0].admissionRank.length; i++)
    admissionRank = document.forms[0].admissionRank.value;
    for(var j = 0; j < document.forms[0].allAdmissionRank.length; j++)
    //alert ("admissionRank : " + admissionRank + " document.forms[0].allAdmissionRank[" + j + "].value : " + document.forms[0].allAdmissionRank[j].value + "\ndocument.forms[0].allApplicantID[" + j + "].value : " + document.forms[0].allApplicantID[j].value + " document.forms[0].applicantID[" + i + "].value : " + document.forms[0].applicantID[i].value);
    if(admissionRank == document.forms[0].allAdmissionRank[j].value && document.forms[0].allApplicantID[j].value != document.forms[0].applicantID[i].value && admissionRank != "" && document.forms[0].allAdmissionRank[j].value != "")
    flag = false;
    document.forms[0].admissionRank[i].focus();
    document.forms[0].admissionRank[i].select();
    break;
    if (flag == false)
    break;
    In this validation i want admissionRank to be removed from the original arraylist if following condition gets satisfied
    "(document.forms[0].allApplicantID[j].value == document.forms[0].applicantID[i].value )"
    Thanks in adv
    Ritu

  • Access to Session variables in XSL via insert-request

    We using the Transform="MyInsert.XSL" on the Insert-Request. How do we reference Session variables in the XSL?
    Thanks

    [list=1]
    [*]Add a top-level <xsl:param> to your stylesheet to define a top-level stylesheet parameter, for example <xsl:param name="foo"/>
    [*]Use <xsql:set-stylesheet-param name="foo" value="{@session-var-name}"/> in your XSQL page before your <xsql:insert-request> to set the value of the top-level stylesheet parameter named "foo" to the value of the session parameter you want.
    [list]

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How to Create a Session variable in JSP?

    How to create a session variable and add attributes to it?
    For example i want to create a session variable called "name" and add value "user" to it? if i try to do it with setAttribute(), it is giving error as both is of type string? how to do it? kindly help me

    This is variable what is working in my aplication
    String variable;
    if(user == null){
                   user=new String("");
         }//if you don'y do this you will have null pointer exception
    session.setAttribute("user",user);//put value
              String name=(String)session.getAttribu("user");      //get value;
    I hope this will help

  • How to create a session variable in Apex?

    Hello colleagues,
    Is there someone do know how to create a session variable in Apex?
    How to get them?
    Thanks
    Best Regards

    Hello,
    What do you mean by 'session variable'? You mean something that stores the value int he users session state?
    I really recommend reading the 2-Day Developer guide documentation, there is a complete section on session state -
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/concept.htm#CIHCFHBD
    Hope this helps,
    John
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd

  • How can we use Session Variable in Answers or Analysis?

    How can we use Session Variable in Answers or Analysis?

    Again, duplicate cross-posting!
    See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue)

  • How to set a session variable

    Hi,
    I would like to know how to set a session variable for the following purpose.
    At the top of my application I have a "Welcome <username>" I'd like it instead to have "Welcome <firstname> <lastname>".
    So the concept would be after the user logs in succesfully this session variable is dynamically set so it can be displayed.

    Hi Scott,
    I realize that I can set items etc in pages. The case I'm referring to is a reference in a template. My template has a "Welcome <user name>" ... so the code looks like "Welcome &APP_USER." Anyway to make it say "Welcome first_name last_name" in the template? Note I'll have to get the first/last names from a query
    Thanks,
    Marty

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • Accessing entity class field values in a visual JSF page

    There is a convenient way to access a session values into a JSF visual page using the following:
    String mySessionValue = (String) getValue("#{sessionScope.name}");Like the same, are there any ways to access entity class field values into a visual JSF page? Are there any concepts similar to "entityClassDataProvider" that can be linked to a table component in a visual JSF page?
    Thank you.

    My question is about (Netbeans visual pack) Java Persistence API and how to display the information from an entity class to a JSF page. But the above mentioned tutorial is about the ordinary visual table presentation.
    Thank you.

  • How to use a session variable in Conditional Format?

    Hi Gurus,
    I created a session variable , called Actual_date,
    using the following SELECT:
    SELECT SYSDATE FROM DUAL
    In a report title the following expression worked fine:
    @{biServer.variables['NQ_SESSION.Actual_date']}
    I red in a reply in this forum, under the
    "Oracle BI EE Variables Overview"
    that we can use the above format in Cond.Format.
    However I got an error:
    "The value entered msut date and Time..."
    Any tips?
    Thanks
    Laszlo

    It's because when you fired
    SELECT SYSDATE FROM DUALYour variable have a LONGVARCHAR type (if I remember)
    Check here how to find the data type.
    http://gerardnico.com/wiki/dat/obiee/obi_server_variable_find_value
    If you just need to get the current date, you can try the system presentation variable current time as :
    @{system.currentTime} Good luck
    Nico

  • How to call a session variable into sql?

    for example, I have a coldfusion session variable - session.testvar
    I am writing a Stored procedure in sql server 2000. The query within my stored procedure needs to insert a value into a table. The value needs to be my CF session variable. I have no idea how this is done, does anyone else have a hunch?
    I am using coldfusion 8 and sql server 2000.

    Pass it to the SP as a variable
    - there are examples in the cf docs

  • How to pass a session variable to the bussines layer?

    Hello,
    I am doing a management application, and I need to store the login user that make insertions on any table, and the pages does not has backing beans.
    I had try to do that bindding the value field of a hidden attribute with the session variable, but it only change the value of the one. My second attempt was make an javascript function to do that on the page´s load, but it not looks like a good solution.
    Someone knows a way to sent the session value to the bussines layer? O a way to access from the Bussines layer to the session?
    Thanks
    Tony

    <p>
    Hi,
    </p>
    <p>
    Another solution (that I always use) is storing simultaneously the same data in HttpSession (in view layer) and session hashtable (in businness layer).
    </p>
    <p>
    You can put and get these data in any businness component using following methods:
    </p>
    <p>
    <font face="courier new,courier" size="2" color="#0000ff">
    private void setToJboSession(String key, Object val){</font>
    <font face="courier new,courier" size="2" color="#0000ff"> Hashtable userData = getDBTransaction().getSession().getUserData();
    if (userData == null) {
    userData = new Hashtable();
     userData.put(key, val);
    }</font>
    </p>
    <p>
     and
    </p>
    <p>
    <font face="courier new,courier" size="2" color="#0000ff">
    private Object getFromJboSession(String key){
     return getDBTransaction().getSession().getUserData().get(key);
    }</font>
    </p>
    <p>
    Kuba 
    </p>

  • How to access a javascript variable from Java?

    Here is my code:
    function validateLoginForm() {
        var username = document.getElementById('un');
        setCookie('un', username, 3650);
        //etc.
    <%   
        HttpSession httpSession = request.getSession();
        httpSession.setMaxInactiveInterval(30 * 60); //30 minutes
        httpSession.setAttribute("un", username); //!prob here - cannot resolve 'username'
    %>
    }...but how do I access the javascript variable 'username' from the Java code?
    Thanks,
    James

    The only way to pass values between JavaScript and JSP is through cookies. It sucks, I know, but right now that is the only option.
    You already are creating a cookie in JavaScript. So go ahead and read it in Java:
    Cookie[] cookies = request.getCookies();
    for(int i = 0; i < cookies.length; i++) {
        Cookie c = cookies;
    if (c.getName().equals("un")) {
    // Do what you need here.

  • How long does a session variable live?

    I have a logon servlet that sets a session variable (validated) and then I reference that variable from various JSP pages. Does the timeout timer start when I last hit the logon servlet or should the session remain persistent as long as the browser is active up until the engine timeout is reached for the zone? I'm using Apache 1.3 with JServ (Oracle 9iAS R2) so unfortunately setMaxInactiveInterval does not work.

    There are timeout settings that can be set, check web.xml documentation for this and this can also be set in the App Server(at least for WAS). You also have to be concerned about how much memeory too and I know WAS has settings concerning session timeouts and memory.
    HTH,
    J.Clancey

Maybe you are looking for