luffy
luffy

Reputation: 335

how to include html files to jsp file

I need your help. I want to do a project as don't write html codes in jsp. I want to create html and javascript files as seperatly from jsp files and use this html files in jsp.

For example I want to show a table on page. I'll create a table.html file and I'll create table.js file and table.jsp file. Now, on table.html file I write html codes and my javascript codes will bw written on table.js file and used on table.html file. after that I want to include this files to jsp files.

I use Spring MVC, twitter bootstrap.

Now Could you tell step by step how can I do that? How can I set project structure? Or could you share a documentation for all about this?

Thank you.

Here is My jsp file under the Web-INF/pages

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/templates/allemployees.html" %>

And I have allemployees.html file under the WEB-INF/templates.

Upvotes: 0

Views: 7916

Answers (1)

Md.Jewel Mia
Md.Jewel Mia

Reputation: 3441

Please try it.

<%@include  file="some.html" %>

Upvotes: 1

Related Questions