0

I am new to Spring framework. I have built simple web application from JSP. I have used by making template in HTML using CSS and Javascript. Now i want to make same project in Spring so Can i implement my template in spring framework or not? If it is possible how to implement it.

Bhuwan
  • 11
  • 3
  • What kind of template (Java or JavaScript)? Are you planning on using jsp/jstl/something else? – jcragun May 12 '14 at 16:23
  • Your question is unclear as to what exactly you are asking for. Please provide more information about a specific problem you are having implementing your project. If you are simply asking if you can have HTML and CSS in Spring projects, the answer is yes. – FGreg May 12 '14 at 16:26

1 Answers1

0

Spring MVC can use a variety of view technologies, such as Freemarker, Velocity, Thymeleaf, and Plain Old JSPs.

Your question is not entirely clear, but I think you are referring to having one Template file, with multiple views that use that Template. Is that correct?

To do so there are a few methods.

One is to include a header/footer on each view using jsp:include. See JSP tricks to make templating easier?

Another option is to use Apache Tiles, which uses the Composite View Pattern.

Another option is to use SiteMesh, which uses the Decorator Pattern.

The first option is probably the easiest for a simple site.

Community
  • 1
  • 1
Neil McGuigan
  • 46,580
  • 12
  • 123
  • 152