This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Custom tag not evaluating ${} expressions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom tag not evaluating ${} expressions" Watch "Custom tag not evaluating ${} expressions" New topic
Author

Custom tag not evaluating ${} expressions

Matthieu Levesque
Greenhorn

Joined: May 22, 2009
Posts: 5
Hi,
I've been stuck for a few days now... I'm trying to build a custum tag with parameters but my setter always receive a string when I pass a value as ${model.testStr}.

It's one of my first tag so I as an exemple I redefined the cut tag in my library... Same soruce code, same config and yet the explression is passed as a srting...
JSP:

Results in :

ps : "SWEET!" is my ${model.testStr}

Here's my lcc.tdl:


Any help will be greatly appreciated,

Thanks,

Matt
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

As per forum instructions, please include what versions of JSP, JSTL and Servlets that you are using.

Problems like this are a sign of mixing incompatible versions, or of web app misconfiguration.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Matthieu Levesque
Greenhorn

Joined: May 22, 2009
Posts: 5
Here's what i'm using :
tomcat 6 with liferay 5.2 portlet container
portlet 2.0

For my jsp version I think it's 1.2 since in my web.xml I have the http://java.sun.com/dtd/web-app_2_3.dtd specified.

For my jstl version 2.0, as it was showing in my last post...

The problem is probably between the jsp 1.2 and jstl 2.0... I'll experiment a bit and let guys kknow...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

You'll need to get your versions straight. For example, there is no JSTL 2.0.

Check the JSP FAQs for info on setting up the proper versions and declaring your web.xml properly.
Matthieu Levesque
Greenhorn

Joined: May 22, 2009
Posts: 5
Hi,

Obviously my config is wrong... Would you have any good working example that I could follow?

Keep in mind that it'is my first custom tag...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

Have you consulted the JSP FAQ as instructed?
Matthieu Levesque
Greenhorn

Joined: May 22, 2009
Posts: 5
I finaly figured it out...

I changed my web.xml header to this :



Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Custom tag not evaluating ${} expressions
 
Similar Threads
Creating and populating a List of javaBeans in a JSP w/o using scriptlets
displat:table tag pls help me
Problem while Tag lib Up gradation
Issues adding i18n Chinese support to existing Struts based code
Problem with JSTL