jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Tomcat compile problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat compile problem" Watch "Tomcat compile problem" New topic

Tomcat compile problem

Clive van Hilten

Joined: Jul 26, 2001
Posts: 5
Hi all
I am using jdk1.3.0_02 on Win2000.
I have two beans, called PortfolioDetailsBean and PortfolioBeanOriginal, both sitting in a directory with the path WEB-INF\ariel\classes. Both beans belong to the same package, i.e. 'ariel'.
I have a JSP called portfolio_chooser.jsp sitting in jsp\ariel\webcentre\portfolio.
Here are the first few lines of the JSP:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<%@ page contentType="text/vnd.wap.wml;charset=ISO-8859-1" %>
<% response.setHeader("Cache-Control", "must-revalidate, no-store"); %>
<%@ page language="java" import="ariel.*" import="java.util.*" %>
<jsp:useBean id="portfolio" scope="session" class="ariel.PortfolioBeanOriginal" />
Further down the JSP, I have the following code:
<a href ="portfolio_chooser.jsp?action=<%=(new PortfolioDetailsBean(e.nextElement())).getPortfolioId()%>"><%=(new PortfolioDetailsBean(e.nextElement())).getPortfolioName()%></a>

My problem is that the JSP fails to compile, complaining that:
Class jsp.ariel.webcentre.portfolio.PortfolioDetailsBean not found.
It seems to me that the fact that the bean is instantiated in an <href> as a parameter for the JSP, is causing Tomcat to look at the wrong path for the bean.
Please note that I believe that my CLASSPATH is correct, as all other beans in the application sit in the same directory, and all compile fine except this one.
Does anyone have any ideas on how to get around this?
Thank you.
Clive van Hilten

Joined: Jul 26, 2001
Posts: 5
I have found the problem.
When I write the import statement like this, it finds the PortfolioDetailsBean:
<%@ page language="java" import="ariel.*, java.util.*" %>
I agree. Here's the link: http://aspose.com/file-tools
subject: Tomcat compile problem
jQuery in Action, 3rd edition