Hi Andrew,

why don?t you populate your beans before you call your jsp (where i asume
your getter methods are being called). i.e. let your ActionClass gather all
customer information, prepare your bean, drop it in the session and access
it in your jsp.

If you want to directly populate your ActionForm check the mailing list. The
topic was discussed a few times.

Rainer

-----Ursprungliche Nachricht-----
Von: Andrew Steady [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 10. Mai 2001 11:40
An: [EMAIL PROTECTED]
Betreff: Getting hold of the session


Hi,

One of my getter methods (called by struts) needs to get hold of an object
in the Session so that it can populate the values of a drop down box based
upon a call to the "customer" object which is stored in the session.
Unfortunatley struts does not pass my method the request or the session
object and neither does it pass either of these to the form constructor so
I can't store a local reference to it in the form.

This problem must have been encountered and solved by others already, does
anyone have any suggestions?

Regards,

Andy S





[EMAIL PROTECTED] on 10/05/2001 09:57:55

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Andrew Steady/Swindon01/Domino01/Kinesis)
Subject:  Re: Transactional Tokens in the JSP?




Allen,
You can set the transactional token in your edit Action class with
saveToken(request). Then you can test the token in
the submit action.
I suggest you have a look at the classes EditRegistration and
SaveRegistration  in the example application.
Jean-Noel
----- Original Message -----
From: Allen Walker <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 10, 2001 10:37 AM
Subject: Transactional Tokens in the JSP?

> I would like to use the transaction token logic in the Action class.
> However I am not able to figure out how to place the Transactional Token
in
> the JSP so it can be validated against when isTokenValid() is called
within
> my Action class. I looked at the Struts source code to find:
>
>      protected boolean isTokenValid(HttpServletRequest request) {
>
>          // Retrieve the saved transaction token from our session
>          HttpSession session = request.getSession(false);
>          if (session == null)
>              return (false);
>          String saved = (String)
session.getAttribute(TRANSACTION_TOKEN_KEY);
>          if (saved == null)
>              return (false);
>
>          // Retrieve the transaction token included in this request
>          String token = (String)
request.getParameter(Constants.TOKEN_KEY);
>          if (token == null)
>              return (false);
>
>          // Do the values match?
>          return (saved.equals(token));
>
>      }
>
> The Contants class is org.apache.struts.taglib.html.Constants.
>
> Thanks for any help
> -allen-
>
>







The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.

PricewaterhouseCoopers Kinesis Ltd

Reply via email to