You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Hightower <rh...@arc-mind.com> on 2004/01/15 05:14:58 UTC

Is there any master list of deprecated methods, and custom tag attributes? RE: low priority question about html:form

Is there any master list of deprecated methods, and custom tag attributes?

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: Wednesday, January 14, 2004 10:48 AM
To: Struts Users Mailing List
Subject: RE: low priority question about html:form


Quick note that the name, scope, and type attributes of <html:form> are
deprecated as of 1.1 and, AFAIK, have been removed in the current codebase.
So,
if there is a compelling use for them, it would be a good idea to address it
through Bugzilla ASAP.

Quoting Glenn Wilson <gw...@serviceobjects.com>:

> Richard,
>
> It seems to me that this would be useful for run-time decisions about
where
> to "send" the form data.  Perhaps if a low-level user and an admin should
see
> the same html form, but the ActionForm that handles the admin's work
should
> be different.  i.e.:
>
> <c:choose>
> <c:when test="${userIsAdmin}">
>   <c:set var="type" value="com.foo.Bar" />
> </c:when>
> <c:otherwise>
>    <c:set var="type" value="com.foo.BarSubClass" />
> </c:otherwise>
> </c:choose>
>
> <html:form action="/myaction" scope="request" type="${type}" name="myform"
> />
> <!-- HTML HERE -->
>
> I'm not sure if the html:form can take dynamic params like that (never
tried
> it!) Regardless of the syntax, it seems like you could share the same JSP,
> subclass the ActionForm, and save yourself from creating a ton of
duplicate
> code.  You'd probably still have to add an ActionForm mapping in
> struts-config for each form, but at least you'd have only one JSP and
Action
> class.  Perhaps changing the scope dynamically like this could potentially
> change the ActionForm stored in the session as well?  Did I miss
something?
>
> Regards,
> Glenn
>
> -----Original Message-----
> From: Richard Hightower [mailto:rhightower@arc-mind.com]
> Sent: Wednesday, January 14, 2004 9:11 AM
> To: Struts Users Mailing List
> Subject: RE: low priority question about html:form
>
>
> Oppsss
>
> the code listig should read:
>
> <html:form action="/myaction" scope="request" type="arcmind.MyForm"
> name="myform"/>
>
>
> -----Original Message-----
> From: Richard Hightower [mailto:rhightower@arc-mind.com]
> Sent: Wednesday, January 14, 2004 10:08 AM
> To: Struts Users Mailing List
> Subject: low priority question about html:form
>
>
>
> I assert the following:
> "You could override the ActionForm associated with this <html:form/> by
> using the scope and type attribute. The scope specifies where to look for
> the ActionForm, and the type specifies what type of ActionForm it is,
i.e.,
> the fully qualified Java classname. This technique is not used in practice
> very often, but it is good to know that it exists."
>
> Example,
>
> <html:form action="/myaction" scope="request" type="arcmind.MyForm"/>
>
> I've thought of a few reasons why you want to do this, but they seemed
> fairly lame. Can someone give me a valid use case where you would need
this
> feature?
>
> QUESTION: Why not just specify the Form in the action mapping?
>
>
> The <html:form /> tag renders an HTML form. The <html:form/> is associated
> with an action mapping by the action attribute. The action attribute
> specifies the path of the action mapping.  Therefore, when the user
submits
> the form the action associated with the ActionMapping will be invoked (if
> the form is valid). It is interesting that this tag inspect the
> ActionMapping and finds the ActionForm associated with the ActionMapping.
> If the ActionForm is in scope, the property values of the ActionForm will
> be
> rendered as the values in the HTML form field of the <html:form/>.  In
fact
> if the ActionMapping has an error (e.g., points to in valid ActionForm),
> the
> page with the <html:form/> will never display until you fix the
> ActionMapping.

--
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Is there any master list of deprecated methods, and custom tag attributes? RE: low priority question about html:form

Posted by Kris Schneider <kr...@dotech.com>.
I think the closest thing is probably in the release notes. For 1.1, it's here:

http://jakarta.apache.org/struts/userGuide/release-notes-1.1.html#diff

But since the tag handler methods associated with the deprecated tag attributes
are not also deprecated, they don't show up in the list (at least in the case of
<html:form>).

