I solved the problem,
My Classes:
public class GuiceServletConfig extends GuiceServletContextListener {
@Override
protected Injector getInjector() {
Injector i = Guice.createInjector(new ServletModule() {
@Override
protected void configureServlets() {
// Bind classes
bind(PerRequestResource.class);
bind(EventoWS.class);
bind(EventoService.class).to(EventoServiceImpl.class);
bind(EventoDAO.class).to(EventoDAOImpl.class);
bind(Principal.class).toProvider(PrincipalProvider.class);
bind(SecurityContext.class).to(MySecurityContext.class);
install(new JpaPersistModule("eventosImpa"));
serve("/*").with(GuiceContainer.class);
}
});
return i;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>com.sun.jersey.samples.guice.GuiceServletConfig</listener-class>
</listener>
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
but i have another problem.
JPA + Guice + EntityManager Injection
I go posting in another topic.
Thanks for the help.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/5B0yZGef4wEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.