Go Back   SitePoint Forums > Forum Index > Program Your Site > Java and JSP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Sep 14, 2005, 00:18   #1
rozner
SitePoint Wizard
 
rozner's Avatar
 
Join Date: Oct 2002
Location: Paris
Posts: 1,029
Need help with Tomcat/Eclipse

Hi,

So here's a problem I never anticipated. I've been working with WebSphere Studio/RAD for some time developing apps for WebSphere which all work great...

So I'm well aware of Eclipse's web tools project which supports Tomcat. I just started playing around with this today and I'm amazed at how fast Tomcat starts up, it's like 1.1 seconds, this is Tomcat 5.5, 4.1 is a bit slower. I won't even get into how long WebSphere takes to start...

Enough useless facts... the problem is... I'm just trying to set up a simple JSP/Servlet app which will be later used as a demo of some sort. All works fine until I try to use JSTL.

I have a servlet doing some stuff and goes somewhere:

Code:
  request.setAttribute("message", message);
Then I forward to a JSP which looks like this:
Code:
  <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  	pageEncoding="ISO-8859-1"%>
  <%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>Hello world</title>
  </head>
  <body>
  <c:out value="${requestScope.message}" />
  <br />
  <br />
  <form action="/HelloWorld" method="post">
  Enter your name:&nbsp;<input type="text" name="name" />
  </form>
  </body>
  </html>
ok the problem has actually changed in the midst of my typing this since I realized I was missing some JSTL jars. I was originally using just jstl.jar but there are a few others I needed. However this has led me to another problem regarding the same code.

Now it finds the c tag library fine but for some reason I can't use expressions in my <cut />

ok nevermind, I figured out that one too sort of, I downloaded the JSTL jars from Jakarta and copied them over to WEB-INF/lib

Got the same problem, saying that <cut /> can't handle expressions, something about the TLD, so I decided to use the TLD that came with the Jakarta package and reference that directly, so the above code has changed to:

Code:
  ...
  <%@taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
  ...
I'm not sure if this is good practice for JSTL but this seems to have fixed my problem. Any reason why my original code didn't work? Or is this just the way JSTL is used with Tomcat?

I apologize for this probably confusing post and my endless babling, this tends to happen late at night.

Thanks
rozner is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 01:12.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved