File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Controller mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Controller mappings" Watch "Controller mappings" New topic

Controller mappings

Vidar x Langberget

Joined: May 12, 2003
Posts: 10
I'm using my own MVC framework, and it works except for one thing. I want to map the controller servlet to both .cka files and the root of my domain:
My current config looks like this:

This doesn't work with the root of the domain of course, but I've been unable to find a solution that works with both. Any suggestions?
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
You don't mention what other approaches you have tried, so can you tell us what results you get if you do:

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Vidar x Langberget

Joined: May 12, 2003
Posts: 10
Frank: That solution doesn't work completely.. The request is sent to the controller, and it forwards the request to the correct view, but the problem is images and style sheets. I have them stored in resources directory under the root of the webapp. So when a view requests an image, the request is sent to the controller. Could I use regular expressions to ensure that requests for files with specific endings don't get sent to the controller?
I did find a way that works, by adding an index.jsp file to the root and forwarding the request to the controller from the jsp file, but I would prefer if I could to it with url mathcing.
I agree. Here's the link:
subject: Controller mappings
It's not a secret anymore!