Session lost in jsp containing iframe

In our application after a user logs in to the system he gets a front page which contains an Iframe. The login process initializes variables in the session (and the user�s security preferences). In some rare cases the Iframe forces the web server to create a new session (apparently the session cookie has not been passed from the parent page to the Iframe src request). In this situation the user is redirected to the login page, when trying to navigate in the website. Does anybody know something about this behavior? And how can this problem be solved (without abandoning the Iframe paradigm)?

You could try using URL rewriting to generate the URL that iframe uses, so that the session ID is in the URL. Sounds like a timing issue with the browser or something.

Similar Messages

  • Calling Session Beans in JSP ?

    Hi Folks,
    I am new to EJB3, I am doing simple applicatuions.
    Can any one please tell me how to call session beans in jsp page.
    for example my case is.. iam entering two diffrent data, lets say user name and password in jsp page and this should go in data base thru JPA (entity beans)
    Iam able to enter data from JPA in data base but if the same i have to fetch from JSP page.. iam not getting..!
    I would really appretiate for your help i need it urgent...!
    thanks in advance.

    abishek1983 wrote:
    Hi Folks,
    I am new to EJB3, I am doing simple applicatuions.
    Can any one please tell me how to call session beans in jsp page.
    Not. You can, technically, but you shouldn't. JSP should be for display purposes only, containing no Java code whatsoever.
    for example my case is.. iam entering two diffrent data,Wrong. You cannot possibly have "2 data", the very concept is impossible.
    You can have "2 data items" which is probably what you intended to say?
    lets say user name and password in jsp page and this should go in data base thru JPA (entity beans)
    Iam able to enter data from JPA in data base but if the same i have to fetch from JSP page.. iam not getting..!
    Same way you insert them. Of course JPA entities are distinctly different from entity beans. The very concept of entity beans no longer exists in the context of JPA, it's solely used to mean EJB 2.1 or earlier entity beans.
    I would really appretiate for your help i need it urgent...!
    It's not urgent.

  • How to reset the data when the session lost?

    When I use response.sendRedirect("http://localhost:82/main.jsp")
    the session lost, because the URL before redirect is using SSL,
    "https://localhost:81/index.jsp", they use the different port,
    so the session lost, what should i do to prevent this? And how
    to reset the data?

    Create a HashMap and store it as an attribute of the servlet context. In the first servlet assign the user a key and store all session data in the HashMap under that key (use a vector, collection or user defined class).
    In the response.sendRedirect call add the key to the url:
    response.sendRedirect(url + "?key=" + userKey);
    In the second servlet get the key (request.getParameter("key")), retrieve the session data from the HashMap in the servletcontext and store in an httpsession.
    Remember to delete the entry from the HashMap so it doesn't become overly large.

  • How to view the session in the web container

    hi, Folks,
    is there any way to view the sessions in J2EE web container? I need to know how many living session currently in the web container.
    Thanks

    You did not indicate the Web Server version that you are using for web container. Assuming its Sun Java System Web Server 6.1, per Servlet 2.3 specification, you should be able to use of session creation and destruction events. This can be done using HttpSessionListener to count active sessions. Here's the docs for reference:
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html
    Thanks
    Manish

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • How to use session object in jsp

    hi all
    marry christmas
    can anyone plz tell me how to use session obect in jsp
    rachna
    Message was edited by:
    rachna_arora82

    hi rachna,
    JSP has a default(implicit) session object...... use the getSession(true) method on the session object and then going u can either get or set attributes depending on the requirement
    That was in general and now with the issue u have got..... what u can do is that the u can create session for every user who logs in and when he/she tries to login again then u can probably check for the existing session object in the JSP and perform the logic as required..... any clarifications plzzzzzzz let me know
    Thanks n Regards
    Naveen M
    Message was edited by:
    Novice_inJAVA
    Message was edited by:
    Novice_inJAVA

  • How to know if a session finished in jsp

    Hello,
    How to know if a session finished in jsp?
    Help me please.
    Best Regards.
    Joseph

    Depends. You can create a javax.servlet.http.HttpSessionListener implementation and register it in the web.xml file (I forget the syntax, though), which can notify you of sessions being created and destroyed.
    Or you can create a javax.servlet.http.HttpSessionBindingListener implementation and add it to the session (setAttribute()) and it'll have it's valueUnbound method called when the session expires (or the attribute is removed, but if you don't remove it, the session invalidating will). That's a good place for session-specific clean-up.

  • The ELResolvers for JSF were not registered with the JSP container

    I'm trying to configure mojarra on tomcat6 (because I want to use Elastic Beanstalk). tomcat complains:
    Feb 8, 2011 10:24:17 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
    INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
    I have tried all sorts of combinations of replacing EL2.2 libs in tomcat/lib, putting the libs in WEB-INF/lib, and the context param:
    <context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
    </context-param>
    JSF pages seem to work but I'd rather have a clean startup. Please assist. Thx in advance.

    Thx for replying.
    I have jstl-1.2.jar:
         <dependency>
                   <groupId>javax.servlet</groupId>
                   <artifactId>jstl</artifactId>
                   <version>1.2</version>
    <scope>provided</scope>
              </dependency>
    Which version numbers are you referring to in *.xml? The following?
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">

  • Problem accessing session variable from jsp

    Hi!
    I get an error retrieving a session variable from inside a JSP declaration scriptlet....
    Something like this code in a JSP page:
    <%!
    public void funtion1() {
    String parameter1 = session.getAttribute("parameter1");
    %>I have seen that I have available getContextServer() method and from there I could call getAttribute("parameter1") . But the thing is that the attribute I want to retrieve was stored in session by another Jsp page.
    Any solutions are welcome
    Cheers
    Victor

    Appropriately the above is one the reasons also You cannot use JSP implicit objects from the declaration tag. However we can think of a small workaround by passing the reference like the one discussed below
    <%!public void funtion1(HttpSession session) {
    String parameter1 = session.getAttribute("parameter1").toString();
    }%>
    <% funtion1(session);%>Hope that helps :)
    REGARDS,
    RaHuL

  • Tomcat servlet/JSP container default files on 10gAS(10.1.2.0.2)

    Hi Friends,
    I am using Oracle Application Server 10g (10.1.2.0.2) on windows
    I have the Vulnerability: Apache Tomcat servlet/JSP container default files.
    and the fix is Review the files and delete those that are not needed.
    i would like to know the location of the files to review and delete.Please suggest?
    Regards,
    DB

    Apache/Tomcat is not related to OAS, where did you get this info? OAS is based in a Orion Web Server and Apache HTTP Server, not Tomcat.
    For this kind of problems there are the CPU you may want to check in Metalink for them.
    Can you clarify also what default files?
    Greetings.

  • Java Webconsole ELResolvers for JSR not registered with the JSP container

    Trying to rebuild a LDAP server running Directory Server 6.1. Just installed Solaris 10 u9 on a SunFire V240. Loaded most recent recommended patch set dated 2011.02.02. Proceeded to load Directory Server V6.0 from native packages using JAVA ES Installer. After Directory Server installation and initialization the Java Webconsole is running but brings up a blank page login page. Note: Did not test the Webconsole prior to Directory Server installation. The errors in the /var/log/webconsole/console/console_debug_log file state:
    Feb 8, 2011 10:32:32 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
    INFO: JSF1027: [console] The ELResolvers for JSF were not registered with the JSP container.
    Feb 8, 2011 10:32:34 AM com.sun.faces.lifecycle.Phase doPhase
    SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /jsp/login/BeginLogin.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@13c3b45]
    The JAVA version is: 1.6.0_22
    The cacao version is 2.2.4.1
    Kernel Patch is Generic_144488-06
    Anyone have an idea what is causing this problem for the JAVA webconsole and how to fix it?

    hi,
    it is tomcat-6.0.20, JSF-RI 2.0.2 (Mojarra)
    a whole bunch of libs and jquery4jsf (though really buggy in this manner, because all components could you rewrite for JSF2-components, etc.)
    Unfortunately it is somehow a config error, because i haven't got it earlier, since i changed PhaseListener and Authentification with JAAS (sample from Ed Burns:
    http://weblogs.java.net/blog/2006/03/07/repost-using-jaas-jsf, but with JDBC-based authentification)
    cheers,
    Istvan

  • Javascript not working when JSP container changed. Why?

    I'm migrating from Resin (if you happen to know what it is) to Tomcat.
    My web app runs fine on Tomcat, without any change in the code. What surprises me is that, javascript, which works perfectly fine while the webapp runs on Resin, seems to have problems when the webapps runs on Tomcat.
    This does not seem to make sense to me: javascript is executed on the client (browser) and should have nothing to do with the JSP container.
    Can someone tell me why, and how to fix this? Thanks!

    see if your browser supports something like a javascript console or debugger.
    e.g.:
    - MS InternetExplorer shows a warning icon in the left bottom corner if there is a javascript error. doubleclicking on it shows the error type and the location (url, line, char) where the error occured.
    - Mozilla supports a javascript console which shows up javascript errors or warnings.
    have a look at what the browser says on your errors.
    if your javascripts are hardcoded it HAS TO BE a browser (misinterpretation) or javascript error. serverside has definitively nothing to do with javascript...
    greetz,
    Thof

  • Session tracking in JSP pages

    I've two pages in my web application which need regular refresh after a particular interval.I'm using
    (session.setMaxInactiveTime) to check the session validation.& HTML's <META> tag to regularly refresh the page after particular interval.
    On these two pages there are links to the different pages for which i'm opening a new window.
    But i'm losing the session after some time & i'm not able to catch the source from where the session is getting invalidated.even when i'm using meta tag of html to refresh the page.
    I'm also using HttpSessionEventListener Interface to know when the session.putValue & session.removeValue
    functions are used.
    I hope the problem is clear to you people.
    an urgent help/suggestion will be appreciated.
    thanks in advance

    Hi,
    it isn't easy see your problem. When you losing your session? When you hava open a link from your page i a new browser window (instance) and return?
    Also check follow: when no validate session exist, a jsp open a new session, else you use <%@ page session="false" %>
    Roland

  • Session Maintenance in JSp-- Servlet-- JSP

    Iam making a browser based Financial Aplication so I want to introduce sessions into it.
    My First page is a JSP which takes username and Password. Then it calls a servlet.
    So my Problems are-
    1. Iam able to start session from servlet (which validates username and password) but after that in the apllication some JSp's are there like for search options so how to maintain sessions in JSP's ?
    2. When user quits browser and then opening a browser and directly types a JSP page which is in-between the flow this JSP opens up whereas i want the user to go from starting as its a security loop hole.
    So how to maintain a session in a JSP (ie when control passes from Servlet to JSP at that time)?
    Plz Help me
    Thanks in advance

    Hi Innova,
    There is a solution .I think while validating the login page entries u should maintain a session variable and give it some constant value if the entered values are valid.And now u should always check this sesson variable for that constant value [ if(session.getParameter("s")==constvalue) ] only then u proceed further else diaplay an error message or link prompting to login
    I hope it will work fine check it out.
    GoodLuck.
    Bye......

  • JSP bug or JSP container bug?

    This the following a JSP bug or JSP container bug?
    When I put:
    <jsp:declaration>
         void method() {
    </jsp:declaration>in a JSP page it runs fine, but when I put:
    <jsp:declaration>
         void method() {
              for(int idx=0; idx<5; idx++) {
    </jsp:declaration>in a JSP page I get:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /doc/c11/XmlSyntaxDeclarations.jsp(54,17) Unterminated <jsp:declaration> tag
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134)
         org.apache.jasper.compiler.Parser.parseXMLDeclaration(Parser.java:695)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1545)
         org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
    Apache Tomcat/5.0.27

    What gives? I'm having the same problem with a scriptlet!
    This works:
    <jsp:scriptlet>
         cntInt++;
         out.println("cntInt = "+cntInt);
    </jsp:scriptlet>but this doesn't works:
    <jsp:scriptlet>
         cntInt++;
         out.println("cntInt = "+cntInt);
         for(int idx=0; idx<cntInt; idx++) {
    </jsp:scriptlet>...it can't seem to handle for loop? Does anyone know why?

Maybe you are looking for

  • Cannot see Private Workareas after Import in a New Instance

    Hi guys, I followed the procedure you recommended in the designer 9i installation guide about migrating/upgrading the repository and It seems I missed something: -I made an export of my repository owner with the RAU in Oracle Database 8.1.7 with Rep.

  • MDD can't recognize drive connected via PCI card

    Hello there, I tried connecting a new Maxtor ATA100 drive to my MDD via a Sonnet TEMPO ATA100 PCI card. Everything works OK except that the drive doesn't mount. Disk Utility doesn't "see" it and get this, ... when I tried opening System Profiler to s

  • Lost Wiki calendars after upgrade to 10.6.4

    Hi, After upgrade my clients to 10.6.4 we are not be able to connect to our Wiki calendars using iCal client. The original path was: /principals/wikis/WIKI-NAME/ But now it says the client is not able to connect to: /principals/_uids_/8a8be0fd-f969-5

  • CMSDK 90420 without an Application Server??

    Hello, as we don't use an Application Server now, it would just be needed for the CMSDK. Unfortunatelly, this costs are not possible as we already have to license some new databases. So, my questions are: 1.) Would the Java Edition of the Application

  • Protecting Sequence Files From Modifications

    I sure others have had to do this in the past. What is the best way to protect the sequence file from being modified in the field? Even I, with my limited TestStand skills, have gone in with a text editor and changed things in a sequence file. We wou