Session expiration in iframe of modal subdialog while calling different servlet
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Session expiration in iframe of modal subdialog while calling different servlet  XML
Forum Index -> JBoss Seam Integration
Author Message
schmiuwe

Joined: 16/05/2008 00:00:00
Messages: 24
Offline


Hello,
my setup is JBoss 5.0.1, ICEfaces 1.8.2 and JasperReports 3.7.2.
In all of my jspx Dialogs I have a button for generating a jasper report. Pressing it opens a modal ice popup. This popup includes an iframe with a fix size. The target url of the iframe gets set dynamically via a javascript call after the button has been pressed. The target url of the iframe calls my own report servlet (extending HttpServlet) that generates a pdf and streams it back into the iframe. The user than can print or save the pdf or close the modal report popup again.
Now the problem is as soon as the user closes the report popup i get a session expire message from icefaces and must reload my origin dialog again.
Did anyone have the same problem or a similar yet or has any solution for this behaviour?

Here's a few code snippets ...

javascript call:
Code:
 JavascriptContext.addJavascriptCall(this.context, "document.getElementById(\"reportPrintIFrame\").src = \""
           + servletURL + "\";");
 


report servlet declaration:
Code:
 public class JBReportServlet extends HttpServlet
 


web.xml extraction:
Code:
   <context-param>
     <description>To allow multiple windows for a single application.</description>
     <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
     <param-value>false</param-value>
   </context-param>
   <context-param>
     <description>Turn on/off application-wide synchronous or asynchronous updates.  </description>
     <param-name>com.icesoft.faces.synchronousUpdate</param-name>
     <param-value>false</param-value>
   </context-param>
   <servlet>
     <servlet-name>Report Servlet</servlet-name>
     <servlet-class>com.lsb.reporting.JBReportServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet-mapping>
     <servlet-name>Report Servlet</servlet-name>
     <url-pattern>/reports</url-pattern>
   </servlet-mapping>
 

judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


What version of Seam are you using and how does this application integrate with Seam?
schmiuwe

Joined: 16/05/2008 00:00:00
Messages: 24
Offline


Well, actually I'm not using Seam. I posted it here because of my integration of ICEfaces into JBoss. I simply created a JBoss configuration, added all dependency ICEfaces and Jasper libs and deployed my EAR. It's running good, except that session expiration with that modal dialog.
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


if you don't need asynchronous why don't you try setting it to syncrhonous:-
Code:
   <context-param>
      <description>Turn on/off application-wide synchronous or asynchronous updates.  </description>
      <param-name>com.icesoft.faces.synchronousUpdate</param-name>
      <param-value>true</param-value>
    </context-param>
 

schmiuwe

Joined: 16/05/2008 00:00:00
Messages: 24
Offline


Because it will not change the result. I still have that session expire problem. What I now tried was to touch the session in my report servlet. But anyhow the SessionDispatcher cannot be resolved at runtime. It ist located in the icefaces.jar that is deployed in my JBoss. Can anyone help?
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


when you say that you
created a JBoss configuration 
have you tried your application on a standard (default) jboss configuration?
schmiuwe

Joined: 16/05/2008 00:00:00
Messages: 24
Offline


no, I took the all configuration. Just made a copy and renamed it ...
schmiuwe

Joined: 16/05/2008 00:00:00
Messages: 24
Offline


I've found the problem causing the session expire problem. As soon as a call my own servlet in order to generate the report pdf stream I get the HttpSession via the HttpServletRequest object (input parameter of the doGet method). -> I do not get my existing session but a new session and anyhow the framework doesn't like that and I get the user session expire popup. If I do not try to get the session everthing works alright, but the problem is I need it.

So the new plan is to just create a JSP page that holds the same code (functionality) like the servlet class. There the session object is already known and I assume it is the same session of the dialog that is running at this time. Should perhaps work without getting the session expiration.

I also tried to touch the session and use a phase listener but this can not work because the new session that is created by the servlet is not known by the ICEfaces lifecycle.
 
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team