[Yanel-dev] Extend Yanel by own servlets
basZero
baszero at gmail.com
Tue Mar 28 11:35:26 EDT 2017
Hi,
I want to extend my realm by a resource that can handle multipart POST
requests according to the Servlet Spec 3.0.
In order to make use of the Servlet 3.0 features, the servlet class must be
annotated by @MultipartConfig, e.g.
@MultipartConfig
public class YanelMultipartServlet extends HttpServlet {
...
}
Currently I think everything is mapped to the YanelServlet in web.xml
My question is: how should I extend Yanel?
What probably has to be done:
- Somehow extend web.xml so that a certain realm path gets mapped to the
new YanelMultipartServlet
- Maybe YanelMultipartServlet can be a subclass of YanelServlet, which then
would find out the mapped resource and the processing of the request could
still be done in the resource.
So, how should I do this?
Use Case why I need this:
in Servlet 3.0 you can easily process all parts in a multipart request like
this:
Collection<Part> parts = request.getParts();
Then you can iterate over all parts.
But the getParts() method only works correctly if the servlet is annotated
by @MultipartConfig
Cheers, Balz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mx2.wyona.com/pipermail/yanel-development/attachments/20170328/e8af53f1/attachment.html>
More information about the Yanel-development
mailing list