You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan <ja...@i-2000.com> on 2001/07/05 21:38:53 UTC

Action forward to Action losing request objects ??

I am submitting to an Action which when successful places an object in the request and forwards to a second Action, which looks for the item in the request, and forwards yet again to a third Action which gets the item placed in the request object by the previous Action:
Action1---->Action2(put in object)---->Action3(getobject)

I am loosing the object in the request between Action1 and Action2 for sure.  Anyone know why?

AW: The never ending story: Turning caching off --- Oooops

Posted by Holger Wiechert <hw...@iks-gmbh.com>.
Sorry, I just figured out, that the time stamp stuff works.
But I figured out another problem, that made me blind for understanding the cache problem.
I'll post it soon.


  -----Ursprungliche Nachricht-----
  Von: Holger Wiechert [mailto:hwi@iks-gmbh.com]
  Gesendet: Mittwoch, 25. Juli 2001 17:25
  An: struts-user@jakarta.apache.org
  Betreff: The never ending story: Turning caching off


  Hi everybody,
  I was looking for a solution for the all time favorite "Caching Problem" (in IE).
  I found a couple of "solutions, like:

  1) Having the following lines in the JSP:
  response.setHeader("Pragma", "NoCache");
  response.setHeader("Cache-Control", "no-cache");
  response.setDateHeader("Expires", 1);


  2) Turning "nocache" on for the ActionServlet:
  <init-param>
    <param-name>nocache</param-name>
    <param-value>true</param-value>
  </init-param>


  3) Adding an unique parameter to the get/post, like System.currentTimeMillis()

  See http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03176.html
  to that idea.

  One answer was, that usnig tokens  is the key:
  http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02888.html
  But, correct me, if I'm wrong, what's the deal with tokens,
  when I don't want a JSP to be cached?


  I tried all of them, but with no success. So, my question is: did I miss
  something or is it really just not possible?

  Thanks in advance,
  Holger


   

The never ending story: Turning caching off

Posted by Holger Wiechert <hw...@iks-gmbh.com>.
Hi everybody,
I was looking for a solution for the all time favorite "Caching Problem" (in IE).
I found a couple of "solutions, like:

1) Having the following lines in the JSP:
response.setHeader("Pragma", "NoCache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);


2) Turning "nocache" on for the ActionServlet:
<init-param>
  <param-name>nocache</param-name>
  <param-value>true</param-value>
</init-param>


3) Adding an unique parameter to the get/post, like System.currentTimeMillis()

See http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03176.html
to that idea.

One answer was, that usnig tokens  is the key:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02888.html
But, correct me, if I'm wrong, what's the deal with tokens,
when I don't want a JSP to be cached?


I tried all of them, but with no success. So, my question is: did I miss
something or is it really just not possible?

Thanks in advance,
Holger




Re: Action forward to Action losing request objects ??

Posted by Peter Alfors <pe...@irista.com>.
All keys are separated by an '&'

here is an example:

       /postsecure_jump.do?sessionid=12345&height=10&weight=100

HTH,
    Pete

Jonathan wrote:

>  It was a dumber mistake which I wont go into ;^>Its fixed, however I
> am now trying to redirect and it is not working.  In my action
> perform() I am doing the following: String query =
> request.getSession().getId();
> String action = "/postsecure_jump.do?sessionid=";
> System.out.println(action+query);
> return new ActionForward( action+query, true);  Can someone tell me
> how to add query strings properly
>
>      ----- Original Message -----
>      From: Peter Alfors
>      To: struts-user@jakarta.apache.org
>      Sent: Thursday, July 05, 2001 3:49 PM
>      Subject: Re: Action forward to Action losing request objects
>      ??
>       Is it possible that you are redirecting instead of
>      forwarding?
>
>
>      Jonathan wrote:
>
>     > I am submitting to an Action which when successful places
>     > an object in the request and forwards to a second Action,
>     > which looks for the item in the request, and forwards yet
>     > again to a third Action which gets the item placed in the
>     > request object by the previous
>     > Action:Action1---->Action2(put in
>     > object)---->Action3(getobject) I am loosing the object in
>     > the request between Action1 and Action2 for sure.  Anyone
>     > know why?
>

