Discussions

Web tier: servlets, JSP, Web frameworks: how to get and use querystring parameters in jsp

  1. how to get and use querystring parameters in jsp (3 messages)

    Hi everyone,

    I am new to jsp from an asp background. I need information on how to access querystring parameters in jsp. in Asp it would be something like this:

    URl: http://myaddress.com/xyz?name=jill&sex=f
    dim someName
    someName = request.querystring("name")


    Thanks,

    Ade
  2. In JSP it will be,
    URl: http://myaddress.com/xyz?name=jill&sex=f
    String someName = request.getParameter("name") ;
    String sex = request.getParameter("sex") ;
    hope that helps..

    -nagesh
  3. Thanks Nagesh,

    I tried it and it works:0).....slowly getting my head away from asp into jsp.

    Cheers,

    Ade
  4. Ade don't get bogged down by the big words Sun uses. In the end u will realise they just copy and package. Coming from a MS background you are way ahead already.

    Happy hunting.