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().

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.
> Dhanji.
>
> On Mon, Aug 24, 2009 at 6:22 PM, gagarin61 <[email protected]> wrote:
>
> > I faced the same problem with Tapestry. Tapestry filter uses its name
> > to define application id, which makes configuring Tapestry entirely
> > with Guice impossible.
> > I gave up relatively fast when found that guice-servlet does not
> > provide filter naming out-of-the-box, so now I go with classic web.xml
> > configuration. Of course, on the one hand it's not very fancy way to
> > configure app, but on the other - guice-servlet just does not fully
> > cover web.xml configuration topics.
>
> > On Aug 22, 4:52 am, Cafesolo <[email protected]> wrote:
> > > Hi Dhanji,
>
> > > I don't know why it needs a name. It's a Wicket thing. I'm sure there
> > > must be a good reason for this.
>
> > > I tried to override the Key.toString() method but it's declared as
> > > final.
>
> > > Any ideas?
>
> > > Regards,
> > > -- Cafesolo
>
> > > On Aug 21, 2:48 am, "Dhanji R. Prasanna" <[email protected]> wrote:
>
> > > > Why does it need a name in order to work?
> > > > By default we just provide Key.toString() as the name of the filter...
>
> > > > On Fri, Aug 21, 2009 at 3:05 PM, Cafesolo <[email protected]> wrote:
>
> > > > > Hi everyone!
>
> > > > > I'm trying to configure a servlet filter using a ServletModule
> > instead
> > > > > of the web.xml file, and I need to specify a name for it. This is my
> > > > > current XML configuration:
>
> > > > >        <filter>
> > > > >                <filter-name>wicketFilter</filter-name>
>
> > > > >  <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-
> > > > > class>
> > > > >                <init-param>
> > > > >                        <param-name>applicationClassName</param-name>
>
> >  <param-value>com.example.MyApplication</param-value>
> > > > >                </init-param>
> > > > >        </filter>
> > > > >        <filter-mapping>
> > > > >                <filter-name>wicketFilter</filter-name>
> > > > >                <url-pattern>/app/*</url-pattern>
> > > > >        </filter-mapping>
>
> > > > > And this is as far as I got with the ServletModule class:
>
> > > > > class MyServletModule extends com.google.inject.servlet.ServletModule
> > > > > {
>
> > > > >       �...@override protected void configureServlets() {
> > > > >                bind(WicketFilter.class).in(Scopes.SINGLETON);
> > > > >                filter("/app/*").through(WicketFilter.class);
> > > > >        }
>
> > > > > }
>
> > > > > As you can see, I'm not specifying a name for this filter (i.e.
> > > > > "wicketFilter"), and I can't find a way to do it. The WicketFilter
> > > > > class needs a name in order to work.
>
> > > > > Is it possible to specify a name for a filter using the ServletModule
> > > > > class?
>
> > > > > Regards,
> > > > > -- Cafesolo
--~--~---------~--~----~------------~-------~--~----~
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