I am having trouble passing data to my servlet code from a request placed from action script
Here is how my actionscript code looks
var variables:URLVariables = new URLVariables();
variables.sessionId = sessionId;
variables.userName = userName;
variables.allExtensions = allExtensions;
variables.redirectPath = redirectPath;
var urlRoute:URLRequest = new URLRequest(endPointUrl +"-standalone");
urlRoute.data = variables;
urlRoute.method = URLRequestMethod.POST;
navigateToURL(urlRoute, "_blank");
Java servlet code looks like this
public class StandaloneRedirectServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
//All of these are null
String sessionId = req.getParameter("sessionId");
String userName = req.getParameter("userName");
String allExtensions = req.getParameter("allExtensions");
String redirectPath = req.getParameter("redirectPath");
//Set cookie
//Redirect
resp.sendRedirect("http://www.google.com"); //This would redirect to redirectPath eventually. For testing, I am using google.com
}
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
this.doPost(req,resp);
}
I know for a fact that the URLVariables (sessionId, userName etc) are set to valid values from the action script side. But on the java side, I get all nulls when I extract the parameters. I am clearly not understanding the right way to pass parameters to my server end point and any help is appreciated.
Thank you