I am using JBoss 4.0.5.GA to run a set of java applications. One of them is a web frontend, using Spring 1.4. URL mappi开发者_开发百科ngs are configured in a way that 'fake' pages from request URLs are mapped to controllers. That means that when someone requests /index.htm, there's no actual 'index.htm' on disk, and that request maps to a specific conroller which then renders a jsp view.
So the problem is as follows: I need to tell JBoss to somehow forward all requests for directory indices to corresponding 'index.htm' URLs like so: / → /index.htm
; /news/ → /news/index.htm
; /foo/bar/baz/ → /foo/bar/baz/index.htm
and so on.
I can't use Tomcat's welcome-file-list
feature because it looks for those files on disk, while all 'index.htm's are fake and don't actually exist on disk.
Why can't you add a controller that handles requests for /
URLs, that forwards on to the index.htm
controllers?
If that's not an option, consider using The URLRewriteFilter library to perform forwarding or redirecting. This should be able to sit outside of your own code.
精彩评论