The scope in which the ActionForm class is placed is defined by the *scope*
attribute of the action mapping within struts-config.xml.
The following should work, but I don't know if it's what you're after.
In struts-config.xml

<form-bean name="frmVendor" type="com.aholdusa.struts.view.N1Form"/>

and

<action path="/processN1.do" type="your.action.Type" name="frmVendor"
scope="request" validate="true" input="yourInput.jsp"></action>

and then in the form tag, just do
<htm:form action="/processN1.do">

HTH

Dave

-----Original Message-----
From: Timothy Hicks [mailto:[EMAIL PROTECTED]]
Sent: 11 June 2001 13:10
To: [EMAIL PROTECTED]
Subject: Form with request scope


I am trying to create a form which has request scope, so that it can be
autopopulated when the form is displayed.  However, when I go to the jsp
the fields are not filled in and if I put debug statements in
FormTag.doStartTag() I realize that the form is tied to a session scope.
The following is the code I am using.  Any thoughts?


<%@page language="java" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:form name="frmVendor" action="processN1.do" scope="request" type
="com.aholdusa.struts.view.N1Form">
<html:errors />
<TABLE border=0 cellPadding=1 cellSpacing=1 id=smallfont>
     <TR>
          <TD colspan=2><H1 class=black>VENDOR INFORMATION</H1></TD>
     </TR>
</table><BR>
<table id="smallfont">
   <tr>
      <td id="captionbar" colspan="4">Company Information</td>
   </tr><TR>
          <TD>VENDOR NUMBER</TD>
          <TD><html:text property="vendorNumber" maxlength="11" size="11"
/></TD>
     </TR><TR>
          <TD>A/P NUMBER</TD>
          <TD><html:text property="apNumber" maxlength="11" size="11"
/></TD>
     </TR><TR>
          <TD>COMPANY NAME</TD>
          <TD><html:text property="companyName" maxlength="75" size="75"
/></TD></tr>
</table><BR>
<table id="smallfont">
   <tr>
      <td id="captionbar" colspan="6">Contact Information</td>
   </tr><TR valign=bottom>
          <TD valign=center>CONTACT FIRST NAME</TD>
          <TD colspan=5><html:text property="contactFirstName" maxlength
="36" size="75" /></TD>
     </TR><TR>
          <TD valign=center>CONTACT LAST NAME</TD>
          <TD colspan=5><html:text property="contactLastName" maxlength
="36" size="75" /></TD>
     </TR><TR>
          <TD>ADDRESS</TD>
          <TD colspan=5><html:text property="vendorStreetAddress1"
maxlength="36" size="75" /></TD>
    </TR><TR>
          <TD></TD>
          <TD colspan=5><FONT ID=DESC>STREET ADDRESS LINE 1</FONT></TD>
    </TR><TR>
          <TD></TD>
          <TD colspan=5><html:text property="vendorStreetAddress2"
maxlength="36" size="75" /></TD>
    </TR><TR>
          <TD></TD>
          <TD colspan=5><FONT ID=DESC>STREET ADDRESS LINE 2</FONT></TD>
    </TR><TR>
          <TD></TD>
          <TD><html:text maxlength="35" property="vendorCity" size="36"
/></TD>
          <TD><html:text maxlength="3" property="vendorState" size="3"
/></TD>
          <TD><html:text maxlength="7" property="countryCode" size="7"
value="USA" /></TD>
          <TD><html:text maxlength="10" property="vendorZip" size="10"
/></TD>
    </TR><TR>
          <TD></TD>
          <TD><FONT ID=DESC>CITY</FONT></TD>
          <TD><FONT ID=DESC>REGION/STATE</FONT></TD>
          <TD><FONT ID=DESC>COUNTRY</FONT></TD>
          <TD><FONT ID=DESC>POSTAL CODE</FONT></TD>
    </TR><TR>
          <TD>PHONE</TD>
          <TD colspan=5><html:text maxlength="12" property="vendorPhone"
size="12" /></TD>
    </TR><TR>
          <TD></TD>
          <TD colspan=5><FONT ID=DESC>XXX-XXX-XXXX</FONT></TD>
    </TR><TR>
          <TD>EMAIL</TD>
          <TD colspan=5><html:text maxlength="128" property
="vendorEmailAddress" size="75" /></TD>
    </TR><TR>
          <TD></TD>
          <TD colspan=5><FONT ID=DESC>[EMAIL PROTECTED]</FONT></TD>
    </TR>
     <TR>
          <TD>ITEM LEAD TIME (IN DAYS)</TD>
          <TD colspan=5><html:text property="poFloat" size="2" maxlength
="2" />
                           <html:text property="busDays" value="BUSINESS
DAYS" /></TD>
     </TR>
</TABLE>
</html:form>

************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

Reply via email to