There are many ways to do this :
1st Method
----------------
If the username/password combination has been verified to be ok by
verification.jsp, then before sending it to main.jsp, you can add the
username to the session (HttpSession) and retrieve it from main.jsp using :
String username = String.valueOf(session.getValue("username.session"));
Once you've retrieved the username in your jsp as a string, then either use
a setUsername() setter method to pass the value to your bean (which is
nothing but a method, as you want) or directly call the method using the
bean [UrbeanName.yourmethod(username)]
2nd Method
-----------------
You can pass it as a hidden form field from verification.jsp to main.jsp
Feel free to email me if you need some help.
- Ravi
http://Babynamesindia.com
------------------------------------------
Download our Free Screensaver
With pictures of the World's Cutest Babies
Only at : http://Babynamesindia.com
------------------------------------------
At 03:39 PM 2/7/01 -0500, you wrote:
>Hi all,
>
>Step1: I have a login.html page which sends info'(userName and password) to
>verification.jsp page. Here the info' is verified and if the info is correct
>then it goes to main.jsp.
>
>Step2: In this main.jsp page i want to access the userName and send it to
>the servlet which calls the method of class XXX by passing this userName.
>
>I'm able to do till Step1. In Step2, i'm accessing userName through
>request.getParameter("userName") and i have to pass it to the servlet. Here
>i'm so confused, how i can i pass the userName to
>methodX(userName) of class XXX, which does some database operation based on
>the userName.
>
>What i've done is accessing userName through HttpServletRequest object in
>the servlet class and calling the methodX(userName) of XXX. But userName was
>not sent. null went into the method. I'm so confused.
>
>I appreciate your help.
>
>Thanks,
>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
===========================================================================
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