Re: Action forward to Action losing request objects ??

Posted by Jonathan <ja...@i-2000.com>.
It was a dumber mistake which I wont go into ;^>
Its fixed, however I am now trying to redirect and it is not working.  In my action perform() I am doing the following:

String query = request.getSession().getId();
String action = "/postsecure_jump.do?sessionid=";
System.out.println(action+query);
return new ActionForward( action+query, true);


Can someone tell me how to add query strings properly




  ----- Original Message ----- 
  From: Peter Alfors 
  To: struts-user@jakarta.apache.org 
  Sent: Thursday, July 05, 2001 3:49 PM
  Subject: Re: Action forward to Action losing request objects ??


  Is it possible that you are redirecting instead of forwarding? 
    
  Jonathan wrote: 

    I am submitting to an Action which when successful places an object in the request and forwards to a second Action, which looks for the item in the request, and forwards yet again to a third Action which gets the item placed in the request object by the previous Action:Action1---->Action2(put in object)---->Action3(getobject) I am loosing the object in the request between Action1 and Action2 for sure.  Anyone know why?

Re: Action forward to Action losing request objects ??

Posted by Peter Alfors <pe...@irista.com>.
Is it possible that you are redirecting instead of forwarding?


Jonathan wrote:

> I am submitting to an Action which when successful places an object in
> the request and forwards to a second Action, which looks for the item
> in the request, and forwards yet again to a third Action which gets
> the item placed in the request object by the previous
> Action:Action1---->Action2(put in object)---->Action3(getobject) I am
> loosing the object in the request between Action1 and Action2 for
> sure.  Anyone know why?

Re: Action forward to Action losing request objects ??

Posted by Struts <st...@hotmail.com>.
Hi, There:

Thank you very much for the infomation, that does save me lots time, I turns out save the form infomation to my own bean, then save bean into the session for the later use, that will be nice if the formdata will go alone with forwarding instead get reset everytime.

Thanks

F
  ----- Original Message ----- 
  From: DHarty 
  To: struts-user@jakarta.apache.org ; Jonathan 
  Sent: Thursday, July 05, 2001 12:59 PM
  Subject: RE: Action forward to Action losing request objects ??


  I had the same problem when trying to use a sequence of pages to complete the same form.

  I turns out that struts ActionServlet class calls the "reset" method of your form between requests, thus erasing your form.  I even tried to put the form in a "session" but had the same problem.  Finally I put conditions around the reset statements in the reset method ot block unwanted resets.

  I would like to know a more elegant solution to this, but it works.

  D
    -----Original Message-----
    From: Jonathan [mailto:jasbell@i-2000.com]
    Sent: Thursday, July 05, 2001 3:39 PM
    To: struts-user@jakarta.apache.org
    Subject: Action forward to Action losing request objects ??


    I am submitting to an Action which when successful places an object in the request and forwards to a second Action, which looks for the item in the request, and forwards yet again to a third Action which gets the item placed in the request object by the previous Action:
    Action1---->Action2(put in object)---->Action3(getobject)

    I am loosing the object in the request between Action1 and Action2 for sure.  Anyone know why?

RE: Action forward to Action losing request objects ??

Posted by DHarty <ha...@db.erau.edu>.
I had the same problem when trying to use a sequence of pages to complete
the same form.

I turns out that struts ActionServlet class calls the "reset" method of your
form between requests, thus erasing your form.  I even tried to put the form
in a "session" but had the same problem.  Finally I put conditions around
the reset statements in the reset method ot block unwanted resets.

I would like to know a more elegant solution to this, but it works.

D
  -----Original Message-----
  From: Jonathan [mailto:jasbell@i-2000.com]
  Sent: Thursday, July 05, 2001 3:39 PM
  To: struts-user@jakarta.apache.org
  Subject: Action forward to Action losing request objects ??


  I am submitting to an Action which when successful places an object in the
request and forwards to a second Action, which looks for the item in the
request, and forwards yet again to a third Action which gets the item placed
in the request object by the previous Action:
  Action1---->Action2(put in object)---->Action3(getobject)

  I am loosing the object in the request between Action1 and Action2 for
sure.  Anyone know why?