W
WJ
I am having a problem putting a <jsp:getProperty. . ./> as a param
in one of my own custom tags.
I am putting a bean on the request and defining in the jsp:
<jsp:useBean id="user" class="User" scope="request"/>
and I can get the properties as well:
<input type="text" name="state" size="2" maxlength="2" class="textbox"
value="<jsp:getProperty name="user" property="state"/>">
However, I want to pass the output of the "state" property into one of my
taglibs, like:
<mytag:render name="state" selectedValues="<jsp:getProperty name="user"
property="state"/>" />
this fails. The error I get is "equal symbol expected"
If I pass a hard coded String, like:
<mytag:render name="state" selectedValues="CA" />
it works fine.
I am running JDK 1.4.2_06 on Tomcat 5.0.28. Now, the <jsp:getProperty />
gets the
property and writes it to the response buffer and I think that's causing the
problem; the
string is not available to the input of the taglib.
I can make this work by putting a value on the request when I put the user
obj on the request.
Then in the tag, I can pull that value off. But I'm really trying to make
this generic.
I've been reading through a JavaServer Pages book this afternoon and am not
finding an
answer. Any input would be greatly appreciated.
in one of my own custom tags.
I am putting a bean on the request and defining in the jsp:
<jsp:useBean id="user" class="User" scope="request"/>
and I can get the properties as well:
<input type="text" name="state" size="2" maxlength="2" class="textbox"
value="<jsp:getProperty name="user" property="state"/>">
However, I want to pass the output of the "state" property into one of my
taglibs, like:
<mytag:render name="state" selectedValues="<jsp:getProperty name="user"
property="state"/>" />
this fails. The error I get is "equal symbol expected"
If I pass a hard coded String, like:
<mytag:render name="state" selectedValues="CA" />
it works fine.
I am running JDK 1.4.2_06 on Tomcat 5.0.28. Now, the <jsp:getProperty />
gets the
property and writes it to the response buffer and I think that's causing the
problem; the
string is not available to the input of the taglib.
I can make this work by putting a value on the request when I put the user
obj on the request.
Then in the tag, I can pull that value off. But I'm really trying to make
this generic.
I've been reading through a JavaServer Pages book this afternoon and am not
finding an
answer. Any input would be greatly appreciated.