• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

why javascript can't redirect under Struts

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic