About 1,2,3,4 you can search yourself in the API and spec. It's a good exercice. Concerning 5, it mays influence a few things. For example, the servlets with a <load-at-startup> set the the same number will be loaded in the order they have been defined in web.xml. (But I think it depends on the container) The way listeners and filters are loaded is also related to the order.
Thanks Satou , But my doubt on the cookies question still stands. In the spec , for the setMaxAge(int expiry) function , it is specified that 0 - cookie is deleted <0 - cookie not persisted >0 - cookie stays for so many seconds on the client.
But is it possible for the cookie to stay forever(i.e. remain active forever) on the client ?? If so what is the value to be specified ?
{There is a instance in HFSJ where it is mentioned that cookies can be made to stay active forever on the client )
I don't know about staying forever, but setMaxAge takes an integer, which should be enough to make it persistent for many years
If you want to keep some information forever, I think you should use something different. Like a DB. [ January 26, 2006: Message edited by: Satou kurinosuke ]
If you want to keep some information forever, I think you should use something different. Like a DB.
I didn't get you here. He is looking for storing the information on the client(browser) for ever and sending them back to the server with each request. In what way DB pictures here.
1)Session will Never expire. 2)Session expires as soon as created, practically session can not be created. 3) Session will Never expire. 4) Anything < 0, it will make your cookie never to destroy. 5) IF you change the order of Listners, filters, Servlets: it affects the Order of Instantiation, or Call.BUT IF you at random shuffle any element with some different element, say error-page put before servlet element, your app. Sever will complain at startup, that the file is wrong, as its checked against DTD. I think that answers you. Do reply back, Mayank
Hi Mayank, Thanks for u'r answers. For the 4th question on cookies," Anything < 0, it will make your cookie never to destroy" is not true coz the spec says if the setMaxAge() has a negative value, then the cookie will not be persisted and would be deleted when the browser exits !!
If the <session-timeout> is set to "0" or "-1" in the DD, the session will never expire.
In the case of a servlet, setMaxInactiveInterval has to be set to "-1" only in order for the session to not expire. Setting it to "0" will expire the session immediately.
The DD and servlet are not consistent when it comes to setting the timeout of the session.
I learned this by answering one of the coffee cram exams in HFSJ.
Post by:autobot
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, the permaculture playing cards