Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

web-app advice  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'd like to build a web-app using tomcat. To avoid html code duplication, I would like to be able to import common html code from other files,

e.g. index.html would look like:

<html>
<head>
... import common tags from a file "head.xyz", passing a parameter
$title...
</head>
<body>
... import a navigation banner code from "nav.xyz"
<p> ...</p>
</body>
</html>

What is the best way of achieving this using tomcat? Server-side includes? Or something smart using Velocity/ JSP?

I had envisaged using Velocity for my dynamic pages, but it seems an overkill solution for the static content. Also, I'm not sure how to configure tomcat to use some particular servlet for the default page of an app.

Thanks for any tips,

best wishes

Andy Cooke
 
Author and ninkuma
Marshal
Posts: 66685
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP custom actions (formerly known as "custom tags").
 
It runs on an internal combustion engine. This ad does not:
free 1 hour java lesson
https://coderanch.com/t/695988/free-hour-java-lesson
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!