
| Key: |
WW-474
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Cannot Reproduce
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Bhavin Kamani
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
WebWork
Created: 18/Feb/04 06:07 AM
Updated: 19/Feb/04 10:09 AM
|
|
| Component/s: |
Interceptors
|
| Affects Version/s: |
2.1
|
| Fix Version/s: |
2.1
|
|
|
Environment:
|
Windows XP, Tomcat 5.0.16, JDK 1.4.1_03
|
|
|
First, Kudos to team for creating a very simple yet powerful framework.
I have a situation where I would like to receive an unknown no. of user names from a web page. Using DHTML I am dynamically creating text fields as user[0], user[1]....
My FormAction.java looks like following
public class FormAction extends ActionSupport {
private String[] users = null;
public String[] getUsers() {
return users;
}
public void setUsers(String[] value) {
this.users = value;
}
public String processForm() {
return SUCCESS;
}
}
However, on submitting the action request, I get
java.lang.InstantiationException: [Ljava.lang.String; error. Even if I initialize the String array, it still does not work.
Not sure if this is a bug or a new feature request. Hence I have reported as a bug.
Would be great to instatiate dynmically unknow no. of object as array in this way.
Thanks in advance
|
|
Description
|
First, Kudos to team for creating a very simple yet powerful framework.
I have a situation where I would like to receive an unknown no. of user names from a web page. Using DHTML I am dynamically creating text fields as user[0], user[1]....
My FormAction.java looks like following
public class FormAction extends ActionSupport {
private String[] users = null;
public String[] getUsers() {
return users;
}
public void setUsers(String[] value) {
this.users = value;
}
public String processForm() {
return SUCCESS;
}
}
However, on submitting the action request, I get
java.lang.InstantiationException: [Ljava.lang.String; error. Even if I initialize the String array, it still does not work.
Not sure if this is a bug or a new feature request. Hence I have reported as a bug.
Would be great to instatiate dynmically unknow no. of object as array in this way.
Thanks in advance
|
Show » |
|
You could also try just leaving the array index stuff off... just name all of the fields "users"... With all of them having the same name, it will get sent to the server as a String[] by the browser.