You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sébastien Geindre <se...@meteo.fr> on 2008/01/21 17:35:31 UTC
How Mounting your block at the root level ??
In documentation i can read :
Mounting your block at the root level
You can mount your block at the root level in the application URI space,
so that instead of using (for example) the URI
http://localhost:8888/myBlock/foo/bar to request a page, you would
request it at http://localhost:8888/foo/bar.
To do this, edit
myBlock/src/main/resources/META-INF/cocoon/spring/block.xml , and change
the element
<property name="mountPath" value="/myBlock1"/>
to
<property name="mountPath" value=""/>
is it still working ?
When i create the lock , there is no block.xml file. and when i create
one , i got an exception...
2008-01-21 16:03:26.018::WARN: Failed startup of context
org.mortbay.jetty.webapp.WebAppContext@511e0a{/,/home/geindre/workspace2/flysafeWebApp/target/flysafeWebApp-1.0-SNAPSHOT}
org.springframework.beans.factory.BeanDefinitionStoreException: Unable
to read spring configurations from classpath*:META-INF/cocoon/spring;
nested exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 2 in XML document from URL
[jar:file:/home/geindre/.m2/repository/fr/meteo/advanced/1.0-SNAPSHOT/advanced-1.0-SNAPSHOT.jar!/META-INF/cocoon/spring/block.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-elt.1: Cannot find the declaration of element 'property'.
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 2 in XML document from URL
[jar:file:/home/geindre/.m2/repository/fr/meteo/advanced/1.0-SNAPSHOT/advanced-1.0-SNAPSHOT.jar!/META-INF/cocoon/spring/block.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-elt.1: Cannot find the declaration of element 'property'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'property'.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
The question is is it possible to change the URL :
http://myMachine:port/myWebApplication/myBlock/resource
to http://myMachine:port/resource ???
-- Sébastien Geindre DPREVI/AERO/DEV sebastien.geindre __at__ meteo.fr
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How Mounting your block at the root level ??
Posted by Sébastien Geindre <se...@meteo.fr>.
I tried setting in bean as robin wrote.
It works.
thanks a lot !!!
for the block.xml way...
it does not work.. Something wrong with the xml data in
block.xml...namespace or whatever..
if you have a working example, i'll try again...
2008-01-22 09:26:39.600::WARN: Failed startup of context
org.mortbay.jetty.webapp.WebAppContext@511e0a{/,/home/geindre/workspace2/flysafeWebApp/target/flysafeWebApp-1.0-SNAPSHOT}
org.springframework.beans.factory.BeanDefinitionStoreException: Unable
to read spring configurations from classpath*:META-INF/cocoon/spring;
nested exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 2 in XML document from URL
[jar:file:/home/geindre/.m2/repository/fr/meteo/advanced/1.0-SNAPSHOT/advanced-1.0-SNAPSHOT.jar!/META-INF/cocoon/spring/block.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-elt.1: Cannot find the declaration of element 'property'.
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 2 in XML document from URL
[jar:file:/home/geindre/.m2/repository/fr/meteo/advanced/1.0-SNAPSHOT/advanced-1.0-SNAPSHOT.jar!/META-INF/cocoon/spring/block.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-elt.1: Cannot find the declaration of element 'property'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'property'.
Robin Rigby a écrit :
> Try this: in
>
> myBlock1/src/main/resources/META-INF/cocoon/spring/servlet-service.xml
>
> set
>
> mount-path=""
>
> -------------------
>
> <bean id="com.mycompany.myBlock1.block"
> class="org.apache.cocoon.sitemap.SitemapServlet">
> <servlet:context mount-path="" context-path="blockcontext:/myBlock1/">
> <servlet:connections>
> <entry key="myBlock2" value-ref="com.mycompany.myBlock2.service"/>
> </servlet:connections>
> </servlet:context>
> </bean>
>
> -------------------
>
>
>
> Robin
>
>
> -----Original Message-----
> From: Grzegorz Kossakowski [mailto:gkossakowski@apache.org]
> Sent: 21 January 2008 20:17
> To: users@cocoon.apache.org
> Subject: Re: How Mounting your block at the root level ??
>
> Sébastien Geindre pisze:
>
>> In documentation i can read :
>>
>>
>> Mounting your block at the root level
>>
>> You can mount your block at the root level in the application URI space,
>> so that instead of using (for example) the URI
>> http://localhost:8888/myBlock/foo/bar to request a page, you would
>> request it at http://localhost:8888/foo/bar.
>>
>> To do this, edit
>> myBlock/src/main/resources/META-INF/cocoon/spring/block.xml , and change
>> the element
>>
>> <property name="mountPath" value="/myBlock1"/>
>>
>> to
>>
>> <property name="mountPath" value=""/>
>>
>> is it still working ?
>>
>
> Have you tried:
>
> <property name="mountPath" value="/"/>
>
> Report if it's working so we can fix code or documentation (most probably
> the latter)
>
> <snip/>
>
>
>> The question is is it possible to change the URL :
>> http://myMachine:port/myWebApplication/myBlock/resource
>>
>> to http://myMachine:port/resource ???
>>
>
> Yep, definitively it's possible.
>
>
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: How Mounting your block at the root level ??
Posted by Robin Rigby <ro...@gondolier.org.uk>.
Try this: in
myBlock1/src/main/resources/META-INF/cocoon/spring/servlet-service.xml
set
mount-path=""
-------------------
<bean id="com.mycompany.myBlock1.block"
class="org.apache.cocoon.sitemap.SitemapServlet">
<servlet:context mount-path="" context-path="blockcontext:/myBlock1/">
<servlet:connections>
<entry key="myBlock2" value-ref="com.mycompany.myBlock2.service"/>
</servlet:connections>
</servlet:context>
</bean>
-------------------
Robin
-----Original Message-----
From: Grzegorz Kossakowski [mailto:gkossakowski@apache.org]
Sent: 21 January 2008 20:17
To: users@cocoon.apache.org
Subject: Re: How Mounting your block at the root level ??
Sébastien Geindre pisze:
> In documentation i can read :
>
>
> Mounting your block at the root level
>
> You can mount your block at the root level in the application URI space,
> so that instead of using (for example) the URI
> http://localhost:8888/myBlock/foo/bar to request a page, you would
> request it at http://localhost:8888/foo/bar.
>
> To do this, edit
> myBlock/src/main/resources/META-INF/cocoon/spring/block.xml , and change
> the element
>
> <property name="mountPath" value="/myBlock1"/>
>
> to
>
> <property name="mountPath" value=""/>
>
> is it still working ?
Have you tried:
<property name="mountPath" value="/"/>
Report if it's working so we can fix code or documentation (most probably
the latter)
<snip/>
> The question is is it possible to change the URL :
> http://myMachine:port/myWebApplication/myBlock/resource
>
> to http://myMachine:port/resource ???
Yep, definitively it's possible.
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How Mounting your block at the root level ??
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Sébastien Geindre pisze:
> In documentation i can read :
>
>
> Mounting your block at the root level
>
> You can mount your block at the root level in the application URI space,
> so that instead of using (for example) the URI
> http://localhost:8888/myBlock/foo/bar to request a page, you would
> request it at http://localhost:8888/foo/bar.
>
> To do this, edit
> myBlock/src/main/resources/META-INF/cocoon/spring/block.xml , and change
> the element
>
> <property name="mountPath" value="/myBlock1"/>
>
> to
>
> <property name="mountPath" value=""/>
>
> is it still working ?
Have you tried:
<property name="mountPath" value="/"/>
Report if it's working so we can fix code or documentation (most probably the latter)
<snip/>
> The question is is it possible to change the URL :
> http://myMachine:port/myWebApplication/myBlock/resource
>
> to http://myMachine:port/resource ???
Yep, definitively it's possible.
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org