JSF REST-post troubles
androsov Apr 24, 2013 10:13 AMHello!
I'm newbie in JSF. Also I'm from Russia and my English is bad. So I hope you'll forgive me if I write stupidities.
I use richfaces 4.3 and Eclipse Juno as my enviroment. I'm trying to use get-post as I've red in book of David Herry.
So I've wrote been-class
@ManagedBean @SessionScoped public class NavigateGetBean implements Serializable{ private static final long serialVersionUID = 1L; private HashMap<String, JsfView> views; private JsfView workZone; public NavigateGetBean() { views = new HashMap<String, JsfView>(); views.put("1", new JsfView("work_zone", "/pages/views/mainView1.xhtml")); views.put("2", new JsfView("work_zone", "/pages/views/mainView2.xhtml")); workZone=views.get("1"); } public String getWorkZone() { return workZone.getWay(); } public void setWorkZone(String workZone) { this.workZone = views.get(workZone); } }
I've wrote xhtml View
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"> <f:metadata> <f:viewParam name="view" value="1"/> </f:metadata> <h:link value="view1" includeViewParams="true" outcome="main" > <f:param name="view" value="1"/> </h:link> <br/> <h:link value="view2" includeViewParams="true" outcome="main?view=2" /><br/> <h:link value="view3" includeViewParams="true" outcome="main?view=3" /> </ui:composition>
I've added breakpoint on getWorkZone() and setWorkZone() methods. When my page opens this view, getter is called (I don't sure it is right, but it is so). But when I click link, setter is NOT called. So I don't know where I made mistake. And if I made it.