aspose file tools*
The moose likes JSP and the fly likes JSTL c:import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL c:import " Watch "JSTL c:import " New topic
Author

JSTL c:import

Sudha Rams
Greenhorn

Joined: May 13, 2005
Posts: 12
Hi,
I just have 2 lines in my JSP:

<%@ taglib prefix="c" uri="c.tld" %>

<c:import url="c://static//mystaticfilewithgraph.htm" />

However, I get the following JSP compilation errors:

1. 'try' without 'catch' or 'finally'

2. ) expected

Where am I going wrong? I'm using JSTL 1.0. Any pointers will be of great help! Thanks for your time.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Pointer: Getting Started with the Standard 1.0 Taglib

Did you install the jars?

Did you try:

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

I'm editing this because I forgot to ask what servlet container and version you are using. Tomcat? Version?
[ May 13, 2005: Message edited by: Carol Enderlin ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You may also want to look at the generated servlet code and see what's going wrong on at the line with the error.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sudha Rams
Greenhorn

Joined: May 13, 2005
Posts: 12
Thanks for all your pointers.

The following piece of code worked after placing all relevant jars in /WEB-INF/lib:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:import url="file://c:/static/mystaticfilewithgraph.htm"></c:import>

Now, the "mystaticfilewithgraph.htm" uses an applet to display a graph but this gives a ClassNotFoundException for the applet.

I hope it is okay to load an html that uses an applet using c:import. If not, please enlighten me!!

[ May 16, 2005: Message edited by: Sudha Rams ]
[ May 16, 2005: Message edited by: Sudha Rams ]
Sudha Rams
Greenhorn

Joined: May 13, 2005
Posts: 12
Just FYI - I had to place the applet class outside WEB-INF folder to enable detection of its existence. Things work now!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL c:import