How to get the session variable value in JSF

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-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
but it retrieve only "null" value.. could u please help me.. it's very urgent one..

Where i use 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..

Similar Messages

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    Cal month

  • How to get BW-BPS variable value into Visual Basic?

    Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variable’s value i want to get the value of variable into Visual Basic and to format header for table in the layout.
    How to get BW-BPS variable value into Visual Basic?
    Could you help me?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how  i would solve this,
    Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM  T-code. Now using the  SAP delivered SAPAfterDataPut  macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
    Hope this helps.
    Sai Vishnubhatla

  • How to get the previoulsy selected value in a combobox

    How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

    Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
            comboBox.addItemListener(new ItemListener() {
                Object prevValue;
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        //do what you need with prevValue here
                    } else {
                        prevValue = e.getItem();

  • How to get the latest procured value of a spare updated in material master

    How to get the latest procured value of a spare updated in material master

    See table MBEW via transaction SE16.
    However, you may need to look at the last PO created for that material.

  • How to get the session name of a batch input

    hi everybody
    does anybody know how to get the session name of a batch input?
    I have to put the name of the session at the end of my program so that the user can click on the session name to go directly to SM35 to run the batch input when the program ends

    Hi sia,
    1. Table is APQI
    2. field name for session name is GROUPID
    amit m.

  • How to get the anchor tag values in next jsp

    Hey all,
    I have two jsp files.
    in first jsp,
    I am getting the resultset.
    I am setting the resultset to the anchor tag.
    below is the code...
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp"><%=rSet.getString(1) %></a></td>
    whenever he click on any anchor tag,
    It will goes to ACSMasterTwo.jsp page for edit the compleate record.
    how to get the anchor tag value in that page...
    Please help me on this.

    You have to pass a parameter. An id is good.
    Of course you have to get an id from somewhere in the result set right?
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp?id=<%= rSet.getString("id") %>"><%=rSet.getString(1) %></a></td>Then you call
    and look up the values related to that id in the database.

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • How to get the table of value field? and can we expand the technical limits

    I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
    And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
    We have a note for R.4.x Please see below:
    OSS note 160892
    You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
    The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
    To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
    David Sun

    how to extend the limit of value numbers? please see the original question.

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List);
    JUCtrlHierBinding treeTableBinding =
    JUCtrlHierNodeBinding nodeBinding =
    String nodeStuctureDefname =
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    Please help me in resolving this issue.

    you should also move
    JUCtrlHierBinding treeTableBinding =
    out of the while loop as this is not necessary to be repeated for each key in the set

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Boopathi M

    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to get the 'text' property value of a button in coding?

    Hi Experts,
    I'm using 10 buttons all are having common action('click'). when i click a button the 'text' value of the button should pass to a function.So the action is same but the passed value will be the 'text' value of the corresponding button.  I don't know how to get the 'text' property of a button in coding. Kindly help me to solve this problem.
    Thanks and Regards

    My event is like this.
    public void onActionclick( wdEvent )
         String s =  ?  ; // should get the 'text' property of clicked button
         fillInput(s);     // function to be called
    The called function is,
    public void fillInput( java.lang.String id )
        String str=wdContext.currentContextElement().getNum();
        str = str + id;
    How can i get the 'text' property value of the corresponding button. Click action should be common to all buttons.
    Thanks and Regards,

  • How to get the current zoom value in ID?

    Is there any way that can get the current zoom value in InDesign?
    Thanks a lot.

    You could peek at the widget indicated in your screen shot, at least when that MDI (?) frame is showing.
    The window title at kLayoutPresentationBoss, IID_IDOCUMENTPRESENTATION also reflects the value.
    Probably best would be the kLayoutWidgetBoss, with its IID_IPANORAMA, GetXScaleFactor() - and GetYScaleFactor()!!!
    I just try to imagine how a document would look if these differ from each other ;-) and, even better, how to achieve that from the UI.
    Btw, one notification is on kDocWorkspaceBoss, protocol IID_IWINDOW, command kUpdateDocumentUIStateCmdBoss.
    Another one: there is a kDocWindowTitleModifyService ...
    Edit: of course I should again mention IID_IPANORAMA, observable from kLayoutWidgetBoss subject.

  • How to get the DFF Context Value in CO

    Dear All,
    i am working on extension on EitUpdateCO, the same page contains more than one EIT
    for Some EITs i have to populate calculated values into their segments .
    How to get the Context value of DFF .
    Please send me the code if u have .

    can i get the information type from ExtraInformationTypeVO,
    but the create ,update pages using different VOs
    Please tell me the solution.

Maybe you are looking for