Skip to Content
0
Jan 13, 2023 at 03:50 AM

Problem accessing the absolute URL in JSP / JSTL on using tag

245 Views

I am trying to display content of absolute media url in jsp / JSTL using <c:import> tag, the code is below

<%@ page contentType="text/plain" language="java" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:if test="${not ((cmsSite.uid eq 'swc') || (cmsSite.uid eq 'sds'))}" >
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<c:forEach items="${siteMapUrls}" var="loc">
<sitemap>
<loc>${fn:escapeXml(loc)}</loc>
</sitemap>
</c:forEach>
</sitemapindex>
</c:if>
<c:if test="${((cmsSite.uid eq 'swc') || (cmsSite.uid eq 'sds'))}" >
<c:forEach items="${siteMapUrls}" var="loc">
<c:import var = "siteMap" url="${fn:escapeXml(loc)}"/>
${siteMap}
</c:forEach>
</c:if>

But when I am accessing the url https://a.local:9002/sitemap.xml. It is giving me below error.

Problem accessing the absolute URL "https://a.local:9002/medias/GSBOL-20221216.xml?context=bWFzdGVyfHJvb3R8OTc2OTN8dGV4dC94bWx8aGEwL2g4My84Nzk2MTQxODQ2NTU4LnhtbHwwNGY1NWI4ZDc0ZjkyMTdlZDU0OTg4Y2FiZmNmODMyNzRlMWI4MTA4NzQ3ODAwN2JjNTk5ODMzYTdhNDBkMDUw". javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching swc.local found.

On passing unsecure url "http://a.local:9001/medias/GSBOL-20221216.xml?context=bWFzdGVyfHJvb3R8OTc2OTN8dGV4dC94bWx8aGEwL2g4My84Nzk2MTQxODQ2NTU4LnhtbHwwNGY1NWI4ZDc0ZjkyMTdlZDU0OTg4Y2FiZmNmODMyNzRlMWI4MTA4NzQ3ODAwN2JjNTk5ODMzYTdhNDBkMDUw

Above code is working as expected and displaying the contents of xml file on using unsecure url.

Anyone knows about this issue.