"Ouyang, Jian" wrote: > > I am trying to display message on the web page from within the init() method > of the servlet. Can any body tell me if it can be done and if yes, how. >
The init() method gets called before any web pages are requested from the servlet. So, no, you can't display a message immediately. What you can do is set a flag and then in your doPost/doGet method check the flag and display an error message when a request finally comes in. You'll probably also want to log an error to a text file someplace on the server side. There's a rundown on the "servlet lifecycle" in the servlet spec: http://java.sun.com/products/servlet/download.html The spec is easy to read and very informative. There are further resources listed in the footer of each message to the list. And if you can afford it, there are some very good servlet books available (check the archives for recommendations) -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
