• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

why javascript can't redirect under Struts

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new struts
i am using java script to forward to struts action class
and i am using ajax for forwarding
following code i am using
function showCountry(){
alert("show country")
var country=document.getElementById('countries');
//stateContainer.removeChild(document.getElementById('states'));
var action = "showCountry";
var pars='action='+action;
var url='/autoSugession.do';
//document.write("<html:rewrite page='/autoSugession.do?action=showCountry'/> ");
new Ajax.Request(url,
{
method:'get',
parameters:pars,
onSuccess: function(transport){
var response = transport.responseText || "no response text";
country.innerHTML=transport.responseText;
},
onFailure: function(transport){
alert(transport.resposeText+ 'Something went wrong...')
alert('responseHeaders: ' + transport.getAllResponseHeaders());
alert('response header content-length: ' + transport.getResponseHeader('content-length'));
alert('status: ' + transport.status);
alert('statusText: ' + transport.statusText);
alert('responseXML: ' + transport.responseXML);
alert('responseText: ' + transport.responseText);
}
});

}
 
Sheriff
Posts: 9674
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bala, welcome to javaranch.

Bala please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything that does any forwarding or redirecting in that code.

Can you post the actual code, and details about what's not working?
 
Our first order of business must be this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic