I have a problem using JSTL tag c:import.
When i use jsp:include it works and if i use c:import i doesn't work. I
don't know what is the problem.
jsp file:
this works:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
...
<table width="100%">
<tr>
<td>
<jsp:include page="predefined/predefined1.jsp"/>
</td>
</tr>
</table>
but this doesn't:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
...
<table width="100%">
<tr>
<td>
<c:import url="predefined/predefined1.jsp" />
</td>
</tr>
</table>
predefined/predefined1.jsp
The file that is being included (predefined/predefined1.jsp) is file on
local disk.
Alan
Hi Alan
Do the logs tell you whether or not they've found your taglibs? What
servlet container are you using?
Also, I've never used c:import with relative URLs, as far as I know it
requires a fully-qualified URL.
You could achieve this by doing a scriptlet. Something like
String filename = "foo.jsp";
pageContext.setAttribute("fullurl",
request.getScheme()+"://"+request.getServerName()+request.getContextPath()+"/"+filename);
and then in the import tag
<c:import url="${fullurl}" charEncoding="UTF-8"/>
(obviously change the encoding to whatever you need it to!)
Hope this gives you some ideas.
Thanks
Stephen
> I have a problem using JSTL tag c:import.
> When i use jsp:include it works and if i use c:import i doesn't work. I
[quoted text clipped - 28 lines]
> local disk.
> Alan