You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeremy C <je...@cowgar.com> on 2001/05/10 03:15:08 UTC

send-redirect --- how?

Greetings!

I have an xsp page that run's a SQL query to return many records. If the 
user performs a query that only returns 1 record, instead of presenting a 
list of entries to choose from, I want to redirect them to the details 
page...why present an option if there's only one choice?

So, what I have done is in my xsp page, I checked the value of a select 
count(id) from ...... and if the count = 1, I do:

<xsp:logic>
response.sendRedirect("http://www.yahoo.com/");
</xsp:logic>

that always fails:
org.apache.cocoon.ProcessingException: Failed to execute 
pipeline.:org.apache.cocoon.ResourceNotFoundException: Language 
Exception:org.apache.cocoon.ProcessingException: Language 
Exception:org.apache.cocoon.components.language.LanguageException: Error 
compiling select_xsp: Line 0, column 0: 
/opt/tomcat/work/localhost/knopro5/org/apache/cocoon/www/sql/reductions/provider/select_xsp.java:209: 
Method sendRedirect(java.lang.String) not found in interface 
org.apache.cocoon.environment.Response. 
response.sendRedirect("http://www.yahoo.com"); ^


If I try:

<xsp-response:send-redirect location="http://www.yahoo.com"/>

that tag will appear in my HTML, but no redirect. Here's the reveland 
protion of code:

page.xsp:
========================
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
   language="java"
   xmlns:xsp="http://apache.org/xsp"
   xmlns:esql="http://apache.org/cocoon/SQL/v2"
         xmlns:xsp-request="http://apache.org/xsp/request"
         xmlns:xsp-response="http://apache.org/xsp/response"
 >

<page>
         <title>Provider List</title>
         <content>
                 <xsp:logic>
                         response.sendRedirect("http://www.yahoo.com");
                       </xsp:logic>


----- or -----

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
   language="java"
   xmlns:xsp="http://apache.org/xsp"
   xmlns:esql="http://apache.org/cocoon/SQL/v2"
         xmlns:xsp-request="http://apache.org/xsp/request"
         xmlns:xsp-response="http://apache.org/xsp/response"
 >

<page>
         <title>Provider List</title>
         <content>
              <xsp-response:send-redirect location="http://www.yahoo.com"/>

Can anyone help out?

Thanks!

Jeremy - jeremy@cowgar.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Cocoon, Tomcat and IIS...

Posted by Lee Goddard <ho...@leegoddard.com>.
> Tomcat and IIS work well together, amazingly.
> But I'm getting a 404 on *.xml files.
>
> The install guide http://xml.apache.org/cocoon/install.html#tomcat
> only applies to Tomcat with Apache, but from I've followed all the
> steps I can apply, and guess my problem lies around the file
> 'cocoon.properties'.
>
> I've copied it from the Cocoon distribution to my Tomcat
> webapps/cocoon/WEB-INF directory, and have run into a possible
> *thing* in the docs:
>
>   "... edit the $TOMCAT_HOME/webapps/cocoon/WEB-INF/web.xml file to
>    point to the Cocoon properties file in the same directory. Do this by
>    changing the text conf/cocoon.properties to WEB-INF/cocoon.properties.
>    Note that this path is a relative path, and must be so. Don't
>    try to use an absolute path here. It won't work. Also note that the
>    web.xml file describes how to map .xml requests to the Cocoon servlet."
>
> The original line in the web.xml file read:
>
> <param-value>[path-to-cocoon]/WEB-INF/cocoon.properties</param-value>

It should be set to

   <param-value>WEB-INF/cocoon.properties</param-value>

which does leave the prose as kind of confusing to me, but hey.

lee


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Cocoon, Tomcat and IIS...

Posted by Lee Goddard <ho...@leegoddard.com>.
Tomcat and IIS work well together, amazingly.
But I'm getting a 404 on *.xml files.

The install guide http://xml.apache.org/cocoon/install.html#tomcat
only applies to Tomcat with Apache, but from I've followed all the
steps I can apply, and guess my problem lies around the file
'cocoon.properties'.

I've copied it from the Cocoon distribution to my Tomcat
webapps/cocoon/WEB-INF directory, and have run into a possible
*thing* in the docs:

  "... edit the $TOMCAT_HOME/webapps/cocoon/WEB-INF/web.xml file to
   point to the Cocoon properties file in the same directory. Do this by
   changing the text conf/cocoon.properties to WEB-INF/cocoon.properties.
   Note that this path is a relative path, and must be so. Don't try to use
an
   absolute path here. It won't work. Also note that the web.xml file
describes
   how to map .xml requests to the Cocoon servlet."

The original line in the web.xml file read:

<param-value>[path-to-cocoon]/WEB-INF/cocoon.properties</param-value>

I've tried all combinations, no joy.  Should [path-to-cocoon] be left in
or replaced with the path to cocoon (making the value an absolute path)?
Should WEB-INF be left in?  As this line refers to a file in the same dir,
and that dir is WEB-INF, shouldn't WEB-INF be left out?

Has anyone got this running on this combo?  I'd be really grateful
to hear from you!

Thanks in anticipation
lee goddard



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>