For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > October 2004 > JSP cannot find class









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JSP cannot find class
Claudio Almeida

2004-10-31, 8:55 pm

I'm learning JSP and I took this exemple from the BigJava book:

~~ ~~ TEST.JSP ~~ ~~
<jsp:useBean id="formatter" class="TimeFormatterBean"/>
<jsp:setProperty name="formatter" property="date" value="<%= new
java.util.Date() %>"/>
<html>
<head>
<title>Time JSP</title>
</head>
<body>
<h1>Time JSP</h1>
<p>The current time is:
<jsp:getProperty name="formatter" property="time"/>
</p>
</body>
</html>


I installed my time.jsp in the webapps, and put the file
TimeFormatterBean.class in the webapps\WEB-INF\classes



But isnt' working. It returns the following error:



org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 0 in the jsp file: /time.jsp

Generated servlet error:
[javac] Compiling 1 source file

F:\JAVA\TomCat41\work\Standalone\localho
st\bigj\time_jsp.java:41:
cannot resolve symbol
symbol : class TimeFormatterBean
location: class org.apache.jsp.time_jsp
TimeFormatterBean formatter = null;
^
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com