Updating session-timeout  value thru JSP

Hi,
I have a requirement that updates the Session time-out in the path Tomcat\conf\web.xml as given below.
<!-- ==================== Default Session Configuration ================= -->
<!-- You can set the default session timeout (in minutes) for all newly -->
<!-- created sessions by modifying the value below. -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
For exanple ,I want to set the session-timeout as 50 thru some html page .The necessary updation into the fle should replace the existing session -timeout 30 with 50.
The entire process should be done using jsp or servlets or thru general java program.
Can anyone help me how to resolve this .
Thanks
VR

Since the web.xml is loaded at startup of the server engine and affects the session-timeout of all sessions created in that invocation of the servlet engine I can't see how trying to update this file would help you.
If you want to update the session timeout after the engine has started up then you must use the method on HttpSession.setMaxInactiveInterval(50).
Hoep this helps.

Similar Messages

  • Showing updated lov target value in jsp

    I've tried to add an LOV to an edit.jsp page for employees. The LOV displays employee names and is used to change the ManagerId of an employee. It works fine, but when i've changed the ManagerId through the LOV, the changed value will not display.
    The page and the LOV use the same (target) attribute from the same iterator. Source attribute is not part of the master-detail relation (separate view on employees).
    How can i display the changed value?
    thanx in advance,
    Marko.

    Hi,
    Use end routine concept here .
    Regards,
    Anil Kumar Sharma .P

  • Implementing session timeout in JSP - - Urgent help !

    Hi
    I have a requirement where I need to write a session timeout functionality in a JSP such that the page is redirected to a different page if there is no activity for 5 min.
    I tried the following :
    1.On the onload of my JSP, i created a new session from the current request using the following code snippet :
              HttpSession pSession = request.getSession(true);
              pSession.setAttribute("loggedin","true");
              pSession.setMaxInactiveInterval(10);
    2. Then on any action performed on the JSP, i called the collowing JS function before invoking the server side code.
    /** function to check the user session **/
    function fnChkSession()
         alert('Inside check session');
         <%
              try
                   System.out.println("The value of the session var loggedin : "+pSession.getAttribute("loggedin").toString());
                   System.out.println(" getMaxInactiveInterval() value is : "+pSession.getMaxInactiveInterval());
              catch (Exception e)
                   System.out.println("** Inside the fnChkSession exception catch block **");
              if (pSession.getValue("loggedin") == null)
         %>
              alert('Session has expired');
              document.forms[0].submit();
         <% } %>
    But when I execute this code ,even after 10 secs my session seems to be alive.I can retrieve the session attribute after 10s.
    I also tried setting the session-timeout value in the web.xml. It didnt work.
    Can anyone pls help me on how to proceed further on this.
    Thanks
    Arun B

    You are confusing java with javascript.
    These two things are not the same.
    The lifecycle goes something like this
    1 - Request is made to server
    2 - Java/JSP runs java code, produces HTML page
    3 - java stops running
    4 - html is sent to browser, and javascript starts running.
    You cannot call java code from browser events (such as onload, onclick, onchange...) The only way to run java code again is to submit a request (normally by submitting a form, or clicking a link. )
    If you want a javascript solution, in IE, use the window.setTimeout() method to execute some javascript code after a certain period of time.
    A more generic approach would be to use the refresh header. Set the timeout for the refresh header to be 300 seconds. If the user stays on the same page for more than 5 minutes, it will redirect to the new page.
    Hope this helps,
    evnafets

  • JSP Session Timeout in multiple pages (iframes used)

    Hi,
    Here is my scenario. I have a JSP Page i.e. A.jsp in which I am setting a session timeout to 3 minutes. I also have another JSP included i.e. B.jsp in the same page (A.jsp) using the following code i.e.
    <IFRAME SRC="B.jsp" width="100%" height="800" frameborder="0" align="center">
             <!-- Alternate content for non-supporting browsers -->
    </IFRAME>I am also setting a session timeout to 1 minute in the B.jsp. Now if the session timeout in one of the pages i.e. A.jsp or B.jsp I want to route to a different page i.e. C.jsp.
    Now my problem is if the session timeouts in the B.jsp the C.jsp is shown inplace of the B.jsp page inside A.jsp. Means A.jsp still shows it's content at top and under it C.jsp is shown. I want to route to C.JSP page if a session timeouts in A.jsp or B.jsp and only show C.jsp.
    Any help is appreciated.
    Thanks

    Where exactly I put the javascript. Here is currently I am checking for the session timeout:
    String error = (String) request.getAttribute("Error");
        if (error != null)
            out.write("<center><strong>");
            out.write("<font color=\"Red\">");
            out.write(error);
            out.write("</font>");
            out.write("</strong></center>");
        response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
        response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
        response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
        response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility
        String userName = (String) session.getAttribute("User");
        if (null == userName)
            request.setAttribute("Error", "Session has ended. Please login.");
            RequestDispatcher rd = request.getRequestDispatcher("C.jsp");
            rd.forward(request, response);
    ................The same code is in A.jsp and B.jsp. If I want to use the javascript to check if it's the top frame or not and redirect properly where exactly I need to put that code.
    Thanks

  • How to fetch session timeout from the server

    Hi
    I want to subscribe about the value of the session timeout value from the server 
    from time to time , is there any way in the flex or through blazeds to achieve 
    this . 
    Thanks 
    Akshat

    Ernie,
    thanks for your suggestions. It seems my problem can't be solved in a smart way. To your question: My server space is limited ( 1 GB ), I use currently about 2/3 of it.
    I have access to the mails via the web interface and therefore I could forward the mails to my account but I would like to have all mails local on my Mac with the original time stamps and format. But that's not the case for forwarded mails. In addition for sure the problem is not solved, if I cure the current symptoms and I have no idea if it's caused by an update of my Mac or by the server.
    Werner

  • Trying to pass Hidden/Session variables from 1 JSP to 3rd JSP

    Hellol JSP Gurus !!
    This is a question on how a hidden or a value of a session variable can be passed from 1 JSP to a 3rd JSP, with the 2nd JSP as a Processing page.
    For eg., here's the scenario
    I have a Login page which has the hidden variables. Once the user enters the Login information, the info is validated in a LoginP.jsp (say, its a Processing page for the Login user/passwd info), which does a sendRedirect to a 3rd (Final) JSP which displays the values of the hidden/session variables of the 1st JSP.
    In my case, for some reason, I am not able to see the value for the hidden or the session variables in the 3rd JSP - they are null values.
    I am attaching some Duke dollars to who ever gives me the right solution.
    Thanks a lot in advance

    Use strings to set attributes;You can store any serializable object in the session. I doubt this will actually change anything.
    Anything wrong with the above code ?Not that I can see ... A number of other things can explain why you're getting null values out of the session. For example :
    - You are not using the implicit session obj in the 3rd jsp, but creating a new one and thus overwriting the one created previously
    - the session timeout value is unusually low, and by the time you're getting to the 3rd jsp, the session is invalidated and you're getting nulls. Verify your server config, or call session.getMaxInactiveInterval() to check the value. Check also if the session is new ( session.isNew() )
    Somebody already pointed this out : If the client does not support cookies and URL rewriting is not enabled, no session ID is returned to the server on a request, which the server then perceives as a new session.
    - Another (remote?) possibility : your 3rd jsp belongs to another webapp (i.e you're redirecting to another app context).
    If nothing of the above applies, post the jsp code and we'll try to help.

  • OAM Session timeout

    Hi All,
    I have the following set up configured.
    1)Deployed a web application in a plain(non oim suite related) weblogic domain
    2)Installed OHS,OAM,OIM and OUD
    3)Configured OHS,OAM,OIM and OUD for SSO in OAM with the external URL from the independent weblogic domain
    4)Independent Weblogic domain is configured with OAMIdentityAsserter and OUD Authentication provider
    My query is as below.
    I have the session time out value configured as 600(seconds) in weblogic.xml of the web application.
    Now when the access the web application through OHS SSO URL, the session is not waiting for 600 seconds to timeout,but getting invalidated in around 30 seconds.
    How to resolve this issue.
    Please advice.
    I have the following configured in OHS proxy.
    <Location /bc>
    SetHandler weblogic-handler
    WebLogicHost ZZZZZZ.oracle.com
    WebLogicPort 9001
    </Location>
    firebug show the following URL getting hit just after the session invalidation http://ZZZZZ.com/oam/server/obrareq.cgi?encquery%3DHBGRZNUhr5Ucxs
    and the following error gets logged in oam server
    "Session invalid as returned by CHECK_VALID_SESSION_RESPONSE responseEvent fail>"
    Kindly suggest.
    Thanks,
    Praveen

    Verify whats session timeout value present in below config:
    http://docs.oracle.com/cd/E27559_01/admin.1112/e27239/session.htm#AIAAG354
    To edit the OAM common session settings:
    Log in to Oracle Access Manager.
    Click System Configuration.
    From the Common Configuration panel, double-click Common Settings.
    In the Session area:
    In Session Lifetime, increase the current value.
    In IdleTimeout (minutes), increase the current value.
    Click Apply.
    ~J

  • Session timeout = 0 in sip.xml causes app session to expire instantly

    Hi
    I used 0 as the session timeout value by specifying in sip.xml. According to the JSR, 0 or less value for the session timeout implies session will never expire.
    However the session times out as soon as call is executed.
    <session-config>
    <session-timeout>0</session-timeout>
    </session-config>
    Thanks
    Ruchir

    Hi,
    A session must always expire eventually - it is impossible to practically reserver resources for a session indefinitely. The general interpretation of a "0" value is not that the session will be maintained indefinitely, but that it will be expired by the container based on the container's management of resources. It it not advisable to attempt to define sessions that will never expire in any case.
    BR,
    -Mike

  • Session Timeout Question in EME

    If I login to eManager Web and instead of logging out I just close the browser will I be logged out? Will the license be released? What is the session timeout for this and is it possible to set this value?

    If you close the browser in e-Manager Enterprise Web instead of logging out there is a TimeOut that will release your license. This can be seen and is reported on in the e-Manager logs. By default the session TimeOut value is 30 minutes. You can find this and/or change this value by opening "<installdir>\Empirix\EmpAppServer\server\default\deploy\jbossweb-tomcat55.sar\conf\web.xml" in a notepad. Once the file is open, go the the ?Default Session Configuration? Section. Here you can change the TimeOut value. You will then need to save the file and restart the Empirix Application Service. The idle sessions are retired after the specified timeout is reached and the licenses are also checked upon this value. I hope this answers your questions.

  • Session Timeouts - User modifiable

    I'm looking for a way for a user to be able to increase their session &
    idle timeouts after logging in. I want the user to have to make the
    choice to increase them, every time they login.
    On checking the API we have getMaxSessionTime() and getMaxIdleTime()
    exposed in com.iplanet.portalserver.session, but not setMaxSessionTime()
    & setMaxIdleTime(). After a little digging I found these hidden in
    com.iplanet.portalserver.InternalSession.
    The other option I'd like to provide to users is the ability to
    reauthenticate a session. Again I found this hidden in the
    InternalSession class.
    Is there any reason the API is missing these key features?

    These are internal api's that were not meant to be exposed.
    Internal api's could change any time, as part of our current release
    we limited changing of the users session timeout values to the
    administrator ...
    KArthik !
    David Rather wrote:
    I'm looking for a way for a user to be able to increase their session &
    idle timeouts after logging in. I want the user to have to make the
    choice to increase them, every time they login.
    On checking the API we have getMaxSessionTime() and getMaxIdleTime()
    exposed in com.iplanet.portalserver.session, but not setMaxSessionTime()
    & setMaxIdleTime(). After a little digging I found these hidden in
    com.iplanet.portalserver.InternalSession.
    The other option I'd like to provide to users is the ability to
    reauthenticate a session. Again I found this hidden in the
    InternalSession class.
    Is there any reason the API is missing these key features?

  • EJB 3.0 Stateful - Setting session timeout in configuration

    Hello Everyone,
    I am working with EJB v3.0 and Glassfish as the app server. In case of Stateful EJB, when we explicitely annotate a method with '@Remove', the bean instance is removed from the container when this method is invoked from the client. However, I just wanted to know if there is any way so that I can override the session timeout value (in configuration or via annotations) such that if no client calls this instance for some configured time, the bean is removed by the container automatically.
    Regards,
    San

    Using a Stateful Session facade from a Servlet is not necessarily a bad design. In some cases, you may want to do some cleanup work on completion of a transaction. Stateful Session beans provide a convenient way (By implementing SessionSynchronization interface) to do this.
    In the servlet programming model, Servlets are not designed to be single threaded. So if you inject a StatefulSessionBean (SFSB) references then multiple threads could be possibly be invoking the SFSB concurrently. In this case, the EJBContainer (as required by the specification), will throw a well defined exception.
    What you may want to do is to place this SFSB reference into you Servlet session.

  • Getting session timeout at runtime

    Does anybody know if I can get (at runtime) the session timeout value that was configured in web.xml?
    Thanks,
    Matt.

    That's what I meant by querying the session. However, if the timeout limit has been changed at runtime (by setMaxInactiveInterval), this method will return the new value, not what is in web.xml. If that's ok for what you need, then you're all set.

  • Can we programatically change the timeout value in Oracle Workflow

    Hi,
    I have a requirement for the Journal Approval Workflow
    I would like to set this to 4 days as standard and have this adjusted to 4 hours during month end close.
    Can I put in some logic in PL/SQL and so that at month end I can update this timeout value to 4 hours in the workflow itself.Is there some API to update this value in a notification.
    Please advise
    Saket

    Hi,
    Maybe, my question is not clear.
    I know on how to maintain the conditions.
    I want to maintain a final price condition, and also the discount rate will be shown in the sales order.
    discount rate= ( List Price 98- Final price 80) / List Price 98
    Or
    I want to maintain a value discount condition,and also need  the discount rate will be shown in the sales order.
    discount rate = value of the value discount condition 18 / List price 98
    The discount rate will be shown in the sales order and the discount amount will be posted to the GL account.
    Thanks&Regards,
    Don

  • Forms session timeout

    hi,
    How to Increase the Forms users session timeout value ??
    We are using formsservlet .
    thx

    Forms timeouts are controlled by ICX Limit Time and ICX Session Timeout. The ICX Limit Time profile option is set to 4 hours at the site level by default. This means users will receive a timeout warning after 4 hours, no matter what activity has been performed. The ICX Session Timeout is set to 30 minutes which matches the jserv timeout in zone.properties of 1800000 millseconds. After any forms/web session has been idle for more than 30 minutes, the session will be terminated at the server level. If you want to double ICX Session Timeout, you also need to double s_sesstimeout in the context file and run autoconfig or double session.timeout in zone.properties (and the context_file to preserve setting across autoconfig runs), and bounce Apache.
    # Set the number of millisecond to wait before invalidating an unused session.
    # Syntax: session.timeout=(long)>0
    # Default: 1800000 (30 mins)
    session.timeout=1800000
    Subject: How To Fix The Forms Timeout Issue In Oracle Applications 11i
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=269884.1

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

Maybe you are looking for