M
Matt
I am new to JSP. But most of the time people say JSP page access Java
Bean classes.
I want to know what if I want to access regular Java classes?? Should
I do like this
in the code:
<%
NormalJavaClass cl = new NormalJavaClass();
cl.process();
%>
<%-- JSP page access Java Bean -- %>
<jsp:useBean scope="session" id="formDataBeanObj"
class="formdatatest.FormDataBean"/>
<jsp:setProperty name="formDataBeanObj" property="*"/>
<HTML>
<HEAD>
<TITLE>page1.jsp</TITLE>
<BODY>
<FORM METHOD="POST" ACTION="page2.jsp">
<H2>User Name = <jsp:getProperty name="formDataBeanObj"
property="username"/></H2>
<%
NormalJavaClass cl = new NormalJavaClass();
cl.process();
%>
<P><INPUT TYPE="SUBMIT" VALUE="submit here">
</FORM>
</BODY>
</HTML>
Please advise. Thanks!!
Bean classes.
I want to know what if I want to access regular Java classes?? Should
I do like this
in the code:
<%
NormalJavaClass cl = new NormalJavaClass();
cl.process();
%>
<%-- JSP page access Java Bean -- %>
<jsp:useBean scope="session" id="formDataBeanObj"
class="formdatatest.FormDataBean"/>
<jsp:setProperty name="formDataBeanObj" property="*"/>
<HTML>
<HEAD>
<TITLE>page1.jsp</TITLE>
<BODY>
<FORM METHOD="POST" ACTION="page2.jsp">
<H2>User Name = <jsp:getProperty name="formDataBeanObj"
property="username"/></H2>
<%
NormalJavaClass cl = new NormalJavaClass();
cl.process();
%>
<P><INPUT TYPE="SUBMIT" VALUE="submit here">
</FORM>
</BODY>
</HTML>
Please advise. Thanks!!