How to include dynamic JSP from another server on a JSP page
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 o开发者_JS百科ther JSP page, by specifying the URL?
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.
精彩评论