This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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"); %> <wml> <%@ 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
Clive van Hilten
Joined: Jul 26, 2001
I have found the problem. When I write the import statement like this, it finds the PortfolioDetailsBean: <%@ page language="java" import="ariel.*, java.util.*" %> Weird?!