STRUTS : How to populate a submit button ?!

Hi,

i am wondering why the struts population mechanism does not populate the value attribute of a submit button.

Here's what i have :

An actionForm with an actionToPerform property

An action that initializes the actionToPerform property of the mapped ActionForm (and also a combo from a database) before it forwards the request to the jsp

A jsp that isused to create and update a row in a table of the database. So, in that jsp, there's a <html:submit property="actionToPerform" />

which i had hoped would get its value prepopulated by struts.

Another action that inherits from lookupdispatchaction and that is the target of the html form of the jsp.

if i place a <html:text property="actionToPerform" />

, the text field gets populated . Why doesn't the submit button ?

Is there a better way to use the same jsp for updating and creating rows in a database having the submit button showing 'Add' when in the creation mode, and 'Update' when in the updating mode ?

thanks

[1125 byte] By [franck93a] at [2007-10-2 6:16:50]
# 1
You might try this:<html:submit property="actionToPerform"><bean:write name="myFormBean" property="actionToPerform"/></html:submit>replace myFormBean with the name of your form bean.
evnafetsa at 2007-7-16 13:18:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks evnafets, that is the solution i eventually went for.

I wish it existed a solution where i would not have to mention the name of the formBean or a way to customize struts behavior for submit buttons.

i really don't understand why the submit input type is treated differently than the text input type.

franck93a at 2007-7-16 13:18:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...