Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

help plz  RSS feed

 
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a delayed meta-refresh in the browser's html.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!