Quoting Richard Hightower <rh...@arc-mind.com>:

> Is there any master list of deprecated methods, and custom tag attributes?
> 
> -----Original Message-----
> From: Kris Schneider [mailto:kris@dotech.com]
> Sent: Wednesday, January 14, 2004 10:48 AM
> To: Struts Users Mailing List
> Subject: RE: low priority question about html:form
> 
> 
> Quick note that the name, scope, and type attributes of <html:form> are
> deprecated as of 1.1 and, AFAIK, have been removed in the current codebase.
> So,
> if there is a compelling use for them, it would be a good idea to address
> it
> through Bugzilla ASAP.
> 
> Quoting Glenn Wilson <gw...@serviceobjects.com>:
> 
> > Richard,
> >
> > It seems to me that this would be useful for run-time decisions about
> where
> > to "send" the form data.  Perhaps if a low-level user and an admin should
> see
> > the same html form, but the ActionForm that handles the admin's work
> should
> > be different.  i.e.:
> >
> > <c:choose>
> > <c:when test="${userIsAdmin}">
> >   <c:set var="type" value="com.foo.Bar" />
> > </c:when>
> > <c:otherwise>
> >    <c:set var="type" value="com.foo.BarSubClass" />
> > </c:otherwise>
> > </c:choose>
> >
> > <html:form action="/myaction" scope="request" type="${type}"
> name="myform"
> > />
> > <!-- HTML HERE -->
> >
> > I'm not sure if the html:form can take dynamic params like that (never
> tried
> > it!) Regardless of the syntax, it seems like you could share the same
> JSP,
> > subclass the ActionForm, and save yourself from creating a ton of
> duplicate
> > code.  You'd probably still have to add an ActionForm mapping in
> > struts-config for each form, but at least you'd have only one JSP and
> Action
> > class.  Perhaps changing the scope dynamically like this could
> potentially
> > change the ActionForm stored in the session as well?  Did I miss
> something?
> >
> > Regards,
> > Glenn
> >
> > -----Original Message-----
> > From: Richard Hightower [mailto:rhightower@arc-mind.com]
> > Sent: Wednesday, January 14, 2004 9:11 AM
> > To: Struts Users Mailing List
> > Subject: RE: low priority question about html:form
> >
> >
> > Oppsss
> >
> > the code listig should read:
> >
> > <html:form action="/myaction" scope="request" type="arcmind.MyForm"
> > name="myform"/>
> >
> >
> > -----Original Message-----
> > From: Richard Hightower [mailto:rhightower@arc-mind.com]
> > Sent: Wednesday, January 14, 2004 10:08 AM
> > To: Struts Users Mailing List
> > Subject: low priority question about html:form
> >
> >
> >
> > I assert the following:
> > "You could override the ActionForm associated with this <html:form/> by
> > using the scope and type attribute. The scope specifies where to look for
> > the ActionForm, and the type specifies what type of ActionForm it is,
> i.e.,
> > the fully qualified Java classname. This technique is not used in
> practice
> > very often, but it is good to know that it exists."
> >
> > Example,
> >
> > <html:form action="/myaction" scope="request" type="arcmind.MyForm"/>
> >
> > I've thought of a few reasons why you want to do this, but they seemed
> > fairly lame. Can someone give me a valid use case where you would need
> this
> > feature?
> >
> > QUESTION: Why not just specify the Form in the action mapping?
> >
> >
> > The <html:form /> tag renders an HTML form. The <html:form/> is
> associated
> > with an action mapping by the action attribute. The action attribute
> > specifies the path of the action mapping.  Therefore, when the user
> submits
> > the form the action associated with the ActionMapping will be invoked (if
> > the form is valid). It is interesting that this tag inspect the
> > ActionMapping and finds the ActionForm associated with the ActionMapping.
> > If the ActionForm is in scope, the property values of the ActionForm will
> > be
> > rendered as the values in the HTML form field of the <html:form/>.  In
> fact
> > if the ActionMapping has an error (e.g., points to in valid ActionForm),
> > the
> > page with the <html:form/> will never display until you fix the
> > ActionMapping.
> 
> --
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org