Skip to main content

Init Params in Servlet and Filter

2 replies [Last post]
deepasobhana
Offline
Joined: 2007-11-28
Points: 0

Hi,

This is a question regarding Servlet 3.0 API. If I annotate my Servlet and filter class using @Servlet and @ServletFilter respectively, how do I retrieve the initialization parameter values from these classes? I couldn’t find any helpful information in the spec regarding this.

Thanks,
Deepa

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

Hi Deepa,

On 09/18/08 02:55 AM, webtier@javadesktop.org wrote:
> Hi,
>
> This is a question regarding Servlet 3.0 API. If I annotate my Servlet and filter class using @Servlet and @ServletFilter respectively, how do I retrieve the initialization parameter values from these classes? I couldn’t find any helpful information in the spec regarding this.
>

Have you checked the latest draft (at
http://wiki.glassfish.java.net/Wiki.jsp?page=FrameworkPluggability)?

Both the WebServlet and ServletFilter annotation types define initParams
elements.

Thanks,

Jan

> Thanks,
> Deepa
> [Message sent by forum member 'deepasobhana' (deepasobhana)]
>
> http://forums.java.net/jive/thread.jspa?messageID=300042
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

deepasobhana
Offline
Joined: 2007-11-28
Points: 0

Thanks Jan for this informative pointer.

I still have one doubt - as per the early draft version of JSR 315 (http://jcp.org/en/jsr/detail?id=315), is there a way to retieve the values of init params in Servlets or Filter classes. Or how do we get the instance of ServletConfig from a sevlet class. Am I missing something here..

Thanks,
Deepa