Question
TD
US
Last activity: 20 Nov 2017 14:28 EST
How to get query parameter from url in Authentication activity
1.How can we get query parameter from url in activity.
eg:https://mesh.pega.com/activity?status=jhjh
i need to get value of status from above and i am trying to get value in of status in authentication activity.I can see state in browser but I am unable to get value of this in activity.Also I don't see the value requri in reqestor or thread page with queryparamter
I don't see this in any requestor page. The url is present is requestor page but i don't see the status.i have tried with @java("((javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject(\"pxHTTPServletRequest\")).getQueryString(\"state\")")
2.I am putting log-messages in authentication activity but i am unable to debug.I don't know the session so i cannot debug from sma.
Please provide your suggestion.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Intellativ
US
Param.Status will have value "jhjh"
In your activity, use Param.Status in Property-Set. You will get the value.
-
Venkat Punati Eduardo Faraldo J Venu
TD
US
I have tried but didn't work.
Pegasystems Inc.
US
Hi Pritam,
Kindly go through the below discussion where Satish has specified how to read the query parameter in the main post itself.
Hope this will help you to achieve your requirement.
Regards
Mahesh
TD
US
Hi ,
I am getting error when i used the same code.can you please check attachment.
Pegasystems Inc.
US
@Pritam, as you are trying to fetch the query param in authentication activity you should use the code specified in the main post, not in the reply comment.
String qString = ((javax.servlet.http.HttpServletRequest) tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest")).getQueryString();
if (qString != null) {
String[] qsAry = qString.split("&");
for (int i = 0; i < qsAry.length; i++){
@Pritam, as you are trying to fetch the query param in authentication activity you should use the code specified in the main post, not in the reply comment.
String qString = ((javax.servlet.http.HttpServletRequest) tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest")).getQueryString();
if (qString != null) {
String[] qsAry = qString.split("&");
for (int i = 0; i < qsAry.length; i++){
if (qsAry[i].indexOf("appName") >= 0) {
myStepPage.putString(".Application", qsAry[i].substring(qsAry[i].indexOf("=") + 1));
}
if (qsAry[i].indexOf("sysName") >= 0) {
myStepPage.putString(".System", qsAry[i].substring(qsAry[i].indexOf("=") + 1));
}
}
}