• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[html:hidden] for DispatchAction

 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Could anyone help me to clarify. Thx
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Steve
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic