Also this error when I submit the page now

500 Internal Server Error
java.lang.IllegalArgumentException: type mismatch
        java.lang.Object
java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
                native code
        void
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(java.lang.Object,
java.lang.String, java.lang.Object)
                PropertyUtils.java:1650
        void
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(java.lang.Object,
java.lang.String, java.lang.Object)
                PropertyUtils.java:1545
        void
org.apache.commons.beanutils.PropertyUtils.setProperty(java.lang.Object,
java.lang.String, java.lang.Object)
                PropertyUtils.java:1574
        void
org.apache.commons.beanutils.BeanUtils.setProperty(java.lang.Object,
java.lang.String, java.lang.Object)
                BeanUtils.java:919
        void
org.apache.commons.beanutils.BeanUtils.populate(java.lang.Object,
java.util.Map)
                BeanUtils.java:726
        void
oracle.jbo.html.struts11.MultipartUtil.populate(java.lang.Object,
java.lang.String, java.lang.String,
javax.servlet.http.HttpServletRequest)
                MultipartUtil.java:216
        void
oracle.jbo.html.struts11.BC4JRequestProcessor.processPopulate(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse,
org.apache.struts.action.ActionForm,
org.apache.struts.action.ActionMapping)
                BC4JRequestProcessor.java:391
        void
org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
                RequestProcessor.java:246
        void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
                ActionServlet.java:1292
        void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
                ActionServlet.java:492
        void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
                HttpServlet.java:740
        void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
                HttpServlet.java:853
        void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
                ServletRequestDispatcher.java:721
        void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest,
javax.servlet.http.HttpServletResponse)
                ServletRequestDispatcher.java:306
        boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS
(9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread,
com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS
(9.0.3.0.0) Containers for
J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream,
java.io.OutputStream, boolean)
                HttpRequestHandler.java:767
        void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
                HttpRequestHandler.java:259
        void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run()
                HttpRequestHandler.java:106
        void
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
                PooledExecutor.java:803
        void java.lang.Thread.run()
                Thread.java:484



>>> [EMAIL PROTECTED] 06/06/03 02:39PM >>>
I still get the error 

Cannot create iterator for this collection

>>> [EMAIL PROTECTED] 06/06/03 02:12PM >>>
Having moved away from logic:iterate in favor of c:forEach from the
JSTL, I
am not exactly sure how to use it in this case. That being said, I
believe
that you want to use id="firstName" in the tag below. The value of i is
incremented by the iterate tag. I am not sure that you can access the
value
of i like you are in the code below. The code should probably look like:

<logic:iterate id="firstName" indexId="i"  name="addRateForm">
  <% int i = ((Integer) pageContext.getAttribute("i")).intValue(); %>
  <html:text name="addRateForm" property="firstName[<%= i %>]" />
</logic:iterate>


-----Original Message-----
From: Sashi Ravipati [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 1:47 PM
To: [EMAIL PROTECTED]
Subject: RE: Error - [Ljava.lang.String;@d23.


Thanks for the code.. I started to build my code based on your replay as
shown below

<logic:iterate id="foo" indexId="i"  name="addRateForm">
  <html:text name="addRateForm" property='<%="firstName["+ i
+"].label"%>' />
</logic:iterate>

I added the get and set methods as u suggested. Also I did not
understand how the value of "i" will be incremented.

But then I got the following error message

Error Message: Cannot create iterator for this collection..

Could u help in explaining how this logic:iterate tag works..

Also I was trying to avaid using Struts-EL tag as it requires web
container supporting Servlet 2.3 specification.

Thanks


>>> [EMAIL PROTECTED] 06/06/03 12:05PM >>>
I hope that I am not too far out of touch with what you are attempting
to
accomplish, but I think I understand. There are a couple of things that
you
will have to do to get this working properly. In essence, what you want
to
do is use an indexed property. First, modify your Java bean as such:

  private String[] firstName;

  /*
    // do the following in the constructor
    // DEFAULT_SIZE should be whatever the maximum number of firstNames
are
allowed
    firstName = new String[DEFAULT_SIZE];
  */

  public String[] getFirstName(){
    return FirstName;
  }

  public void setFirstName(String[] newName){
    firstName = newName;
  }

  public String getFirstName(int i){
    return firstName[i];
  }

  public void setFirstName(int i, String newName){
    firstName[i] = newName;
  }

You will have to initialize the array to some default size in the
constructor of the Java bean, otherwise the code below may throw a null
pointer exception. If you need the size of the array to be dynamically
resizable, perhaps you could use an ArrayList instead and have your Java
bean methods encapsulate this fact. 

Then, in the JSP, you will have to iterate over every element in that
array
and use a tag of the following form:

<html-el:text property="firstName[${i}]"  />

You will also have to modify any validation on this property for this
form.
See http://marc.theaimsgroup.com/?l=struts-user&m=104773695010730&w=2
for
details. I do not have much experience with this aspect of indexed
properties, but it seems like support for this in the validator is
limited
to statically declaring validation on a specific named element such as
firstName[1] or firstName[88].

This should also solve the repopulation problems that you were
experiencing.
I hope that this helps.

Larry


-----Original Message-----
From: Sashi Ravipati [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: RE: Error - [Ljava.lang.String;@d23.


I do have multiple elements of the same name. I started to work with one
element and then I got this error. 

So do I have to add any thing more to the tag?

Thanks

>>> [EMAIL PROTECTED] 06/06/03 10:29AM >>>
>[Ljava.lang.String;@d23.

Thats the default stringified version of your array. It looks like from
the
tag your using you just want to print a simple string, why are you
trying to
pass an array as the property?



-----Original Message-----
From: Sashi Ravipati [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 10:22 AM
To: [EMAIL PROTECTED]
Subject: Error - [Ljava.lang.String;@d23.


Hi

I get the following error when the jsp page is displayed after the
validation fails (Validation errros are all working fine)

[Ljava.lang.String;@d23.

This happens when I am passing values to a String Array. eg: .jsp I have

<html:text property="firstName"  />

These are my set and get methods in my ActionForm

private String [] FirstName=null;

public String[] getfirstName(){
    return FirstName;
  }

  public void setfirstName(String[] newName){
    FirstName = newName;
  }

It works fine when I use String but returns jusn when using String
array.
The values are being set correctly when I ran in debug mode.

Is this a bug??

Thanks


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


***************************************************************************

This electronic mail transmission contains confidential and/or
privileged 
information intended only for the person(s) named.  Any use,
distribution, 
copying or disclosure by another person is strictly prohibited. 
***************************************************************************




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


***************************************************************************

This electronic mail transmission contains confidential and/or
privileged 
information intended only for the person(s) named.  Any use,
distribution, 
copying or disclosure by another person is strictly prohibited. 
***************************************************************************




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

Reply via email to