tags:

views:

45

answers:

1

Is it possible to do something like this:

<bean:message bundle="MyBundle" key="mytext.text" 
    arg0='<input  type="text"  name="text"  value="<%=num %>"'/>

I know that it is possible to pass an HTML element, but I will end up with an input box with the value "<%=num%>" instead the actual value of that variable. What am I missing?

A: 

You cannot combine scriptlet with a string for a tag argument, like you see the scriptlet is not evaluated so try that:

<% String s = "<input  type=\"text\"  name=\"text\"  value=\""+ num +"\""  %> 
<bean:message bundle="MyBundle" key="mytext.text" arg0="<%= s %>"/>

Take note that the input tag is not closed as in the example you provided.

svachon