Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in taglib

 
Puja Verma
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey friends.....

I am trying to implement the example given in chapter 10 of HFSJ, which is about tag files...

Here is my code.
My tag file in WEB-INF/tags directory :

<%@ attribute name="subTitle" required="true" rtexprvalue="true" %>
<strong> ${subTitle} </strong>
<img src="test.jpg"> <br>
=======================================================================
my jsp file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags" %>
<HTML><BODY>

<myTags:Header subTitle="testing subtile in JSLT" />

</BODY></HTML>
=======================================================================
my Web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" id="WebApp" version="2.4">
<display-name>Test_JSTL</display-name>
</web-app>
======================================================================
Out which I am getting is :
${subTitle}
......................................................................
Why my subTitle has not been displayed ???
THis EL problem has been coming everytime... Last time the problem was with version in web.xml.
This time i have given it as 2.4 then also ............

Can anyone help me out to solve this problem...

thanks,
pooja
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the DOCTYPE from your web.xml
 
Puja Verma
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removing DOCTYPE is not making any difference in my outcome... Can you see anything else could be the problem in this code ???
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI..

there is no problem in your code, i was able to run your code on my setup.

I think the issue is with EL being disabled.

Please explicity set in your JSP and then try to execute

Hope it helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic