dev@woodstock.java.net

Re: ? on upload filter init params

From: Bob Yennaco <Bob.Yennaco_at_Sun.COM>
Date: Wed, 24 Oct 2007 16:39:25 -0400

richard ratta wrote:
> good question.
>
> I am always amazed how difficult it is to get certain information from
> a web app's servlet, even when in the servlet. I can't find any.
>
> The closest thing I can see is adding listeners that get called when
> filters
> and servlets are invoked.
>
> Can I ask why you need to know this ?
issue #132. And so I figured the way to do this was in my validator -
compare the size of the file to be uploaded with "maxSize" as specified
in the filter. If it's too big, throw an exception.

> Since you are the application developer, you set the value ;)
It already is - in the filter.

>
> -rick
>
> Bob Yennaco wrote:
>
>>
>> If I have the following filter config in web.xml
>>
>> <filter>
>> <filter-name>UploadFilter</filter-name>
>> <filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
>> <init-param>
>> <param-name>maxSize</param-name>
>> <param-value>1000000</param-value>
>> </init-param>
>> </filter>
>>
>> Then can someone tell me what interface I need to use from my app to
>> get access to the maxSize parameter? If I can get ahold of the
>> javax.servlet.FilterConfig, then I can call
>> getInitParameter("maxSize") on it and I'm in business, right? So
>> then how do I get access to the FilterConfig? I would have thought
>> that UploadFilter would have a getFilterConfig() method but it
>> doesn't. Even if it did, how would I get a handle to the
>> UploadFilter object?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_woodstock.dev.java.net
>> For additional commands, e-mail: dev-help_at_woodstock.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: dev-help_at_woodstock.dev.java.net
>