Hello all,
I noticed that some jsp application use 2 (or more) different
approach when executing some of the business process :
one by using httpservletrequest, httpservletsession,
another by using setItem then call the javabean's method via JSP
(please see code below).
my question is, what's the strength (and weakness) of each
approach, especially for mission-critical application?
i've seen a couple of books, and not many cover this, could you
point me to any available resources?
thank's a lot!
// login.jsp (login form)
<form action="loginprocess.jsp">
userid : <input type="text" name="userid"> <br>
password : <input type="password" name="password"> <br>
<input type="submit">
</form>
-----
// loginprocess1.jsp (using httpservletrequest, httpservletsession)
<jsp:useBean id="mybean" scope="session" class="com.dion.Login"/>
<%
// getParameter & checkhappens inside the the bean
session = mybean.processRequest(request, session);
%>
loginis = <%= session.getAttribute("islogin") %>
privelege = <%= session.getAttribute("privelege") %>
----
// loginprocess2.jsp (using javabeans to fill the properties, do the
// next step inside the jsp)
<jsp:useBean id="mybean" scope="session" class="com.dion.Login"/>
<jsp:setProperty name="mybean" value="*"/>
<%
String islogin = mybean.CheckLogin();
String privelege = mybean.CheckPrivelege();
%>
loginis = <%= session.getAttribute("islogin") %>
privelege = <%= session.getAttribute("privelege") %>
--
Best regards,
dion mailto:[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets