Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with uri attribute of taglib  RSS feed

 
Karthik Vaidiswaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a Hello World app using custom tags.
I am using IBM Websphere Studio App Developer -v 5.1


When I include the taglib directive as shown below
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

,I get an error message saying
Broken link: "http://java.sun.com/jsp/jstl/core

Please advise in this regard.


Thanks
Karthik
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have this in your web.xml file...



You can (and actually must) omit the <jsp-config> element wrapper if you're using an appserver that doesn't support JSP 2.0.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, replace "/WEB-INF/tld/c.tld" with the actual path (relative to your context root) of the TLD file.
 
Karthik Vaidiswaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mr. James,

Thanks for replying. I dont have any tag by name <jsp-config> in my web.xml.
I downloaded jar files for JSTL from apache.org. I have given one of the jar files (standard.jar) as reference in my IDE. Now I am getting an exception which says

[Servlet Error]-[javax/servlet/jsp/el/ELException]: java.lang.NoClassDefFoundError: javax/servlet/jsp/el/ELException


Please advise in this regard.

Thanks
Karthik
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What server are you using (vendor/version)? What version of JSTL?
 
Derek Stodghill
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had similar problems until I found out that Websphere 5.x does not support jsp 2.0 or jstl 1.1. Instead I just removed everything taglib wise from my web.xml, WEB-INF/lib directory, and used the jstl 1.0 uri's.

For instance:
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

Note the lack of the jsp in the uri. Also Websphere will help you out a little by finding the valid taglibs for you. Go to JSP in the menu bar and select Insert Custom. Click the add button to add tag libraries. It will then list the tags from the library. You can then insert the specific tags from there as well.

I have yet to figure out how to get anything besides the core, sql, and fmt libraries to work however. If anyone knows anything let me know.

Derek
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!