Device Resource Management System-Filter
Operation:
1. Create a checklogonuserfilter class to implement javax. servlet. Filter
2. Obtaining method:
Public void Init (filterconfig arg0) throws servletexception {
1) initiate connections that cannot be filtered (stored in List objects)
}
Public void dofilter (servletrequest arg0, servletresponse arg1, filterchain arg2) throws ioexception, servletexception {
1) obtain all the connections in the current operation and compare them with those that cannot be filtered during initialization. If the connection does not contain any connection that is not filtered, the connection cannot be opened and jumps to the homepage.
2) obtain the session from the request, and then obtain the information of the currently logged-on user from the session to determine whether the user is empty. If it is blank, it will jump to the homepage.
}
Public void destroy (){
}
Add a filter to Web. xml