Re: AW: Getting hold of the session
thanks, I've added an initialise method to my form now which I call from the action class, the method checks if it has already run or not and then populates the drop down box fields. [EMAIL PROTECTED] on 10/05/2001 14:20:08 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Andrew Steady/Swindon01/Domino01/Kinesis) Subject: AW: Getting hold of the session 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 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
AW: Getting hold of the session
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
RE: Getting hold of the session
oops my mistake.. Sorry about my last mail ... I really need some caffeine before i answer any more questions here cheers, Amar.. -Original Message- From: Tony Karas [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 6:44 AM To: [EMAIL PROTECTED] Subject: Re: Getting hold of the session I assume that you're bean extends ActionForm.can't you get the required information you need from the session during the call to the validate() method? This method receives a request object as a parameter. >From: "Andrew Steady"<[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Getting hold of the session >Date: Thu, 10 May 2001 10:39:37 +0100 > >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 _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
RE: Getting hold of the session
Use this... ActionForm.getServlet().getSession() . cheers, Amar.. -Original Message- From: Tony Karas [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 6:44 AM To: [EMAIL PROTECTED] Subject: Re: Getting hold of the session I assume that you're bean extends ActionForm.can't you get the required information you need from the session during the call to the validate() method? This method receives a request object as a parameter. >From: "Andrew Steady"<[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Getting hold of the session >Date: Thu, 10 May 2001 10:39:37 +0100 > >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 _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: Getting hold of the session
I assume that you're bean extends ActionForm.can't you get the required information you need from the session during the call to the validate() method? This method receives a request object as a parameter. >From: "Andrew Steady"<[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Getting hold of the session >Date: Thu, 10 May 2001 10:39:37 +0100 > >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 _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
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