Session becoming NULL

I am working on struts application.
When we restart Tomcat, it's working fine.
After few days, session becoming null in particular area of the application. Otherthan that area, application is working fine. If we restart Tomcat, then it's works fine.
There is no problem with database (MySQL). Previously, we started db with max_allowed_packets=50M as default.
struts-config.xml contains the following content:
<data-sources>
      <data-source key = "jdbc/RFS">
         <set-property property = "password" value = "rfs" />
         <set-property property = "minCount" value = "1" />
         <set-property property = "maxCount" value = "50" />
         <set-property property = "user" value = "rfs" />
         <set-property property = "driverClass" value = "com.mysql.jdbc.Driver" />
         <set-property property = "description" value = "" />
         <set-property property = "url" value = "jdbc:mysql://172.23.7.64:3306/rfs" />
         <set-property property = "readOnly" value = "false" />
         <set-property property = "autoCommit" value = "true" />
         <set-property property = "loginTimeout" value = "" />
      </data-source>
      </data-sources>Please let me know the usage of loginTimeout.

Hi,
Session Create Code in Login file
HttpSession hs = req.getSession( true );
hs.setAttribute( "user", lb.getUsername() ); // username() is ur unique id
Session Tracking code in all file
               HttpSession hs=request.getSession();
               if ( hs == null || hs.getAttribute( "user" ) == null )
                    response.sendRedirect ( "./index.jsp" );
Logout code
HttpSession hs=req.getSession(false);
               hs.setAttribute( "user", null );
               hs.invalidate();
               res.sendRedirect ( "./index.jsp" );
// I hope this snippet will help u..

