window.location.href=location.origin+"/apreizspring/teammember"
apreizspring is my project name. I want to replace this by using pagecontext
. Can anyone provide me a solution?
window.location.href=location.origin+"/apreizspring/teammember"
apreizspring is my project name. I want to replace this by using pagecontext
. Can anyone provide me a solution?
In Javascript file:
window.location.href = requestContextPath + "/teammember"
Lets say, your javascript file is named temp.js
In jsp :
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<script>
var requestContextPath = '${pageContext.request.contextPath}';
</script>
<script type='text/javascript' src = 'temp.js'></script>