Session attribute between JVMs

Hi,
I have a JSP try to send two session attribute from one JSP to another. The target JSP is in different WEB server (JVM). How can I do so that target JSP can use "session.getAttribute" to get the attribute?
1. Cann't use any JAVA Script in JSP.
2. Conn't show or send hidden because I don't want let user see the value of the variable.
Thanks
Kenny

SEND IT VIA HIDDEN BUT INSTEAD OF USING GET METHOD USE POST TO ADDRESS YR SECURITY CONCERNS

Similar Messages

  • Sharing session attributes between weblogic servers

    Hi,
    Is there any way to pass the session data of one Weblogic server to another Weblogic server.
    Thanks in advance.
    Regards,
    Sid

    You should protect all content with a security constraint in web.xml that matches all content.
    http://download.oracle.com/docs/cd/E21764_01/web.1111/e13711/thin_client.htm#i1042490

  • How to share session object between multiple WAR's

    I am Using servlet 2.3 & websphere 5.1 application server. I am using multiple war applications in my ear and i am able to share context-attributes & session attributes between wars. Can any one guide me how i can share session object?
    I am getting session -time out in first war even though i am doing some operation's in second war. I want to maintian the same session, even in my second war which was created in my first war.
    Can any one help me. Thanks in advance.

    Hi LNL,
    Can you explain more on singleton solution as you said....
    For session attributes & context attributes i am using persistent storage to retrive them in multiple wars. My problem is how should i use "session object" in my second war which was created in my first war.

  • Passing attributes between providers and portlets

    When using Providers, it is possible to pass session data between providers via ProviderContext.setSessionProperty. Is it possible to pass attributes from a provider to a portlet? Anything set on the ProviderContext does not seem to get propagated to the portlet via PortletSession.getAttribute(). Similarly the attributes set on the provider's request object to not seem to be propagated to the PortletRequest.

    My understanding is that Providers are the Sun proprietary portal technology, predating JSR 168 and Portlets.
    You can use Portlets to implement leaf channels ... but you must still write Providers if you want to fiddle with containers.

  • Some session attributes lost

    hi
    traversing between different jsp pages,
    I find that three of the session attributes are lost.
    While it is set, I can print it and verify that it exists in the session.
    Is there any limit on the #, or is it something else.
    thanks in advance
    babu

    hi
    traversing between different jsp pages,
    I find that three of the session attributes are lost.
    When it is set, I can print it and verify that it exists in the session. But, when another page is called and then if I check, it is not present.
    Is there any limit on the #, or is it something else.
    thanks in advance
    babu

  • Java.lang.NullPointerException: IWSHttpSession: Session attribute name or v

    Hi ,
    I could deploy Web module (war) file on iPlanet 6.0 sp7. But when I try to run the app in the browser, I get the following error :
    Has anyone come across this same issue?
    Thanks.
    Peter
    p.s. I do not have this issue with Sun One 7.0 Ap Server.
    Start of Server Log
    [30/Jun/2004:09:59:15] info ( 1540): successful server startup
    [30/Jun/2004:09:59:15] info ( 1540): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:09:59:15] info ( 1540): Installing a new configuration
    [30/Jun/2004:09:59:15] info ( 1540): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:09:59:15] info ( 1540): A new configuration was successfully installed
    [30/Jun/2004:09:59:15] info ( 1540): Internal error: unable to create JVM
    [30/Jun/2004:09:59:15] failure ( 1540): Failure to load JVM (check your JRE)
    [30/Jun/2004:09:59:15] failure ( 1540): Late initialization failed: Error running init function(late) NSServletLateInit: unknown error
    [30/Jun/2004:09:59:15] info ( 1540):  Suspend Httpd Service
    [30/Jun/2004:10:04:29] info (  508): successful server startup
    [30/Jun/2004:10:04:29] info (  508): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:10:04:29] info (  508): Installing a new configuration
    [30/Jun/2004:10:04:30] info (  508): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:10:04:30] info (  508): A new configuration was successfully installed
    [30/Jun/2004:10:04:32] info (  508): Using the Java HotSpot(TM) Server VM v1.3.1_12 from Sun Microsystems Inc.
    [30/Jun/2004:10:04:32] info (  508): Java VM classpath: c:/program1/sun/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSServletLayer.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/AdminNativeUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaMiscUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet-2.3-filters-api.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jsp092.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jaxp.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/crimson.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/xalan.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jspengine.jar;
    [30/Jun/2004:10:04:32] info (  508): Loading IWSSessionManager by default.
    [30/Jun/2004:10:04:32] info (  508): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:10:04:33] info (  508): Successfully initialized web application environment (web-apps.xml) for virtual server (https-gutierc)
    [30/Jun/2004:10:40:36] warning (  508): for host 172.20.37.58 trying to GET /AFOWeb/start.do, send-file reports: can't find c:/program1/sun/iPlanet/Servers/docs-90/AFOWeb/start.do (File not found)
    [30/Jun/2004:12:18:51] info (  508):  Suspend Httpd Service
    [30/Jun/2004:12:18:52] info (  508): vs(https-gutierc)Closing the web applications
    [30/Jun/2004:12:19:03] info ( 1848): successful server startup
    [30/Jun/2004:12:19:03] info ( 1848): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:12:19:03] info ( 1848): Installing a new configuration
    [30/Jun/2004:12:19:03] info ( 1848): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:12:19:03] info ( 1848): A new configuration was successfully installed
    [30/Jun/2004:12:19:04] info ( 1848): Using the Java HotSpot(TM) Server VM v1.3.1_12 from Sun Microsystems Inc.
    [30/Jun/2004:12:19:04] info ( 1848): Java VM classpath: c:/program1/sun/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSServletLayer.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/AdminNativeUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaMiscUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet-2.3-filters-api.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jsp092.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jaxp.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/crimson.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/xalan.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jspengine.jar;
    [30/Jun/2004:12:19:04] warning ( 1848): msg_badAlias
    [30/Jun/2004:12:19:04] info ( 1848): Loading IWSSessionManager by default.
    [30/Jun/2004:12:19:04] info ( 1848): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:12:19:05] info ( 1848): Adding web application (/AFOWeb) at (C:/Program1/sun/iPlanet/Servers/docs-90/AFOWeb)
    [30/Jun/2004:12:19:06] info ( 1848): Loading IWSSessionManager by default.
    [30/Jun/2004:12:19:06] info ( 1848): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:12:19:12] info ( 1848): vs(https-gutierc)servlet 'action' class = 'org.apache.struts.action.ActionServlet' loaded in context = '/AFOWeb'
    [30/Jun/2004:12:19:12] info ( 1848): action: init
    [30/Jun/2004:12:19:21] info ( 1848): Successfully initialized web application environment (web-apps.xml) for virtual server (https-gutierc)
    [30/Jun/2004:12:20:58] failure ( 1848): Internal error: servlet service function had thrown ServletException (uri=/AFOWeb/start.do): javax.servlet.ServletException: IWSHttpSession: Session attribute name or value is null, stack: javax.servlet.ServletException: IWSHttpSession: Session attribute name or value is null
         at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:937)
         at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1071)
         at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:999)
    , root cause: java.lang.NullPointerException: IWSHttpSession: Session attribute name or value is null
         at com.iplanet.server.http.session.IWSHttpSession.setAttribute(IWSHttpSession.java:494)
         at com.infinity.imaging.afo.presentation.action.DoStartAction.execute(DoStartAction.java:45)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:937)
         at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1071)
         at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:999)

    I am not sure if this solved the problem.
    But now, I am using Sun One Web Server 6.1 sp1.
    You can download it from
    http://wwws.sun.com/software/download/products/4000635d.html
    Try using this and see if the problem gets resolved.
    Peter.

  • How to set session attributes in a bean?

    How do I set a session attribute in a server-side bean?
    I'm not sure if I asked the question the right way. What I meant is, while it's easy to set session attributes in a JSP page (session.setAttribute("sessionname", "sessionvalue")), I'd want to set such an attribute within a server-side bean defined in this web application. But what is the syntax for doing it?

    Here a simple bean that stores something in the session and retrieves something from it.
    import javax.servlet.http.HttpSession;
    public class TestBean {
      private String value;
      public void doSomething(HttpSession session, int a, int b) {
        if (a+b > 0) {
          session.setAttribute("ab",Boolean.TRUE);
        } else {
          session.setAttribute("ab",Boolean.FALSE);
      public void init(HttpSession session) {
        if (session != null) {
          Boolean b = (Boolean)session.getAttribute("ab");
          if (b == Boolean.TRUE) {
            value = "a + b is greater than zero";
          } else {
            value = "a + b is not greater than zero";
        } else {
          value = "no session";
      public String getValue() {
        return value;
    }In your JSP, use something along the lines of :
    <%
      TestBean bean = new TestBean();
      bean.init(session);
      bean.doSomething(session,1,2);
    %>If your bean only lives during one request, you can pass the session to the constructor, which stores it in a private variable. This saves passing the session each time.
    Hope this helps,
    --Arnout                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Javascript to JSP question...Can javascript function set session attributes

    hello,
    i have a web app that, on one of its pages, displays "tabbed pane" as an image map at the top (a la amazon.com). my problem is this: each "logical" page contains separate forms that all use the same javabean. in other words, imagine that the tabs represent an account maintenance web ui for an on-line record store. the first tab might be labeled "General," the second "Contact info," the third "Shipping Info." Each uses the same account bean and displays portions of its properties relevant to the tab at hand. what i want to do is allow a user to enter the account maintenance ui, update info on the first tab, click on tab two and have the request with the changes sent to a processing jsp. yet, since each "tab" is actually a separate URL to another page, how do i get the updated info on the first tabe without adding some sort of "SAVE" button on each tab. ive considered using javascript, but dont know how to get the request params out of the first tab whn i click on another tab. is it possible to include an "onClick" function in each URL that "grabs" the updated form fields off the preceeding tab? can a javacript function set session attributes in jsp?

    hello there,
    wow, you've created one big mammy-jammy tool.
    first, javascript cannot access, set values to the session, without having to post to another JSP. javascript is great for manipulating objects, layers, form values, etc.
    you have 2 issues [if i understand correctly]:
    1) you need to able to save user info for a specific tab without having to reloading the page.
    ---you can create a form for EACH of your tabs and POST all the information to a hidden IFRAME or LAYER for NN4. that hidden IFRAME / LAYER will load a JSP page which with all the parameters you posted to it. or you can build a FRAMESET and target that document["frame-name"].src with that same JSP.
    2) handling when the SAVE INFO action should happen: hence some javascript event handler: onMouseOver, onClick, etc
    ---i don't know the dynamics of your tabs, but if store which tab was clicked on last, then if the user clicks on some other tab, javascript can submit that FORM to a JSP [see condition above]
    you have an interesting tool. can i see?
    i hope i wasn't too confusing, but your problem is sooo interesting. =)
    -WJP

  • How to get from data entered on a form to a session attribute

    I have a jsp with a form with fields that are updated by the user.
    The values are in the fields value as I expected.
    Example. document.frm.Name.value = "Me"
    How do I populate a session variable with document.frm.Name.value?
    I think I have to do a request.getParameter("Name") followed by a
    session.SetAttribute. But the request.getParameter does not get populated with the latest value in document.frm.Name.value.
    Any idea is welcomed. Thanks
    Claudiine

    Below is the code:
    What I want to do is save in the session attribute "mailToAddressList" whatever the user types in the textarea "MailTo"
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.sql.*;
    import java.text.*;
    import java.io.*;
    import com.cname.apl.*;
    public class DealTeamServlet extends HttpServlet {
    private appUtil util ;
    private java.sql.Connection conn ;
    private static String dbUrl ;
    private static String dbUid ;
    private static String dbPwd ;
    private static String mailFromAddressList ;
    private static String mailToAddressList ;
    private static String mailCcAddressList ;
    private static String mailBccAddressList ;
    private static String mailSubject ;
    SimpleDateFormat SDF = new SimpleDateFormat("d-MMM-yyyy");
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    dbUrl = config.getInitParameter("dbUrl");
    dbUid = config.getInitParameter("dbUid");
    dbPwd = config.getInitParameter("dbPwd");
    mailFromAddressList = config.getInitParameter("mailFromAddressList");
    mailToAddressList = config.getInitParameter("mailToAddressList");
    mailCcAddressList = config.getInitParameter("mailCcAddressList");
    mailBccAddressList = config.getInitParameter("mailBccAddressList");
    mailSubject = config.getInitParameter("mailSubject");
    if (dbUrl == null)
    dbUrl = "*" ;
    if (dbUid == null)
    dbUid = "*" ;
    if (dbPwd == null)
    dbPwd = "*" ;
    if (mailFromAddressList == null || mailFromAddressList.equals("*"))
    mailFromAddressList = "" ;
    if (mailToAddressList == null || mailToAddressList.equals("*"))
    mailToAddressList = "" ;
    if (mailCcAddressList == null || mailCcAddressList.equals("*"))
    mailCcAddressList = "" ;
    if (mailBccAddressList == null || mailBccAddressList.equals("*"))
    mailBccAddressList = "" ;
    if (mailSubject == null || mailSubject.equals("*"))
    mailSubject = "" ;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    HttpSession session = request.getSession(true) ;
    String msgBody = (String) request.getParameter("msgBody");
    String uid = (String) request.getParameter("uid");
    String key = (String) request.getParameter("key");
    Boolean isAuthorized = (Boolean) session.getAttribute("isAuthorized");
    java.io.PrintWriter out = response.getWriter();
    if (msgBody == null) msgBody = "" ;
    response.setContentType("text/html");
    if (uid == null || key == null) {
    isAuthorized = new Boolean(false);
    if ( isAuthorized == null ) {
    util = new appUtil();
    conn = util.getConnection(dbUrl, dbUid, dbPwd) ;
    isAuthorized = util.isAuthorized(conn, uid, key);
    util.closeConnection(conn) ;
    if ( isAuthorized.booleanValue() ) {
    session.setAttribute("isAuthorized", new Boolean(true));
    java.sql.Timestamp serverTime = util.getServerTime(conn) ;
    java.sql.Date now = new java.sql.Date(serverTime.getTime());
    int idEntry = Integer.parseInt(msgBody);
    mailToAddressList = request.getParameter("MailTo");
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Team Members</title>");
    out.println("<SCRIPT LANGUAGE=JavaScript>");
    out.println("function open_window() {");
    out.println("document.domain = \"ny.cname.com\"");
    out.println("var loc = \"http://peoplelkp.ny.cname.com/peoplelkp/PDLookupService?&emil2=eMail&form=frm&launch=myRoutine()&csr=1&srch=1&adv=1&wc=y&pump=\"");
    out.println("loc = loc + document.frm.Name.value");
    out.println("var w = window.open(loc,\"Model_Details\",\"scrollbars,width=400,height=450,resizable=yes\")");
    out.println("return;");
    out.println("}");
    out.println("function myRoutine() {");
    out.println("document.frm.MailTo.value=document.frm.MailTo.value+\",\"+document.frm.eMail.value;");
    out.println("}");
    out.println("function submitForm() {");
    out.println("alert('submit form')");
    out.println("var mailAdd = document.frm.MailTo.value");
    out.println("alert('mailAdd='+mailAdd);");
    out.println("if ( mailAdd.length == 0 || mailAdd.indexOf(' ') == 0 || mailAdd.indexOf('.com') == -1 || mailAdd.indexOf('@') == -1 ) {" );
    out.println("alert('The To: field must be populated. No space are allowed. Email addresses must have valid format. Example: [email protected]')");
    out.println("document.all.frm.MailTo.focus();");
    out.println("return false;");
    out.println("}");
    out.println("return true;");
    out.println("}");
    out.println("function UpdateMailTo() {");
    out.println("alert ('I am in UpdateMailTo='+document.frm.MailTo.value);");
    out.println("}");
    out.println("</SCRIPT>");
    out.println(util.getStyleSheet());
    out.println("</head>");
    out.println("<body bgcolor='silver'>");
    out.println("<form name='frm' action='SendMail' method='post'>");
    out.println("<b>Team Members</b>");
    out.println("<tr>");
    out.println("<TABLE cellpadding='0' cellspacing='0' border='0'>");
    out.println("<tr>");
    out.println("<td align='right'><b>Subject:  </b></td>");
    out.println("<td>Deal Team Members Cleared by Conflicts</td>");
    out.println("</tr><br>");
    StringBuffer bod = new StringBuffer("");
    SimpleDateFormat SDF = new SimpleDateFormat("d-MMM-yyyy");
    try {
    /*get header information*/
    CallableStatement st = conn.prepareCall("{call apl_get_sp ?}");
    st.setInt(1, idEntry);
    ResultSet rs = st.executeQuery();
    int id = 0;
    int dw = 0;
    String cde_proj = "";
    String nm_title = "";
    String nm_long = "";
    String empl = "";
    String sid = "";
    int userid = 0;
    String email_pr = "";
    while ( rs.next() ) {
    id = rs.getInt("id_entry");
    dw = rs.getInt("id_dealworks");
    cde_proj = rs.getString("cde_proj");
    nm_title = rs.getString("nm_title");
    nm_long = rs.getString("nm_long");
    empl = rs.getString("empl_name");
    sid = rs.getString("id_standard");
    email_pr = rs.getString("id_email_ext_unix");
    mailToAddressList = email_pr.trim();
    out.println("<tr><td align='right'><b>To:  </b></td>");
    out.println("<td><textarea name='MailTo' cols='50' rows='2'>"+mailToAddressList+ "</textarea></td>");
    out.println("<td>  </td>");
    out.println("<td><input type='button' value='Save' onClick='UpdateMailTo()'></td>");
    out.println("</tr>");
    // out.println("request.setAttribute('mailadd',document.frm.MailTo.value);");
    // mailToAddressList = request.getParameter("mailadd");
    out.println("<tr><td align='right'><b>Name:  </b></td>");
    out.println("<td><INPUT NAME='Name' VALUE='' size=65 ></td>");
    out.println("<td>  </td>");
    out.println("<td><input type='button' value='Search' onClick='open_window()'></td>");
    out.println("</tr>");
    out.println("<tr><td align='right'><b>EMail:  </b></td>");
    out.println("<td><INPUT NAME='eMail' VALUE='' size=65'></td>");
    out.println("</tr>");
    if (rslt != null) rslt.close() ;
    if (stmt != null) stmt.close() ;
    }/*end try*/
    catch ( Exception e) {
    System.out.println(e) ;
    getServletContext().log(e.toString());
    out.println("<td colspan='5' align='right'><input type='submit' value='Send email' onClick='submitForm()'></td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</form>");
    out.println("</body>");
    out.println("</html>");
    mailSubject = "Team Members";
    String body = "testing";
    session.setAttribute("mailFromAddressList", mailFromAddressList);
    session.setAttribute("mailToAddressList", mailToAddressList);
    session.setAttribute("mailCcAddressList", mailCcAddressList);
    session.setAttribute("mailBccAddressList", mailBccAddressList);
    session.setAttribute("mailSubject", mailSubject);
    session.setAttribute("mailBody", body);
    else {
    session.setAttribute("isAuthorized", new Boolean(false));
    out.println("You are not authorized.");
    //out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Short description";
    }

  • Problem removing session attributes

    I have a problem removing session attributes
    I try w/ mysession.removeAttribute("key");
    but it still lives in memory. I've tried setAttribute("key", null) as the API states that will do the same thing, but it doesn't work.
    I can get mysession.invalidate() to work, but I want to keep some of the attributes there, while removing another.
    I get no exceptions and no errors.
    Help.
    Running Tomcat 4
    jre 1.3.1

    Actually,
    response.addHeader("Expires", "-1");should be enough.
    The browser should then contact the Web server for updates to that page via a conditional If-Modified-Since request. You don't want a cache disabling 'overkill', since you'd still want the page to remain in the disk cache and used in appropriate situations without contacting the remote Web server, such as when the BACK and FORWARD buttons are pressed...
    Anyway, try this first, and if it doesn't solve your problem, add the other cache-disabling headers, as outlined in the previous post.
    If you're using JSP, verify also that your page has
    <%@ page session="true"%>

  • How to save the login ID as a session attribute ?

    I am using form-based authentication in a web application which is being deployed on a JBoss 3.2.3 server. I am authenticating against an Oracle database by way of a DatabaseServerLoginModule (JAAS).
    I would like to save the user's login ID as a session attribute in order to be able to use it later in the application.
    It's not obvious how you can capture this information and add it to the session, since it seems that the login ID is lost once the authentication is done by j_security_check process.
    Is there some way to tell the servlet container to save the login ID as a session attribute as part of the j_security_check process (something along the lines of "if the authentication succeeds add the login ID as an attribute to the session") ?
    Is there another approach ? What is the accepted "best practice" for doing session initialization after authentication ? For example if a user needs to have several attributes set in their session after login -- how is this handled ? I have done this before with a login servlet which did both the authentication and the session initialization, but when using form-based authentication and j_security_check it's not clear to me how you go from the authentication to the initialization logic.
    Thanks in advance for any suggestions or insight.

    You should already have it... hidden in request.getUserPrincipal().getName()

  • Variable coming from a session attribute

    Hello, I am developing a web application with JDeveloper 10g
    I've got a View Object which is basically a query, where I use a variable:
    WHERE BbCustomerOrderStatusTab.CUSTNO = :CustomerNumber
    When I define CustomerNumber in a form, it works:
    <af:panelForm>
    <af:inputText value="#{bindings.CustomerNumber.inputValue}"
    label="#{bindings.CustomerNumber.label}"
    required="#{bindings.CustomerNumber.mandatory}"
    columns="#{bindings.CustomerNumber.displayWidth}">
    <af:validator binding="#{bindings.CustomerNumber.validator}"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.ExecuteWithParams.execute}"
    text="ExecuteWithParams"
    disabled="#{!bindings.ExecuteWithParams.enabled}"/>
    </af:panelForm>
    But I would like CustomerNumber to come from a session attribute. I tried something like that:
    session.setAttribute("CustomNum","IRI0001");
    setCustomerNumber(session.getAttribute("CustomNum"));
    with the View Object Editor -> Client Interface setCustomerNumber selected, but it doesn't work.
    I tried :
    String CustNum=session.getAttribute("CustomNum");
    %>
    <af:attribute name="#{bindings.CustomerNumber}"
    value="<%= CustNum%>"/>
    but it tells me that "Attribute value does not accept runtime expressions".
    Does someone know how I could do that?
    Thanks,
    Romain

    Hi,
    Frank's suggestion should work.
    Most importantly, don't forget to declare your bind variable in your view object !!
    Your statement looks odd to me
    String CustNum=session.getAttribute("CustomNum");
    %>
    <af:attribute name="#{bindings.CustomerNumber}"
    value="<%= CustNum%>"/>
    There are many ways to do it. You may try using backing bean for command button's actionlistener or action like the following
    class myBackingBean
    private String CustNum; //of course with getter and setter method
    myButtonAction() {
    CustNum = yourFavouriteValue;
    OperationBinding ob = getBindings().getOperationBinding("ExecuteWithParams"};
    ob.execute();
    note you must declare CustomValue in your pageDef's binding to #{yourBackBeanClass.CustNum} in your ExecuteWithParams binding
    I don't know and seems not being recommended to set session value in jspx.
    Another way is inside your command button in the jspx
    <af:setActionListener from="#{somesource.value}"
    to="#{processScope.CustNum}"/>
    in such case, you must declare CustomValue in your pageDef's binding to #{processScope.CustNum} in your ExecuteWithParams binding
    If you have already set session value somewhere beforehand, then what you need to do is simply declare CustomValue in your pageDef's binding to #{sessionScope.CustNum} in your ExecuteWithParams binding.
    I did lot of ExecuteWithParams thing and no problems occur so far.

  • "Sharing" a stateful session bean between two servlets, beans

    Hello!
    I just started to learn some java ee programming and was wondering how i would share one stateful session bean between two servlets.
    I created the bean with @Stateful.
    I tried to inject the stateful bean in both servlets by @EJB and i can manipulate the object, but each servlet seems to have its own object.
    The bean has a remote interface that it implements.
    What i also tried was to add the mappedName to the @Stateful expression. Something like: @Stateful(mappedName="name") and to use the bean by @EJB(mappedName="name") but it had no effect.
    Im using glassfish 2.1 with netbeans 6.7.1 as my environment (standard settings)
    dummy question, but i googled like hours and couldnt find anything : \
    hope someone can help and sorry for my bad english
    greets and thanks

    Hi there!
    I think you are searching for something like an application wide singleton. There is the possibility to define such one in the Glassfish admin console.
    Hope this helps!

  • Unable set session attribute with certain types.

    Hello I was surprise that when I execute HttpSession.setAttribute("somekey", new HashMap()), "somekey" will not be stored in the Session. I can replace HashMap with HashSet and it's okay.
              Out of curiosity, I create a Java class like below :
              public class abc implements Serializable {
              public String def = "def";
              And I have the same issue with HashMap and it will not get stored in the Session attribute. Does anyone know what kind of valid object and what makes the object storable into the Session's attribute? Any inputs are appreciated. Thanks.
              yien

    Actually never mind. It have something to do with BEA's Portal Ad services. I will post this into the appropriate forum.

  • Setting session attributes at the Role level

    I am running AM7.1 in Legacy mode and I am trying to create a role and assign session attributes at this role level. I followed the instructions for doing this but it does not seem to be working. I created the role and added the session service to it. I then went in an changed the attributes (Max Idle, Max Session, etc.) to the values I need for the role. I then assigned the role to a user. However when I log in as this user and look at the Active Sessions panel all of the values are still saying they are set at the defaults. It is not picking up the new values for the user. Am I missing something? Help! -Jeff

    Reply i was also getting this problem in relam mode but 7.0..........but when i specify in the url?role=rolename..........i see the session info applied but i wanted it to be dyanmically applied(without specifiying the role in the url).......i have raised an SR but that is for 7.0 .........please do it for 7.1 i think you might get some response.

Maybe you are looking for

  • Can i register 2 iphones on 1 itunes account

    Can I register 2 iphones (my wife & I) with 1 itunes account?

  • Question re flash player??

    Does anyone know why since I installed the latest flash player I can't view pic galleries via internet explorer from the website that I run. Its fine if I want to access them through Google Chrome?

  • Bug information

    good day all some time ago i posted a problem that i was having with listboxes and i got a reply that stated my problem was a bug with bug number 6408472. is there any way that i can get more information on this bug? i have searched the sun developer

  • I cannot get firefox to load mymathlab and it was working last week

    i have to do my math homework on mymathlab and i cannot get it to load on firefox it is saying website is unavailable but i know it is not the website cause it works on other computers. please help

  • Is my db running in RAC mode or not?

    Friends, db: 10gR2 and 11gR2 In 10gR2 i dont have RAC. its a single instance db. 11gR2 i have 2 RAC Node. i know the below command will show the difference. select instance_number,instance_name,host_name from v$instance; but i want to know whether th