/servlet-interest Paula Lumby wrote:
> [...]
> One sample jsp is in the file jsp1.0\examples\jsp\num\numguess.jsp and there is
> straightforward html link to that page from the jsp1.0\webpages\index.html
> through jsp1.0\examples\jsp\index.html.
>
> The numbguess.jsp contains the lines:
> <jsp:useBean id="numguess" class="num.NumberGuessBean" scope="session"/>
> <jsp:setProperty name="numguess" property="*"/>
>
> Now the num.NumberGuesBean is in the file
> \jsp1.0\examples\web-inf\jsp\beans\num\NumberGuessBean.class
>
> This string is not in the classpath. So how does the server find the class? Is
> there a mapping hidden somewhere to ...\jsp\beans...?
Hmmm... In the serverstart.bat file included with the JSP 1.0 EA package I
downloaded, <JSP-HOME>\examples\WEB-INF\jsp\beans is added to the CLASSPATH.
And since the Bean class is in a package named "num", the server finds
it in <JSP-HOME>\examples\WEB-INF\jsp\beans\num, i.e. just where you say
it's stored.
A Bean is just a Java class, basically just using some special method naming
conventions; there's no magic here, no "magic beans" (pun intended). So just
place your Bean classes in a directory or JAR file that's part of the server's
CLASSPATH, using the normal conventions for package name to subdirectory
mapping, and it should work fine. If you still have problems, maybe it's
not that it can't find the class file but that your Bean doesn't have a
public constructor or a similar problem.
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".