You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sudipta Sarkar <su...@usa.net> on 2002/04/01 19:42:14 UTC

Opening page in a new window

Hi,
  I have a application with the following feature:

  I have a form with some text fields and a submit button.
  When I press submit I need to do some database interaction and the result of
that I store in seesion.
  The results then  need to be displayed on a different page on a new browser
window.

  What I did is:
   In the action class did the database calls and the put the results in
session.
   The JSP page uses the results present in the session (which was populated
in the action class) and displays them.
I have used something like the following
  <html:form method="post"  action="/report"
onSubmit="javascript:openReportWindow('report.jsp')" >
 to open the jsp page in a new window.(openReportwindow is my javascript
function which open a new window)
  What is happening is that the jsp page is saying bean not found in session
and that is because the jsp page is trying to get the bean before the
action's perform method has finished and hence its not finding the bean.
What should I do in order the jsp page tries to get the session variable/beans
after the perform method has finished i.e the data in put into session from
the database.  
 
Thanks in advance.
Sudipta  


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Opening page in a new window

Posted by srinivas <sv...@intensit.de>.
hello,

In this case you are opening a window and then sending the request, instead
send the request and then open the window on response.
use onLoad event of body tag to open a new window and request for the page.

also i notice that u use action="/report"??
are u submitting to another servlet ??

hope this helps,
srinivas.


-----Original Message-----
From: Sudipta Sarkar [mailto:sudipta_sarkar@usa.net]
Sent: Monday, April 01, 2002 8:42 PM
To: Struts Users Mailing List
Subject: Opening page in a new window


Hi,
  I have a application with the following feature:

  I have a form with some text fields and a submit button.
  When I press submit I need to do some database interaction and the result
of
that I store in seesion.
  The results then  need to be displayed on a different page on a new
browser
window.

  What I did is:
   In the action class did the database calls and the put the results in
session.
   The JSP page uses the results present in the session (which was populated
in the action class) and displays them.
I have used something like the following
  <html:form method="post"  action="/report"
onSubmit="javascript:openReportWindow('report.jsp')" >
 to open the jsp page in a new window.(openReportwindow is my javascript
function which open a new window)
  What is happening is that the jsp page is saying bean not found in session
and that is because the jsp page is trying to get the bean before the
action's perform method has finished and hence its not finding the bean.
What should I do in order the jsp page tries to get the session
variable/beans
after the perform method has finished i.e the data in put into session from
the database.

Thanks in advance.
Sudipta


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>