Max,

> I can't speak for Tapestry, but as far as I can see from the code,
> Wicket only cares to the extent of wanting to discover the base URL
> within your webapp which is assigned to Wicket, and it provides a filter
> init-param for you to override the default logic which attempts to parse
> web.xml.

You were right. WicketFilter provides a filter init-param called
"filterMappingUrlPattern" that overrides the default logic. The
WicketFilter works perfectly with Guice Servlet if you specify the url
pattern using this parameter.

For anyone interested, this is how my ServletModule looks right now:

public class ServletModule extends
com.google.inject.servlet.ServletModule {

        @Override protected void configureServlets() {
                serve("/myapp/foo").with(FooServlet.class);
                serve("/myapp/bar").with(BarServlet.class);

                Map<String, String> params = new HashMap<String, String>();
                params.put("applicationClassName", 
"com.myapp.MyWicketApplication");
                params.put("filterMappingUrlPattern", "/myapp/*");
                filter("/myapp/*").through(WicketFilter.class, params);
                bind(WicketFilter.class).in(Scopes.SINGLETON);
        }

}

Thanks guys!

Regards,
-- Cafesolo


On Aug 24, 9:25 am, Max Bowsher <[email protected]> wrote:
> gagarin61 wrote:
> > I find this like just another approach of meta-oriented programming/
> > configuration that become more popular novadays. It might be
> > inappropriate way for someone, but I personally find more
> > inappropriate to hide possibilities of configuration of standard
> > properties like <filter-name/> from developer. See FilterConfig
> > interface and its implementation in guice-servlet, where getFilterName
> > () just returns key.toString().
>
> I'd imagine it's a consequence of no-one thinking anyone would ever care
> about names of servlets/filters, so why bother exposing a useless API.
>
> > On Aug 24, 12:02 pm, "Dhanji R. Prasanna" <[email protected]> wrote:
> >> Also note that you don't have to choose either or, you can configure
> >> WicketFilter with web.xml and everything else with Guice Servlet, while we
> >> sort this issue out. It's pretty ridiculous that the name of the filter is
> >> significant to web frameworks, however.
>
> I can't speak for Tapestry, but as far as I can see from the code,
> Wicket only cares to the extent of wanting to discover the base URL
> within your webapp which is assigned to Wicket, and it provides a filter
> init-param for you to override the default logic which attempts to parse
> web.xml.
>
> Max.
>
>  signature.asc
> < 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to