wood burning stoves 2.0*
The moose likes Struts and the fly likes can anybody answer my question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can anybody answer my question" Watch "can anybody answer my question" New topic
Author

can anybody answer my question

Manuel Schenkhuizen
Greenhorn

Joined: Apr 20, 2011
Posts: 14
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

Joined: Oct 29, 2001
Posts: 8843
    
    7

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?

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Hi friend,

Can you please post your User class and the error what you are getting at console.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Manuel Schenkhuizen
Greenhorn

Joined: Apr 20, 2011
Posts: 14
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can anybody answer my question
 
Similar Threads
problems validation.xml in struts 2
problems in validation part of struts 2
struts2 result question
Data not get displayed in struts2 - jquery grid
submitting correct username and password, it again come in login.jsp