Hi, the problem is that HTTPService is meant to load remote data into the application - HTTPService has no concept of displaying that data. For loading and displaying external mxml files take a look at the mx.controls.Loader class.
However, maybe you don't even have to pass back a whole new document in your case - as a general rule you usually don't need to pass back "pages" (layout and data) when using a rich client. Usually, you only send the relevant data to the client and your client side logic takes care of it. Makes sense? Dirk. > -----Original Message----- > From: zfan00 [mailto:[EMAIL PROTECTED] > Sent: Monday, March 21, 2005 8:13 PM > To: [email protected] > Subject: [flexcoders] Redirect using HTTPService > > > > > Hi, everyone! I am new to Flex. Currently I tried to use Flex with > struts. Yes, I have already read that article talking about the > integration between flex and struts. However, I could not find the > answer to my question. My question is very simple. I have a login > page. After the use clicks the "login" button, the page will be > submitted to the Struts controller and redirect the page to another > page (contacts.mxml). The login.mxml code listed as blow: > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> > > <mx:HTTPService id="svc" url="/strutsflex/action/signin" > resultFormat="text" method="POST" > result="alert(svc.result.toString())"> > <mx:request> > <userName>{userName.text}</userName> > <password>{password.text}</password> > </mx:request> > </mx:HTTPService> > > <mx:Script> > <![CDATA[ > function sendHttp() { > svc.send(); > } > ]]> > </mx:Script> > > <mx:Form> > <mx:FormItem label="User Name: " required="true"> > <mx:TextInput id="userName" > width="200"></mx:TextInput> > </mx:FormItem> > <mx:FormItem label="Password: " required="true"> > <mx:TextInput id="password" > width="200"></mx:TextInput> > </mx:FormItem> > <mx:FormItem> > <mx:Button label="Log In" click="sendHttp()"/> > </mx:FormItem> > </mx:Form> > > </mx:Application> > > And the struts-config.xml is like the following (only the action path > part): > > <action-mappings> > <action > path="/signin" > type="samples.action.SignInAction" > name="signInForm" > validate="false" > input="login.mxml"> > <forward name="success" > path="/contacts.mxml" redirect="true"/> > </action> > > I checked the result and it contains the contacts.mxml file. But I > don't know how to display the contacts.mxml page. > > Help is desperately needed. Thanks in advance. > > Jen > > > > > > > > Yahoo! Groups Links > > > > > > > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

