1. 程式人生 > >flex URLVariables傳遞大量變數資料

flex URLVariables傳遞大量變數資料

flex 程式碼


private function setMetaData():void{
    
    variables.titles = titles.text;
    variables.auther = userCode;
    
    variables.playchannel = playchannel.selectedLabel;
    variables.column = column.selectedLabel;
    variables.keyWords = keyWords.text;
    variables.timer = timer.text;
    variables.content = content.text;
    variables.fileName = guid;
    variables.videoName = videoName;
    variables.imageName = imageName;
    variables.fileType = "xml";
    var urlrequest: URLRequest = new URLRequest();//載入伺服器地址
    var

url:String = CommonConst.webRoot+"/upload";
    urlrequest.method=URLRequestMethod.POST;
    urlrequest.url=url;
    urlrequest.data = variables;
    urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
    /*
    navigateToURL(urlrequest);
    */
    urlLoader.load(urlrequest);
   }


java 程式碼接受


protected void doPost(HttpServletRequest request,
   HttpServletResponse response) throws ServletException, IOException {


            String titles = request.getParameter("titles");
   String auther = request.getParameter("auther");
   String playchannel = request.getParameter("playchannel");
   String column = request.getParameter("column");
   String keyWords = request.getParameter("keyWords");
   String timer = request.getParameter("timer");
   String content = request.getParameter("content");
   String fileName = request.getParameter("fileName");
   String videoName = request.getParameter("videoName");
   String imageName = request.getParameter("imageName");