hi,

Recent builds of the 1.7 stable branch and the cvs head support using the request scope to store mmbase variables (next to the previously already existing page and session contexts) -- thanks Michiel! In the light of recent discussions about using a model-2 architecture (or not) this is a very useful addition.

Using the request scope is a good alternative to using parameters to pass along with the request which was previously the only way to pass varables to another page when including or forwarding.

example:

test.jsp (could be your 'controller')
<%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0"; prefix="mm" %>
<%-- create a variable --%>
<mm:import id="test" >jajaja een variabele in de request scope!</mm:import>
<%-- write the variable to the request scope --%>
<mm:write referid="test" request="test-in-request" />
<jsp:forward page="test2.jsp" />

test2.jsp (the 'view' ?)
<%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0"; prefix="mm" %>
<%-- import the variable --%>
<mm:import id="test" externid="test-in-request" from="request" />
<%-- write the variable to the page --%>
Test: <mm:write referid="test" />

Since I'm very happy about this I thought I'd share the joy! :-)

cheers,

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

Reply via email to