Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:30:23+00:00 2026-06-13T04:30:23+00:00

I want to redirect mxml file to servlet and print the code on servlet

  • 0

I want to redirect mxml file to servlet and print the code on servlet but when i use navigate to url code then the output shows null values of the textinput fields in the servlet page, please help me clerify the problem the basic coding of mxml and servlet are given below

The MXML File

<s:Application...>
<fx:Script>
<![CDATA[
  import flash.net.navigateToURL;
  import mx.controls.*;
  import mx.events.Request;
  import mx.rpc.events.FaultEvent;
  import mx.rpc.events.ResultEvent;

  public function resultHandler(event : ResultEvent):void
  {             
    navigateToURL(new URLRequest('Srvlt'),'_self')
  }
  public function faultHandler(event : FaultEvent):void
  {
    Alert.show("error");
  }
]]>
</fx:Script>

<fx:Declarations>
  <s:HTTPService id="service" url="Srvlt" result="resultHandler(event)" fault="faultHandler(event)" method="GET" showBusyCursor="true" resultFormat="text">
    <s:request xmlns="">
      <email>{email.text}</email>
      <pass>{pass.text}</pass>
    </s:request>
  </s:HTTPService>
</fx:Declarations>
<s:VGroup verticalAlign="middle">
  <s:FormItem label="E-mail : ">
    <s:TextInput id="email" />
  </s:FormItem>
  <s:FormItem label="Password :">
    <s:TextInput id="pass" displayAsPassword="true" />
  </s:FormItem>
  <mx:Button label="Submit" click="service.send()" />
</s:VGroup>
</s:Application>

The servlet’s get method coding is as follows

String e = request.getParameter("email");
String p = request.getParameter("pass");
String resul;
PrintWriter out = response.getWriter();
resul = "Hi i am servlet, your username is " + e + " & password is " + p + ". are they correct ?";
out.print(resul);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:30:24+00:00Added an answer on June 13, 2026 at 4:30 am

    You’re sending 2 different requests in your application. The first one is HTTPService, the second one is URLRequest.

    <s:HTTPService id="service" url="Srvlt" result="resultHandler(event)"
    fault="faultHandler(event)" method="GET" showBusyCursor="true" resultFormat="text">
        <s:request xmlns="">
            <email>{email.text}</email>
            <pass>{pass.text}</pass>
        </s:request>
    </s:HTTPService>
    

    When you handle result, you can get your response string via ResultEvent object

    public function resultHandler(event : ResultEvent):void
    {
        Alert.show(event.result); // you'll see "Hi i am servlet..." here
    }
    

    You can work now with this string.

    But if you want to open new page with the result text, then you don’t need to use HTTPService. Use URLRequest class.

    var request:URLRequest = new URLRequest("Srvlt");
    var variables:URLVariables = new URLVariables();
    variables.email = email.text;
    variables.pass = pass.text;
    request.data = variables;
    navigateToURL(request);
    

    So, you’re doing it wrong now. Don’t send 2 requests. Choose either HTTPService and handling result inside the application, or navigateToURL and URLRequest if you want just to display response in new window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to redirect every url to a single php file that will act
I want to redirect the output of a bash script to a file. The
I want to redirect using .htaccess abc.com/test.php to abc.com/test . but it will execute/display
I want to redirect to home page if session get invalid. My spring-servlet.xml is
I want to redirect the output of some Windows program directly to gvim basically
I want to redirect one specific url like: www.example.com/test/ex.gif to static.example.com/ex.gif How can i
I want to redirect users to an error page if they enter any URL
I want to redirect an URL like this one: /calculate?from=london&to=paris to other like this
i want Redirect the old url`s to new address. Redirect all http://www.mysite.com/viewdownload/**/** url`s to
I want to redirect a IE7 user, but window.location.href does not seen to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.