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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to