Get Query String Values in Spring MVC Controller

前端 未结 3 1527
Happy的楠姐
Happy的楠姐 2020-12-30 22:56

I have a referrer URL like this:

http://myUrl.com?page=thisPage&gotoUrl=https://yahoo.com?gotoPage

How do I get the Values of \"page\" and \"gotoUrl\" in

3条回答
  •  庸人自扰
    2020-12-30 23:24

    Get the QueryString in Spring MVC Controller

    This is Liferay portal specific solution, and it works.

    Query String Example: ?reportTypeId=1&reportSeqNo=391

    In order to get the value of reportSeqNo in Liferay Portal, we need to get the Original Servlet Request.

    String reportSeq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest)).getParameter("reportSeqNo");
    

提交回复
热议问题