Hi Brenda!
If you declare the property name "pass_code", then the setUserpass() method that
you wrote is wrong: it should be called setPass_code()...
Maybe is better to replace the property names in the .jsp: pass_code ==>
userpass, and everything should work fine.
Bye.
BRAIN Development GmbH
Andrea Vicentini
System Engineer e-Business
Phone: +49 (7151) / 602-332
Fax: +49 (7151) / 602-372
Internet: http://www.brainag.com
e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]
Brenda Tung <[EMAIL PROTECTED]> on 31.03.2000 11:30:41
Please respond to Brenda Tung <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Andrea Vicentini/DV/BRAIN)
Subject: problems with accessing form data using beans
hi all,
I have a login_page.html with 2 fields ( named 1:username and
2:pass_code) and when submitted, it's call
response.jsp which will call bean: NameHandler to access form data.
However, I've tried with 1 form field and it
works. But when I try to read 2 form fields it gives me an error.
pls look at it if u all can spare the time.
brenda
here's the code for response.jsp
<%@ page import="myb.NameHandler" %>
<jsp:useBean id="mybeanb" scope="session" class="myb.NameHandler"/>
<jsp:setProperty name="mybeanb" property="username" param="username" />
<jsp:setProperty name="mybeanb" property="pass_code" param="pass_code"
/>
<HTML>
<head>
<title> </title>
</head>
<BODY>
<jsp:getProperty name="mybeanb" property="username" />
<jsp:getProperty name="mybeanb" property="pass_code" />
</BODY>
</HTML>
here's the code for bean NameHandler
package myb;
public class NameHandler {
private String username, pass_code;
public NameHandler() {
username = null;
pass_code = null;
}
public void setUsername( String formName ) {
username = formName;
}
public String getUsername() {
return username;
}
public void setUserpass( String formPass ) {
pass_code = formPass;
}
public String getUserpass() {
return pass_code;
}
}
===========================================================================
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
===========================================================================
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