开发者

Looking for a java web framework that support django styled url handling [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_StackOverflow

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

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.


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.


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.


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 !


You can use Django on Jython.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