Invoking an action....?
Hello
I have a controller class like that:
publicclass MyAction{
private String name;
public MyAction(){
}
public String action1(){
setName("guest");
return"ok";
}
public String getName(){
return name;
}
publicvoid setName(String name){
this.name = name;
}
}
And in faces-config.xml, a session scoped bean is declared for MyAction:
<managed-bean>
<managed-bean-name>action</managed-bean-name>
<managed-bean-class>com.milage.MyAction</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
and the navigation rule is:
<navigation-rule>
<navigation-case>
<from-outcome>ok</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
I prepared a simple page for invoking that "action" bean's "action1" method:
welcome.jsp
<f:view>
<h:commandButton id="sendButton1" value="SEND THE POST1" action="#{action.action1}" />
<h:commandButton id="sendButton2" value="SEND THE POST2" action="ok" />
</f:view>
action1 method returns "ok" (as you see in the class declaration) but when sendButton is clicked "index.jsp" page is not opened.
I'm confused....May someone help please?

