The Artima Developer Community
Sponsored Link

Java Answers Forum
How to pass an object in Response

1 reply on 1 page. Most recent reply: Jul 20, 2004 12:27 AM by vijaya

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Amit

Posts: 23
Nickname: amitactsh
Registered: Nov, 2002

How to pass an object in Response Posted: Jul 11, 2004 11:30 PM
Reply to this message Reply
Advertisement
Hi,
I need to pass an object in the http response using an servlet in servlet - applet communication.
I discovered that setAttribute method of ServletRequest could be used in this case. But could any please send me a chunk of code implementing setAttribute to pass an object

Thanks


vijaya

Posts: 5
Nickname: vijji
Registered: Dec, 2002

Re: How to pass an object in Response Posted: Jul 20, 2004 12:27 AM
Reply to this message Reply
Suppose u'r ResponseObject is Hashtable then,u'r code should be like this.,

Hashtable ResponseObject = new Hashtable();
if( ( ResponseObject != null ) && (! "null".equals(ResponseObject) ) ){
request.setAttribute( "MyResponseObject",ResponseObject);
}

Thanks & Regards
Vijaya.

Flat View: This topic has 1 reply on 1 page
Topic: Java applets Previous Topic   Next Topic Topic: a thread question

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use