url mapping对比

url mapping

django:
urls.py

urlpatterns = patterns("blog.views",
    (r"^people/mblog/(?P<blog_id>\d+)/detail/$", "getMBlogDetail")
)
urlpatterns = patterns("duitang.japa.static",
    (r"^img/(?P<path>.*)$", "/WEB-INF/js/"),
)



flask:
代码中:
@app.route('/login', methods=['GET', 'POST'])
def login():
    pass


spring:
动态资源:

    @RequestMapping(value="/blog/{id}",method=RequestMethod.DELETE) 
    public ModelAndView delete(@PathVariable Long id,HttpServletRequest request,HttpServletResponse response) { 
        blogManager.removeById(id); 
        return new ModelAndView(LIST_ACTION); 
    } 

context:component-scan base-package="com.**.controller"/> 

静态资源:
<mvc:resources location="/WEB-INF/js/" mapping="/js/**" />

==========================================================

from duitang.japa import render_template
from duitang.japa import render_json


return render_template('template',{})
return render_json({})

 

你可能感兴趣的:(mapping)