getServlet() replacement : I am coding for my changes from `Struts1` to `Struts2`. In this we find many instances where the `getServlet` is being used like the following code snippet. now, getServlet() is being deprecated. I would like to know what to use instead. I tried looking at google a lot but no luck till now.

    protected XXXServlet getYYYActionServlet() {
    		try {
    			return (XXXServlet)getServlet();
    		} catch(ClassCastException ex) {
    			return null;
    		}
    	}

Please provide your suggested course of action with example.