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 6084335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:30:33+00:00 2026-05-23T11:30:33+00:00

I will try to be as precise as possible in explaining the situation I

  • 0

I will try to be as precise as possible in explaining the situation I am facing. I am developing a Struts 2 based web application and in one of the page, I use Jquery 1.4.4 to make Ajax calls(POST) to Struts2 Action classes and get back an XML which I iterate through and build a select box and render it on UI.

This piece of code works fine on my Local WAS 6.1 development environment. But not quite on the production server(same WAS version). The select box is built properly in Local env but not in production.

The Ajax Code is below :

$.ajax({      url: 'DisplaySplitCriteriaValuesAction',
      type:'POST',
      dataType: "xml",
      data:{ splitCriteriaType: $.trim($(this).text()) },
      success: function( xmlResponse ) {
      buildSelectBoxNoDropDown(xmlResponse, "serviceActivitiesValue", "#ServiceActivitiesValueSelectionDIV");   
      $('#serviceActivitiesValue').bind({
        change: function(){                                 
                if($(this).val() != '-1'){
                    makeDefault(this,'defValueForSA');
                }
            }
          });
         }  });

function buildSelectBoxNoDropDown(xmlData, selectBoxName, whereToDisplayedDiv){
                var selectBoxhtml = '<select name="'+selectBoxName+'" id="'+selectBoxName+'"size="12" class="select_optionsBOX">';              
                $(xmlData).find('name').each(function(){                
                    selectBoxhtml = selectBoxhtml+'<option value="'+$(this).text()+'">'+$(this).text()+'</option>';
                        });
                selectBoxhtml = selectBoxhtml+'</select>';
                $(whereToDisplayedDiv).empty();
                $(whereToDisplayedDiv).append(selectBoxhtml);
            }

Sample XML structure I am returning from Action class

<SplitCriteriaValues><name>Sample SC Value 1</name><name>Sample SC Value 2</name><name>Sample SC Value 3</name></SplitCriteriaValues>

The surprising part is I see the XML response when debugging using Firebug. When I compare the responses in both dev and prod environments, both match however, there is an extra tab called “XML” right beside “response” tab. I am not sure if that makes any difference.

Is there anything that has to be accounted for when moving from one environment to another? Any pointers to resolve this kind of weird behavior will be helpful.

Thanks

  • 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-05-23T11:30:34+00:00Added an answer on May 23, 2026 at 11:30 am

    I was finally able to figure this out. Though Firebug was showing a response, the missing XML tab meant the production server never knew the content type it was receiving (or assumed it was simple text rather than XML), A quick look at the response header also confirmed that the response content type by default was text/plain.

    So All I had to do was set the content type to “text/xml” in the Action class and that fixed my problem. some how my local server did not consider the content type an issue but the production one did.

    Thanks.
    Sandeep

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

Sidebar

Related Questions

I will try to explain the situation as it is a little bit more
I will try to be as clear as possible because I can't get anybody
I will try to keep this as simple as possible. I have a rather
I will try my best to explain this. I have an application that show
I will try to explain as well as possible what I'm trying to do.
I will try to explain myself as best as possible, I know the title
I will try and explain my problem as accurately as possible, I don't think
I will try to make this as straight forward as possible. This question does
Lets say I have an old application which will try to load an external
I will try to explain my problem with as little code as possible. Basically

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.