Closed
Solved
How to get query parameter from url in Authentication activity
To see attachments, please log in.
This content is closed to future replies and is no longer being maintained or updated.
Links may no longer function. If you have a similar request, please write a new post.
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.
Accepted Solution
Param.Status will have value "jhjh"
In your activity, use Param.Status in Property-Set. You will get the value.
I have tried but didn't work.
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
Hi ,
I am getting error when i used the same code.can you please check attachment.
@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));
}
}
}
Question
Question Solved
Question
Question Solved
Question
Question Solved
Question
Question
Question
Question
Pega Collaboration Center has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.