Win a copy of Java Challengers this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

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: 67528
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: 67528
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?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic