You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gajo Csaba <cs...@enyem.com> on 2007/02/18 10:58:00 UTC
How to use a simple XSP page?
Hello everyone!
I've just started learning cocoon. I passed the basics of transforming an
xml into html with my own stylesheet, and now I want to do some basic
action with an XSP page. I used the tutorial from the Cocoon web site:
http://cocoon.apache.org/2.1/userdocs/xsp/logicsheet.html as well as
others on that site.
Basically the problem I'm having is that when I create an XSP file, let's
say test.xsp, I get an error saying that the file is not associated with a
pipeline. Since on the Apache site it is not mentioned how should I
configure XSP pages, I wrote this into my sitemap:
<map:match pattern="**.xsp">
<map:generate type="serverpages" src="/docs/{1}.xsp"/>
<map:serialize/>
</map:match>
And I always get the following error:
UnnamedSelector: ComponentSelector could not find the component for hint
[xsp] (key [xsp])
file:/D:/cocoon/build/webapp/tutor2/sitemap.xmap - 76:22 <map:serialize>
file:/D:/cocoon/build/webapp/tutor2/sitemap.xmap - 75:65 <map:generate
type="serverpages">
file:/D:/cocoon/build/webapp/sitemap.xmap - 1035:92 <map:mount>
As far as I understand this it says it cannot find a component to
transform the XSP page into an XML. Could someone provide me with a proper
configuration? What should I enter into my site map so that XSP pages
would work?
For example, I created this XSP page:
<?xml version="1.0" encoding="UTF-8"?>
<xsp:page xmlns:xsp="http://apache.org/xsp">
<xsp:logic>
// this could be arbitrarily complex Java code, JDBC queries, etc.
String msg = "Hello, world!";
</xsp:logic>
<greeting>
<xsp:expr>msg</xsp:expr>
</greeting>
</xsp:page>
It should generate an XML with "Hello world" between the <greeting> tags.
Then this XML should be transformed to HTML. How do I do this? By placing
the test.xsp simply into the docs directory I only get the error, there
doesn't seem to be an auto-configuration.
Thanks, Csaba
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to use a simple XSP page?
Posted by Gajo Csaba <cs...@enyem.com>.
OK solved the problem... deleted everything and built Cocoon from scratch,
now it's working.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to use a simple XSP page?
Posted by Gajo Csaba <cs...@enyem.com>.
Oh yeah, and might I add that when I try to access one of the samples that
also uses XSP, for exmaple
http://localhost:8080/cocoon/samples/simpleform/one/index
I also get the error. So it is obviously a problem with Cocoon as a whole.
But I have not changed anything on Cocoon, I just downloaded, unpacked and
built it yesterday. Why is it not working?
Csaba
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org