开发者

How to include dynamic JSP from another server on a JSP page

开发者 https://www.devze.com 2023-01-05 02:46 出处:网络
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 o

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消