>>From what I've seen XSP is being phased out (or at least discouraged for
most uses) now that we have better ways (Control Flow) to handle
processing.
>
> I didn't understood one thing, if XSP is outdated, do I need to serialize
> the Java program output again and again to XML if XSP is not there? Because
> AFAIK in cocoon the output of one stage to another goes in XML format. Do
> you have to say something on this?

Sure! :-)

XSP allows you to inject values from Java objects into the XML stream, but
rather uncleanly (IIUC) since it also mixes the logic of how to get those
Java objects into the presentation layer.  In Cocoon's MVC framework the
logic for getting the objects is done in the Flow, which then passes those
objects along to the presentation pipeline as view data:

  var myBean = doLogicToGetBean();
  var viewData = {
    "theBean" : myBean,
    "foo" : "bar",
    "now" : new Date() //etc...
  };
  cocoon.sendPage("the/display/pipeline", viewData);

Then you use something like JXTemplateGenerator[1] to grab the appropriate
values from the view data and inject them into the XML.  This is a cleaner
separation of concerns (logic in the flow, presentation in the template)
than XSP and that's probably the reason XSP is being discouraged.

You definitely don't want to generate representations of your beans as XML
each and every time; I've done this on a prior project and performance
sucks because you end up generating huge XML streams for just a few
values.

[1] http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html

--Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to