I am getting jsp Exception. When exception occurs, page content is not getting loaded and code which is causing this exception is in div section new-product-promo.
Please suggest what is wrong with this URL. Is there any other way to handle this exception in jsp page?
<%@ page language="java" contentType="text/html" session ="false" %>
<head>
<script type="text/javascript">
function closeWarningMessage() {
for (var i=0; i<document.forms.length; i++) {
document.forms[i].reset();
}
}
</script>
</head>
<body onLoad="closeWarningMessage();"> // page loaded till here
<jsp:include flush="true" page="/myCart/logoutHeader.jsp"/>
<div id="new-product-promo">
<c:if test="${ !empty product.newPromo}">
<c:import url="http://www.mStore.com ${product.newPromo}" charEncoding="UTF-8"/>
</c:if>
</div>
</body>
The URL looks wrong to me: you have a space in it. Souldn’t it be something like
?
Anyway, you could wrap this inside a
<c:catch>or, even better, get the contents of this URL from a servlet/action before dispatching to the JSP (or to another JSP if it’s not possible to load the external URL).