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

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.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

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

    Hello,
    Scenario:
    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

    Hi,
    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.
    regards
    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

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

  • 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
    regards,
    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
    request.getParameter("id");
    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
    kotresh

    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

    Dear
    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
    Regards!

    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 =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

  • 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?
    Regards,
    Boopathi M

    Hi
    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
    Basheer

    Hi,
    My event is like this.
    public void onActionclick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent 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;
        wdContext.currentContextElement().setNum(str);
    How can i get the 'text' property value of the corresponding button. Click action should be common to all buttons.
    Thanks and Regards,
    Basheer

  • 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.
    Dirk

  • 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 .
    Thanks
    Raju

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

Maybe you are looking for

  • Dunning Wizard "To" Date

    Currently the Dunning wizard has no "To" Date. Dunning is calculated to "Today's" Date.  With a separate "To" Date, it would be possible to run the Dunning Wizard on a different date, than the date up to which you wish to Dunn. (This could for instan

  • Display Still thinks Im Connected

    I connected to my television montior as i have done many times, but this time the dual display came on and i do not know how to turn it off, or to connect back to a monitor. The computer thinks i am already connected at the moment but i am not. The t

  • Isight camer gives green screen in photo booth, black in ichat.

    imac g5 insight   Mac OS X (10.4.6)  

  • Mac Pro crashes when left unattended with EXC_BAD_ACCESS  (SIGSEGV)

    For no apparent reason my Mac Pro has begun to crash once or twice a day.  These crashes occur when the computer is left unattended.  I come back after a variable time away to find the login screen, indicating a reboot.  I have added no new hardware

  • Motion tracking to create paralax in 3D environments

    I'm going to be shooting footage on green-screen and I have looked at the Motion tutorial DVD which shows how to motion track where you would overlay an image onto the source footage (it's the one with the sat nav screen in the car). What I want to d