cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Gruber <>
Subject Re: Integration of Wicket Servlet within C2.2 Block with servlet service -> Problem
Date Thu, 11 Oct 2007 16:59:21 GMT
hmm, thanx Daniel that helped.

the url-context correctly redirects to the wicket-servlet. however it 
seems the xhtml wicket tags are not beeing rendered correctly by the 
wicket servlet.

the returned output is:
<?xml version='1.0' encoding='UTF-8'?>
        <title>Wicket Quickstart Archetype Homepage</title>
        <strong>Wicket Quickstart Archetype Homepage</strong>
        <span wicket:id="message">If you see this message wicket is 
properly configured and running</span>
        Input field:<br/>
        <textarea wicket:id="yourinput" name="yourinput"></textarea>
        <button wicket:id="PressMe" name="PressMe" 

which is actually the unmodified homepage.xml

my looks like this:

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.WebPage;

 * Homepage
public class HomePage extends WebPage {

        private static final long serialVersionUID = 1L;

        // TODO Add any page properties or variables here

         * Constructor that is invoked when page is invoked without a 
         * @param parameters
         *            Page parameters
    public HomePage(final PageParameters parameters) {

        // Add the simplest type of label
        add(new Label("message", "If you see this message wicket is 
properly configured and running"));

        // TODO Add your page's components here
        add(new TextArea("yourinput"));
        add(new Button("PressMe"));
    public String getMarkupType() {
        return "xml";

any ideas?  I recall some guys at the cocoon GT wanted to showcase a 
Wicket integration...

thanx in advance..


Mag. Gabriel Gruber
Senior Consultant
Workflow EDV GmbH, Dannebergplatz 6/23, A-1030 Wien

Daniel Fagerstrom <> 
11.10.2007 18:13
Please respond to


Re: Integration of Wicket Servlet within C2.2 Block with servlet service 
-> Problem

Gabriel Gruber skrev:
> Dear C2.2 Dev-Community!
> I just played around with Wicket and wanted to integrate a HelloWorld 
> Wicket application within a C2.2 Block as a servlet service:
> <beans xmlns=""
>   xmlns:xsi=""
>   xmlns:servlet=""
>   xsi:schemaLocation=" 
>   <bean id="com.mycompany.block2.service" 
> class="org.apache.cocoon.sitemap.SitemapServlet">
>     <servlet:context mount-path="/block2" 
> context-path="blockcontext:/block2/"/>
>   </bean>
>   <bean id="com.mycompany.block2.wicketapp" 
> class="org.apache.wicket.protocol.http.WicketServlet">
>     <servlet:init-params>
>       <entry key="applicationClassName">
>         <value>com.mycompany.WicketApplication</value>
>       </entry>
>     </servlet:init-params>
>     <servlet:context mount-path="/block2-wicket" 
> context-path="blockcontext:/block2-wicket/"/>
>   </bean>
> </beans>
> While this seems generally ok, there seems to be a problem with the 
> spring namespacehandler for the servlet service tags. When i start 
> spring an exception is thrown like this...
> Caused by: 
> org.springframework.beans.factory.BeanDefinitionStoreException: Unable 
> to read spring configurations from classpath*:META-INF/cocoon/spring; 
> nested exception is 
> *Configuration problem: Cannot locate BeanDefinitionDecorator for 
> element [init-params]*

> What is wrong here?
> Any suggestions?
The servlet:context element must be the root element of the elements in 
the servlet: namespace. The error message basically sys that there is no 
handler for the servlet:init-params as a  root element.

Modify the above  bean definition to:

  <bean id="com.mycompany.block2.wicketapp" 
    <servlet:context mount-path="/block2-wicket" 
        <entry key="applicationClassName">

And see if it works.


View raw message