简体   繁体   中英

How to get request query string from the URL

I am trying to extract the query string from the static URL from the browser using Java. But when I use the getQueryString() method, it is returning the query string for the particular portlet.

For example: my static url looks like this /owner/?search&name= and the portlet URL is /home/create which can't be seen in the browser URL.

Is there any way to extract the query string from Static URL?

James,

You may try to use PortletRequest.getParameterMap() , returning a java.util.Map of java.lang.String,java.lang.String[] - as in the official JSR-286 spec

Check the link, there are some other methods to extract URL parameters and values.

Hope this helps, Philippe

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