• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL Tag File Attribute problem  RSS feed

 
Saravanan Vijayappan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Tomcat 5.0.28 version, JSTL 1.1, JSP 2.0.

The problem is that the tag attribute value is not printing in jsp.

The below is source of my jsp file - tagfiletest.jsp and this file has been directly placed in application home directory.

<html>
<head>
<title>JSTL View</title>
</head>

<%@ page isELIgnored="false" %>
<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>

<body>
<my:myfooter subtitle="testing the tagfile attribute" />
</body>
</html>

The below is content of my tag file - /WEB-INF/tags/myfooter.tag
------------------------------------------------------------------

<%@ attribute name="subtitle" required="true" rtexprvalue="true" %>

This is tage file and it gets the following attribute details from jsp file : ${subtitle}

I gets the below output when I load the following url: http://localhost:8080/jspel/tagfiletest.jsp

Output in browser is below
----------------------------
This is tage file and it gets the following attribute details from jsp file : ${subtitle}


Hence, I'm not sure why EL is not recognized and why "testing the tagfile attribute" is not being displayed instead of ${subtitle} ??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your web.xml set up properly according to the JSP FAQ?
 
Saravanan Vijayappan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I was told that no need to set up <taglib> configuration in web.xml for jsp 2.0.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saravanan Vijayappan:
Yes, I was told that no need to set up <taglib> configuration in web.xml for jsp 2.0.


That is correct, but that's not what I asked.

Did you set up the web.xml correctly using the Servlets 2.4 XML Schema format, or are you still using the Servlets 2.3 DOCTYPE?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!