Malhar,
If your question is "Is it okay to set cookies in JSP?," I think the answer is "Yes."
Why you might not has some reasons however. One is that it puts
Java code in the page and makes maintenance a bit troublesome down the road in a complex web application. However, if this is a simple application, then it's perfectly fine. MVC design here however is always best.
Also consider that you "add" Cookies, not "set" Cookies.
Tim
Timothy Stone, MIT, SCJP
http://www.petmystone.com/
"This Satan's drink [coffee] is so delicious, we shall cheat Satan and baptize it." --Pope Clement the VIII (1592-1605)