> -----Original Message-----
> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, June 12, 2002 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Redirect in XSP
> 
> 
> > From: Matthew Hailstone [mailto:[EMAIL PROTECTED]]
> > 
> > > > From: Matthew
> > > >
> > Scenario:
> >     Homepage XSP generates an initial form.
> >     Parameters are set.
> >     I would like to then access my sub-sitemap URI space depending
on the parameter values.
> >     Ex.
> >     eval/first/first if parameter value is 1
> >     eval/second/second if parater value is 2
> > 
> >     Is this possible by doing the following?
> 
> Yes, it's possible.
> 
> What Cocoon version do you use? Update either cocoon or just 
> sitemap.xsl with the latest one from the cvs, cocoon_2_0_3_branch.
> 
> Vadim

I am using Cocoon 2.0.1 with Tomcat 4.0.2 on Windows 2000.
I also have installed Cocoon 2.1 (HEAD - correct?) with Tomcat 4.1.3.

On Cocoon 2.1, the pipeline recognizes the <map:select> element, and I
get a recursive loop because the parameter repeatedly does not exist, it
keeps going into the <otherwise> element of the <map:select>. Is there a
way to test whether the request parameter exists or not?

I tried replacing the sitemap.xsl, but I don't think I did it properly.
I copied the new sitemap.xsl file that I checked out from CVS
cocoon_2_0_3_branch to the
<tomcat4.0.2>webapps\cocoon\WEB-INF\classes\org\apache\cocoon\components
\language\markup\sitemap\java\ directory, but I got this error:

ERROR   (2002-06-13) 14:46.10:879   [access] (/cocoon/eval)
HttpProcessor[8080][4]/CocoonServlet: Problem with servlet
org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
sitemap_xmap:
Line 339, column 41:  Method getLabels(java.lang.String) not found in
class org.apache.cocoon.sitemap.SitemapComponentSelector.
Line 0, column 0: 
Note: D:\apps\Apache Tomcat
4.0\work\localhost\cocoon\cocoon-files\org\apache\cocoon\www\eval\sitema
p_xmap.java uses or overrides a deprecated API.  Recompile with
"-deprecation" for details.
1 error, 1 warning

        at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.cre
ateResource(ProgramGeneratorImpl.java:285)
        at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa
d(ProgramGeneratorImpl.java:196)
        at org.apache.cocoon.sitemap.Handler.run(Handler.java:228)
        at java.lang.Thread.run(Thread.java:484)


Also, is it possible to jump from the <map:select> element in the
pipeline to the <map:match> element?

Matthew

> > 
> >     <map:pipeline>
> >     ...
> >       <map:select type="request-parameter">
> >         <map:parameter name="parameter-name" value="test-name"/>
> >         <map:when test="">
> >           <map:redirect-to session="true" uri="eval/home/form"/>
> >         </map:when>
> >         <map:when test="1">
> >           <map:redirect-to session="true" uri="eval/first/first"/>
> >         </map:when>
> >         <map:when test="2">
> >           <map:redirect-to session="true" uri="eval/second/second"/>
> >         </map:when>
> >       <map:otherwise>
> >           <map:redirect-to session="true" uri="eval/home/form"/>
> >         </map:otherwise>
> >       </map:select>
> > 
> >       <map:match pattern="*/*">
> >         <map:generate type="serverpages" src="logic/{1}/{2}.xsp"/>
> >         <map:transform src="style/menupage.xsl">
> >           <map:parameter name="toc-file"
value="../content/toc.xml"/>
> >           <map:parameter name="css-stylesheet" value="default.css"/>
> >           <map:parameter name="base-url" value="/cocoon/eval"/>
> >         </map:transform>
> >         <map:serialize/>
> >       </map:match>
> >     ...
> >     </map:pipeline>
> > 

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

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to