cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java
Date Mon, 17 Nov 2003 17:46:06 GMT
 

> 
> -----Original Message-----
> From: Sylvain Wallez [mailto:sylvain@apache.org] 
> Sent: maandag 17 november 2003 17:47
> To: dev@cocoon.apache.org
> 
> Unico Hommes wrote:
> 
> <snip/>
> 
> >>Why do we need a setStatus() on the response in the flow?
> >>
> >>Setting the status should IMO be available only by sending 
> an empty response with redirector.sendStatus(), or through 
> the "status-code" attribute on <map:read> and <map:serialize>.
> >>
> >
> >The status-code attribute on map:read and map:serialize 
> aren't variable-resolved. So doing something like:
> >
> >flow.js:
> >function doSomething() {
> >  var status = helper.doIt();
> >  sendPage("done/"+status,null);
> >}
> >
> >sitemap.js:
> ><map:match pattern="done/*">
> >  <map:generate src=".." />
> >  <map:serialize status-code="{1}" />
> ></map:match>
> >
> >Will not work.
> >  
> >
> 
> Well, let's make status-code variable-resolvable if that's 
> just what's missing!
> 

+1

> >Instead, now we can do:
> >
> >flow.js
> >function doSomething() {
> >  response.setStatus(helper.doIt());
> >  sendPage("done",null);
> >}
> >
> >sitemap.js:
> ><map:match pattern="done">
> >  <map:generate src=".." />
> >  <map:serialize />
> ></map:match>
> >  
> >
> >>Moreover, this introduces a dependency on the http 
> environment, which isn't good.
> >>    
> >>
> >
> >Yeah, that sucks.
> >  
> >
> 
> So, what about removing it and resolving the status-code? 
> This seems way cleaner to me ;-)
> 

I just remembered that there is a setStatus() method on the Environment
interface too. If we use that, perhaps we can keep the
response.setStatus() method. Or do you see other objections for this
method?

Unico

Mime
View raw message