cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <>
Subject [cocoon3] @Context Request request
Date Sun, 30 Oct 2011 17:35:37 GMT

for processing a multipart/form-data request holding image data, I 
intend to use the commons imageupload [1]. In order to do so, I need to 
get access to the javax.servlet.http.HttpServletRequest object inside a 
REST resource. The @Context annotation injects information about the 
request, see e.g. [2] and also [3], but the request object should 
implement the interface (I think).

How can I get to the HttpServletRequest inside a REST resource. Is there 
a way to convert Request to javax.servlet.http.HttpServletRequest? 
According to [4],"When deploying a JAX-RS application using servlet then 
ServletConfig, ServletContext, HttpServletRequest and 
HttpServletResponse are available using @Context." But how?

Right now, I assume

public Response uploadImage(@Context HttpServletRequest request) {

but I do not believe this is actually correct.

The actual type is com.sun.jersey.spi.container.ContainerRequest 
(implements Request), according to request.getClass().getName().

There is nothing in the request itself, while I see with Firebug that 
the image file is sent to the server in the proper way.



Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email:
University of Oulu, Finland  | WWW:
StruBioCat                   | WWW:
Triacle Biocomputing         | WWW:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message