On Sat, 13 Apr 2002, Wellie W. Chao wrote:

> Date: Sat, 13 Apr 2002 10:57:29 -0400
> From: Wellie W. Chao <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Struts design question re: form action
>
> I'm just curious about a design issue with Struts 1.1. The <html:link/> tag
> has a "forward" attribute that lets you specify an entry from
> struts-config.xml as the destination of the link. That way you aren't tied
> to a particular action or a particular JSP/HTML page. Why isn't there a
> similar attribute for <html:form/>? You have to directly specify the URI
> (using the "action" attribute) instead of being able to specify a forward
> mapping. It just seemed inconsistent to me.

A couple of reasons:

* The "action" parameter (which is used to specify the <action> you want)
  is already a logical indirection; the name of a bunch of business logic
  that you want to execute ("save customer") without knowing anything
  about the actual Action class that implements this logic.  It would be
  redundant to provide two different logical indirection schemes.

* Using a forward parameter instead of an action name would mean that the
  page has no way to infer what form bean to use, so you'd essentially
  have to give up all the fancy support provided for form beans.

Craig



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

Reply via email to