-1

Possible Duplicate:
How do I include a jsp file from a diff project into my project

How to call a JSP from a diff website(project)?

I am trying to make a common project which would have a header and footer that all my web projects in my firm is going to use.

so I have a jsp at

http://localhost:8080/common/webappfooter.jsp

and I am trying to get a page in my Sample project to include it.

I beening trying

<jsp:include path="http://localhost:8080/common/webappfooter.jsp" />

but it does not work

Community
  • 1
  • 1
user1472384
  • 93
  • 3
  • 8
  • 1
    You're going totally the wrong path as to sharing JSP files between web projects. Check my answer on your previous quesiton how to achieve this properly. http://stackoverflow.com/questions/11210628/how-do-i-include-a-jsp-file-from-a-diff-project-into-my-project You should split the to-be-shared JSP file out into a standalone web fragment project which you in turn include in all web projects. – BalusC Jun 26 '12 at 16:16

2 Answers2

0

You could use JSTL.

<c:import url="http://localhost:8080/common/webappfooter.jsp" />
rickz
  • 4,324
  • 2
  • 19
  • 30
  • 1
    Note that this includes the output of the JSP (like as the webbrowser retrieves), not the source code of the JSP. – BalusC Jun 26 '12 at 16:17
  • @BalusC Yes, that is true. But, since javaspyman posted the action element(not the include directive) in his code, I assume that is what he wants to do. – rickz Jun 26 '12 at 16:22
  • I wouldn't assume that javaspyman really understands what he's actually doing. Based on this question and the previous question on the same subject, he is going the wrong path this way. – BalusC Jun 26 '12 at 16:23
  • how else do you think I should do this. – user1472384 Jun 26 '12 at 16:26
  • That's already answered in your previous question. – BalusC Jun 26 '12 at 16:27
  • If you don't want to use JSTL, then you could use a HttpURLConnection object. – rickz Jun 26 '12 at 16:38
-1

Include work in same project, so it won't work here..

You can use iframe to do so..

Sagar
  • 1,315
  • 8
  • 15