Must I compile a bean for a JSP page?

webmasterbeta

New Member
I am trying to make a JSP page that also using a java bean.When doing so, do I need to compile the bean myself and then put it intothe appropriate directory, (i.e. jswdk-1.0.1\examples\WEB-INF\jsp\beans\instantjsp1),before accessing the JSP page through my browser, or will an instance ofmy bean be made automatically when the JSP page is loaded..This is the beanpackage instantjsp1;public class ScopeTest {private int i;public ScopeTest() {i = 0;}public int getNextInt() {return ++i;}}JSP Page<jsp:usebean id = "appScopeCount" scope = "application"class = "instantjsp1.ScopeTest" /><jsp:usebean id = "reqScopeCount" scope = "request"class = "instantjsp1.ScopeTest" /><html><head><title>Scope Test</title></head><body><br><br><br>Counter (scope = application) has a value of &nbsp;<jsp:getProperty name = "appScopeCount" property = "nextInt"/><br><br>Counter (scope = request) has a value of &nbsp;<jsp:getProperty name = "reqScopeCount" property = "nextInt"/><br><br><center><form method = get action = "ScopeTest.jsp"><input type = submit name = "submit" value = <!-- m --><a class="postlink" href="http://forums.devx.com/archive/index.php/">http://forums.devx.com/archive/index.php/</a><!-- m -->"INCREMENT"></form></center></body></html>ClassPath used by serverUsing classpath: .\classes;.\webserver.jar;.\lib\jakarta.jar;.\lib\servlet.jar;.\lib\jsp.jar;.\lib\jspengine.jar;.\examples\WEB-INF\jsp\beans;.\webpages\WEB-INF\servlets;.\webpages\WEB-INF\jsp\beans;.\lib\xml.jar;.\lib\moo.jar;\lib\tools.jar;.;C:\JDK12~1.1\lib\tools.jar;c:\javase~1\jswdk\jswdk-~1.1\examples\web-inf\jsp\beans
 
Back
Top