Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can anybody answer my question

 
Manuel Schenkhuizen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the index.jsp

<s:form action="abc" namespace="/test">
<s:textfield name="users[0].name" label="ff"/>
<s:submit />
</s:form>

here is the hello.jsp

<body>
<s:property value="users[0].name" />
</body>

struts.xml

<struts>
<package name="hello" namespace="/test" extends="struts-default">
<action name="abc" class="struts.HelloWorld">
<result>/test/Hello.jsp</result>
</action>
</package>
</struts>

helloworld.class

public class HelloWorld extends ActionSupport {
private String username;
private boolean flag;
private List<User> users;


public List<User> getUsers() {
return users;
}

public void setUsers(List<User> users) {
this.users = users;
}

public boolean isFlag() {
return flag;
}

public void setFlag(boolean flag) {
this.flag = flag;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String execute() {
return "success";
}
}

what`s wrong ?
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.

wifm wifmmm wrote:
what`s wrong ?


I have no idea. What happens when you run it? How does that differ from what you expect?
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friend,

Can you please post your User class and the error what you are getting at console.
 
Manuel Schenkhuizen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem has been resolved.
I wrote the user class and the helloworld class in the same class file,maybe this is what struts cann`t allow.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic