cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy C <jer...@cowgar.com>
Subject send-redirect --- how?
Date Thu, 10 May 2001 01:15:08 GMT
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message