I want to use DispatchAction and my method request parameter is generated by <html:hidden property="method"...>. But is it a must that I should include an ActionForm (or DynaActionForm) containing the property 'method'? I am not going to use the method parameter nor to validate it. Setting a formbean just for this is too troublesome. But the documentation is not clear on this and it seems to suggest 'property' of attribute <html:hidden> has to be corresponding to an action form property.
No, you don't need a form or a Bean for this. I have used it in the past by appending the method to the URL as a request parameter.
Joined: Jan 28, 2004
Perhaps I should change my question a bit. I am more concern about the use of 'property' in html tag. Assuming I don't want to append the parameter at end of URL (index.do?method="something"). Perhaps, I want to do this: <html:form action="ss"> <html:submit property="" value=".."/> <html:submit property="" value=".."/> </html:form>
(or image as submit button). This key point is that is it a must to use a form bean if we use 'property' in our input tag?
I've done some tests. The property attribute seems to demand a form-bean (<action name="sth"..> must be defined). But the form-bean does not have to contain exactly the property you specified in the tag.
The struts documentation is not very clear in this area. Appreciate if anyone can provide more info.
For html:submit, property is a passive attribute and does not reference an ActionForm. If it gives you problems, I highly recommend using just regular html tags for the buttons. Using the struts tags for these really doesn't add any extra functionality.