Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

taglib  RSS feed

 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been given a file of customized tags but am having trouble getting them to work. The file is called sasads.tdl. I've put it into the META-INF directory in my "root" directory, and added the tablib uri and location to the web.xml in the WEB-INF directory. I use the jar files all the time to import the customized classes, but I get a message that says it can't find the file. I'm stumped. I'm very obviously missing SOMETHING, but for the life of me, I can't figure out what it is.
I'm using websphere.
Pat
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taglib checklist:
1) .tld file (is your post a typo or is the file misnamed?) in WEB-INF or WEB-INF/tags (location shouldn't matter, but one of these is customary)
2) taglib declared in web.xml
3) taglib directive in JSP pages using them
4) jar file in WEB-INF/lib
My experiences have been with Tomcat and Resin so I don't know if there are any Websphere nuances.
If you've done all these steps, perhaps posting the relevant declarations would help.
bear
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taglib checklist:
1) sasads.tld file (yes, it's a typo) is in META-INF
2) taglib is declared in web.xml
3) taglib directive is in JSP pages using them
4) jar file is in our main location for the jar files; should it be in the WEB-INF dir?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
4) jar file is in our main location for the jar files; should it be in the WEB-INF dir?

Depends on your environment. The servlet containers will automatically add jars to the classpath of the web app that are located in the WEB-INF/lib folder of the app. For jars to be shared amongst multiple apps, the containers provide a central foloder (shared/lib in Tomcat, for example). Conventionally, jars are kept in these locations.
It is possible to add extra stuff to the classpath -- you just need to do something explicit to tell the container where it is.
I'd drop the jar in WEB-INF/lib (even if it's only as a debug measure) to see if you are having a classpath issue or not.
You might also want to post the exact error message you are getting. Might give someone an important clue as to what's going on.
bear
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you really want it, I'll post it, but it's huge. The gist of the first part of the error message:
An error occurred at line: 75 in the jsp file: /sas_internet_old/jsp/mddb_report.jsp Generated servlet error: d:\xxx\jsp\_mddb_5F_report.java:228: Missing term. MDTable <% table %> = null;
is that it doesn't seem to like my code:
<jsp:useBean id="<% table %>" class="MDTable" scope="session" >
even though I set String table beforehand as
<%
// load the current application name for the bean
String table = applicationData[0];
%>
I've used this type of code to pass info outside of the java code successfully before, so I'm at a loss.
Thanks.
Pat
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, this has nothing to do with your taglib. I'm glad your other topic sorted your useBean issue out.
bear
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!