How to make EL expression evaluate its values?

R

Ray

Hello,

We have this xml string tht is dynamically generated every request,
and it is output using <c:eek:ut>.

The problem is, we'd like to have JSTL tags inside that as well. A
simple example:

<c:eek:ut value="<html:text ..... />"/>

or

${"<html:text .... />"}

Is there a way so that that value is evaluated? That is, it becomes
<input type="text" ... > instead of "<html:text .... />"

Thanks in advance,
Ray
 
L

Lew

Ray said:
We have this xml string tht is dynamically generated every request,
and it is output using <c:eek:ut>.

The problem is, we'd like to have JSTL tags inside that as well. A
simple example:

<c:eek:ut value="<html:text ..... />"/>

or

${"<html:text .... />"}

Is there a way so that that value is evaluated? That is, it becomes
<input type="text" ... > instead of "<html:text .... />"

EL is not a macro language that stands in for HTML. It is a standin for Java
code. It represents values and expressions present at the time the JSP is
generated.

So you don't "<c:eek:ut>" a value that equals a tag, you just place the tag in
your JSP and use EL to plug in specific values inside the tag.

This part of the JSP should look like:

<input type="text" ... value="${someRequestAttribute.member}" />

You don't need <c:eek:ut> at all, as far as I can see.

- Lew
 
R

Ray

EL is not a macro language that stands in for HTML. It is a standin for Java
code. It represents values and expressions present at the time the JSP is
generated.

So you don't "<c:eek:ut>" a value that equals a tag, you just place the tag in
your JSP and use EL to plug in specific values inside the tag.

This part of the JSP should look like:

<input type="text" ... value="${someRequestAttribute.member}" />

You don't need <c:eek:ut> at all, as far as I can see.

I know that part, basically the reason is this: we have an existing
big application. Most of the content of the file is generated using
XSLT transform.

So in the "skeleton" page, we have something like:

<html:form action...>

<c:eek:ut value=<that XSLT-generated big string, which is stuffed into a
request attribute> escapeXml="false"/>

</html:form>

So all the tags (JSTL or otherwise) are written as they are--they're
not evaluated. When inside the big string we put things like <c:if...>
and so on, when I view the source it will be <c:if...> instead of the
result.

I was wondering if there's a quick way to just tell the page,
"evaluate all tags in this dynamically generated string".

Thanks,
Ray
 
L

Lew

I know that part, basically the reason is this: we have an existing
big application. Most of the content of the file is generated using
XSLT transform.

So in the "skeleton" page, we have something like:

<html:form action...>

<c:eek:ut value=<that XSLT-generated big string, which is stuffed into a
request attribute> escapeXml="false"/>

</html:form>

So all the tags (JSTL or otherwise) are written as they are--they're
not evaluated. When inside the big string we put things like <c:if...>
and so on, when I view the source it will be <c:if...> instead of the
result.

Of course. You have instructed the JSP to generate that string as a literal.
I was wondering if there's a quick way to just tell the page,
"evaluate all tags in this dynamically generated string".

You do not put the "big string" inside a <c:eek:ut>. Do not use <c:eek:ut> for this.

You put your dynamic tags directly on the JSP.

- Lew
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top