You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joe Germuska <Jo...@Germuska.com> on 2004/01/14 16:32:46 UTC
why are form beans required for html:form?
I'm working with an old Struts application recently ported to a
Struts 1.2 nightly. One land mine that keeps popping up is that
pages using the <html:form> JSP tag which used to work now no longer
do. I have one specific case where a developer chose not to
implement an ActionForm class (probably because the app also
pre-dated DynaForms and/or he was being lazy) so now the JSP throws
an exception when it comes to the html:form tag and can't find a form
bean associated with the destination action.
Now, I'm all for encouraging people to use Struts the way it was
designed to be used, but in this case, the form has no HTML fields
which are pre-filled from a form bean, so it seems pushy of the
html:form tag to insist that this is an error condition.
Would it make more sense to have the individual input tags complain
if they can't find a form bean, and have html:form be more permissive?
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Imagine if every Thursday your shoes exploded if you tied them
the usual way. This happens to us all the time with computers, and
nobody thinks of complaining."
-- Jef Raskin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
RE: why are form beans required for html:form?
Posted by Joe Germuska <Jo...@Germuska.com>.
At 8:59 PM -0700 1/14/04, Richard Hightower wrote:
>how about another attribute, i.e.,
>
><html:form checkFormBean="false" ...
>
>The checkFormBean defaults to true so it is backwards compatible with other
>versions.
>
>
>I like the idea that html:form checks for the form bean. It makes it easier
>to debug the way it is.
>However, I can see when you would not want that....
Well, I'm figuring that if you actually NEED the form bean, then
something else would throw an exception; presumably the first input
tag which isn't backed by some explicitly named bean.
I'd probably leave out the parameter in preference of error checking
at the right spot. I think what Ted was getting at in his email was
that other tags might not be doing good error checking because
they've always deferred to html:form -- and yes, it would be bad to
remove the check and then start having NPEs thrown that might be much
harder to debug.
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Imagine if every Thursday your shoes exploded if you tied them
the usual way. This happens to us all the time with computers, and
nobody thinks of complaining."
-- Jef Raskin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
RE: why are form beans required for html:form?
Posted by Richard Hightower <rh...@arc-mind.com>.
how about another attribute, i.e.,
<html:form checkFormBean="false" ...
The checkFormBean defaults to true so it is backwards compatible with other
versions.
I like the idea that html:form checks for the form bean. It makes it easier
to debug the way it is.
However, I can see when you would not want that....
-----Original Message-----
From: Ted Husted [mailto:husted@apache.org]
Sent: Wednesday, January 14, 2004 2:49 PM
To: Struts Developers List
Subject: Re: why are form beans required for html:form?
Someone needs to try relaxing the requirement and see what happens to the
input tags.
Of course, the point of the exercise is really the input tags. The buttons
are secondary. We don't want to complicate the input tags for this edge
case. (Though, I don't know if it would be a complication or not.)
Another idea would be a separate tag that could be used for formless forms
[html:formless perhaps? :)]
-Ted.
On Wed, 14 Jan 2004 16:26:44 -0500, Sgarlata Matt wrote:
> Joe -
>
>
> I agree that html:form is being too aggressive in its requirement
> of a form bean. I believe there is already an open BugZilla ticket
> for this issue:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=24356
>
>
> Your reasoning is a little different than the reasoning in the
> ticket, so it might be useful to include your email as a comment on
> the bug.
>
> Matt
> ----- Original Message -----
> From: "Joe Germuska" <Jo...@Germuska.com>
> To: "Struts Developers List" <st...@jakarta.apache.org> Sent:
> Wednesday, January 14, 2004 10:32 AM Subject: why are form beans
> required for html:form?
>
>
>> I'm working with an old Struts application recently ported to a
>> Struts 1.2 nightly. One land mine that keeps popping up is that
>> pages using the <html:form> JSP tag which used to work now no
>> longer do. I have one specific case where a developer chose not
>> to implement an ActionForm class (probably because the app also
>> pre-dated DynaForms and/or he was being lazy) so now the JSP
>> throws an exception when it comes to the html:form tag and can't
>> find a form bean associated with the destination action.
>>
>> Now, I'm all for encouraging people to use Struts the way it was
>> designed to be used, but in this case, the form has no HTML
>> fields which are pre-filled from a form bean, so it seems pushy
>> of the html:form tag to insist that this is an error condition.
>>
>> Would it make more sense to have the individual input tags
>> complain if they can't find a form bean, and have html:form be
>> more permissive?
>>
>> Joe
>>
>>
>> --
>> Joe Germuska
>> Joe@Germuska.com
>> http://blog.germuska.com
>> "Imagine if every Thursday your shoes exploded if you tied them
>> the usual way. This happens to us all the time with computers,
>> and nobody thinks of complaining." -- Jef Raskin
>>
>> ------------------------------------------------------------------
>> --- To unsubscribe, e-mail: struts-dev-
>> unsubscribe@jakarta.apache.org For additional commands, e-mail:
>> struts-dev-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: why are form beans required for html:form?
Posted by Ted Husted <hu...@apache.org>.
Someone needs to try relaxing the requirement and see what happens to the input tags.
Of course, the point of the exercise is really the input tags. The buttons are secondary. We don't want to complicate the input tags for this edge case. (Though, I don't know if it would be a complication or not.)
Another idea would be a separate tag that could be used for formless forms [html:formless perhaps? :)]
-Ted.
On Wed, 14 Jan 2004 16:26:44 -0500, Sgarlata Matt wrote:
> Joe -
>
>
> I agree that html:form is being too aggressive in its requirement
> of a form bean. I believe there is already an open BugZilla ticket
> for this issue:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=24356
>
>
> Your reasoning is a little different than the reasoning in the
> ticket, so it might be useful to include your email as a comment on
> the bug.
>
> Matt
> ----- Original Message -----
> From: "Joe Germuska" <Jo...@Germuska.com>
> To: "Struts Developers List" <st...@jakarta.apache.org> Sent:
> Wednesday, January 14, 2004 10:32 AM Subject: why are form beans
> required for html:form?
>
>
>> I'm working with an old Struts application recently ported to a
>> Struts 1.2 nightly. One land mine that keeps popping up is that
>> pages using the <html:form> JSP tag which used to work now no
>> longer do. I have one specific case where a developer chose not
>> to implement an ActionForm class (probably because the app also
>> pre-dated DynaForms and/or he was being lazy) so now the JSP
>> throws an exception when it comes to the html:form tag and can't
>> find a form bean associated with the destination action.
>>
>> Now, I'm all for encouraging people to use Struts the way it was
>> designed to be used, but in this case, the form has no HTML
>> fields which are pre-filled from a form bean, so it seems pushy
>> of the html:form tag to insist that this is an error condition.
>>
>> Would it make more sense to have the individual input tags
>> complain if they can't find a form bean, and have html:form be
>> more permissive?
>>
>> Joe
>>
>>
>> --
>> Joe Germuska
>> Joe@Germuska.com
>> http://blog.germuska.com
>> "Imagine if every Thursday your shoes exploded if you tied them
>> the usual way. This happens to us all the time with computers,
>> and nobody thinks of complaining." -- Jef Raskin
>>
>> ------------------------------------------------------------------
>> --- To unsubscribe, e-mail: struts-dev-
>> unsubscribe@jakarta.apache.org For additional commands, e-mail:
>> struts-dev-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: why are form beans required for html:form?
Posted by Sgarlata Matt <sg...@bah.com>.
Joe -
I agree that html:form is being too aggressive in its requirement of a form
bean. I believe there is already an open BugZilla ticket for this issue:
http://issues.apache.org/bugzilla/show_bug.cgi?id=24356
Your reasoning is a little different than the reasoning in the ticket, so it
might be useful to include your email as a comment on the bug.
Matt
----- Original Message -----
From: "Joe Germuska" <Jo...@Germuska.com>
To: "Struts Developers List" <st...@jakarta.apache.org>
Sent: Wednesday, January 14, 2004 10:32 AM
Subject: why are form beans required for html:form?
> I'm working with an old Struts application recently ported to a
> Struts 1.2 nightly. One land mine that keeps popping up is that
> pages using the <html:form> JSP tag which used to work now no longer
> do. I have one specific case where a developer chose not to
> implement an ActionForm class (probably because the app also
> pre-dated DynaForms and/or he was being lazy) so now the JSP throws
> an exception when it comes to the html:form tag and can't find a form
> bean associated with the destination action.
>
> Now, I'm all for encouraging people to use Struts the way it was
> designed to be used, but in this case, the form has no HTML fields
> which are pre-filled from a form bean, so it seems pushy of the
> html:form tag to insist that this is an error condition.
>
> Would it make more sense to have the individual input tags complain
> if they can't find a form bean, and have html:form be more permissive?
>
> Joe
>
> --
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Imagine if every Thursday your shoes exploded if you tied them
> the usual way. This happens to us all the time with computers, and
> nobody thinks of complaining."
> -- Jef Raskin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org