Maybe I misunderstood what you're looking for, but if I just want some value from web.xml in my action bean I just use:

<web-app>
    <context-param>
        <param-name>myCustomProperty</param-name>
        <param-value>someValue</param-value>
    </context-param>

getContext().getServletContext().getInitParameter("myCustomProperty");

You can even override these in Tomcat for specific deployments without changing the web application/WAR.

Matthijs

On 2013-02-13 02:27, Venkat Ravuri wrote:
Can I do from within ActionBean ( if I have the property configured in web.xml). Where do I need to configure the property in web.xml to make this work?. Under StripesFilter?.

Thanks in advance.


On Tue, Feb 12, 2013 at 11:51 AM, Remi VANKEISBELCK <r...@rvkb.com <mailto:r...@rvkb.com>> wrote:

    Probably :

    
http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/config/Configuration.html#getBootstrapPropertyResolver%28%29

    The property resolver is basically a way to access init params in
    web.xml, with some additional sugar.

    You can get it from anywhere in your app, there's even a static
    for that :
    
http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/controller/StripesFilter.html#getConfiguration%28%29

    It's more elegant to implement ConfigurableComponent though IMO...

    HTH

    Rémi

    Le 12 févr. 2013 à 17:52, Venkat Ravuri a écrit :

    > Is there way to pass my custom property and a value from web.xml
    using Stripes filter or Dispatcher servlet, just like we do for
    Servlets?.
    >
    > Is this possible, if so how do I achieve it?. If I want to use a
    property file for that, how do I pass custom property  file to
    Stripes.
    >
    >   <init-param>
    > <param-name>myCustomProperty</param-name>
    > <param-value>someValue</param-value>
    >         </init-param>
    >
    > Thanks in advance.
    >
    > Thanks,
    > Venkat
    >
    
------------------------------------------------------------------------------
    > Free Next-Gen Firewall Hardware Offer
    > Buy your Sophos next-gen firewall before the end March 2013
    > and get the hardware for free! Learn more.
    >
    
http://p.sf.net/sfu/sophos-d2d-feb_______________________________________________
    > Stripes-users mailing list
    > Stripes-users@lists.sourceforge.net
    <mailto:Stripes-users@lists.sourceforge.net>
    > https://lists.sourceforge.net/lists/listinfo/stripes-users


    
------------------------------------------------------------------------------
    Free Next-Gen Firewall Hardware Offer
    Buy your Sophos next-gen firewall before the end March 2013
    and get the hardware for free! Learn more.
    http://p.sf.net/sfu/sophos-d2d-feb
    _______________________________________________
    Stripes-users mailing list
    Stripes-users@lists.sourceforge.net
    <mailto:Stripes-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb


_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to