This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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?
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.