After reading about it, it does seem like the robot legs problem. I think my failure in recognizing it was that I'm new to DI in general. I was thinking about configuration from the servlet spec side... declarative, not programmatic.
I guess I have to rethink my design. Thanks Dhanji. Brandon On Mon, Feb 15, 2010 at 10:35 PM, Dhanji R. Prasanna <[email protected]>wrote: > Hi, > > This sounds like the robot legs problem: > http://code.google.com/p/google-guice/wiki/FrequentlyAskedQuestions > > Dhanji. > > On Tue, Feb 16, 2010 at 3:24 PM, brandon_n_atkinson < > [email protected]> wrote: > >> The subject pretty much says it all. >> >> I've been trying to configure guice-servlet to serve two different >> urls served by the same servlet class. Each url's servlet needs to be >> configured differently. >> >> The equivalent web.xml would look like: >> >> ... >> <servlet> >> <servlet-name>FooServlet</servlet-name> >> <servlet-class>com.example.TestServlet</servlet-class> >> <init-param> >> <param-name>message</param-name> >> <param-value>hello world</param-value> >> </init-param> >> </servlet> >> <servlet> >> <servlet-name>BarServlet</servlet-name> >> <servlet-class>com.example.TestServlet</servlet-class> >> <init-param> >> <param-name>message</param-name> >> <param-value>goodbye cruel world</param-value> >> </init-param> >> </servlet> >> <servlet-mapping> >> <servlet-name>FooServlet</servlet-name> >> <url-pattern>/foo.srv</url-pattern> >> </servlet-mapping> >> <servlet-mapping> >> <servlet-name>BarServlet</servlet-name> >> <url-pattern>/bar.srv</url-pattern> >> </servlet-mapping> >> ... >> >> This seems like it should be possible with Guice Servlet, but is it? >> I've tried, but cannot seem to get it to work. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "google-guice" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-guice%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-guice?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-guice%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-guice?hl=en. > -- You received this message because you are subscribed to the Google Groups "google-guice" group. 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.
