Hi,
I understand that the request.getParameter should not be used when the
info is readily available in the 'form' object.
But can we really take it out? When I create a list of records in a
table, with links to each record details, I would be generating an
<html:link> object with parameters attached, resulting in sth like: <a
href="/aaa/details.do?id=1">. Then I need to use the
request.getParameter to get the id, then retrieve the record details
from db.  So my question is, is there a way to get around this, so I can
get rid of request.getParameter completely?

Rgds,
Patrick.



-----Original Message-----
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 13, 2004 10:09 AM
To: Struts Users Mailing List
Subject: RE: Mandatory use of form rather than request object


No. He would provide setters in the form for anything that needs to be
passed along in request scope. This has the dual advantages of type
safety and making the design more explicit to anyone reading the code.

-----Original Message-----
From: Brice Ruth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 13 January 2004 02:25
To: Struts Users Mailing List
Subject: Re: Mandatory use of form rather than request object


This precludes you from storing data in the request scope, though - so
you're left with only storing things in the session scope, which I
wouldn't consider ideal.

Right?

Richard Hightower wrote:

>Create a superclass that overides the execute method and calls an 
>abstract execute method that does not pass the request object. The 
>subclasses overide the execute method without the request object being 
>passed.
>
>Also look into the ProcessAction, which is part of the scaffold.
>
>You can get the scaffold code by downloading the struts source.
>
>
>Rick Hightower
>Developer
>
>Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
>
>Struts/J2EE consulting -- 
>http://www.arc-mind.com/consulting.htm#StrutsMentoring
>
>-----Original Message-----
>From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]
>Sent: Monday, January 12, 2004 8:19 AM
>To: 'Struts Users Mailing List'
>Subject: Mandatory use of form rather than request object
>
>
>Hello All,
>
>I did some code reviews recently for my project being done on struts.
>
>I found that most people still do a request.getAttribute("NAME") kind 
>of code even when the name is a property of the form object and is 
>available
in
>the form object.
>
>My question is should the use of form be mandatory. If yes, how it can 
>be enforced. Is there quick way I can remove all the params/attributes 
>from
the
>request object once the corresponding values have been set in the form 
>object?
>
>Thanks in advance for your advise.
>
>Regards,
>Abhishek.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to