Hi,

I tried whatever you said. I created a bean with getter,setter methods on
userName,password. And in the verification.jsp, I used useBean tag with
scope="session". How do i use this in another jsp page? again i have use
useBean tag with session scope or is there any other way. Some times i'm
getting ClassCastException.

Here is small code on each page:

/************* start *********************************/

which i'm using in verification.jsp:

<jsp:useBean id="userInfo" class="com.nalini.servlets.UserInfo"
scope="session" >
<jsp:setProperty name="userInfo" property="*" />
</jsp:useBean>

<% String user = userInfo.getUserName();
   String password = userInfo.getPassword();
   //do all data base checking. If correct information provided by
   //the client then forward to generate.jsp otherwise go to error.jsp
%>

Here is the code in generate.jsp:

<jsp:useBean id="userInfo" class="com.nalini.servlets.UserInfo"
scope="session" >
<jsp:setProperty name="userInfo" property="*" />
</jsp:useBean>

<% System.out.println(userInfo.getUserName()); %>
<%-- rest is HTML page.I didn't put starting ending tags for visibility of
the code. Please bare with me --%>

form name="myForm1"
action="../servlet/com.nalini.security.GenerateKeysServlet" method="GET"
Enter a name to Key Pair:
input type="text" name="nameToPair" size="20"
Enter Public Key name:
input type="text" name="publicKeyName" size="20"
Enter Private Key name:
input type="text" name="privateKeyName" size="20"
input type="submit" value="Generate Keys" name="genKeys"
/form

In the GenerateKeysServlet's doGet, I'm writing the following code:
String userName = request.getParameter("userName");
GenerateSecurity genSec = new GenerateSecurity(); //this is not a bean.

genSec.generatePublicAndPrivateKeys(userName,publicKeyName,privateKeyName);

/******************** end **********************************/

Hope you got my problem.

Janavee
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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

Reply via email to