logo

MMBase tips

Basic template

tip #11 / Thu 18 Mar 2010 / André / 3 comments

The jspx template I use most often to create a new web page in mmbase.

This is the jspx template - a stationery really in BBEdit - with the taglbiraries I use most often. It includes JSTL core and functions, and the mmbase taglibrary.

<mm:content 
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
expires="120" postprocessor="none" type="text/html">
<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.1//EN"
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
<mm:cloud>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Untitled</title>
</head>
<body>

</body>
</html>
</mm:cloud>
</mm:content>

I have another one for jsp, before I started to use jspx.

<%@ page language="java" contentType="text/html" 
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib uri="http://www.mmbase.org/mmbase-taglib-2.0" prefix="mm"
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<mm:content expires="120" type="text/html" escaper="none">
<mm:cloud>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Untitled</title>
</head>
<body>


</body>
</html>
</mm:cloud>
</mm:content>

The <mm:content /> tag sets the expires header to 120 seconds, meaning the page should be cached for two minutes.

3 comments

Where are the meta headers good for?

do 18 maart 2010 / Mihxil' → http://www.meeuw.org/

I never gave it much thought but I may have included them a while ago because of this guideline http://www.webrichtlijnen.nl/richtlijnen/#r-pd-16-3 But they're in the response headers as well.

vr 2 april 2010 / AndrĂ© → http://www.toly.nl/

Ok, so I think the only reason for it, is that if a visitor saves it to her hard-disk, and the opens it again, that then the meta-headers still are present, and the real headers not.

I'm still not sure what to think of it that. I always found it pleonastic, and the responsibility of the browser, not the server, to correctly store it locally, if realy desired.

vr 2 april 2010 / Mihxil'

RSS feed

Tweet this article

Most mentioned links:

MMBase documentation
MMBase API
MMBase SVN
Bugtracker
MMBase Taglib reference
The reference for all tags mm