struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Noël Ribette <>
Subject Re: new problem - fixed one, now I've got another
Date Thu, 15 Mar 2001 17:58:14 GMT

----- Original Message -----
From: Jesse Vitrone <>
To: <>
Sent: Thursday, March 15, 2001 4:15 PM
Subject: RE: new problem - fixed one, now I've got another

> I thought it worked like this:
> <struts-config>
>  <form-beans>
>   <form-bean  name="priceForm"
>      type="com.giantbear.struts.BNPriceForm"/>
>  </form-beans>
>  <action-mappings>
>   <action     path="/checkPrice"
>      type="com.giantbear.struts.BNPriceAction"
>      name="priceForm"
>      scope="request"
>      validate="false">
>    <forward name="results" path="/results.jsp"/>
>   </action>
>  </action-mappings>
> </struts-config>
> My index.jsp has this:
>    <html:form action="/checkPrice" focus="isbn"/>
>     <bean:message key="index.prompt"/>
>     <html:text property="isbn" size="10" maxlength="10"/>
>     <html:submit property="submit" value="Get Price"/>
>    </html:form>
> Because of the config, doesn't it call BNPriceForm, then BNPriceAction?
> BNPriceForm does the validation, and BNPriceAction gets the value, creates /
> sets / adds to the session my BNBook bean, and then moves on to the next
> page.  The next page, then uses that bean to display the info.
> Am I thinking of that wrong?

No, you're right.

One more thing you need to know is that if you forward to your jsp and there is already a
BNPriceForm in the context, it
will be used to set the initial values of the form. If there isn't, a new one will be created
for you by Struts.
This is why the html:text, checkbox etc. need to be in the form field, to have access to this

That is why you got the error closing the tag (<html:form .../> <html:text .../>...).
The text tags didn't find the Form

 If I add class="com.giantbear.struts.BNBook"
> to my html:form, what does that get me?

There are no class attribute for the form tag. However there is a type attribute that I think
can be used if there are
no config parameters in struts-config.

> I think I'm a little confused on how things work.  Any help clearing things
> up is greatly appriciated.
> Thanks,
>     Jesse

View raw message