title: Extracting url parameters in java servlet from a request placed by action script code
body: <p>I am having trouble passing data to my servlet code from a request placed from action script</p>
  
  <p>Here is how my actionscript code looks </p>
  
  <pre><code>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");
  </code></pre>
  
  <p>Java servlet code looks like this</p>
  
  <pre><code>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);
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>Thank you</p>