简体   繁体   中英

Java: get parameters like are Sent in One String, using get method

I have this URI:

http://IP5:port/notification/myServlet.do?method=myMethod&param1=[08]&method2=anotherParam&param0=[07,04,06]

I want to obtain the URI's last part in the same order:

method=myMethod&param1=[08]&method2=anotherParam&param0=[07,04,06]

But' I can't discover how:

I can see in the request the field input , in order to do a substring after of ? character...

the methods: request.getRequestURI() and request.getRequestURL() is not working for me.

It looks like request is an HttpServletRequest . If so, you should be able to get what you are looking for using request.getQueryString() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM