• Post Reply Bookmark Topic Watch Topic
  • New Topic

save httprequest arguments  RSS feed

 
tashu Bairy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

can anyone let me know, How to save values in the httprequest arguments on to a file system Thanks
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To you mean how do you store the data or how do you store the object?

The HttpRequest object is a HashMap with some additional attribute values. You can use getAttributeNames() to read the list of keys and getAttribute(keyName) to read the value for each key.

Assuming values from an HttpRequest are Strings (which they usually are since they come from web forms), you can create a simple file (or connect to a database) and store the key/value pairs the same way you would store any string data in a file. You might also want to store additional information such as header information, content type, etc.
 
Tom Blough
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all you want to do is save it and read it back later you could just serialize the Map object returned from getParameterMap using an ObjectOutputStream, and read it back in later using a ObjectInputStream.

Cheers,
[ November 16, 2005: Message edited by: Tom Blough ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!