Try <html:form action="/process">

-----Original Message-----
From: Marcello Savino [mailto:[EMAIL PROTECTED] 
Sent: 18 September 2006 13:29
To: Struts Users Mailing List
Subject: R: R: Dynamically Generated html:Text

Something like that:

public class myMapForm extends ActionForm {

      public void setTxt(int index, Object value) {
          a[i]=value;
      }

      public String getTxt() {
          return (String)a[i];
      }

}

========JSP file(test.jsp)=============

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; 
charset=windows-1252"/>
    <title>Google Client</title>
  </head>
  <body>
  <html:form action="process">
     <%
     for(i=0;i<1;i++)
     %>
     <html:text property='<%="txt[" + i +"]" %>' />
  </html:form>
    </body>
</html>

Please  take a look a the struts documentation on-line for further details o
other examples.
Marcello
-----Messaggio originale-----
Da: Aftab Vhora [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 18 settembre 2006 12.30
A: Struts Users Mailing List
Oggetto: Re: R: Dynamically Generated html:Text

Hi Savino,

Thanks for the reply. Could u please provide me an example my test.jsp 
using indexed properties.

Thanks & Regards,
Aftab Vhora




Marcello Savino wrote:

>1) You have some kind of getter and setter for txt property not for txt1,
txt2, ....txt3 property
>You'd better look for indexed properties
>
>-----Messaggio originale-----
>Da: Aftab Vhora [mailto:[EMAIL PROTECTED] 
>Inviato: lunedì 18 settembre 2006 12.06
>A: Struts Users Mailing List
>Oggetto: Dynamically Generated html:Text
>
>Hi,
>
>I m dynamically generating the html:text , i have made correct entry in 
>the struts config.xml and also implemented the Action Form and Action 
>class.
>
>But I m getting below error, request you to kindly provide me the solution.
>
>===========ERROR============
>
>javax.servlet.jsp.JspException: No getter method for property txt1 of 
>bean org.apache.struts.taglib.html.BEAN
>at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
>at 
>org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176
)
>at _test._jspService(_test.java:63)
>[/test.jsp]
>.................
>
>=====action form=========
>public class myMapForm extends ActionForm
>{
>  private final Map values = new HashMap();
>
>      public void setTxt(String key, Object value) {
>          values.put(key, value);
>      }
>
>      public String getTxt(String key) {
>          return (String)values.get(key);
>      }
>
>}
>
>========JSP file(test.jsp)=============
>
><html>
>  <head>
>    <meta http-equiv="Content-Type" content="text/html; 
>charset=windows-1252"/>
>    <title>Google Client</title>
>  </head>
>  <body>
>  <html:form action="process">
>     <%
>     for(i=0;i<1;i++)
>     %>
>     <html:text property='<%="txt" + i %>' />
>  </html:form>
>    </body>
></html>
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to