开发者

Adjusting web.xml listeners, filters and servlets

开发者 https://www.devze.com 2023-02-19 22:45 出处:网络
Following is outline of what I have in my web.xml config file. I need help putting this into the correct order.

Following is outline of what I have in my web.xml config file. I need help putting this into the correct order.

web.xml web-app

 1. contextConfigLocation applicationContext.xml
 2. defaultHtmlEscape true
 3. listeners 
 4. servlets 
 5. filters <order sensitive>    
 6. session-config timeout 120
开发者_Go百科 7. error page 404 500

UPDATE:

I'm getting ClassNotFoundException on all my listeners in tomcat's logs/localhost.log There are not problems after the application starts just log entries that indicate that something is off.

I have organized it as per BalusC's suggestions. Any idea why is this happening?

Where should the session-config go?


Only the order of the <filter-mapping> elements is relevant. It will be the actual order how the filters are invoked whenever the request URL matches the url-pattern of more than one filter. A filter can namely decide whether to continue the chain or not. The remnant has no significant influence on the functioning of the webapp. Just adhere the ordering as specified in DTD/XSD (if any) and/or whatever you feels it makes the best readable/maintainable. Generally, the ordering is as follows: context params, listeners, servlets, filters and error/welcome pages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号