J
Joerg Gippert
Hi everyone!
I´m using Struts 1.1 and I encountered a problem, which I either didn´t find
a solution for in the Struts documentation or there actually is no solution
for this issue. Just wanted to know, if my "work around" isn´t too messy or
maybe someone has a cleaner solution for this. Ok, here´s the problem:
In my webapp I´d like the user to edit his own data record. Like changing
address, email etc.. As I understand it, Actionforms are designed for
capturing input from HTML forms only but not to present data in HTML forms.
And when I had a look at the html:text tag, I noticed that it doesn´t
provide a value="" field for setting the value of the input field. One can
set initial values for the imput elemts in the config files but how does
that work at runtime? E.g. I pass a bean within the session to the JSP form
and want to set values of input fields from this bean. Actually, that´s my
workaround. In my JSP form I did
<bean:define id="item" name="ITEM" scope="session" />
<input type="text" name="itemname" value="<cut
value="${item.itemname}"/>">
to set the value. Doesn´t look really clean to me but it works
Does anyone have a nicer solution to populate a form at runtime? Maybe I
only missed something
Any hint is appreciated!
Thanks,
Joerg
I´m using Struts 1.1 and I encountered a problem, which I either didn´t find
a solution for in the Struts documentation or there actually is no solution
for this issue. Just wanted to know, if my "work around" isn´t too messy or
maybe someone has a cleaner solution for this. Ok, here´s the problem:
In my webapp I´d like the user to edit his own data record. Like changing
address, email etc.. As I understand it, Actionforms are designed for
capturing input from HTML forms only but not to present data in HTML forms.
And when I had a look at the html:text tag, I noticed that it doesn´t
provide a value="" field for setting the value of the input field. One can
set initial values for the imput elemts in the config files but how does
that work at runtime? E.g. I pass a bean within the session to the JSP form
and want to set values of input fields from this bean. Actually, that´s my
workaround. In my JSP form I did
<bean:define id="item" name="ITEM" scope="session" />
<input type="text" name="itemname" value="<cut
value="${item.itemname}"/>">
to set the value. Doesn´t look really clean to me but it works
Does anyone have a nicer solution to populate a form at runtime? Maybe I
only missed something
Any hint is appreciated!
Thanks,
Joerg