<c:import> tag error: java.io.FileNotFoundException

java, jsp, jstl, url

Solution

If they're in the same webapp, you don't need a ful URL, you just need the URI relative to the webapp root:

<c:import url="/header.jsp" charEncoding="UTF-8" />  

Problem

I'm trying to import file from the Header.jsp in my file by using import tag url attribute, but I'm getting runtime error ``` java.io.FileNotFoundException: http://localhost:8081/latest/header.jsp ``` The imported file and the importing file in the same web app(latest). The code of the importing file is: ``` <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html><body> <c:import url="http://localhost:8081/latest/header.jsp" charEncoding="UTF-8" /> <em>Web services Support Group.</em><br><br> </body></html> ``` and the code of imported file is: ``` <em><strong>${param.name}</strong></em><br> ```

Original source