aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes TLD file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "TLD file" Watch "TLD file" New topic
Author

TLD file

Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
Hi,

I've created a code just like on page 393 of Head first, but while accessing a page from JSP by using an expression: ${mine:rollIt()}, it's displaying as it is as a string literal in the output in JSP, instead of calling the real function which is stored in the function-signature tag in TLD file. Why is that so?

Here's the TLD file which is just like on Head first book page no. 393:


and here's the JSP code:






Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Pawan. There is a typo. Your prefix="mine1" in taglib directory. Use
Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
There is a typo. Your prefix="mine1" in taglib directory


The following too is still displaying an EL expression as an string literal as an output in JSP:




produces:

${mine:rollIt()}
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
In your web.xml is there any entry to disable EL, ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Make sure that your web.xml is declared correctly. See this FAQ.


[My Blog]
All roads lead to JavaRanch
Miroslaw Malicki
Greenhorn

Joined: May 08, 2008
Posts: 2
Try to put missing tag in the TLD
<short-name> somename </short-name>
just after <tlib-version>

It may help.


SCJP 1.4 SCWCD 5
Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
Chinmaya Chowdary wrote:In your web.xml is there any entry to disable EL, ?


I've not declared any el-ignored tag in DD.

The request is going straight to JSP. Although, I checked with request going first to servlet then to JSP, but still getting that string literal as an output.



Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Which jsp version are you using?
Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
2.0
Aarti Malhotra
Greenhorn

Joined: Dec 20, 2006
Posts: 14
Have you placed the TLD in the correct location?


Aarti Malhotra
SCJP 5.0, SCWCD 5.0
Narendhiran Nagarajan
Ranch Hand

Joined: Jun 17, 2009
Posts: 30
Can you post the class
foo.DiceRoller


Naren
-------------------
SCJP - 90%
SCWCD - 98%
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Can you please put web.xml.


Thanks,
Shailesh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: TLD file