flex页面:
其中:_url.action为用户定义的请求,该页面向struts2发送两个参数:userName,pswWord
Xml代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#f6f6f6" backgroundGradientColors="[#f6f6f6, #AA1220]" fontSize="12">
<mx:Label text="用户名:" x="23" y="61" id="txt"/>
<mx:TextInput id="userName" x="77" y="59"/>
<mx:Label text="密码:" x="35" y="91"/>
<mx:TextInput id="pswWord" x="77" y="89"/>
<mx:Button label="提交" click='my_HS.send()' x="185" y="121"/>
<mx:HTTPService id="my_HS" url="_url.action" method="post" >
<mx:request>
<userName>{userName.text}</userName>
<pswWord>{pswWord.text}</pswWord>
</mx:request>
</mx:HTTPService>
</mx:Application>
其中:_url.action为用户定义的请求,该页面向struts2发送两个参数:userName,pswWord
Xml代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#f6f6f6" backgroundGradientColors="[#f6f6f6, #AA1220]" fontSize="12">
<mx:Label text="用户名:" x="23" y="61" id="txt"/>
<mx:TextInput id="userName" x="77" y="59"/>
<mx:Label text="密码:" x="35" y="91"/>
<mx:TextInput id="pswWord" x="77" y="89"/>
<mx:Button label="提交" click='my_HS.send()' x="185" y="121"/>
<mx:HTTPService id="my_HS" url="_url.action" method="post" >
<mx:request>
<userName>{userName.text}</userName>
<pswWord>{pswWord.text}</pswWord>
</mx:request>
</mx:HTTPService>
</mx:Application>