JSP Session problem in HTML frames????

Hi everybody;
I have a problem with session I think. My index page is created with 4 diffrent jsp's in 4 diffrent frames.After a while lets say 15 minutes when my session is expired.When I click one of my button ..The frames which linked with that button is show Http 500 error page.When I refreshes the web page they all gone.(and my web page goes normal again)
I want to ask you how can I handle this problem.How can I solve this error page showing and stop showing that error page instead of in each frame,to refresh the index page again??
Thanks for your consideration.....

The first step is to decide whether 15 minutes is a suitable timeout for sessions.
If it isn't then simply increase it in web.xml. You may also decide that session persistence is worth enabling (if your Servlet container supports it).
If it's not then your pages will need to handle a null (or at least new) session slightly more elegantly. You're probably just getting a null pointer exception because something your pages is relying on is missing (a session attribute of some sort). Sometimes it's sufficient just to redirect the topmost window to the index page - not the greatest user experience in the world but at least consistent.
Hope this helps.

Similar Messages

  • BC4J. JSP, session problems

    I would like to store session type information, ie client_id in a session object and be able to retrieve its value from any of my jsp pages.
    Is there a jsp tag or some other JDev component that I should be using?
    TIA

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Danny Gagliardi ([email protected]):
    I would like to store session type information, ie client_id in a session object and be able to retrieve its value from any of my jsp pages.
    Is there a jsp tag or some other JDev component that I should be using?
    TIA<HR></BLOCKQUOTE>
    You could try something like this in your jsp
    <%
    session.setAttribute("clientId", "1234");
    %>
    To get the clientId from the session try
    <%
    String ClientID = (String) session.getAttribute("clientId");
    %>
    Hope this help,
    Kh

  • JSP Session Problems

    Hi, i am facing a problem of the Object set into a session not being visible to the others pages. what did i done wrongly?
    here is the code:
    in login.jsp (currently hardcode cos i haven recieve that part):
    <%@page import="fantasy.team.*,java.util.Vector" session="true"%>
    <%
    Team t = new Team("Kacheek FC");
    session.setAttribute("team",t);
    if( session.getAttribute("team") ==null){
         out.write("how come null");
    }else{
         out.write("not null");
    %>
    Select
    //End of coding
    not null will be printed
    Following code belong to selectPlayer.jsp:
    if( session.getAttribute("team") == null){          
              out.write("i am null");               }else{
              out.write("i am not null");
    i am null is printed
    what is wrong with my coding?
    thanks.

    i do a
    if(session.isNew())
    out.write("New");
    and the result is new.
    meaning that my session is invalidate.
    that explain my value from "gone" rite?
    how to solve this?
    thanks.

  • Newbie :  JSP session problem after reload with IE refresh button.

    Hi,
    I had an issue with JSP reloading using tomcat 4.* and IE.
    I have a jsp1.jsp is opened in two different IE windows(one by one). Once i refreshed using IE refresh button from the first window, its loaded with second windows session details. Its changess whole http request object with second window.
    Am not sure , why its happening ? Could anybody shed light on this ?
    Thanks and Regards
    PV

    Hello,
    No, am not saving any form details . But i noticed session id is changing completely for the first window once i loads frame on the second window.
    javascript:alert(document.cookie) Above scriptlet (IE address bar) returns session id from the second window rather than current window without refreshing, that means, its removed whole request completely or somehow manipulated previous sessions. Can anybody explain this behaviour ?
    Thanks

  • Jsp session problem when more than one user is loging from the same machine

    Hi everybody,
    I have created a login page and i use to store user name and password using sessions. It is working fine for one user from one machine. But if two or more users logged from the same machine, all the users are getting the same data as of the last user logged in. Also if one user is logged out all user sessions on that machine are expiring (same as previous YAHOO problem).
    i think there is problem with session variables. The user name and password which i am storing in session variables are updating the same variables for all users. I think a seperate set of session variables are not creating for each user login.
    Can any body help me plz....
    regards,
    Prasanth.C

    First, you need to clear any cookies you are setting.
    Second, you need to synchronize some key data fetching blocks in your servlet.
    Third, ensure that you are invalidating a session properly.
    Don't ask me for more details. Google around for information ;)
    Richard.

  • Session Problem in JSP IFrames

    Hi All,
    I am trying to use IFrames in my jsp page. but when it load the creditReportDetails.jsp it will open the frame in login screen means it looses the session in frames window.
    CreditReports.jsp
    <html:form>
         <IFRAME SRC='<%= response.encodeURL("creditReportDetails.jsp") %>' marginheight="2"     marginwidth="2" height="100%" width="100%"      scrolling=yes> </IFRAME>
    </html:form>
    Can you help me about this metter?
    Thanks,
    Hiren Modi

    please look at the question given first to know the jsp1 and jsp2.
    actually the applet which calls page2.jsp using it's getAppletContext().showDocument method, has been contained in page1.jsp. there is also an intermidiate servlet which store the objects in session but it is not part of my problem hence i didn't mention it.
    moreover, i am using applet-servlet communication from page1.jsp to make the data available inside servlet.
    the overall procedure is,
    1) user enter the information in page1.jsp.
    2) by applet-servlet communication data is sent to servlet to store in session.this is accomplished while being at page1.jsp because applet-servlet communication occurs in background.
    3) once data stored in session, page2.jsp is called from page1.jsp using applet's getAppletContext().showDocument method.
    in the first cycle it work fine while in second cycle and same server startup when session's object has been edited using same applet-servlet communication and page2.jsp has been called using same method then session.getAttribute() method doesn't show the new values at page2.jsp.
    it seems like session has expired at page2.jsp in second cycle.

  • Session timeouts for login page with in a html frame

    Hi, i have a login page which when the session times out gets redisplayed within the frame of the html page where the session timed out , i have tried setting the session timeouts to be less than the other application so that the login page will timeout before the documentum application but this does not make a difference.
    does any one know how i could get the login page to redisplay by itself, outside of the html frame. do i need to have some javascript to figure out if there is a frame then redraw the page etc...and how should i di this ? any working examples will be appreciated.

    You would certainly need some Javascript or use the meta-refresh tag to the session timeout time. If you set the meta-refresh tag in a frame to a time just a little bit bigger than the session timeout time and the set your security mechanisms to force the user to login in again when the session times out, the frame will refresh after the session has timed out and the application should forward the frame to the login page.
    <meta http-equiv="refresh" content="session-timeout-timeout+1">
    (timeout time is in seconds)

  • How to bring Login.jsp under a html frame ?

    hi all.
    I have customized the Login.jsp and actually have lot of static content to be displayed in our proposed entry page.
    I decided to use Html frames - something like the one below.
    When i point on the frame to the Login.jsp ( i referred it as 'amserver/UI/Login') --> it loads all frames then redirects the page to the /amserevr/UI/Login -> the Login.jsp now occupies the entire screen and i c none of the html frames..
    any idea how to bring in the portal Login.jsp under a html frame ?
    Thanks
    Vee
    <html>
    <frameset noresize="noresize" frameborder=0 rows="25%,70%,5%">
    <frame frameborder=0 noresize="noresize" src="/amserver/UI/Login" name="banner_frame" scrolling=no>
    <frameset frameborder=0 noresize="noresize" cols="30%,70%">
    <frame frameborder=0 src="./images/menus.gif" name="menu_frame" scrolling=no>
    <frame frameborder=0 src="./images/content.gif" name="content_frame" scrolling=no>
    </frameset>
    <frame frameborder=0 src="./images/copyright.gif" name="copyright" scrolling=no>
    </frameset>
    </html>

    is it possible to write jsp code or javascript code inside this Login.jsp ?
    I got a bunch of content - menu driven to displayed additional to the identity server login module.
    veera

  • Alternative to HTML Frame in struts/jsp

    I am using Struts/JSP for my application..
    I have 3 panels(3 jsp's) each with a table of information.. each jsp has a summary part to it.. the data & information in the summary is the same across all panels.. Currently I've copy pasted the code for the summary in all 3 jsp's & Actions & ActionForms... I would like to change this to using a 4th panel sort of for the summary information... not sure what would be the best way to do this.. html frames or anything better maybe.. ?
    Thanks

    did u consider using struts tiles?
    http://struts.apache.org/userGuide/dev_tiles.html

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • Session problem in jsp application

    I face a session problem. I setting everything in a session and when pass back to a main page, the value is not display in the screen. But after refresh the value will display in the screen and this kind of problem only come out very few time and i dun knw how to solve this...
    Anyone here can give me some idea and suggestion or the way to solve this kind of problem!!!

    define "2 different clients"
    1) You have 2 different PCs and it's using the same session ID for both? I doubt this. I think the server is advanced enough not to use give a session ID that's already been created.
    2) You have 1 PC and are using IE or Netscape and using File > New Window to open a new window and connect again. This you can't fix without using only URL rewriting to manage session, because the different windows will share the same session cookies.

  • [FL] Problema con un frame html

    Hola amigos....
    Estoy actualizando una pagina que realice hace unos
    años, en ella tenia un
    menu hecho en Flash4, la pagina estaba dividida en dos frames
    entonces los
    botones del menu tenian el frame destino en
    getURL("pagina.htm",
    "frame_destino"), pero ahora despues de que el Dreamweaver me
    lo actualizo
    cuando lo abri, las paginas no son cargadas en el frame sino
    en una nueva
    ventana del navegador como si fuese _blank.
    Que habra ocurrido...??? se que varios me diran que elimine
    los frames, cosa
    que creo que hare, pero me intriga saber porque ahora no anda
    ese
    redireccionamiento. Sera por el javascript que crea el
    Dreamweaver????
    espero sus enseñanzas .... gracias

    Gracias Guille...! no lo he probado todavia porque opte por
    cambiar todo a
    paginas sin frames. Pero ya lo experimentare.

    "Guille" <[email protected]> escribió en el
    mensaje
    news:fvo18f$i4v$[email protected]..
    > En Flash CS3 y su AS3 ya no se permiten agregar acciones
    directas a
    > botones, por lo que deberas asignar dichas acciones en
    el keyFrame donde
    > estan los botones utilizando algo parecido a:
    >
    > function ir(e:Event):void {
    > getURL(nombre.html; frame);
    > }
    > bot1.addEventListener(MouseEvent.CLICK,ir);
    > stop();
    >
    > Yop estoy empezando a tratar de entender Flash CS3 y si
    no es correcto lo
    > que digo, Por favor corrijanme
    > Suerte
    >
    >
    > "Joe Vega" <[email protected]> escribió en el
    mensaje
    > news:fvnnps$8h5$[email protected]..
    >> Me corrijo, no fue la correccion del Dreamweaver lo
    que no hizo funcionar
    >> mas el direccionamiento sino el paso a Flash Player
    8
    >>
    >>
    >> "Joe Vega" <[email protected]> escribió en
    el mensaje
    >> news:fvnnji$874$[email protected]..
    >>> Hola amigos....
    >>>
    >>> Estoy actualizando una pagina que realice hace
    unos años, en ella tenia
    >>> un menu hecho en Flash4, la pagina estaba
    dividida en dos frames
    >>> entonces los botones del menu tenian el frame
    destino en
    >>> getURL("pagina.htm", "frame_destino"), pero
    ahora despues de que el
    >>> Dreamweaver me lo actualizo cuando lo abri, las
    paginas no son cargadas
    >>> en el frame sino en una nueva ventana del
    navegador como si fuese
    >>> _blank.
    >>> Que habra ocurrido...??? se que varios me diran
    que elimine los frames,
    >>> cosa que creo que hare, pero me intriga saber
    porque ahora no anda ese
    >>> redireccionamiento. Sera por el javascript que
    crea el Dreamweaver????
    >>>
    >>> espero sus enseñanzas .... gracias
    >>>
    >>> Jº
    >>>
    >>>
    >>>
    >>
    >>
    >
    >

  • JSF seems not to support the use of the back buttons and html frames.

    I�m having the following problem. I have a JSP which contains a button that register a listener. Here is part of the code:
    <h:command_hyperlink label="<%=engineBean.getId()%>" commandName="<%=engineBean.getId()%>">
    <f:action_listener type="helloDuke.CommandAction"/>
    </h:command_hyperlink>
    This action listener only forwards the request to other simple JSP.
    The problem appears in the following situation:
    1 � I click in the button that generates the event that will be processed by helloDuke.CommnadAction listener.
    2 � It forward to a second JSP page.
    3 � This second page is rendered to the user properly.
    4 � The user clicks in the browser�s back button to return to previous page.
    Then if is the user clicks in first page button, the CommandAction listener was removed. You must click again in the button to forward to the correct page.
    The same happened if you are using html frames. If you have a frame with 2 pages and both pages register action listeners.
    The last loaded page cleans the actions listener of the other.
    Does anybody have any solution?.
    It seems JSF doesn�t support the use of frames and I think that in some situation the frames are the solution to several problems.
    Any help will be really appreciated.

    Using the saveStateInClient=true produces a faulty output when using the command_button and an action_listener. The page that is rendered is totally useless: the button won't work, and due to the faulty rendering there's an output like: >com.sun.faces.saveStateMarker
    So, why is it, that pressing the button (not using the saveStateInClient option) will only work the second time, same thing pressing the backbutton. Pressing the reload button will toggle between two pages - the one before the session id is assigned and the one that it's supposed to show.
    Any guess will be greatly appreciated !!!!

  • HTML Frames not using custom scrollbar in Flex 3 mx:HTML

    I've been working on an app that uses a custom skin in Flex 3. The app has a help window. The help contains an HTML with frames. Problem is, the main app vertical scrollbar custom skin is being ignored for the HTML Frames scrollbar (what looks like the classic version of Halo - maybe). This only happens with frames. It happens no matter how or where I place my HTML or HTMLLoader. If I dont have frames the custom scrollbar is used. Is there a node im missing in my skin css (obviously not VScrollBar or ScrollBar - the two standard used by Flex)? or some other way to connect the HTML Frames scrollbar to my custom skin.
    I'm not a noob but not an expert.
    Thanks.
    See attached image for example.

    Take the code of the jsp file :
    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <html>
       <head>
         <title> First Struts Application </title>
       </head>
         <body>
            <table width="500" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> </td>
            </tr>
            <tr bgcolor="#36566E">
              <td height="68" width="48%">
                <div align="left">
                  <img src="images/hht.gif" width="220" height="74">
                </div>
              </td>
            </tr>
            <tr>
             <td> </td>
            </tr>     
           </table>
           <html:form action="Lookup"
                      name="lookupForm"
                      type="wiley.LookupForm" >
           <table width="45%" border="0">
            <tr>
              <td>Symbol:</td>
              <td><html:text property="symbol" /> </td>
            </tr>
             <tr>       
              <td colspan="2" align="center"><html:submit/> </td>
             </tr>       
            </table>              
          </html:form>
         </body>
    </html>

  • Session problem in ADF BC

    We have an application developed in Jdev 10.1.3.4 (JSP, Struts, ADF BC) and running on OAS. Now we have a big problem with session, hope somebody can help with some ideas.
    We set session time to 45 min in the web.xml. The problem is that sometimes some user work on a page with form,for instance performing some edit activity. If he/she leave the page open inactive for more than 45 minutes and come back from lunch, press the ’save’ button, the application would then commit the change to the wrong row in database, most probably the top row in the View Object(VO) instance. This is because the application module actually does a rollback when session expires, it loses all user data.(e.g. row currency in VO instance).
    To avoid saving wrong data to the wrong place, we implemented a session Filter(see att. Below: ApplicationSessionExpiryFilter.java) to catch session time-out and forward request to an error page alerting user that their session has expired due to long time of inactivity. The Filter works as it should but it gives another problem. If user already has one of our application page open for very long time and open another page in a new browser (e.g. click a link from an email), he/she will get session-expire error immediately in the new browser. I guess it is because the session in the first browser already expires and the newly opened the browser shares the same session with the first one. That is how browsers works, we can do nothing about it.
    But our users are of course not very happy about getting the session errors in a newly opened browser. So we tried implementing a heartbeat funtion in AJAX(see att. Below: Heartheat.html and Template.jsp) to keep the session alive until the page is closed. Basically what we do is adding an invisible div tag in every jsp page and invoke AJAX funtion to periodically update the div tag with a small html page. In this way, a request is being sent to the server every 5 minutes thus the session should be kept alive until the page/browser is closed.
    It sounds to us like a very logical solution but it doesn’t work very properly. We sometimes still get the session error page immediately after opening a new page while we have another page open for long time.
    Could anyone please help to look at our Filter and heatbeat funtion? Is there anything wrong with our Filter or the heartbeat? Why does the session still expire before we close the page?
    All we do here is to try to avoid the initial probelm with saving data after session and the application module expires. If anyone has a better solution to this problem, we would very much like to try. Appreciate if anyone can share some ideas!
    Thanks in advance!
    *1. ApplicationSessionExpiryFilter.java*
    public class ApplicationSessionExpiryFilter implements Filter {
    private FilterConfig _filterConfig = null;
    public void init(FilterConfig filterConfig) throws ServletException {
    _filterConfig = filterConfig;
    public void destroy() {
    _filterConfig = null;
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    HttpServletRequest httpRequest = (HttpServletRequest)request;
    boolean sessionInvalid = false;
    if(httpRequest.getRequestedSessionId() != null) {
    if(!httpRequest.isRequestedSessionIdValid()) {
    if (!httpRequest.getRequestURI().endsWith("sessionExpired.do")) {
    sessionInvalid = true;
    if (sessionInvalid) {
    ((HttpServletResponse) response).sendRedirect(_filterConfig.getInitParameter("SessionTimeoutRedirect"));
    else {
    chain.doFilter(request, response);
    *2. Heartheat.html* (A small html page to be invoked by template.jsp periodically)
    <html>
    <head>
    <META Http-Equiv="Cache-Control" Content="no-cache, must-revalidate">
    <META Http-Equiv="Pragma" Content="no-cache">
    <META Http-Equiv="Expires" Content="Expires: Mon, 26 Jul 1997 05:00:00 GMT">
    </head>
    <body>
    heartbeat to keep session alive!
    </body>
    </html>
    *3. Template.jsp* (Template page to be extended by all jsp pages, invoke heart.html every 5 min)
    <Html>
    <body>
    <div id="heartbeat" style="display:none">
    </div>
    <script type="text/javascript" language="javascript">
    new Ajax.PeriodicalUpdater('heartbeat','jsp/template/heartbeat.html',{ method: 'post', frequency: 300, decay: 1 }); // update heartbeat.html every 300 sec(5min)
    </script>
    </body></html>

    Hi Shay,
    Reviewing ADFContex methods it seems that this object shouldn't be accessible from BC. Example:
    public static ADFContext initADFContext(java.lang.Object context,
                                            java.lang.Object session,
                                            java.lang.Object request,
                                            java.lang.Object response)
        Initializes the ADFContext for the environment of the specified context.
        Parameters:
            context - the ServletContext or PortletContext of the current execution environment.
            session - the HttpSession or PortletSession of the current execution environment. OPTIONAL.
            request - the HttpServletRequest or PortletRequest of the current execution environment. OPTIONAL.
            response - the HttpServletResponse or PortletResponse of the current execution environment. OPTIONAL.
        Returns:
            the ADFContext that was current when init was invoked. Should be passed back to resetADFContext after the block requiring the ADFContext has completed.Kuba

Maybe you are looking for