Jsp请求路劲模板

Jsp请求路劲模板

  • 1.Jsp里面
- <%  
      String path = request.getContextPath();  
      String basePath = request.getScheme() + "://" +   
                                        request.getServerName() + ":" +  
                                        request.getServerPort() + path;  
  %>  

<%=basePath%>/demo/login
<%=basePath%>/ 项目名/servletName
  • 2.HTML里面
<form action="/maven3/demo9" method="post">
	/ 项目名/servletName
posted @ 2022-03-28 23:41  ElloeStudy  阅读(29)  评论(0编辑  收藏  举报