File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Include remote file, problems in setting up JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Include remote file, problems in setting up JSTL" Watch "Include remote file, problems in setting up JSTL" New topic
Author

Include remote file, problems in setting up JSTL

kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
Hi,

I need to have a jsp include directive that can bring in a file outside of the web app.
Searching the forums suggested the usage of <c:import> from JSTL.

I am using WSAD 5.1.1, and I enabled the project to use JSTL (from project>properties>web project features), and WSAD automatically added some jar files that included jstl.jar, standard.jar.

I modified my jsp to include this



But when I type <c:import> its not even recognised. I see an Unknown Tag error.

Is there anything else that I ought to do? Googling tells me that I don't need to modify my web.xml file ... Does anyone know what I am missing?

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

What version of the JSTL? Your URI may not be correct.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
I was using jstl 1.0.
I tried updating it to 1.1. No luck.

I tried changing the uri to "http://java.sun.com/jsp/jstl/core". Still does not work!
kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
When I had this uri: http://java.sun.com/jstl/core

I get this message, when I run it inspite of those yellow lines

No such tag import in the tag library imported with prefix c'


If the uri is changed to : http://java.sun.com/jsp/jstl/core

I see this message

This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application'
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

Hmm, ok so it does sound like the container is finding the TLD based upon your URI. But for some reason it's not finding the import tag def. Odd.

Whose JSTL implementation are you using? I'd open the standard.jar file and find the TLD to make sure that the import tag is properly defined.
kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
The problem is fixed Bear! Thanks for your help.

I am not sure what the problem is, but today morning, all I did was restart my WSAD application, and it started working automatically with no code change at all..
Ben Leadholm
Greenhorn

Joined: Nov 29, 2005
Posts: 6
Kayal,

I don't know if this would answer your problem, but if your app server has JSTL examples, use the JAR files and URI from the examples in your application. For example, I had the same error that you did when I was working with Tomcat. I had inadvertently used the wrong JAR directory (standard-1.0/lib rather than standard/lib ) when referencing the Jakarta JSTL libraries.

Don't know why a re-start would solve the issue, but at least you're off and running !!
 
jQuery in Action, 2nd edition
 
subject: Include remote file, problems in setting up JSTL