Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL c:import

 
Sudha Rams
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to look at the generated servlet code and see what's going wrong on at the line with the error.
 
Sudha Rams
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just FYI - I had to place the applet class outside WEB-INF folder to enable detection of its existence. Things work now!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic