users@jersey.java.net

Re: Jersey Guice JSP how to?

From: Zhanming Qi <qizhanming_at_gmail.com>
Date: Sat, 16 Oct 2010 08:07:14 -0700 (PDT)

Hi Paul,

Thanks for your reply. I use jersey 1.4, It works.
I thought, maybe it was my mistake for 1.3, whatever it works now.

Here is another question. The static css file doesn't work.

I found some solution from this url:
http://jersey.576304.n2.nabble.com/WebPageContentRegex-and-Guice-integration-td3615214.html
and this: http://github.com/charliek/jersey-guice-example

here is my ServletModule()

new JerseyServletModule() {
        @Override
        protected void configureServlets() {
                // bind web resources
                bind(Index.class);
                // setup Jersey
                Map<String, String> params = new HashMap<String, String>();
                params.put("com.sun.jersey.config.feature.ImplicitViewables", "true");
                params.put("com.sun.jersey.config.feature.Redirect", "true");
                params.put("com.sun.jersey.config.property.packages",
"org.example.jersey.action");
                // this serves the static content
                serveRegex("/(images|style)/.*").with(DefaultWrapperServlet.class);
                serve("/*").with(GuiceContainer.class, params);
        }
}

But it didn't works for me. Is there some other fix?
Thanks a lot.
-- 
View this message in context: http://jersey.576304.n2.nabble.com/Jersey-Guice-JSP-how-to-tp5349718p5642097.html
Sent from the Jersey mailing list archive at Nabble.com.