Using bean:write to populate value of html:option

S

Sameer

Hi,

I am doing something like this. (Tomcat 4.1.27, Struts 1.0)

<html:eek:ption value='<bean:write name="SampleForm" property="userName" />' />

i.e. using bean:write to populate the value of html:eek:ption.
The problem is that the bean:write tag is not executed and the
text of the tag is passed literally to the value attribute.

I have tried all combinations of single and double quotes. With all
double quotes parser gives error. With the combo of single and double
quotes, above mentioned behaviour occurs.

Is there any way to make this work?
For some reason I don't want to use html:eek:ptions tag.

Please help.

Thanks,
Sameer.
 
C

Christophe Vanfleteren

Sameer said:
Hi,

I am doing something like this. (Tomcat 4.1.27, Struts 1.0)

<html:eek:ption value='<bean:write name="SampleForm" property="userName" />'
/>

i.e. using bean:write to populate the value of html:eek:ption.
The problem is that the bean:write tag is not executed and the
text of the tag is passed literally to the value attribute.

I have tried all combinations of single and double quotes. With all
double quotes parser gives error. With the combo of single and double
quotes, above mentioned behaviour occurs.

Is there any way to make this work?
For some reason I don't want to use html:eek:ptions tag.

Please help.

Thanks,
Sameer.

You can't nest tags like that.

Try <html:eek:ption value="${Sampleform.userName}"/> instead.
If the struts html tags support the expression language, that should work.

Btw, you shouldn't start your beannames with capitals, that makes it
confusing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top