Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Newbie struts el-tag question

Thread view: 
kebabkongen@hotmail.com - 09 Oct 2006 14:36 GMT
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
Manish Pandit - 09 Oct 2006 17:01 GMT
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
Lew - 09 Oct 2006 21:10 GMT
> Regarding EL reference, I could not find any either :(
>
> -cheers,
> Manish

It's not a complete reference, but
http://java.sun.com/javaee/5/docs/tutorial/doc/JSPIntro7.html#wp101877
is useful.

- Lew
kebabkongen@hotmail.com - 11 Oct 2006 12:29 GMT
This helps a lot, seems to be working for me now.

Thank you! :-)

Lew skrev:
> > Regarding EL reference, I could not find any either :(
> >
[quoted text clipped - 6 lines]
>
> - Lew
Mike Beaty - 11 Oct 2006 15:20 GMT
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

> This helps a lot, seems to be working for me now.
>
[quoted text clipped - 11 lines]
> >
> > - Lew
Manish Pandit - 11 Oct 2006 18:12 GMT
>Mike Beaty wrote:
> 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:out value="${sessionScope.user.firstName}"/>

-cheers,
Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.