cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Wyles <...@robinwyles.com>
Subject Re: MultipartHttpServletRequest in a generator
Date Mon, 16 Jun 2008 21:21:01 GMT
By the way you asked, I guess in some sort of ridiculous attempt to  
get hold of some binary data that has been posted to a pipeline  
containing the generator :)


robin


On 16 Jun 2008, at 22:10, Grzegorz Kossakowski wrote:

> Robin Wyles pisze:
>> Hi,
>> How can I get hold of a MultipartHttpServletRequest in a generator?
>> If I do this...
>> final WebApplicationContext parentContext =  
>> WebAppContextUtils.getCurrentWebApplicationContext();
>> final ProcessInfoProvider infoProvider = (ProcessInfoProvider)  
>> parentContext.getBean(ProcessInfoProvider.ROLE);
>> HttpServletRequest request = infoProvider.getRequest();
>> MultipartHttpServletRequest mpr = (MultipartHttpServletRequest)  
>> request;
>> I get the following error when the final line is executed...
>> java.lang.ClassCastException: $Proxy13
>> Eclipse debugger shows that request is an instance of  
>> MultipartHttpServletRequest.
>> What's the secret?
>
> The secret is how JVM proxies work with the fact that  
> MultipartHttpServletRequest is a class not interface.
>
> Situations like this are little bit worrying me but anyway standard  
> question: why do you want to cast to MultipartHttpServletRequest?
>
> -- 
> Grzegorz Kossakowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


Mime
View raw message