This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes help plz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "help plz" Watch "help plz" New topic
Author

help plz

S.L.Narayanan
Ranch Hand

Joined: Apr 01, 2005
Posts: 431
Hi ranchers

Please help me out in solving this problem. I have a situation like this. I need to show a login page whenever the user logs-in, in the mean time I need to get all his data in a backend process. Once the data acquisition process is completed, i need to forward him to another JSP page which can show the data. I am able to do this in usual Servlet, JSP architecture with some automatic refresh mechanisms. Since I could not access the response's outputstream inside an Action class, I am very much confused of how to do this in Struts.

Is there anyone who already faced a situation like this. Any solutions?


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, NEXT--->IBM XML
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
You could use a delayed meta-refresh in the browser's html.


http://www.goodercode.com
SCJP 1.4
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Your assertion that you can't get the response's output stream from an action class is incorrect. Since the response is passed into the execute() method as a parameter, you can access it's outputStream property. The important thing to remember is that since you're handing the response in your action class, you need to let Struts know that no forwarding is necessary by returning null from the execute() method, rather than an ActionForward.

In the sample code that come with Struts 1.2, there is an example of doing this. Look in struts-examples.war for org.apache.struts.webapp.exercise.ImageAction.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: help plz
 
Similar Threads
Show animation during report building
[Struts] forward actions
JSP adn buttons
I-frame within a jsp page
fow to forward to an action from jsp ?