cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Waddington <wa...@yahoo.com>
Subject Page redirect without HTTP...
Date Wed, 23 Aug 2000 19:11:41 GMT
Folks,

I'm struggling with how to implement redirecting from a Cocoon page.  
The reason for this is to implement a Cocoon page that is pure logic, a
"logic page".  A logic page takes some inputs (from form parameters or
elsewhere), does some code execution (say a database query) via XSP, saves
any data that might be required later and then "redirects" to another page in
the application based on the results.  The page redirected could be a simple
static "success" or "failure" message, but more often than not will use XSP
to retrieve/transform the data.  It might even be another "logic page". This
structure allows me to cleanly separate logic and presentation pages rather
than embed large quantities into each page that mix content/logic.  I don't
know if anyone agrees with me that this is a good idea but its what I'm
trying to do.  

Now my technical problems are:

1. Using sendRedirect() to go from my logic page to a new page is UGLY and
inefficient, subject to client problems and caching problems etc.  

2. What I really want to do is use the servlet engine to redispatch the
request on the server side, but damned if the Apache/JServ that I have to use
doesn't support servlet 2.1 or higher where this would be possible.

3. I wrote a "logic" processor that looks at a PI I add to the page to tell
it what the next page is, it then discards the current document and goes to
that.  I also wrote a bunch of code to emulate servlet request attributes  so
I can preserve environment between my pages.  This works great except where I
redirect to another page with XSP in it.  XSP uses the current request object
to get the path of the file to compile and since my code doesn't touch the
request object (it cant) XSP compiles the original file, executes it and
redirects again in an infinite loop.

I don't want to change XSP.  I'm stuck with servlet 2.0 (doh!).  Is there any
way out?

Thanks in advance,

Simon Waddington.


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Mime
View raw message