Init parameter custom property

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Init parameter custom property

Venkat Ravuri
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Init parameter custom property

VANKEISBELCK Remi
You mean configure an Interceptor or stuff like that ?

http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/config/ConfigurableComponent.html

?

HTH

Remi


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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Init parameter custom property

VANKEISBELCK Remi
In reply to this post by Venkat Ravuri
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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Init parameter custom property

Venkat Ravuri
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 <[hidden email]> 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
> [hidden email]
> 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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Init parameter custom property

Matthijs Laan

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 <[hidden email]> 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
> [hidden email]
> 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
[hidden email]
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Init parameter custom property

VANKEISBELCK Remi
In reply to this post by Venkat Ravuri
C'mon dude, RTFM... 
We can't do much more than pointing you to the appropriate docs.

Cheers

Remi


Le 13 févr. 2013 à 02:27, Venkat Ravuri a écrit :

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 <[hidden email]> 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
> [hidden email]
> 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
[hidden email]
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users