Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getParameter question in servlet

 
girish mishra
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TextCan i send object to ajax while calling the servlet url and get it from Ajax servlet useing

CustomisedClass obj=(CustomisedClass)((Object) request.getParameter("object"));


Please send the response as early as possible.


Regards,
Girish
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP only allows strings to be passed on a request.

Perhaps you can investigate the use of JSON to serialize objects into strings.
 
girish mishra
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,

let me know how can I send object using ajax.

Regards,
Girish
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've already told you -- you can't send an object. Repeating the question will not change reality. HTTP only allows text to be submitted on a request, Ajax or otherwise.

You'll need to serialize the objet as text (perhaps using JSON) for transmission over HTTP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic