On Tue, 15 Oct 2002, Stefan wrote:
> Hi,
>
> I have a bean that I use to format text in my JSP pages. The bean contains several
>methods that take strings as arguements and then returns a string.
>
> The following is an attempt to use such a bean method, but it seems the tag is not
>passing the processed result, instead the tag is being passed as a literal string
>(for lack of better terms).
>
>
> <%= gui.displaySex("<c_rt:out value='${value.sex}'/>")%>
>
> The tag normally returns either 'm' or ' f ' but inside the scriptlet the method
>gets the actual tag?
>
> <c_rt:out value='${value.sex}'/>
>
> Instead of the rendered value.
>
> As you may have noticed I am trying to use the rt version of the core taglib
>thinking that this might do the trick.
>
> Any suggestions,
<c_rt:out .../> is a JSP tag. ie) an element of the JSP language.
<%= %> [and others like <% %>] are JSP tags which wrap Java.
gui.displaySex is Java.
I'm skating a little fine with the definitions, but the basic problem is
that you have JSP code where the system expects Java code.
Would you expect:
<img src="http://example.com/index.html"> to work?
No, because an image doesn't expect a html page, it expects an image, be
in png/jpeg/gif etc. Same thing here. <% %> <%= %> effectively mark the
entry into a different type of context, similar to how " marks the exit
from Java syntax and entry into String syntax.
ie) "if {" is different to if {
The rtexpr bit means that you could do:
<c:out value="value--[<c:out value="foo"/>]"/> or some such
ie) a c:out in the attribute of another c:out [or other tag].
Hen
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>