How can I include a jsp page in html?

I am using Netbeans and MySql server. I want to add JSP content to an HTML file. How to enable it?

+4
source share
2 answers

Make the HTML file a JSP page and use the JSP include (static or dynamic, depending on what you want, but you probably want to include static here):

<%@include file="theJspToInclude.jsp" %> 

HTML files are static resources that are served as without any interpretation by the web container.

+5
source

JSP is dynamic. It requires a web container to run. Why do you need to include it in a static html page. As far as I know, if you want to add jsp page to html page, your page will be dynamic. Therefore, you should change this as a JSP page. Now you can use

 <%@include file="includeable.jsp" %> 

This will be your jsp.

You cannot include JSP in an HTML page.

+2
source

All Articles