Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Get URL parameter on server side

    Hi,

    I'm able to get parametr from URL on cliend using
    Code:
    com.google.gwt.user.client.Window.Location.getParameterMap()
    but when I tried it on server side in ServiceImpl class I wasn't able to get parametes. I've tried
    Code:
    getInitParameter("par"));
    		
    getThreadLocalRequest().getParameter("par"));
    		
    getServletContext().getInitParameter("par"));
    		
    getThreadLocalRequest().getAttribute("par"));
    but no-luck...

    When I tried (on server)
    Code:
    com.google.gwt.user.client.Window.Location.getParameterMap()
    the RPC was onFailure...

    Could anyone kick me right way?
    Thx.
    Last edited by tape6; 12 Jul 2009, 06:31.

    #2
    ServiceImpl methods are invoked when you use GWT-PRC, and when you do so, you don't work with request parameters directly. You pass an argument to your RPC method and it is available on the server when the method is executed.

    If you use RequestBuilder to do a GET or POST to a specific URL, then your servlet controller registered to act on that URL is invoked with HttpServletRequest as a parameter. Use HttpServletRequest.getParameter(..) to get the parameter value.

    Sanjiv

    Comment

    Working...
    X