Results 1 to 5 of 5
Thread: question on servlets
- 01-04-2009, 12:30 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 3
- Rep Power
- 0
question on servlets
which two prevent a servlet from handling requests?
A. the servlet's init method returns a non-zero status.
B. the servlet's init method throws a ServletException.
C. the servlet's init method does NOT return within a time period defined by the servlet Container.
the correct options are B and C.
Could somebody explain me as to what exactly happens in case of option C?
- 01-15-2009, 09:03 PM #2
Member
- Join Date
- Jan 2009
- Location
- italy
- Posts
- 16
- Rep Power
- 0
the init Servlet method returns void type so it can't returns any non-zero status
Article and examples about Java EE world
http://programmaremobile.blogspot.com
- 01-15-2009, 09:15 PM #3
Senior Member
- Join Date
- Nov 2008
- Posts
- 286
- Rep Power
- 13
I'm not sure that there's one specific, exact behaviour that containers must follow. It it really matters to you, I would test it with the specific version of the specific Servlet runner that you're using.
That said, I would expect reasonably behaviour be for the Servlet runer to send some appropriate HTTP status code such as 504 ("Gateway Timeout") back to the client.Neil Coffey
Javamex - Java tutorials and performance info
- 01-15-2009, 10:51 PM #4
Member
- Join Date
- Jan 2009
- Location
- italy
- Posts
- 16
- Rep Power
- 0
Sorry but I the first my reply I hadn't understand correctly the question!:p
Perhaps It is possible that the servlet container doesn't response to client so client go in timeout.
I'm curious, tomorrow I try this behaviour with glassfish application server.Article and examples about Java EE world
http://programmaremobile.blogspot.com
- 01-16-2009, 10:21 AM #5
Member
- Join Date
- Jan 2009
- Location
- italy
- Posts
- 16
- Rep Power
- 0
PHP Code:@Override public void init() { while(true) { try { Thread.sleep(5000); } catch (InterruptedException ex) { Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex); } } }
I think that the servlet container wait for init() method completionsArticle and examples about Java EE world
http://programmaremobile.blogspot.com
Similar Threads
-
JTextPane with servlets
By kinabaloo in forum Advanced JavaReplies: 2Last Post: 07-11-2008, 06:32 AM -
Deploying Servlets
By gapper in forum New To JavaReplies: 2Last Post: 01-17-2008, 12:43 PM -
servlets or jsp
By krishnapal in forum Advanced JavaReplies: 1Last Post: 12-13-2007, 02:31 PM -
Servlets
By nagaroopanandha in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 02:09 PM -
working with servlets
By Freddie in forum Java ServletReplies: 2Last Post: 05-15-2007, 05:50 PM
Bookmarks