You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mark Washeim <es...@canuck.com> on 2000/07/12 20:21:17 UTC
Re: Cocoon 1.7.4, XSP and hasChanged
on 11/7/00 1:06 pm, Robin Green at greenrd@hotmail.com wrote:
> The hasChanged code is definitely in 1.7.3, and in the latest CVS (see
> http://xml.apache.org/websrc/cvsweb.cgi/xml-cocoon/src/org/apache/cocoon/proce
> ssor/xsp/XSPProcessor.java?rev=1.22&content-type=text/vnd.viewcvs-markup
> ). I recognise it, because I wrote it. It used to work - I don't see why it
> shouldn't work now.
>
> Maybe this is a stupid question, but what servlet engine are you using,
> Alex? Printing to System.out isn't a good idea - for instance, with tomcat
> on Unices, tomcat.sh spawns a child process and System.out is blackholed, so
> you have to use System.err - or better yet, servletContext.log (), which
> goes to a tomcat-specific log file. Do you get the "in treeview.xml"
> displayed on the terminal at all?
>
>
> Alex Muc <al...@utoronto.ca> wrote:
>> No one has gotten back to me about this. I'd be really interested in
<SNIP>
Ok, I've found why hasChanged doesn't get called correctly. At least with
tomcat 3.1
in the method within XSPProcessor:
public boolean hasChanged(Object context) {
if (!(context instanceof HttpServletRequest)) {
System.err.println("XSPProcessor hasChanged called, context
failed");
return true; // Can't interpret context
}
HttpServletRequest request = (HttpServletRequest) context;
String filename = Utils.getBasename(request, servletContext);
// Get page from Cocoon cache
PageEntry pageEntry = (PageEntry) this.store.get(filename);
// New page?
if (pageEntry == null) {
System.err.println("XSPProcessor failed to get PageEntry: " +
filename);
return true;
}
// NOT pageEntry.hasChanged ()! We are calling the hasChanged method
// of the XSP page itself.
System.err.println("XSPProcessor hasChanged called");
return pageEntry.getPage().hasChanged(context);
}
I added the sys err lines and discovered that:
XSPProcessor failed to get PageEntry:
/MacintoshHD/jakarta-tomcat//webapps/cocoon/ef/gb_home.xml
I'm curious why, since that's the correct resource, THOUGH, in the cocoon
object store, it has a query string . . . could that be related????
I also noted that PageEntry had it's hasChanged called consistently. That
is, the PageEntry object WAS having it's hasChanged called . . .
I need to poke around a bit more, since I'm not that familiar with the
internals . . .
--
Mark (Poetaster) Washeim
'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.
Quem colorem habet sapientia?'
Evan S. Connell