Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

NullPointerException for pxHTTPServletRequest

SA-36071

Summary



Getting exception when writing a function to get the HTTP header through a Java step like this :

javax.servlet.http.HttpServletRequest req=(javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest");

When I use same thing as a Property-Set step like this:

@java("((javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject(\"pxHTTPServletRequest\")).getHeader (\"standardid\")")

- it works fine.


Error Messages



Exception java.lang.NullPointerException


Steps to Reproduce



Set a java step in authentication activity :
javax.servlet.http.HttpServletRequest req=(javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest");


Root Cause



The pxHTTPServletRequest object is available during an authentication activity - during a Property-Set or a Java step. It is not available after that.

Resolution



Explanation : The scope of pxHTTPServletRequest is limited to authentication process.

Published April 7, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community 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.

Close Deprecation Notice
Contact us