tags:

views:

316

answers:

2

Hi,

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>
+1  A: 

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" />
skaffman
Thanks for your response. You're absolutely correct.
Greenhorn
A: 

probably you are using the wrong path, where is the file header.jsp? is it in a directory called "latest"? or is "latest" the context path of your application?

skaffman is right, you don't need the full url, but just the url relative to the web app root.

emas