Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 9692
42
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?
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic