You can try defining a new different role for the second DumbUser.
First you need to modify your dumbClass like this (adding a new role):
| @Name("dumbUser")
| @Role(name="dumbUser1")
| public class DumbUser {
|
| private String name;
|
| public DumbUser() {
| }
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
| }
|
Then your hello world component:
| @Name("helloworld")
| public class Helloworld {
|
| @In("dumbUser")
| private DumbUser dumbUser1;
|
| @In("dumbUser1")
| private DumbUser dumbUser2;
|
| public String sayHello() {
| System.out.println("sayHello: "+ dumbUser1.getName());
| System.out.println("sayHello: "+ dumbUser2.getName());
| return "success";
| }
| }
|
Then the JSF should looks like:
| <h:form>
| <div>
| <h:inputText value="#{dumbUser.name}"></h:inputText>
| <h:inputText value="#{dumbUser1.name}"></h:inputText>
|
| <h:commandButton type="submit" value="sayHello!"
action="#{helloworld.sayHello}"/>
| </div>
| </h:form>
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011954#4011954
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011954
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user