Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

help plz

 
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.
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic