Hi,
    Just to check, did you make sure that the action of your form points back to
this same JSP ?
The reason for this is that the form will be using the http GET (or POST) methods
and this method only attaches the parameters to the end of a new request.

Hint... if you want the form in your input file to be generic , ie not have to
specify the name of the page it's action points to then leave out the ACTION and
your browser will assume that the action is pointing back to its self.
eg

<!-- contents of input file inForm.html  nb No ACTION statement-->
<FORM METHOD=GET >
 <INPUT TYPE=TEXT NAME="account" SIZE="4"><p>
 <INPUT TYPE=SUBMIT>
</FORM>
<!-- end of inForm.html -->

now the jsp

<!-- contents of testBean.jsp -->
<%@ page import="SearchBean" %>

<jsp:useBean id="searchcriteria" scope="session" class="SearchBean" >
<jsp:setProperty name="searchcriteria" property="account"
</jsp:useBean>

<HTML>
    <HEAD><TITLE>Test Bean</TITLE></HEAD>
    <BODY>
        <jsp:include page="inForm.html" flush="true" /> <P>
        <HR>
        The value of account is = <jsp:getProperty name="searchcriteria"
property="account" />
    </BODY>
</HTML>
<!-- End of testBean.jsp -->

Hope this helps

Karl

Reg Sherwood wrote:

> Hi,
> I want to do the following....
>
> 1) Use an input file in my HTML/JSP source... eg: <..... input
> type="text" name="account" size="4" .... >
> 2) Have the user fill in the required fields and have the value they
> have supplied accessible to a bean. ie: Upon some button being pushed
> have the value of the input field (ie: name) set a corresponding value
> in a bean to be used to perform some processing.
>
> Example:
> <jsp:useBean id="searchcriteria" scope="session" class="SearchBean" >
> <jsp:setProperty name="searchcriteria" property="account"
> </jsp:useBean>
>
> I also have a class called SearchBean (for lack of a better name)... it
> has a private member called account.  Two additional methods have been
> supplied setAccount(String account) and getAccount().  From what I have
> read I should be able to use jsp:setProperty.  Or would it  be more
> efficient to use the request object and the getParameter("account")
> method inside a servlet?
>
> I have tried the above but all I can seen to set is null.....
>
> Thanks,
>
> Reg Sherwood
> [EMAIL PROTECTED]
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to