Attributes in Session

Hello,
I need help for an EP-Application which is migrated from EP5 to EP6.
There is an iView (extends from AbstractPortalComponent) which is deployed on <u>multiple</u> sites in the portal. It only has an input-field and a button in the jsp and it stores the submitted data in the HttpSession (to use by other iView on the multiple sites).
It is necessary that the submitted data from the input field of this iView is also set in the input field on the other sites if the user opens an other site. In EP5 it works fine but in EP6 the input field is filled different on every site. It shows the last entries submitted from this site but different on every site. So every site has it own session?  My question is, which class from the EP6 API is usable to store Attributes (like session.setAttribute("...","...") in Servlets) which are available in the complete Portal-Context?
Or does anyone has a link to a documentation about this Problem?
Thanks for your help.
Stefan

Hi,
there is an httpsession (from the portal servlet) and the portal component session (per portal component, per iView).
Now: it all depends on what name is used in the http session for those iviews. If they use a name derived from the portal component context name than this would be different between pages in EP6, but identical between pages in EP5.
Regards, Henning + Oliver

Similar Messages

  • I cant replace attributes in sessions

    Hi! :)
    I need to replace an attribute value in a session, but it seems to become 2 attributes instead.
    I need this method to replace or remove a value:
    public void changeItemCount(HttpServletRequest request, String nr, String id) {
         try {
              int itemCount = Integer.valueOf(nr).intValue();
              if(itemCount == 0) {
                   session.removeAttribute(id);
              } else {
                   session.removeAttribute(id);
                   session.setAttribute(id, itemCount);
         } catch (NumberFormatException e) {     }
    }But removeAttribute does not remove it, and setAttribute instead insersts one more with the same id :(
    If i call the method like this: changeItemCount(request, "2", "item1")
    and, print all attributes i get:
    item: nr:
    item1 1
    item1 1
    I want:
    item: nr:
    item1 2
    Here is all the code (cart.jsp)
    <%@ include file="head.jsp" %>
    <script language="javascript">
    function getInfo(inputId) {
         var antal = document.getElementById(inputId).value;
         window.location = "cart.jsp?update=" + inputId + "&itemNr=" + antal;
    </script>
    <%!
    ProductAccessor accessor = ProductAccessorSimulator.Factory.getInstance();
    HttpSession session;
    %>
    <%!
    public int getItemCount(HttpServletRequest request, String id) {
         int itemCount = 0;
         try {
              itemCount = Integer.valueOf((String)session.getAttribute(id)).intValue();
         } catch (NumberFormatException err) {}
         catch (NullPointerException err) {}
         catch (ClassCastException err) {}
         return itemCount;
    public void insertId (HttpServletRequest request, String id) {
         session = request.getSession();
         if(session.getAttribute(id) != null) {
              int itemCount = Integer.valueOf((String)session.getAttribute(id)).intValue();
              session.removeAttribute(id); // ta bort
              session.setAttribute(id,Integer.toString(itemCount+1));
         } else {
              session.setAttribute(id, "1");
    public void changeItemCount(HttpServletRequest request, String nr, String id) {
         try {
              int itemCount = Integer.valueOf(nr).intValue();
              if(itemCount == 0) {
                   session.removeAttribute(id);
              } else {
                   session.removeAttribute(id);
                   session.setAttribute(id, itemCount);
         } catch (NumberFormatException e) {     }
    %>
    <%
    if(request.getParameter("update") != null && request.getParameter("itemNr") != null) {
         String nr = request.getParameter("itemNr");
         String id = request.getParameter("update");
         changeItemCount(request, nr, id);
         response.sendRedirect("cart.jsp");
    if(request.getParameter("id") != null) {
         String idt = request.getParameter("id");
         insertId(request, idt);
         response.sendRedirect("cart.jsp");
    out.println("<table>");
    out.println("<tr>");
    out.println("<th>Item</th>");
    out.println("<th>Nr</th>");
    out.println("<th>Refresh</th>");
    out.println("<th>Rempve</th>");
    out.println("</tr>");
    for(Enumeration e = session.getAttributeNames(); e.hasMoreElements() ;) {
         String str = (String)e.nextElement();
         int items = getItemCount(request, str);
         try {
              Id id = Id.parse(str);     
              Product p = accessor.getProduct(id);
              str = p.getName();
         } catch (Exception err) {
         out.println("<tr>");
         out.println("<td>" + str + "</td>");
         out.println("<td><input id="+str+" type='text' value='"+ items + "' size='1' name='nr'/></td>");
         out.print("<td><button onclick=");
         out.print("getInfo(");
         out.print("'"+str+"'");
         out.println(");>Refresh</button></td>");
         out.println("<td><button>Remove</button></td>");
         out.println("</tr>");
    out.println("</table>");
    %>
    <%@ include file="foot.jsp" %>

    I suspect the problem is in the String variable 'id' as follows:
    When you call session.removeAttribute(id), the value is dereferenced in the session object's internall collection of items, but remains attached to the reference variable 'id' (ie, 'id' still points at the memory address). Then when you call session.setAttribute(id, itemCount), the collection is reattached to the same memory address via 'id' and somehow the collection doesn't like that. Normally (for all other users of removeAttribute, setAttribute), when you call removeAttribute(id), all references to object that id points to are removed when the function returns to the caller (the id reference is dereference and at that time, and the item is actually removed from the collection). I suggest trying this:
    FROM:
              int itemCount = Integer.valueOf(nr).intValue();
              if(itemCount == 0) {
                   session.removeAttribute(id);
              } else {
                   session.removeAttribute(id);
              session.setAttribute(id, itemCount);
    TO:
              int itemCount = Integer.valueOf(nr).intValue();
              if(itemCount == 0) {
                   session.removeAttribute(id);
              } else {
                   session.removeAttribute(id);
    String idNew=id;
    id=null;
              session.setAttribute(idNew, itemCount);
    The above assigns the value of id to idNew (its a string copy to a new address space, not simply a reference assignment). Now id is free to be set to null (dereferenced).
    Last point: its not such a good idea to use id (1, 2, 3, etc) for a name as an attibute. They are not unique names. Some other part of the program may use those names and overwrite them by mistake. I suggest prepending a unique name to the front of them such as personItem1, personItem2.

  • Getting attributes from session between two different applications

    I'm developing with JDK 1.3 and deploying my webapp at ORACLE 9iAS.
    I would like to jump between JSPs deployed at differents OC4J instances and
    keep session object. I've seen I can get sessionID and it's the same but the attributes have disapeared.
    I jump using JavaScript code (document.location.href).
    Should I use a <form> ?
    Should I use getServletContext() method ?
    I dont know even if it's possible and I don't want to loose my time looking for a solution that doesn't exist.
    NEED HELP, AN EXAMPLE OR WHATEVER USEFUL.
    ... THE SOON AS POSSIBLE
    THANX in advance
    PS..- I have already look for in this forum but I didn't get any info to solve my doubts. If I mistaken please let me know

    Ok.
    getServletContext().getContext() may return null in 'security conscious' servers. Apparently this is your case, therefore you wouldn't be able to use it to store global data...
    As for sharing sessions directly between different web apps, the servlet spec (since 2.2 at least) explicitely prohibits it.
    The link provided by tolmank about pseudo-sessions should address your issue, since it will allow you to distribute your session data on your different webapps.
    Some other alternatives would be :
    -store the session data in the DB (slow)
    -use java serialization
    -use RMI
    -use JNDI
    -if you're using Tomcat, you can implement single-signon accross multiple apps using cookies :
    http://www.ingrid.org/jajakarta/tomcat/tomcat-4.0b5/src/catalina/docs/singlesignon.html

  • Report Print Attributes and Session State Protection

    Hi all,
    I have a report (old style Apex report, not an IR) that I would like to have a Print option, producing a PDF output.
    The report is on a page that takes a number of arguments and uses the page security option "Arguments require checksum".
    When I turn on the Enable Report Printing option in the report, the Print link appears at the bottom of the report. However, clicking Print leads to the following message:
    "Error      No checksum was provided to show processing for a page that requires a checksum when one or more request, clear cache, or argument values are passed as parameters."
    Disabling Session State Protection for that page makes the report link work, but I would prefer not to do that.
    How do I get the built-in report print option to generate the required checksum?
    I'm using Apex 4.0.2.00.07, by the way.
    Alex

    WORKAROUND:
    1.) Create hidden ITEM on page (I named it P23_PREPARED_CSV_DOWNLOAD_URL).
    Enter the following for the ITEM
    as the SOURCE_TYPE : PL/SQL Function Body
    as the SOURCE: return apex_util.prepare_url('f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:CSV:')
    2.) Create BUTTON that executes javascript to open POPUP window with this url.
    a.) Create Button and enter
    &lt;a href="javascript:popupURL('&P23_PREPARED_CSV_DOWNLOAD_URL.')"&gt;Download and Save to CSV file&lt;/a&gt;as the "Text Label/Alt"
    Originally had custom code for javascript POPUP and this is not needed .... just use the APEX javascript function.
    Edited by: Bryce Tuohy on Mar 5, 2009 10:47 AM

  • How can I get the attribute of another app of the JSP server's session

    in one server, use Tomcat 4.1, have two application at
    .../webapps/app1
    .../webapps/app2
    when use login to application1, it'll set a attribute of session use following code:
    session.setAttribute("identitycode", IdentityCode);
    session.setMaxInactiveInterval(SessionTimeOut);
    and the other jsp programs which at app1 directory will try to get the attribute of this session to identity whether the user had login and get the identity code.
    I want to make user just login one time to use application1 and application2, but I didn't know how to get the attribute of session what seted at app1 in app2's programs.
    can you tell me how I can do this?

    If there are 2 different applications like app1 & app2, U need to use:
    application.setAttribute() method.(not session.getAttribute).
    u need to maintain one collection like hash table which will store the mappings of User & their IDs . U can then get the user details from app1 to app2

  • Session attributes persists forever!

    When I validate form input in my servlet, I create a HashMap of error
    messages and store that Hash in the session
    (session.setAttribute("myErrors", hash))
    Then, I response.sendRedirect() the user back to the page and print
    the error messages with (session.getAttribute("myErrors")). After
    this, I try to clear the session attribute with:
    session.removeAttribute("myErrors"), but it still remains in the
    session!
    I even try to add a "new HashMap()" to the "myErrors" attribute after
    I remove it, but that doesn't work.
    Any ideas on why I'm unable to clear the attribute from my session?

    I found out that the session has changed. I am using Tomcat. This probably explain why the attribute is not there.
    When I use the back button, I get back to the earler session with all the attribute intact. Why does this happen???.
    JSP code below
    <BR>Session ID: <%= session %></BR>
    <%
         Enumeration ee;     
         ee = session.getAttributeNames();
         System.out.println("[START LIST]SESSION ATTRIBUTES........");
         while (ee.hasMoreElements()) {
              String s = (String)ee.nextElement();
    %>
    <BR><%=s %></BR>
    <%
         System.out.println("[END LIST] SESSION ATTRIBUTES........");
    %>

  • Session timeout skillbuilders question

    Application security attributes settings
    Session Timeout  Maximum Session Length in Seconds   60
    On session timeout direct to this URL   <url>
    Maximum Session Idle Time in Seconds   45
    On session idle time timeout direct to this URL   <url>
    Session timeout component settings
    Name: SkillBuilders Session Timeout (1.0.1) [Plug-in]
    *Session Timeout Action  Alert
    *Session Timeout Message  Application will timeout shortly
    *Mask Browser Screen on Timeout  No
    *Session Idle Warning  Yes
    *Session Idle Title      Idle message Warning ( I cannot see this displayed but when I copied that area this came)
    *Session Idle Message    This application session will expire shortly! If you want to continue working please click ok on the alert.
    *Show Warning Seconds Before  40
    *Keep Session Alive           Yes
    So the moment I start my application and the login page is displayed i get the idle message displayed on the screen.  So my application should timeout in 1 minute. I should be alerted after 45 seconds.
    Are the settings correct?
      Murali

    Please keep in mind that maximum session length and idle time are two different things. The following configuration should satisfy your requirements
    Configure the following application attributes:
    "Maximum Session Length in Seconds" =  ??? -- you did not specify how long your session can last, if left blank it will revert to the instance level setting which defaults to 8 hours
    "Maximum Session Idle Time in Seconds" = 10800 -- the maximum amount of time the user as to interact with the server again
    Configure plugin settings:
    "Session Timeout Action" = ALERT
    "Session Timeout Message" = <your message>
    "Session Idle Warning" = Yes
    "Session Idle Title" = <your title>
    "Session Idle Message" = <your message>
    "Show Warning Seconds Before" = 900 -- 15 min x 60 seconds
    "Keep Session Alive" = Yes -- this will renew the session if the user interacts with the idle warning
    Please let me know if you have any questions.
    Good Luck!
    Tyson

  • "Maximum Session Length in Seconds" Not Working In Apex 3.2

    Hello.
    I am using Apex 3.2 and have noticed that pages are session timing out after just 10 minutes of inactivity. I am aware of the new security attributes "Maximum Session Length in Seconds" and "Maximum Session Idle Time in Seconds".
    I asked our Apex admin and he reported that these attributes are set to 8 hours on the instance level. Within my own Apex application, these two attributes are not set at all. According to the popup help window associated
    with these attributes, if they are not set, then there is no timeout at all that is enforced.
    So, does anyone know why my application pages are session timing out after just 10 minutes of inactivity and users are forced to login again?
    Thank you.
    Elie

    Scott,
    Thank you for your help on this.
    I've uploaded my Apex app called "Online Model", App ID 62063 in my workspace EEG on the Oracle hosted site apex.oracle.com.
    Workspace = EEG
    Username = [email protected]
    Password = galaxy (I'll change the password after you're done helping me)
    Orginally, this app had "Database Authentication" set. I changed this to "DAD Authentication" so that you can simply run it without having to login.
    If I open up the app in developer mode and simply leave it alone for, say, 30 minutes and then click on the "developer bar" to see the definition of one of the pages, Apex instead prompts me to re-login again into Apex. I've not placed any values in any of the "Session Timeout" fields on any of the pages in this app.
    When the same app is run as a user (that is, no "developer bar" appears at bottom of pages), again the page will time out after about 30 minutes of in-activity.
    And as mentioned in my original posting, our Apex Admin has the "Administrator Timeout Session" field set to 8 hours.
    The Apex 3.2 docs say that if no value is placed in these Timeout Session fields, then there is no timeout imposed.
    Thank you for your help. It's much appreciated.
    Elie

  • Using jsessionid to get to the right session

              We've got an odd situation that we've run into using Weblogic Server 8.1 SP2 to
              serve up dynamic VoiceXML pages. Our VoiceXML platform has a VoiceXML browser
              and another component called a compilation server, whose job is to retrieve grammars,
              compile them and make them available for recognition. Although the browser itself
              supports cookies, the compilation server does not.
              Here's the scenario:
              Server A (the browser) makes a request to Weblogic for its initial page, and a
              new session is created. The page that is returned contains a link that includes
              the session ID appended to the end of the URL, so that it looks like this. http://someserver/voice/grammars/grammar.jsp;jsessionid=A0vIhV1RkYzwYI0vcS1b0ykU21YPy2Ww3r9WBzoDAOq04liAWnQf!507937038!1089777544278.
              Server A sends that URL (including the jsessionid) to server B (the compilation
              server), and B uses the URL to fetch a grammar.
              In the HTTP access logs for Weblogic, we see the second request (from B) come
              in, and it contains the correct jsessionid. However, our application logs show
              that a entirely new session is actually created, with a brand new session ID.
              To further test it out, some attributes that were put into the session during
              the initial request are definitely not there on the second request.
              Anyone know how we can make Weblogic use the jsessionid to find the correct session
              rather than create a new one? Our assumption is that since the request is coming
              from a different client, Weblogic is automatically creating a new session.
              

    Our assumption is that          > since the request is coming
              > from a different client, Weblogic is automatically
              > creating a new session.
              Server will create a new session only if the jsessionid is not present in the original request. Making a request from a different client should not make a difference.
              Are you making the request to the same application in both the cases ?
              You may try the following code and access it from diff. client to see the expected result.
              <html>
                   <head>
                        <title>some Application</title>
                   </head>
                   <body>
                   Session is new ==> <%=session.isNew()%> <BR>
                   Session Id is ==> <%=session.getId()%>     <BR>
                   <% if(session.isNew()){
                        session.setAttribute("one","sesion-one");
                             else{
                             out.println("Attribute is " + session.getAttribute("one"));
                   %>     
                   </body>
              </html>

  • Problem with session.removeAttribute()

    Hi,
    After doing
    <% session.removeAttribute("USER");%>from one jsp, if i say
    <% =session.getAttribute("USER") %>in another jsp, I still get the value of the session variable USER.
    Can anybody tell what might be the problem ???
    Thanks !

    No it shouldn't and it doesn't just apply to those objects.
    Quoting the api:
    The remove attribute method:
    public void removeAttribute(java.lang.String name)
    Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.
    After this method executes, and if the object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueUnbound. The container then notifies any HttpSessionAttributeListeners in the web application.removeAttribute removes the attribute from session.
    If you can still see it in another jsp, you must be putting it back INTO the session somewhere.
    Cheers,
    evnafets

  • HADB session failover & realm problem

    I have a enterprise applicaiton server cluster configured for loadbalancing and session failover.
    I installed HADB.
    HADB works, I test with the webapp from the samples of the application server:
    I add some attribute in session, I see which node executed the request, I stop the node.
    The other requesto go to the other node and the session is reloaded as it was on the stopped node.
    The problem I have is with app with realms authentication.
    I can login without problem on the first node.
    I stop the server handling the request and when switched to the other server I have to login again if I request a realm protected URL again.
    Any suggestion?
    Thanks in advance.

    Solved
    on Cluster configuration (in the tree of admin apps of application server):
    my-clu-config -->
       Availability Service -->
            Web Container Availability -->
                      Single-Sign-On State: Enabled.

  • Access session variable in Java Function in JSP

    Hi Experts !!
    I am developing an application using STRUTS MVC...
    Very sorry if u have problem understanding my question, i ll try to improve... and sorry if i can't post codes here
    Basic question is ....
    I want to open a word document on pageLoad of JSP, the word document is not a single document, there is a form in which there is a "name" and "template" whenever user clicks on a button there is one action attached to it which creates a copy of that template in a different folder.. on the next page OnLoad i want to open that particular document. for that i have created a variable and also have set in the session, just want to access it in the below code.
    I have a formbean in which i have a variable, the scope is session, that variable i have put it in session also. but i want to access that variable in a "java function" in JSP so that "onLoad" page that function should work.
    JSP---
    <script type="text/javascript">
    function openDocument() {
    var w = new ActiveXObject("Word.Application");
    var docText;
    var obj;
    var a;
    if (w != null) {
    w.Visible = true;
    obj = w.Documents.Open(I HAVE TO ACCESS THAT VARIABLE HERE);
    </script>
    FORMBEAN----
    public class CreateSOWFormBean extends ActionForm {
    private String workflowName;
    private String comment;
    private String sowTemplate;
    private String sowFileCreated;
    public String getSowFileCreated() {
    return sowFileCreated;
    public void setSowFileCreated(String sowFileCreated) {
    this.sowFileCreated = sowFileCreated;
    sowFileCreated is the variable that i have accessed in session and that value i have to pass in that function in JSP....
    I am aware of something like
    obj = w.Documents.Open(<%'sowFileCreated'%>);
    but i m not sure how to write....
    Plz help.....

    If you're working under a framework like struts you should definitely be using JSTL tags rather than scriptlet code to access variables within the page. With JSTL code <% codes can be almost entirely avoided.
    To transfer a value from a Servlet to a JSP don't use a session variable, use a request attribute. Session variables should only be used when values have to survive from one transaction to another.
    You can write something like:
    obj = w.Documents.open('<c:out value="${openURL}"/>');in the Javascript portion of your JSP.
    Just beware of potential problems with quotes. The coresponding code in the Servlet would be like:
    request.setAttribute("openURL", openUrl);

  • H323 cisco attributes not being forwarded to Radius accounting server

    I have enabled a Radius server to gather AAA Accounting CDR records but I don't see any of the Cisco h323 attributes. The following is an example of the list I WANT to see.
    ATTRIBUTE h323-remote-address 23 string Cisco
    ATTRIBUTE h323-conf-id 24 string Cisco
    ATTRIBUTE h323-setup-time 25 string Cisco
    ATTRIBUTE h323-call-origin 26 string Cisco
    ATTRIBUTE h323-call-type 27 string Cisco
    ATTRIBUTE h323-connect-time 28 string Cisco
    ATTRIBUTE h323-disconnect-time 29 string Cisco
    ATTRIBUTE h323-disconnect-cause 30 string Cisco
    ATTRIBUTE h323-voice-quality 31 string Cisco
    ATTRIBUTE h323-gw-id 33 string Cisco
    ATTRIBUTE h323-incoming-conf-id 35 string Cisco
    I see a lot of stuff comming in, but I don't see any of the attributes above.
    PS. when I do a DEBUG AAA ACCOUNTING here's what I see.
    *Oct 8 18:00:19.681: AAA/ACCT/CONN(00001863): STOP protocol reply FAIL
    *Oct 8 18:00:19.681: AAA/ACCT(00001863): Accouting method=NOT_SET
    Here's my config
    aaa new-model
    aaa group server radius ACS
    server X.X.X.X auth-port 1645 acct-port 1646
    aaa authentication login h323 group ACS
    aaa authentication login no_rad local
    aaa accounting update newinfo
    aaa accounting exec default start-stop group ACS
    aaa accounting connection default start-stop group ACS
    aaa accounting connection h323 start-stop group ACS
    aaa session-id common
    gw-accounting aaa
    attribute acct-session-id overloaded
    attribute h323-remote-id resolved
    acct-template callhistory-detail
    radius-server host X.X.X.X auth-port 1645 acct-port 1646
    radius-server timeout 60
    radius-server key XXXXX
    radius-server authorization permit missing Service-Type
    radius-server vsa send accounting
    radius-server vsa send authentication
    dial-peer voice 447 voip
    destination-pattern 1647280....
    voice-class aaa 1
    session target ipv4:X.X.X.X
    Any ideas?
    thanks,
    Paul

    Try the following command:
    gw-accounting h323 vsa
    See here (http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122tcr/122tvr/vrg_g1.htm#wp1505752) for details.

  • Set atribute value from session bea while creating new record using ADF BC

    hi,
    i want to set the value of new record attribute from session bean while
    using ADF BC using creation form. how can i set the value of a perticular arribute of a record to the value stored in session bean.

    Chapter 9 in the ADF Developer's Guide for Forms/4GL Developers (available on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html ) describes how to accomplish this along with other typical kinds of programmatic business logic.

  • Handling Session in jsp and bean scope

    i have problems with handling session in jsp
    I want to check on all jsp pages
    first thing is session is null
    i want to him to be redirected to first page
    and he should not be able to go ahead
    I tried
    if(session ==null)
    response.sendRedirect("Login.jsp");
    but this does not seem to work
    It is very crtical problem can any one answer
    this asap
    Also i wanted to know that
    I have bean which in turn calls static methods of another class which holds all DomainTable(database tables which do not change frequently)
    Information .
    This is bean is being implemented by me
    in seession scope in a jsp
    Do u guys think it would be goo idea to change
    scop of this bean as Application in jsp
    if so what would be advantages for same
    I would appericate if i could a quick reply on both
    question
    as i am time crunch
    arsh

    You will always get some value of session and your code wont work. At the end of your Login.jsp, you should create a sesssion and store attributes. Check for these attributes in session, rather than checking session==null.

Maybe you are looking for