File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Template system with JSP and Servlet?

 
Karol Matysiak
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I'm think about building website with some kind of classic template.

I could do this with jsp:import, but that would mean that i have to paste few lines (header part, with title of the page param, banner/menu part and footer part) in each page and I would have to override the "content" part, and I think this is not exactly the idea of so called "templating". I know that in JSF is something like ui:composition, and I'm looking for something like this, but using JSP and servlets. Is there any jstl tag to do this, or maybe I should use framework like spring or struts?

best regards
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SiteMesh and Tiles are among the most common layout engines, as far as I know. The Play! framework also has its own layout engine.
 
Karol Matysiak
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so the only way is to use framework? And most of website which are JSp/Servlets based uses frameworks to build pages based on template?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends upon whether you consider 3rd party implementations such as SiteMesh or Tiles to be "frameworks".

If you want to roll your own, surely you can do that. Custom tags can be of great help here. Personally, I only "reinvent the wheel" when I feel that none of the existing wheels are acceptable. I'd suggest looking at the existing systems and evaluating them for your use before dismissing them out of hand and setting out on your own.

If you want to be very "avant garde", you can also explore client-side templating. But that's not something I'd recommend for someone not already very handy on the client-side technologies (Javascript, jQuery et al).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic