• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass url to Struts1.3

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,


I want to pass below url (var strURL="http://localhost:8080/SUNTYRE/customerServletAjax?value="+value;) to action class and call action class method.Currently i am passing this url to servlet but my requirement is to pass to action class .I am using struts1.3.
How to pass i dont know .
please help anybody to do this.

this is my code..




Thanks
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A URL is a URL. It doesn't matter if a Servlet or a Struts action handles it. You invoke them the same way. What's the URL of the action you wish to invoke?
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Actually I want to call action class method and pass parameter .please tell me how to call action method and pass parameter inside ajax code.

i am passing url like that ( var strURL="test.do?method=testMethods value="+value;) inside this method (self.xmlHttpReq.open('POST', strURL, true);)



thanks
rajjaiswal
MCA SCJP1.6
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you getting an error?
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Actually this url ( var strURL="test.do?method=testMethods value="+value;) is not calling to action class method.I thank is not correct way to call and pass value to action class method.Even its not giving any error .Please find the correct way to pass data from ajaxscript to action class method.


Thanks
Raj jaiswal
MCA SCJP1.6

 
Ranch Hand
Posts: 47
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

parameter passing should be same to actions as to any servlets.

format should be



Why are you providing method name with the url parameters ?
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
vijay dadhwal thank you very much for your help.I have solved it.

thanks once again all javaranch team.

 
reply
    Bookmark Topic Watch Topic
  • New Topic