14 September 2011

How to handle parameters from GET request in jetty ?

Solution based on  Jetty 6.1.x *

It quite easy, In your  handle method

 public void handle(String target, HttpServletRequest request, HttpServletResponse response, int arg) throws IOException, ServletException {
  String myCoolParameter = request.getParameter(" myCoolParameter ");
  response.getWriter().println("Your paramater is:>" + myCoolParameter );

 If you have more parameter you just add another   getParameter(name) where name is a name of parameter
so for example
http://eclispe.screw.up.jetty.seven/example.html?eclipseiscrap=true&whyihateeclipse=because is clumsy

*I have no idea is it works on jetty 7.x+ because I was unable to install and run it as embedded server.
 Eclipse Foundation mess up badly  with Jetty again.Eclipse really should change name to Clumsy.