当我尝试访问我的应用程序主页URL localhost:8080/CP/index.do
时,我正在获取以下stacktrace
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: In URL tags, when the "context" attribute is specified, values of both "context" and "url" must start with "/".
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
org.apache.jsp.WEB_002dINF.jsp.core.index_jsp._jspService(index_jsp.java:447)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
org.springframework.web.servlet.FrameworkServlet.doGet$glowroot$metric$http$request$0(FrameworkServlet.java:827)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
root cause
javax.servlet.jsp.JspTagException: In URL tags, when the "context" attribute is specified, values of both "context" and "url" must start with "/".
org.apache.taglibs.standard.tag.common.core.UrlSupport.resolveUrl(UrlSupport.java:152)
org.apache.taglibs.standard.tag.common.core.UrlSupport.doEndTag(UrlSupport.java:103)
org.apache.jsp.WEB_002dINF.jsp.core.index_jsp._jspx_meth_c_005furl_005f0(index_jsp.java:491)
org.apache.jsp.WEB_002dINF.jsp.core.index_jsp._jspService(index_jsp.java:175)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
org.springframework.web.servlet.FrameworkServlet.doGet$glowroot$metric$http$request$0(FrameworkServlet.java:827)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
javax.servlet.http.HttpServlet.service$glowroot$metric$http$request$7(HttpServlet.java:728)
javax.servlet.http.HttpServlet.service(HttpServlet.java:48)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
这是我的index.jsp文件
input#username {
background: #fff url(<c:url value='/core/v2/img/login_username.png' context='${ staticContext }' />) no-repeat 10px center;
background-image: url(<c:url value='/core/v2/img/login_username_ie.png' context='${ staticContext }' />)\9;
background-size: 15px 15px;
border-bottom: 1px solid #ccc;
border-radius: 4px 4px 0 0;
box-shadow: inset 0 1px 4px rgba(0,0,0,.2);
}
input#password, input#certpassword {
background: #fff url(<c:url value='/core/v2/img/login_password.png' context='${ staticContext }' />) no-repeat 10px center;
background-image: url(<c:url value='/core/v2/img/login_password_ie.png' context='${ staticContext }' />)\9;
background-size: 15px 15px;
border-top: 1px solid #ccc;
border-radius: 0 0 4px 4px;
box-shadow: inset 0 -1px 4px rgba(0,0,0,.2);
}
<form id="loginForm" name="loginForm" method="post" action="j_spring_security_check" autocomplete="off">
<fieldset>
<c:if test="${pageContext.request.serverName ne 'cp.datacert.com' and pageContext.request.serverName ne 'collaborate.datacert.com'}">
<div id="notProd"><spring:message code="nonproduction.environment.message" /> <c:out value="${pageContext.request.serverName}" /></div>
</c:if>
<img src="<c:url value='/core/v2/img/logo.png' context='${ staticContext }' />" width="175" height="155" />
<c:if test="${ param.timeout ne null }">
<div class="alert alert-info"><spring:message code="security.user.account.timeout" /></div>
</c:if>
<c:if test="${ (param.failedMessage != null && param.failedMessage != '') or failedMessage != null}">
<div class="alert alert-error">
<c:choose>
<c:when test="${ param.failedMessage eq 'security.user.account.locked' }">
<spring:message code="security.user.account.locked" />
</c:when>
<c:when test="${ param.failedMessage eq 'security.user.account.expired' }">
<spring:message code="security.user.account.expired" />
</c:when>
<c:when test="${ param.failedMessage eq 'security.user.incorrect.password' }">
<spring:message code="security.user.incorrect.password" />
</c:when>
<c:when test="${failedMessage ne null}">
<spring:message code="${failedMessage}" />
</c:when>
</c:choose>
</div>
</c:if>
<label>email address</label>
<input type="text" name="j_username" id="username" autocorrect="off" autocapitalize="off" autocomplete="off" placeholder="email address" title="email address" />
<label>password</label>
<input type="password" name="j_password" id="password" autocorrect="off" autocapitalize="off" autocomplete="off" placeholder="password" title="password" />
<button type="submit" onclick="this.disabled=true; this.form.submit.click();"><spring:message code="v2.login.button" /></button>
<p id="link"><a href="forgotPassword.do"><spring:message code="index.login.forgotPassword"/></a></p>
<!-- legacy support -->
<div class="loginContent" style="display:none">
<button type="submit" name="submit"><spring:message code="common.button.login" /></button>
</div>
</fieldset>
</form>
我尝试使用前缀/作为context='/${ staticContext }'
更新所有上下文值,但仍然遇到相同的错误。有人可以帮我解决我的问题吗?