Hello Bill,

Try to use

 <html:form action="insertQuestion.do">
 <html:text property="questionDesc"/>
 </html:form>

not
 
 <html:form action="insertQuestion">
 <html:text property="questionDesc"/>
 </html:form>

and restart servlet container (Tomcat, Resin, etc.) after
strut-config.xml changing (or call http://host:port/path/admin/reload)

Friday, June 08, 2001, 11:43:06 PM, you wrote:

BC> Hello,
BC>      I just am starting out with struts, and I have a question.  I 
BC> started with this syntax in my test jsp:

BC> <html:form name="questionForm" action="insertQuestion">
BC> <html:text property="questionDesc"/>
BC> </html:form>

BC> and this in my struts-config.xml:

BC> <form-bean      name="questionForm" 
BC> type="com.companyname.actionform.QuestionForm"/>

BC> but I was getting this error:

BC> javax.servlet.jsp.JspException: Must specify type attribute if name is 
BC> specified

BC> #########################

BC> After searching this list's archives, I saw a reply to a similar 
BC> question from Craig McClanahan that states:

BC>  > If you specify name here, you must also specify type.
BC>  >
BC>  > If you change this to:
BC>  >
BC>  >    <form:form action="regstep1.do">  The tag will be smart enough
BC>  > to figure out what form bean name you want, without
BC>  > having to specify it both here and in struts-config.xml.
BC>  >

BC> so, to test, I specified the name in my jsp html:form tag so it looked 
BC> like this:

BC> <html:form name="questionForm" 
BC> type="com.companyname.actionform.QuestionForm" action="insertQuestion">

BC> and this worked.

BC> #########################

BC> But, I don't want to have to list the classnames in the JSPs, so I tried 
BC> to follow craigs suggestion.  I changed the lines in the JSP to:

BC>   <html:form name="questionForm" action="insertQuestion">

BC> and tried this in my struts-config.xml:

BC> <form-bean name="questionForm" 
BC> type="com.companyname.actionform.QuestionForm"/>

BC> <action    path="/insertQuestion" 
BC> type="com.companyname.actionmap.InsertQuestionAction"
BC>                 name="questionForm"
BC>                scope="request"
BC>             validate="false">
BC>        <forward name="success"              path="/strutstest.jsp"/>
BC>      </action>

BC> but now I get this error:
BC> javax.servlet.jsp.JspException: Cannot find ActionMappings or 
BC> ActionFormBeans collection

BC> I also searched on this error, but the messages I found did not seem to 
BC> match my situation.

BC> #######################################

BC> Since it works when I specify both the name and type in the html:form 
BC> tag, I am starting to wonder if my struts-config.xml (in my WEB-INF dir) 
BC> is being read.  Is it enough to put this file in the WEB-INF directory?

BC> Also, when I had the name in my html:form tag and the type in the 
BC> form-bean tag, it seemed obvious how these two things were linked (even 
BC> thought this was not correct).

BC> When I follow Craig's suggestion, I am unsure how "The tag will be smart 
BC> enough to figure out what form bean name you want."  Does it use the JSP 
BC> name to link to the "path" attribute of the action tag, and link the 
BC> name attribute of the action tag to the name attribute of the form-bean tag?

BC> Sorry about the length of this message, but I wanted to try to be as 
BC> specific as possible about the problem.

BC> Also, if anyone knows of any good documentation links, I am open to 
BC> suggestions.  Other than the docs on the apache site, I have only found 
BC> www.husted.com , which has lots of useful tips.  Any others out there?

BC> Thanks, Bill



-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to