Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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
Posts: 65542
110
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
Posts: 65542
110
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.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!