File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass url to Struts1.3

 
raj jaiswal
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting an error?
 
raj jaiswal
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • 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

 
vijay dadhwal
Ranch Hand
Posts: 47
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic