|
From: <gen...@li...> - 2011-02-17 13:20:18
|
Dear RESTeasy users,
I'm interested to learn more about REST-CDI integration.
I've set up a simple front-end with JSF
<h:form action="restservice">
<h:outputText value="Enter your name:" />
<h:inputText id="username" value="#{user.name}"/>
<h:inputText id="password" value="#{user.password}"/>
<h:commandButton />
<h:messages/>
</h:form>
This should consume a service defined in a CDI Bean
@Named
@Stateless
@Path("/")
public class Example {
@Inject User user;
. . . . .
@Path("restservice")
@POST
@GET
public String login() {
return "Logged with " + user.getName() + " " + user.getPassword();
}
}
However I can see that JSF simply does not bind the form to the REST service
("restservice"), I guess the JSF lifecycle prevents to reach the Web service.
am I choosing the wrong approach to integrate CDI and REST services ?
Any help would be highly appreciated.
john
|