In case it helps anyone else (or in case anyone wants to tell me how much of a
bad idea this is), to solve this problem I ended up writing my own SkinFilter
class (implements Filter) which looks for a "skin" parameter in the
HttpSession. If it's there, then the servlet request is wrapped in a
SkinRequestWrapper (extends HttpServletRequestWrapper):
// If a skin param is there, wrap the request in a SkinRequestWrapper,
which asks for the skinned resource if present
// Uses skinDir and defaultDir from the filter config parameters
SkinRequestWrapper skinreq = new SkinRequestWrapper( (
HttpServletRequest ) req, filterConfig.getServletContext( ) );
chain.doFilter( skinreq, res );
The SkinRequestWrapper overrides the getServletPath() method. If the file (
image, css, js, whatever the filter is mapped to) exists in the "skin"
directory, then that is returned by getServletPath(). If it's missing, then
super.getServletPath() is returned.
Criticism welcome!
-rgm
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]