One. JSP
A.<%=request.getcontextpath ()%>//results:/projectname
b.${pagecontext.request.contextpath}//Results:/projectname
Usage:
<link rel= "stylesheet" type= "Text/css" href= "${pagecontext.request.contextpath}/order/css/ordercss.css"/>
<link rel= "stylesheet" type= "Text/css" Href=<%=request.getcontextpath ()%>+ "/order/css/ordercss.css"/>
Two. js
A. ' ${pagecontext.request.contextpath} '//Result:/projectname
B. ' <%=request.getcontextpath ()%> '//Result:/projectname
Usage:
<script>
function Searchdata (DOM) {
$ (DOM). attr (' disabled ', true);
var url = ' ${pagecontext.request.contextpath}/ordercontroller/getorders.jsp? ' +$ (' #orderForm '). Serialize ();
var url = ' <%=request.getcontextpath ()%> ' + '/ordercontroller/getorders.jsp? ' +$ (' #orderForm '). Serialize ();
$ (' #dataDiv '). HTML (' Data Loading ... '). Load (URL, function () {
$ (DOM). attr (' disabled ', false);
});
}
<script>
Get the project path name in JSP and JS