Newbie struts el-tag question

K

kebabkongen

Hi,
I'm trying to debug some code with el-tags that is not working
properly.
That is, the code worked fine with Resin web-container, but seems to
have problems when running on jBoss / TomCat.

This line of code (line #2) works under Resin but not under TomCat:

<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<c:if test="${pageContext.request.parameter('debug') == 'true'}">

It seems as if it won't compile in TomCat or something. If I remove the
lines, the page works as expected.
Any ideas?

Also:
anyone know where to find reference for el-tag coding? When I google
it, I only find dozen of spanish sites which are not relevant.

Regards, PML
 
M

Manish Pandit

Hi,

request is not a part of pageContext. If you want request attribute,
you should be doing this:

<c:if test = "${requestScope.debug == true}">

If you want to access the request parameters, you should be doing this:

<c:if test= "${param.debug == true}">

Regarding EL reference, I could not find any either :(

-cheers,
Manish
 
M

Mike Beaty

Lew

This is a great reference: www.jadecove.com/jstl-quick-reference.pdf

Also, the code you posted is JSTL, not Struts-EL. JSTL is made up of
the c, fmt and sql taglibs. Struts-EL, however, is an extention of the
standard Struts taglibs (html, bean and logic) that will allow you to
use the expression language to access data.

Hope this helps,
Mike
 
M

Manish Pandit

Mike said:
Also, the code you posted is JSTL, not Struts-EL. JSTL is made up of
the c, fmt and sql taglibs. Struts-EL, however, is an extention of the
standard Struts taglibs (html, bean and logic) that will allow you to
use the expression language to access data.

The code I posted is JSP 2.0 EL. JSTL is a collection of tag libraries
(standard and non-standard), while EL is Expression Language supported
in JSP 2.0 spec. EL can be used within a tag (JSTL or custom) as long
as the tag is configured to accept expressions as attributes.

Pretty much like <c:eek:ut value="${sessionScope.user.firstName}"/>

-cheers,
Manish
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top