File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Cookies in Java or JavaScript

 
Saulo Menezes
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently studying the subject 'Cookies' and up to now I am a bit confused.
My group and I are about to create a site that will use solely jsp pages. In it I am in charge of the cookies.
The teacher intructed us to use JavaScript for that but I found out that it can be done using varied scripts or programming languages. Would anyone be able to tell me which would be the best solution? I intend to keep the date on the client-side.
Thanks
Saulo
[ March 26, 2003: Message edited by: Saulo Menezes ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Javascript to manipulate cookies on the client (browser) side. Javascript is the only client side scripting language with wide support. Note that Javascript has practically nothing to do with the Java language.
On the server side you have to use the Servlet and JSP APIs to manipulate cookies.
Bill
 
Geeta Ramasami
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
To be more explanatory, if u want to store and user information on the client side u go in for cookies.If u want to store any user information on the server side u go in for session objects.
With respect to cookies u can create it on the client side using javascript as well as on the server side using JSP or servlets.
As ur cookie is however going to be stored in the client machine its better to create in client side as creating it on the server side involves an extra overhead of sending that cookie with the response object
Cheers
Geeta
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic