How to get the id of my session in jsf page

hi
i saved the adress of an image in my session
i would like to get this adress in my jsf; the problem is that the key used to save my image is dynamic:it is the id of my session
my java code look like this:
HttpSession s=SessionUtil.getSession();
String adressePagesWeb=s.getServletContext().getRealPath("/")+"pages/";
s.setAttribute(s.getId(), adressePagesWeb+s.getId()+"piechart.png");and my jsf look like:
<h:graphicImage value="#{<%=request.getSession().getId()%>}" id="log"/>but this doesn't work
please help me

No, it doesn't work as you sayed ! every user has it's own session so you can give the same name for an attribute and it will be stored in the user session:
HttpSession s=SessionUtil.getSession();
String adressePagesWeb=s.getServletContext().getRealPath("/")+"pages/";
s.setAttribute("A_CHOOSEN_NAME", adressePagesWeb+s.getId()+"piechart.png");and for the picture you must keep the session id as a part of it's name !

Similar Messages

  • How to get the SSRC in RTP session

    Hi
    i am using RTPManager to send voice between two machine , how to get the SSRC of the receiver end , and how to get SSRC of the receiving end.
    with regards
    Rekha kailas

    To get SSRC of received stream: receiveStream.getSSRC();
    To get SSRC of send stream: sendStream.getSSRC();

  • How to get the Dynamic UI component value from JSFF page to any managedbean

    HI ,
    We have list of bean objects in jSF page we are iterating the list of bean using the forEach loop and displaying the value into Input type text (UI component) value filed .
    If we try to get the UI component value in Managed bean we are not getting the dynamic values .
    The below piece of code used to retrieve the dynamic values from the JSF page doesn't have any form :
    UIComponent component = null;
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext != null) {
    UIComponent root = facesContext.getViewRoot();
    component = findComponent(root, componentId);
    then component type casting to the based on UI component which we trying to access and getting the value as " NULL " ..Please let me know how to get the dynamic values form the JSF ?
    Please let me know if any other approach or any changes required on above ?
    Thanks

    Hi,
    the root problem is this
    <h:inputText id="it3" value="#{familyList.ctn}" />
    <tr:commandButton text="Save" id="cb3"Note how each row writes to the same managed bean property, thus showing the same data. Instead your managed bean should expose a HashMap property that you then apply values to using a key/value pair. The key could be the ID of the field, which then you also should dynamically define e.g. cb<rowIndx>. The command button could then have a f:attribute assigned that has the row HahMap key as a value. This way you truly create value instances for the object
    Frank

  • How do get the role from ldap session.

    i am using the follwing getting the role from the request in openldap and j_security_check:
    f(request.isUserInRole("manager")){
    how can i use this in the session:

    You might wanna change permissions for that attribute ...
    Change it from Admin to OWNER and you should be able to then get it for any user ...
    HTH ..

  • How to get the list of SmartView sessions?

    Hi All,
    We know that we can get the list of current SmartView session in EAS->Hyperion Provider Servers->Sessions. However, we would like to do using scripts/program.
    It seems to me that we can use the JAPI and there is some sample java programs under $APS_HOME/sample folder. Does anyone have any idea?
    Regards,
    nww

    I think what you get is below;
    App Store
    Calculator
    Calendar
    Contacts
    Dashboard
    Dictionary
    DVD Player
    FaceTime
    Font Book
    Game Center
    Image Capture
    iTunes
    Launchpad
    Mail
    Messages
    Notes
    Photo Booth
    Preview
    QuickTime Player
    Reminders
    Safari
    Stickies
    System Preferences
    TextEdit
    Time Machine
    Twitter
    Activity Monitor
    AppleScript Editor
    Audio MIDI Setup
    Bluetooth File Exchange
    Boot Camp Assistant
    ColorSync Utility
    Console
    DigitalColor Meter
    Disk Utility
    Grab
    Grapher
    Keychain Access
    Migration Assistant
    Network Utility
    RAID Utility
    System Information
    Terminal
    VoiceOver Utility
    X11
    XQuartz
    Note if you buy a new Mac with ML preinstalled the list may be larger.

  • How to get the None button on my account payment page

    I would like to remove my old credit card info from my account and start using only gift and prepaid iTune cards.  However, the None button is not showing on the page.  Is there some sort of pathway that I need to go through to get the button or do I have to have some other support for this function?

    I NEED TO GET MY ITUNE CARD TO MY ACCOUNT

  • How to get the result of a method on a page

    I use JDeveloper 11g
    I want the result of a method (String) in the ApplicationModule on a page (jspx)
    What I have done is:
    1. make a method (getValue) in the ApplicationModule Algemeen (also in Client interface)
    2. make a pagedef-file with executables and bindings, see
    <executables>
    <invokeAction id="doGetValue" Binds="getValue"
    Refresh="renderModel"/>
    <variableIterator id="variables" Refresh="renderModel">
    <variable Type="java.lang.String" Name="getValueReturn"
    IsQueriable="false" IsUpdateable="0"
    DefaultValue="${bindings.getValue.result}"/>
    </variableIterator>
    </executables>
    <bindings>
    <methodAction id="getValue" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getValue"
    IsViewObjectMethod="false" DataControl="AlgemeenDataControl"
    InstanceName="AlgemeenDataControl.dataProvider"
    ReturnName="AlgemeenDataControl.methodResults.getValue_AlgemeenDataControl_dataProvider_getValue_result"/>
    <attributeValues IterBinding="variables" id="ValueReturn">
    <AttrNames>
    <Item Value="getValueReturn"/>
    </AttrNames>
    </attributeValues>
    </bindings>
    3. on the page (jspx) I have an outputText-component:
    <h:outputText value="#{bindings.ValueReturn.inputValue}"/>
    But, it does not work, I don't get the result of the method on the screen.
    Who can help me with this?

    Hi,
    Simple example below:
    Suppose you have this method in AppmoduleImpl:
    public void testHello( ) {
    return "Hello";
    1.After you expose this to clientInterface,drop this method on the jspx page as ADF Parameter
    form
    2.Drop the return String as outputText
    3.Run the page,click on the commandButton & the outputText returns 'Hello'
    Regards,
    Shantala

  • Unable to get the output when i run any jsf page in adf

    Hi,
    I have created one jsf page to access the business components which i had created earlier after that when i drop the another panel splitter into the second facet of the initial panel splitter we created , I was unable to see in the workspace (.jpx) window.can you suggest me on this.
    after done all the steps if I tried to run that page it starts the WLS servier and createda URL but the url is taking long time approx more that two hour and still not getting the required output only the loading window I can see.
    Please suggest me on this.
    Thanks
    Chetan

    Hi,
    the panelSplitter should at least show in the Structure Window. So check if it is there. The runtime issue can be caused by the proxy settings. Go to Tools / Preferences --> Browser and Proxy and add localhost to the list of exclusion
    If you are new to ADF I recommend running a tutorial like this: http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm
    Frank

  • How to get the user of current session in EBS

    Hi everyone,
    I create a new form in EBS 11. I want to get user ID (or userName) of user who log in the current session of application for inserting into CREATE_BY field of table in database.
    How have i to get it
    thanks you and best regards

    Hi,
    It seems like your application variables have not been initialized. Has your form been registered in a menu under a valid responsibility? Give us more details of the form and where it is has been registered.
    Make sure you look at P29-3 of the Application Developer's Guide for WHO column maitenance as you should be populating other columns besides the USER_ID. (http://download.oracle.com/docs/cd/B40089_10/current/acrobat/120devg.pdf)
    Cheers
    Dale

  • How to get the value of a session bean through a scriptlet

    Hi,
    I have defined a session bean in faces-config file and now I want to acces this bean object through a scriptlet. How should I go about doing that ?
    eg in faces-config file I have something like this
    <managed-bean>
    <managed-bean-name>pc_DepTest</managed-bean-name>
    <managed-bean-class>pagecode.WEBINF.Pages.DepTest</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Now in another pager called xyz.jsp
    I want to access the pc_DepTest object through a scriptlet... How should I do that ?
    Thanks

    I avoid scriplets, but you could write:
    pagecode.WEBINF.Pages.DepTest test = (pagecode.WEBINF.Pages.DepTest) FacesKit.getBean("pc_DepTest");
    //you use WEBINF in package names? gack!
    ...Where in FacesKit you've defined:
    public static Object getBean(String expr){
        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();
        ValueBinding binding = app.createValueBinding("#{" + expr + "}");
        return binding.getValue(context);
    }

  • JDev 9.0.3.5 : How to get the value of an item on a page in the controller

    Hi,
    In the processFormRequest part of my page controller, when the user clicks on Apply, I need to pass the value(s) entered by the user, to a PL/SQL stored procedure. The user enters a value for a field called "FirstName" on the page. I then need to pass this value to a stored proc. But the following code gives me a java.lang.ClassCastException on the 2nd line here. What am I doing wrong?
    String firstNameStr = "";
    OATextInputBean firstNameBean1 = (OATextInputBean)webBean.findIndexedChildRecursive("FirstName"); // This line throws exception!!
    OAWebBean firstNameBean = (OAWebBean)pageContext.getWebBeanValue(firstNameBean1,firstNameStr);
    Any help is greatly appreciated.
    Kind regards
    Tessa Lillie

    rather use
    String firstNameStr = pageContext.getParameter("FirstName");

  • How to get the selectOneRadio value in javascript

    Hi,
    I want the selectOneRadio value in javascript. Can anyone give us a solution how to get the selectOneRadio value to javascript from jspx page.
    Thanks,
    Eswari

    Hi,
    I assume you are talking about JDeveloper 10.1.3 in where there is no JavaScript API ADF Faces.Here you will have to use document.getElementById() to access the radio button component (which is a list component). You can look at the generated HTML for how the component and its ID look like.
    However, what is the usecase that you cannot handle in native JSF ?
    Frank

  • How to get the UserTransaction object in  stateless session bean

    Hi, I am using jboss server and jdk5 version and using EJB.
    My Application flow :
    JSP à Action(Struts) à Service Locator à Session bean à Entity Bean(cmp) à DB.
    I tried to get the UserTransaction object in my Action. Its my code.
    InitialContext ctx = new InitialContext();
    UserTransaction uTrans = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    After used uTrans.begin(),uTrans.commit() and uTrans. rollback () also.
    Its working fine .
    But, I used the the same code inside in my session bean its not working.
    Stateless Session Manager Bean code :
    public class SampleManagerBean implements SessionBean {
    public void ejbCreate() throws CreateException {  }
    public void ejbRemove() {  }
    public void ejbActivate() {   }
    public void ejbPassivate() {   }
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
         public void createSample() throws EJBException
         try{
                   InitialContext ctx = new InitialContext();
                   UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
              }catch(Exception e) {
              System.out.println(“ Exception === > “+e)
    Its throws the error ie: javax.naming.NameNotFoundException: UserTransaction not bound
    How to get the UserTransaction object in my session bean. Kindly give solution the above errors.
    - Thendral

    first of all, you could just use sessionContext.getUserTransaction(). however, that would only work if your bean is using bean-managed transactions. the default is container-managed transaction, in which case you cannot get a UserTransaction object. if you want to manage transactions, you need to add the TransactionManagementType.BEAN annotation to your ejb.

  • How to get the process id of a sql statement or a session  ....

    How to get the process id of a sql statement or a session . ..?
    Thanks

    What about this?
    SELECT pid
      FROM v$session s, v$process p
    WHERE p.addr = s.paddr
       AND s.sid = :sid;   -- replace :sid with your session idRegards.
    Al

  • How to get the transaction_id from the current session of the current trx?

    Hello Gurus,
    How can get the hr_api_transactions.transaction_id from the current session to use it in my SQL script in VO.xml?
    I don't know if I can get the item_type, item_key from the current self service session in iRecruitment? to use it in hr_transactions_ss.get_transaction_id(p_item_type, p_item_key)
    I saw something icx_sec.getID(icx_sec.g_transaction_id)!
    Can I use this in the where clause of the SQL part of my VO extension?
    Thanks for all the help!
    FR

    Hi!
    Try this thread:
    http://help.sap.com/saphelp_nw04s/helpdata/EN/80/b2dd3a6dac703be10000000a11405a/frameset.htm
    brgs Ziggy

Maybe you are looking for