Similar Messages

  • Existing session is becoming null when returning from jsp

    Hi Guys !
    I have an urgent requirement to meet in few days from now and got stuck with session problem in servlet.
    Scenario :-
    For the first time when i call a servlet a new sessoin is created and after some validations i forward to a jsp which has some links.
    I have printed sessoin ids from both the servlet and jsp and they are same.
    Now when i clicked on the link in jsp , the servlet is called but session is lost its becoming null.
    Servlet Code :
    HttpSession session = request.getSession(false);
    if(session ==null){
    // create session code ....using getSession(true)
    RequestDispatcher r = servletcontext.getRequestDispatcher(resp.encodeURL("/user.jsp"));
    jsp code:-
    <a href="<%=response.encodeURL(/application/servlet/ViewUser") %">" > View User </a>
    GUYS GIVE ME A SUGGESTION IN THIS REGARD AS SOON AS POSSIBLE .....
    Thanks in advance !
    Aparna</a>

    Hi,
    Session Create Code in Login file
    HttpSession hs = req.getSession( true );
    hs.setAttribute( "user", lb.getUsername() ); // username() is ur unique id
    Session Tracking code in all file
                   HttpSession hs=request.getSession();
                   if ( hs == null || hs.getAttribute( "user" ) == null )
                        response.sendRedirect ( "./index.jsp" );
    Logout code
    HttpSession hs=req.getSession(false);
                   hs.setAttribute( "user", null );
                   hs.invalidate();
                   res.sendRedirect ( "./index.jsp" );
    // I hope this snippet will help u..

  • Window.opener becoming null after 10 seconds

    Wondering if anyone else has ran into this problem...
    function refreshMe()
    var openerObj = window.opener;
    window.close();
    alert(openerObj);
    openerObj.opener.location.href = openerObj.opener.location.href;
    openerObj has a value of [object DOMWindow] when a new window pops up. But when I wait approximately 10 seconds the value is becomes null.
    Any suggestions or advice you may have is appreciated.

    Basically I'm using Javascript to pop up a window (child). That window changes to another URL (sub child) after a user selection... Once that pop up form submission is complete I want to refresh the original parent window and close the sub child.
    To accomplish this I'm using window.opener.opener.location.href (the original URL) which should be saved by Safari. The problem is after approx. 10 seconds the window.opener variable becomes null. I'm guessing this is something related to Sarfari and not my code...
    However, I'm open to any suggestions. Thank you.

  • Data automatically become null in Oracle 11g DB

    We setup an Oracle 11g database for our application. Yesterday I have noted that in a table Contract_Owner the effective date for the owner FQYX1 is 30-Oct-12. But all of a sudden it has become NULL today. Im not sure how it has changed from 30-Oct-12 to NULL.
    Any ideas/thoughts will be appreciated greatly ....
    Edited by: 959598 on Apr 18, 2013 2:03 AM

    Oracle wouldn't change a value to a NULL unless it is told to do so.
    It could have been a user , a developer, a power user / super user.
    It could have been application code.
    It could have been a trigger.
    It could have been a mistakenly-written update.
    It could have been a scheduled job or a one-off job.
    Hemant K Chitale

  • Dropdown values becoming null after deployment

    Iam using jdev 10.1.3.4 and oc4j 10.1.3.4 server.
    we have a ADF table in a page in the application with three dropdowns. when i run the page in jdev the values are getting populated correctly for every record.But After deployment, for some records the values in the dropdowns are becoming null. we have 85 records in our Database for which only 5 records have this problem after deployment. But this works fine in local server.
    Any help will be appreciated.
    Thanks,
    Lakshmi.

    Thank you very much for answering...
    I can't send all the code because it needs plenty of files to run. I'll just describe the "critical" parts of it:
    - my main class extends JPanel and implements ActionListener + FocusListener + ListSelectionListener
    - the JTable is declared by private JTable myTable = null;
    - the table is inited by a call to a private void method, with the followind code:
       myTable = new JTable(cellData,colNames);
       myTable.setName("my_table");
       myTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       //... - the table is then put in a scroll pane:
       sTable = new JScrollPane(myTable);and the scroll pane put in the NORTH of a JPanel.
    - I put a listener on the table by:
       myTable.getSelectionModel().addListSelectionListener(this);Here is the most part of the misfuntionning code... the table goes well until the listener generates events... then the myTable instance becomes NULL.
    Thanks in advance for thinking about the problem's causes,
    Cheers.

  • DynamoHttpServletRequest becoming null

    Hi,
    We are getting null pointer error because of DynamoHttpServletRequest becoming null. Any clue on what scenario request leak can happen in ATG. We are using ATG10.1.2.
    Also in logs I can see following warning before I encounter null request.
    atg.servlet.ServletUtil Detected currentRequest leak. Set trackSetCurrentRequest to true to debug this issue.
    I do not see any extra errors in the logs.

    as Shaik suggested check your web.xml it should have Filter and Filter url pattern mapping for example
    <filter>
    <filter-name>PageFilter</filter-name>
    <filter-class>atg.filter.dspjsp.PageFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>PageFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

  • Bindings are becoming null

    Hi All,
    I am working in ADF 10.1.3.3 .
    I have a class where I have overridden the Prepare Model method.
    In this I am executing a Query using Iterator Bindings for the VO.
    When the page is loaded Query is executing fine , but when I come from other page to my page, bindings are becoming null.
    What is the solution for this?
    Pls help me.
    Thanks,

    Hi,
    as stated in the developer guide, the binding content is not available between requests, which means that you wont have it available e.g. in a restore view phase
    Frank

  • Page values becoming null

    Hi,
    I've created a quotation form, In that, I've created a application process to get details of a customer from the customer master. If I'll enter Customer ID, details are coming automatically. The problem is, If the customer is not existing in the master, I'm entering customer details directly into the form without id and I'm saving these details in the quotation table. I can see the details also in the table. But when I'm editing the exiting quotation, I can see all details in the form, But When I press any button all other details are existing. But related to customer details are just becoming null. This is happening only in the form. Details are existing in the quotation table.
    What could be the problem.
    Thanks and Regards,
    Sudha.

    Hi Sudha,
    Without seeing the page this is my best guess as to what is happening.
    If you have created the form using the automated row fetch wizard it will by default have created a reset page process. When you resubmit the page this will be clearing the form items. If this is the case you will need to change the behavior of this process.
    cheers,
    Ron

  • An instance was created, but it becomes null later

    I just start to work on an existing Java web application. I build a class. UserDAO which wrap a home-grown DB connection pool. And a client of this class is something like:
    Class A {
    private UserDAO userDAO;
    public A(){
    userDAO = new UserDAO();
    if(userDAO == null)
    System.out.println("The instance can't be created"):
    public void method1(..){
    userDAO.doSomething();
    }The instance in the method1 becomes null for a reason I don't understand. This instance is never set to null as any point of the application.
    When I test the code with a small piece of testing code, the situation doesn't occur, however.
    Can anyonee see any reasons?
    Thanks.

    uj_ wrote:
    vwuvancouver wrote:
    The instance in the method1 becomes null for a reason I don't understand. This instance is never set to null as any point of the application.Maybe the A() constructor isn't run. Maybe there's another constructor that's used which doesn't assign an object to userDAO?
    Or maybe userDAO is reset to null somewhere in the class.
    It can only be one of these.There's a third - albeit very unlikely - option. The omitted code from method1 has a local reference called userDAO that isn't assigned to anything. Unlikely, but it's a mistake people have made in the past. I'm with you, though, it's probably that the default constructor ain't being called

  • On making call to Oracle procedures from Java, Value becomes null on oracle

    We are using some user defined Oracle data types in my Java/J2EE application
    and some of them are Oracle collections(ex. VARRAY).
    We are making a call to Procedures/Functions from Java, there are some
    parameters of user defined data types declared in the
    procedures/functions, from java the values are properly setting to these
    user defined data type parameters and sending to Procedures.
    We are not getting any exception at Java side and Oracle side and values
    are becoming blank/null at oracle procedure side for the parameters of
    user defined data types.
    But when do the count of collection of user defined data type then it is
    properly giving the size of collection(VARRAY).
    When we are trying to read the values from the collection(VARRAY) it is
    giving blank/null value and there is no exception.
    Please let me know if you have any suggestion on this?

    user7671994 wrote:
    When we are trying to read the values from the collection(VARRAY) it is
    giving blank/null value and there is no exception.If you are talking about VARCHAR2 parameters of the objects - then you should add orai18n.jar to classpath.

  • Session geting null in AM Impl class

    All,
    In my root AM IMPL class i am setting the session variables as follows
            if(pAccountNumber!=null) getSession().getUserData().put("accountNumber",  pAccountNumber);
            System.out.println("User Account Number from Session is : " + getSession().getUserData().get("accountNumber")); //this value is getting printed
            if(pBranch!=null) getSession().getUserData().put("branch", pBranch);
            if(pItem!=null) getSession().getUserData().put("item", pItem);
            if(pOrganizationCode!=null) getSession().getUserData().put("organizationCode", pOrganizationCode);
            if(pCustomerId!=null) getSession().getUserData().put("customerId", pCustomerId);
            if(pCustomerName!=null) getSession().getUserData().put("customerName", pCustomerName);In my AM impl class extending the root Ampl class i am calling the getSession() like this
            ViewObjectImpl itemStockVo = getItemStock();
            _logger.fine("Account Number from Session : " + getSession().getUserData().get("accountNumber")); //this is printing as nullPlease advice what is wrong here ?
    thnks
    jdev 11.1.1.5

    Yes can be but as i have not disabled the AM pooling and the account name is coming null evne in the first go, i sense that may not be the issue (I may be wrong here).
    For your second part Timo, i am setting the session value as the default activity when the taskflow loads and i am trying to get it in the next view activity

  • ADF Bug? SelectOneChoice in af:column becomes null after refresh

    Hello,
    I just discovered a serious issue in my code (ADF 11.1.1.4/Windows 7). I was able to reproduce the issue using the following code :
    I have a table mapped to a Widget ViewObject listing some widget definitions. On of the column represents the widget type id. I use an af:selectOneChoice and the widgetTypeId is mapped to the WidgetType ViewObject (the category name is displayed)
    The page definition :
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="11.1.1.59.23" id="testFramePageDef"
                    Package="com.test.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables"/>
        <iterator Binds="WidgetView1" RangeSize="25"
                  DataControl="AppModuleDataControl" id="WidgetView1Iterator"/>
        <iterator Binds="WidgetTypeView1" RangeSize="-1"
                  DataControl="AppModuleDataControl" id="WidgetTypeView1Iterator"/>
      </executables>
      <bindings>
        <tree IterBinding="WidgetView1Iterator" id="WidgetView1">
          <nodeDefinition DefName="com.test.model.views.dashboard.WidgetView"
                          Name="WidgetView10">
            <AttrNames>
              <Item Value="WidgetId"/>
              <Item Value="WidgetTypeId" Binds="WidgetTypeId"/>
              <Item Value="Name"/>
              <Item Value="Reference"/>
              <Item Value="Description"/>
              <Item Value="StrId"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
        <list IterBinding="WidgetView1Iterator" id="WidgetTypeId"
              DTSupportsMRU="true" StaticList="false"
              ListIter="WidgetTypeView1Iterator">
          <AttrNames>
            <Item Value="WidgetTypeId"/>
          </AttrNames>
          <ListAttrNames>
            <Item Value="WidgetTypeId"/>
          </ListAttrNames>
          <ListDisplayAttrNames>
            <Item Value="Name"/>
          </ListDisplayAttrNames>
        </list>
      </bindings>
    </pageDefinition>The jsf page displays the widgets name and type, which are both modifiable. I also added previous/next buttons :
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:c="http://java.sun.com/jsp/jstl/core">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:messages id="m1"/>
          <af:form id="f1">
            <af:panelStretchLayout id="ptstc">
              <f:facet name="top">
                <af:panelGroupLayout id="pglact" layout="horizontal">
                  <af:commandButton id="cbprv" action="#{userBean.previous}" text="Previous"/>
                  <af:commandButton id="cbnxt" action="#{userBean.next}" text="Next"/>
                </af:panelGroupLayout>
              </f:facet>
              <f:facet name="center">
                <af:table value="#{bindings.WidgetView1.collectionModel}" var="row"
                          rows="#{bindings.WidgetView1.rangeSize}"
                          emptyText="#{bindings.WidgetView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.WidgetView1.rangeSize}"
                          rowBandingInterval="0"
                          selectedRowKeys="#{bindings.WidgetView1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.WidgetView1.collectionModel.makeCurrent}"
                          rowSelection="single" id="t1">
                  <af:column sortProperty="WidgetId" sortable="false"
                             headerText="#{bindings.WidgetView1.hints.WidgetId.label}"
                             id="c3">
                    <af:inputText value="#{row.bindings.WidgetId.inputValue}"
                                  label="#{bindings.WidgetView1.hints.WidgetId.label}"
                                  required="#{bindings.WidgetView1.hints.WidgetId.mandatory}"
                                  columns="#{bindings.WidgetView1.hints.WidgetId.displayWidth}"
                                  maximumLength="#{bindings.WidgetView1.hints.WidgetId.precision}"
                                  shortDesc="#{bindings.WidgetView1.hints.WidgetId.tooltip}"
                                  id="it5">
                      <f:validator binding="#{row.bindings.WidgetId.validator}"/>
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.WidgetView1.hints.WidgetId.format}"/>
                    </af:inputText>
                  </af:column>
                  <af:column sortProperty="WidgetTypeId" sortable="false"
                             headerText="#{bindings.WidgetView1.hints.WidgetTypeId.label}"
                             id="c1">
                    <af:selectOneChoice value="#{row.bindings.WidgetTypeId.inputValue}"
                                        label="#{row.bindings.WidgetTypeId.label}"
                                        required="#{bindings.WidgetView1.hints.WidgetTypeId.mandatory}"
                                        shortDesc="#{bindings.WidgetView1.hints.WidgetTypeId.tooltip}"
                                        id="soc1">
                      <f:selectItems value="#{row.bindings.WidgetTypeId.items}"
                                     id="si1"/>
                    </af:selectOneChoice>
                  </af:column>
                </af:table>
              </f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>Here is the code from my backing bean :
        private int widgetId = 1010;
        public void previous(){
          text = "action";
          AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject vo = am.getWidgetView1();
          widgetId--;
          vo.setWhereClause("WIDGET_ID="+widgetId);
          vo.executeQuery();
        public void next(){
          text = "action";
          AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject vo = am.getWidgetView1();
          widgetId++;
          vo.setWhereClause("WIDGET_ID="+widgetId);
          vo.executeQuery();
        }Now the issue : if I open the page, the entire widget table is displayed. I click on 'next' and the first record is displayed with correct name and type. If a do a refresh by hitting F5, the action is re-executed and the second row is displayed, also with correct name and type. But if I select 'previous', I come back to the first row but the type is now set to null(0).
    Can you tell me if this code is correct and if yes : are you able to reproduce it? / is this an ADF bug?
    Thank you
    Stephane
    Edited by: drahuks on 9 mai 2011 01:32

    Frank,
    The backing bean is session scoped.
    I tried a second solution using af:iterator and af:selectItem instead of af:selectItems :
    pageDef :
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="11.1.1.59.23" id="testFramePageDef"
                    Package="com.test.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables"/>
        <iterator Binds="WidgetView1" RangeSize="25"
                  DataControl="AppModuleDataControl" id="WidgetView1Iterator"/>
        <iterator Binds="WidgetTypeView1" RangeSize="-1"
                  DataControl="AppModuleDataControl" id="WidgetTypeView1Iterator"/>
      </executables>
      <bindings>
        <tree IterBinding="WidgetView1Iterator" id="WidgetView1">
          <nodeDefinition DefName="com.test.model.views.dashboard.WidgetView">
            <AttrNames>
              <Item Value="Name"/>
              <Item Value="WidgetTypeId"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
        <table IterBinding="WidgetTypeView1Iterator" id="WidgetTypeLov">
          <AttrNames>
            <Item Value="Name"/>
            <Item Value="WidgetTypeId"/>
          </AttrNames>
        </table>
      </bindings>
    </pageDefinition>jspx :
    <af:selectOneChoice value="#{row.WidgetTypeId}"
                                        id="soc1">
                      <af:forEach var="typeNode"
                                  items="#{bindings.WidgetTypeLov.rangeSet}">
                        <af:selectItem id="sit" value="#{typeNode.WidgetTypeId}"
                                        label="#{typeNode.Name}"/>
                      </af:forEach>
                      <!--<f:selectItems value="#{row.bindings.WidgetTypeId.items}"
                                     id="si1"/>-->
                    </af:selectOneChoice>Still get an issue : when hitting F5 I get a nullpointer exception. Here is the debug :
    <ADFLogger> <begin> Execute query
    <ViewObjectImpl> <buildQuery> [1960] _LOCAL_VIEW_USAGE_com_test_model_views_dashboard_WidgetView_WidgetTypeView1>#q computed SQLStmtBufLen: 112, actual=85, storing=115
    <ViewObjectImpl> <buildQuery> [1961] SELECT WidgetType.WIDGET_TYPE_ID,         WidgetType.NAME FROM WIDGET_TYPE WidgetType
    <ViewObjectImpl> <getPreparedStatement> [1962] ViewObject: [com.test.model.views.WidgetTypeView]AppModule._LOCAL_VIEW_USAGE_com_test_model_views_dashboard_WidgetView_WidgetTypeView1 Created new QUERY statement
    <ViewObjectImpl> <bindParametersForCollection> [1963] Bind params for ViewObject: [com.test.model.views.WidgetTypeView]AppModule._LOCAL_VIEW_USAGE_com_test_model_views_dashboard_WidgetView_WidgetTypeView1
    <ViewObjectImpl> <bindParametersForCollection> [1964] For RowSet : _LOCAL_VIEW_USAGE_com_test_model_views_dashboard_WidgetView_WidgetTypeView1_0
    <ADFLogger> <addContextData> Execute query
    <ADFLogger> <addContextData> Execute query
    <ADFLogger> <addContextData> Get LOV list
    <MessageFactory> <getMessage>
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUCtrlListBinding.processNewInputValue(JUCtrlListBinding.java:3834)
         at oracle.adfinternal.view.faces.model.HierNodeBindingELResolver.setValue(HierNodeBindingELResolver.java:77)
         at oracle.adfinternal.view.faces.model.AdfELResolver.setValue(AdfELResolver.java:132)
         at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:283)
         at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:252)
         at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:278)
         at com.sun.el.parser.AstValue.setValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.setValue(Unknown Source)
         at org.apache.myfaces.trinidad.component.UIXEditableValue.updateModel(UIXEditableValue.java:289)
         at org.apache.myfaces.trinidad.component.UIXEditableValue.processUpdates(UIXEditableValue.java:252)Stephane
    Edited by: drahuks on 10 mai 2011 04:09

  • Problem when passing string array in sessions showing null value

    i am trying to pass a string array but it is showing me the null value
    i think the the problem is seem to be in session.settAttribute("subject['"+i+"']",subject) in 2.login_action.jsp
    or in String sub1=(String) session.getAttribute("subject[0]"); in 3.user_home.jsp
    i have following three pages
    1.login.html
    2.login_action.jsp
    3.user_home.html
    1.login.html
    <html>
    <body>
    <form method="post" action="login_action.jsp">
    Username<input type="text" name="username"></input>
    <br>
    Password<input type="password" name="password"></input>
    <input type="submit" value="login"></input>
    </form>
    </body>
    </html>
    2.login_action.jsp
    <%@ page contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <%!
    String user,pwd;
    String subject[]=new String[10];
    int i,totalsubject;
    %>
    <%
    try
    user=request.getParameter("username");
    pwd=request.getParameter("password");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:ods","scott","tiger");
    PreparedStatement ps = con.prepareStatement("select password from users where username='"+user+"'");
    ResultSet rs = ps.executeQuery();
    if(rs.next())
    if(rs.getString("password").equals(pwd))
    session.setAttribute("username",user);
    PreparedStatement ps2 = con.prepareStatement("select subject_id from allot_teachers where staff_id='"+user+"'");
                        ResultSet rs2 = ps2.executeQuery();          
                             while(rs2.next())
                             i=0;
                             subject[i]=rs2.getString(1);
    // if i display here the subjects in out.println(subject[i]) it is working fine
    // but in next redirected page it is showing null
                             session.setAttribute("subject['"+i+"']",subject[i]);
                             //out.println(subject[i]);
                             i++;
    response.sendRedirect("user_home.jsp");
    else
    out.println("error invalid username or password");
    else
    out.println("error invalid username or password");
    con.close();
    catch(Exception e)
    out.println(e);
    %>
    3. user_home.jsp
    <%@ page contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <html>
    <%
    String user,pwd,cat,cat1;
    String username=(String) session.getAttribute("username");
    if(username==null)
    response.sendRedirect("login.html");
    //just tried for first two subjects
    String sub1=(String) session.getAttribute("subject[0]");
    String sub2=(String) session.getAttribute("subject[1]");
    //here it is printing null
    out.println(sub1);
    //here it is printing null
    out.println(sub2);
    %>
    <form method="post" action="logout.jsp">
    <input type="submit" value="Logout"></input>
    </form>
    </html>
    Cheers & Regards
    sweety

    The name in getAttributre doesnt match the name in setAttribute.
    Note "subject[0]" is a string containing 10 chars, "subject" is a string containing 7 chars.
    Here is your code:
    session.setAttribute("subject",subject);
    String sub1=(String) session.getAttribute("subject[0]");

  • Session variables - null

    In my application, when a user logs in, I add some user info to the session which I access on subsequent pages. Its working fine.
    But, when I run my application inside a portlet in the Oracle portal and read the values of session variables, they turn out to be null.
    What could be the problem?

    Not sure what the portlet thing for Oracle portal is, but the first thing I'd check is that the browser is getting the session ID cookie from the server. It's the most likely problem, since if the session ID is not sent to the browser, subsequent requests can't send it back, thus the server can't get the same session back. If you can't figure out how to get the cookie to come thru (assuming that's the problem), you'd have to use URL rewriting (response.encodeURL()) to encode all URLs for all links and forms to get the session ID added to the link.

  • Safari 5.1.2 browsing sessions become idle..

    As of last week, my safari browser hasn't been working properly. For some strange reason the pages I visit seem to become idle for no apparent reason, especially if I spend a few minutes on a page simply browsing or writing a message. When I click to access a following page or opening a new page, I have to disconnect my wifi and reconnect. The pages then load like normal and browsing resumes, until I have to repeat this process again later down the line.
    This is not only frustrating, but I am concerned because the same has been happening with other browsers like google chrome and firefox, which I tried out to see if they had the same problem. My wifi is working fine and has a very strong connection, so I don't know what the problem is... I must add that this all started happening, after my laptop had a bit of a knock. I hope nothing has been damaged inside to cause my current browsing problem. I hope someone can help. Having to constantly kickstart Safari this way is driving me mad!

    How much free space on the starup disk?
    Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure there's a minimum of 15% free disk space.
    And you may want to check the startup disk. It may need repairing.
    Launch Disk Utility. That's located in /Applications/Utilities
    Select the startup disk in the panel on the left then select the First Aid tab.
    Select Verify Disk  (not Verify Disk Permissions)
    If the disk needs repairing, follow the instructions for Using Disk Utility to verify or repair disks
    Check your up and download internet speeds here >  http://www.speedtest.net/

Maybe you are looking for

  • Activate projects in controlling area RCPL in 2011

    Dear sir i am create WBS , Ofter goods issue on MB1A ,MVT 221 , ofter enter wbs that time below error is come "Activate projects in controlling area RCPL in 2011" please provide ofter create WBS how to assign  wbs  over company,

  • Clearing of reservations -reg

    Friends , issue is like this a component has been deleted from BOM, its CS15 is nothing , its not used any BOMs Still PRs are getting generated in MRP for that part number when analysed its understood that there are few Production Orders which are pa

  • Anyone get this before "Unable to Assemble Book" -

    anybody get this when trying to buy a iphoto book-  "Unable to Assemble Book" - It goes through the process of assembling the book- line is all blue, but then it does not upload it

  • Content Filters

    Content Filters have been selected  through My Verizon Security Suite; however, it blocks TV shows that I would like to watch.  How do I prevent this?

  • Will anything happen to my internet  phone if i update it

    Ok so i was wondering if anything will hapen if i update my iphone to ios 6. i have iphone 4 and h2o will anything hAPPEN if i update it about the internet?????