Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet+jQuery

 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am trying to call a servlet using jquery and while calling i am passing the value of hidden field ,




here vname is the id of hidden field which contains data the alert could pop out the data present in hidden field but in my servlet it shows null




servlet shows th output as

str value is null

please correct me where i am doing wrong..
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i could solve it i just need to change the 'input' to 'vname' ...

$.post("http://localhost:8080/AutomatedIntelligence/PostTest",{vname: $("#vname").val()});
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am posting data from javscript using jquery to the servlet , the servlet after processing data and after inserting in database performs a requestdispatcher forward




but as i invoke the servlet using jquery its not forwarding request to ../AI/ProcedureError and do not display the message
"The Operation Completed Successfully!\\n\\nPlease Run Batch CM-MFAC"

how do i handle request dispatcher using jQuery, can anybody suggest me something...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never ever ever, and did I mention never, use page-relative addressing in a dispatcher (or anywhere else in a web application, for that matter).

Ditch the ".." and use real context-relative addressing in your dispatch URL.
[ November 25, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic