1 Reply Latest reply on Nov 10, 2006 6:07 AM by peterent

    still i coudn't make it pls help me out

    sandeepmkumar
      till now what i have done, the code goes here,

      the UI part is
      ----------------------------------------------------------------------------------------- -------------------------------
      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <%@ taglib uri="FlexTagLib" prefix="mm" %>
      <%<jsp:forward page="page2.jsp"/>%>
      <mx:Script>
      <![CDATA[
      public function clear(){
      UserName.text="";
      Password.text="";
      }
      ]]>
      </mx:Script>


      <mx:HTTPService id="hi" url=" http://loalhost:8080/Sandeep/page2.jsp" method="POST" result="handleResult(event)">
      <mx:request>
      <UserName>{UserName.text}</UserName>
      <Password>{Password.text}</Password>
      </mx:request>
      </mx:HTTPService>
      <mx:Form id="form" x="305" y="295" width="282">
      <mx:Label x="460" y="322" text="UserName"/>
      <mx:TextInput id="UserName" width="184"/>
      <mx:Label x="460" y="368" text="Password"/>
      <mx:TextInput id="Password" x="536" y="366" width="192" displayAsPassword="true"/>
      <mx:Button label="Submit" toolTip="click this button to login" click="hi.send()" resizeEffect="true" width="85"/>
      <mx:Button label="Reset" toolTip="click this button to clear all textfields" click="clear.send()" width="87"/>
      </mx:Form>
      </mx:Application>
      ------------------------------------------------------------------------------------------ ---------------------------------------
      now the jsp page which i am calling is "page2.jsp"

      <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitled Document</title>
      </head>

      <body>
      <h1>enter valid user </h1>
      </body>
      </html>

      ________________________________

      in this page2.jsp i am just display a text " enter valid user" . thats all

      but when i run the tomcat, and in browser i entered URL= http://localhost:8080/Sandeep/new_Login.html

      well this page is an flex mxml page ,

      then it will display the UI part and when i click the submit button it will popup a error message
      ----------------------------------------------

      an actionscript error

      [RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]
      at mx.rpc.http::HTTPService/ http://www.adobe.com/2006/flex/mx/internal::processResult()
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::resultHandler()
      at mx.rpc::Responder/result()
      at mx.rpc::AsyncRequest/acknowledge()
      at ::DirectHTTPMessageResponder/completeHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::onComplete()
      --------------------------------------------------------------------------->
      even if i type URL as = http://localhost:8080/Sandeep/new_Login.mxml

      all the files are in apache tomcat/webapps/Sandeep/.

      can u pls tell me how to solve this issue.

      or give me the whole procedure to solve this issue

      thanks
      sandeep.mk@adobe.com
        • 1. Re: still i coudn't make it pls help me out
          peterent Level 2
          You've put JSP/Java syntax into your Flex files - you cannot mix the two of them. There are 2 ways to use Flex:

          Take your Flex code (a combination of MXML and ActionScript files) and compile them into a SWF. This is either done with Flex Builder 2 or with the compiler in the Flex SDK 2.

          Or, install Flex Data Services and place your Flex code files into the web directory and have the files compiled when the first person requests the MXML application file using a browser. The web-tier compiler will assemble a SWF from the Flex source and generate an HTML wrapper page.

          There are various combinations as well, including writing your own HTML wrapper (which could be JSP, but you do not put the Flex code in there).

          If you haven't done this already, visit the Flex Quick Starts page in the Flex Developer Center on our site.