Hai,

Just to let you know a small but nice change has been made on how mm:context works, Im postiing this because not many will hear about it unless you read the cvs logs or are on irc.

Its not alot easer to 'transpost' values from page to page within your applications. You can add a 'scope' to the context and if you do the whole context will be automagicly reloaded on a new page.

The example, loads just one variable into the context that is imported from the parameters (so add ?name=Bla to the url to test).

--------- page 1 ----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/transitional.dtd";>
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0"; prefix="mm" %>
<mm:cloud>
<mm:context id="testsite" scope="session">
<mm:import externid="name" from="parameters,this">Henk</mm:import>
<html>
<head>
<title>context test</title>
</head>
<body>
NAME : <mm:write referid="name" /> <br />
link to page 2 <a href="<mm:url page="page2.jsp" />">LINK</a>
</body>
</html>
</mm:context>
</mm:cloud>
-------------


--- page 2-------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/transitional.dtd";>
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0"; prefix="mm" %>
<mm:cloud>
<mm:context id="testsite" scope="session">
<html>
<head>
<title>context test</title>
</head>
<body>
NAME : <mm:write referid="name" /> <br />
</body>
</html>
</mm:context>
</mm:cloud>
------------------


Lots of other things are possible now but for that i refer to the taglib docs.

Thanks for michel for adding this makes it alot easer,

Daniel.



_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to