• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL Tag File Attribute problem

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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} ??
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic