views:

93

answers:

4

I'm looking for a java web framework that will allow you to configure dynamic urls where information is being passed to the controller.

For example

/{clientName}/login

would call the same controller regardless of the clientName and pass that clientName as an accessible value or an object in it's own right.

A: 

You can use Django on Jython.

myfreeweb
I think the OP meant in the Java language.
Santa
+4  A: 

Spring MVC @Controllers allows that kind of request mappings in a very simple way. See "15.3.2 Mapping requests with @RequestMapping" for details.

@Controller
public class AppointmentsController {

    @RequestMapping(value="/appointments/{day}", method = RequestMethod.GET)
    public Map<String, Appointment> getForDay(@PathVariable int day) {
        ...
    }

    @RequestMapping(value="/appointments/new")
    public AppointmentForm getNewForm() {
        ...
    }
}

It is available since Spring 2.5.

Guido
+1  A: 

SpringMVC can be configured for this kind of URL routing since version 2.5. You have tu use annotations as described in http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping

Good luck !

Guillaume
+1  A: 

You can use UrlRewriteFilter to rewrite the URLs (for the sake of them being "pretty") for any java web framework.

In addition, there is PrettyFaces for JSF.

Bozho