velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garey Mills <>
Subject Integrating VelocityViewServlet with Guice
Date Tue, 05 Apr 2011 19:02:18 GMT
Hi -

     I am trying to integrate VelocityViewServlet and Guice 3.0. I am 
having a problem because VelocityViewServlet does
not seem to see what I am putting into the context to forward to it.

     Guice intercepts all access points. You write a 'ServletModule' 
that forwards different URL patterns to different servlets.

      Guice requires servlets to annotated as Singletons, or to be bound 
to singleton scope in the 'ServletModule'. Here is my
servlet module


     protected void configureServlets() {






In my GisFormServlet,

         HttpSession hs = req.getSession();

         ServletContext sc = hs.getServletContext();

         sc.setAttribute("GISVALUE", "Hello, I'm GISVALUE");

         String next = "/submission/submission.form.vm";
         RequestDispatcher dispatcher = 

I have also put GISVALUE into the request and into the HttpSession. In 
every case, my simple submission.form.vm






outputs '$GISVALUE'. No substitution is occurring.

     Has anyone tried to integrate VelocityViewServlet and Guice? Does 
anyone have any insight into how to fix this, or even how to debug it?

Any help appreciated;

Garey Mills
Library Systems Office
UC Berkeley

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message