Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to specify formbean in struts 1.2.9

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
in struts 1.1 we will specify formbean name in form tag as follows

<html:form action="Lookup" name="lookupForm" type="com.LookupForm">

name=it will look for an appropiate formbean. Its main purpose is to pass form data between view and controller components.

type-fully qualified classname of the form bean which is used in this request.

but in the case of struts 1.2.9 name and type attribute of form tag has been depricated then how to specify formbean in this version

thanks in advance
saiprasanna
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even in version 1.1, the name and type attribute of the <html:form> tag were optional. If you specify the action attribute of this tag, you've told Struts all it needs to know. Given the action mapping, it can find the configuration for the action and form bean that you created in the struts-config.xml file. The type and name of the ActionForm bean are already defined there, so there's no need to define them again in the <html:form> tag. It's just cleaner to have the configuration all in one place and not duplicated.
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Merril
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic