Finding a java web framework that supports django style url handling

I am looking for a java web framework that will allow you to set up dynamic urls where information is passed to the controller.

for instance

/ {CLIENTNAME} / Login

will call the same controller regardless of the client name and pass that client name as an accessible value or an object in its own right.

+2


a source to share


4 answers


Spring MVC @ Controllers allow you to render requests in a very simple way this way. For details, see "15.3.2 Mapping Requests Using @RequestMapping".

@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 has been available since Spring 2.5.

+4


a source


You can use UrlRewriteFilter

to rewrite urls ("pretty" for the sake of them) for any java web.



Also, PrettyFaces exists for JSF .

+2


a source


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

Good luck!

+1


a source


You can use Django in Jython.

0


a source







All Articles