views:

121

answers:

1

I am writing a some code that to dynamically include an HTML snippet in a page. Basically, I have course information on one server, which I want other servers to be able to include with a single line of code.

If it was on the same server, I would use this:

<jsp:include page="coursedescription.jsp?subj=ENGL100" /> 

But the JSP page is on a different server. This is what I have tried, and it does not work:

<jsp:include page="http://myotherserver.com/courselist.jsp?subj=ENGL" /> 

How can I include that snippet from the other JSP page, by specifying the URL?

+1  A: 

you can use c:import tag for doing this. The other way is to fetch the content in the server side using commons HTTP and include the result inline.

Teja Kantamneni
Thanks, this works great: <c:import url="http://myotherdomain.com/courselist.jsp?subj=ENGL" ></c:import>
jeph perro