I've successfully gotten JSP1.0 to work with all of it's samples. Now I'm
trying to create a new jsp page. I've created the simplest possible program
(think "HelloWorld") and I cannot get it to work! Here is the source for
"rtest.jsp":
<html>
<body bgcolor="white">
<jsp:useBean id="ricky" scope="request" class="rtest.RicksClass" />
<font size=4>
<ul>
<li> The property is: <jsp:getProperty name="ricky"
property="helloProp"/>
</ul>
</font>
</body>
</html>
Here is the source for RicksClass.java:
/*
* Ricks Test applet for JSP
*/
package rtest;
import java.util.*;
public class RicksClass {
String globalString;
public RicksClass() {
// the constructor
globalString = "Hello World";
}
public String helloProp() {
return globalString;
}
}
Now, the first problem I had was about where to put the java source file.
All of the example sources are in <install
dir>\examples\WEB-INF\jsp\beans\xxx, so I created a directory named rtest
and put the source file there. When I first tried to run "rtest.jsp", I got
an error about not finding the java source file. I tried putting a copy of
it in the same directory as the .jsp file to no avail so I *manually*
compiled it. Now, when I try to run "rtest.jsp", I get the following error
in my browser window:
com.sun.jsp.JspException: getProperty(ricky): can't find method to read
helloProp
at com.sun.jsp.compiler.GetPropertyGenerator.generate(Compiled Code)
at
com.sun.jsp.compiler.Jsp1_0ParseEventListener.generateAll(Compiled Code)
at
com.sun.jsp.compiler.Jsp1_0ParseEventListener.endPageProcessing(Jsp1_0ParseE
ventListener.java:91)
at com.sun.jsp.compiler.Main.compile(Main.java:193)
at com.sun.jsp.runtime.JspLoader.loadJSP(Compiled Code)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(Compiled
Code)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(Compiled
Code)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(Compiled Code)
at com.sun.jsp.runtime.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.sun.web.core.ServletWrapper.handleRequest(Compiled Code)
at com.sun.web.core.Context.handleRequest(Compiled Code)
at com.sun.web.server.ConnectionHandler.run(Compiled Code)
I must be getting stupid in my old age! Any help at all would be *much*
appreciated!
Rick Schaeffer
([EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> )
===========================================================================
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".