This example project might help...

https://github.com/jetty-project/embedded-servlet-3.0

Look at the 
src/test/java/com/company/foo/EmbedMe.java<https://github.com/jetty-project/embedded-servlet-3.0/blob/master/src/test/java/com/company/foo/EmbedMe.java>
for
an example on how to setup the server configuration for various Servlet 3.x
features.

Also note, you should update your connector configuration.
Apache with mod_ajp (and Jetty with Ajp13Socket) is discouraged.  Use
Apache with mod_proxy (and Jetty with standard connectors).
The mod_proxy configuration is much better supported and maintained, both
at the Apache side, and at the Jetty side. (plus you'll see a performance
boost)


--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org


On Mon, Dec 2, 2013 at 6:47 AM, Ramirez, Edwin <[email protected]>wrote:

>  Hello,
>
> I have created a simple application with Jetty embedded (see code below),
> and I would like to programatically setup the servlet version to 3.  In
> particular, I would like to use the multipart features in
> HttpServletRequest such as getParts(), in order to read uploaded files.
>
> ...
>     void JettyStartup(TreeMap conf) {
>         Server server = new Server();
>
>         Ajp13SocketConnector ajp = new Ajp13SocketConnector();
>         ajp.setPort(conf.getInt("Listener.service.port"));
>         ajp.setHost("localhost");
>
>         server.addConnector(ajp);
>
>         JettyHandler jh = new JettyHandler();
>         jh.conf = conf;
>         server.setHandler(jh);
>         try {
>             server.start();
>         } catch(Exception e) {
>             e.printStackTrace();
>         }
>     }
> ...
>
> public class JettyHandler extends AbstractHandler {
>  public void handle(String target, Request baseRequest, HttpServletRequest
> request, HttpServletResponse response)
>         throws IOException, ServletException
>     {
>         ...
> *        request.getParts();*
>         ...
>     }
> }
>
>
> Thank you.
>
>    Edwin S. Ramirez
> Senior Developer, Information Technology
> Mount Sinai Medical Center
>
> 875 Avenue of the Americas (6th Ave.)
> New York, NY 10001
>
> Phone: 646-217-3112
> Fax:  212-356-0085
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to