• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running JSP in Tomcat 5.5

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I just installed the latest tomcat version and I am able to run all the examples in Tomcat.
I created a jsp page for my own called MYHELLO.jsp as the following and copy it to C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
and I got an error of The requested resource (/MYHELLO.jsp) is not available. Please help.

Thanks



<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title> HEllo </title>
</head>
<body bgcolor="RED">
<H1>hELLO</H1>
<%--TESTING--%>
1+2+3=<C UT VALUE="${1+2+3}"/>
</BODY>
</HTML>
[ March 20, 2005: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must create WAR file and your JSP file must be a part of it. Use ANT or your IDE for creating the WAR file.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No you don't HAVE to creat a WAR file - for just experimenting, all you have to do is put the JSP in a web application directory that knows how to run JSP.

IS NOT a web application directory - webapps\ROOT is the default web application directory. It already has a WEB-INF, etc -
Bill
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a similar issue wtih Tomcat 5.0.27 compiling JSPs. I have my JSPs under a different directory and pointing the docBase tag in fragment context xml to this directory.

My current running application on Tomcat 4 uses JSP 1.1 version. Looks like Tomcat 5 is not compiling my useBean tags and custom tag libs properly. Any idea if any refactoring of the JSP code is required to migrate to JSP 2 version?

Following is the error I get
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TC four was more forgiving if you try to use a non-bean tag with the useBean tag.

A Boolean is not a bean.
Try using "type=.." in your useBean tags instead of "class=".
Better yet, only use classes that comply with the definition of a javabean with jsp:useBean.
 
Md Fizal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. Problem with useBean is solved now. But, JSP custom tags are still giving me hard time. I have a tag with zero parameters like this:

When I saw the source Tomcat 4 & 5 generated I saw the following difference.

In tomcat 4 :
In tomcat 5:

Can anyone help me why it's different?

Here is the error message I get:
 
Md Fizal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the problem. The problem was with Tomcat 5 tag pooling feature which will be turned on by default, because of which custom tag library tags are parsed in a different order than regular.

In order to turn off tag pooling in Tomcat 5, add the following in $CATALINA_HOME/conf/web.xml, locate the
servlet, and add:


[ March 25, 2005: Message edited by: Md Fizal ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic