Hi,

I am Testing the new Portlet 2.0 with Liferay and have some problems with
Ajax-calls.

I am using wicket 1.4-SNAPSHOT(Revision 741130) and Liferay Portal Standard
Edition 5.2.1 (Augustine / Build 5201 / February 3, 2009).

I have a simple page with one label and one Ajaxlink:

 public HomePage(final PageParameters parameters) {

        final Label label = new Label("label", new
PropertyModel<Integer>(this, "value"));
        label.setOutputMarkupId(true);
        add(label);

        AjaxLink link = new AjaxLink("link")
        {

            @Override
            public void onClick(AjaxRequestTarget target) {
                value = value + 1;
                target.addComponent(label);
            }

        };
        add(link);
    }

The portlet is shown correctly but when I click the Ajaxlink nothing
happens. In the Ajax-Debug-Log appears the following text:

INFO:
INFO: Initiating Ajax POST request on
http://localhost:8080/web/guest/home?random=0.9410006487742066
INFO: Invoking pre-call handler(s)...
INFO: Received ajax response (84 characters)
INFO:
The requested resource (/ACE_PortletTest-1.0-SNAPSHOT/portlettest/) is not
available
ERROR: Error while parsing response: Could not find root <ajax-response>
element
INFO: Invoking post-call handler(s)...
INFO: Invoking failure handler(s)...

This is the log form Java when the Ajax-Link is clicked:

DEBUG - 0-SNAPSHOT]                - servletPath=/ACETEST, pathInfo=/invoke,
queryString=null, name=null
DEBUG - 0-SNAPSHOT]                -  Path Based Forward
DEBUG - WicketPortlet              - Portlet "RESOURCE_PHASE" for wicket
url:/portlettest/?wicket:interface=:0:link::IBehaviorListener:0:
DEBUG - 0-SNAPSHOT]                - servletPath=/portlettest/,
pathInfo=null, queryString=wicket:interface=:0:link::IBehaviorListener:0:,
name=null
DEBUG - 0-SNAPSHOT]                -  Path Based Include
DEBUG - WicketPortlet              - redirect url after inclusion:null
DEBUG - WicketPortlet              - end of request, wicket
url:/portlettest/?wicket:interface=:0:link::IBehaviorListener:0:
DEBUG - 0-SNAPSHOT]                -  Disabling the response for futher
output
DEBUG - 0-SNAPSHOT]                -  The Response is vehiculed using a
wrapper: com.liferay.portal.servlet.AbsoluteRedirectsResponse

Here is my web.xml and my portlet.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
    version="2.4">

    <display-name>ACE_PortletTest</display-name>

    <context-param>
        <param-name>org.apache.wicket.detectPortletContext</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>configuration</param-name>
        <param-value>development</param-value>
        <!-- param-value>deployment</param-value -->
    </context-param>

    <filter>
        <filter-name>wicket.ACE_PortletTest</filter-name>

<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationClassName</param-name>
            <param-value>de.acando.ace.WicketApplication</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>wicket.ACE_PortletTest</filter-name>
        <url-pattern>/portlettest/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
</web-app>

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";>
  <portlet>
    <description>ACE Test</description>
    <portlet-name>ACETEST</portlet-name>
    <display-name>ACETEST</display-name>

<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
    <init-param>
      <name>wicketFilterPath</name>
      <value>/portlettest</value>
    </init-param>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
    </supports>
    <supports>
      <mime-type>text/xml</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
    </supports>
    <portlet-info>
      <title>ACE Portlet Test</title>
      <keywords>ACE Portlet Test</keywords>
    </portlet-info>
  </portlet>
  <container-runtime-option>
    <name>javax.portlet.escapeXml</name>
    <value>false</value>
  </container-runtime-option>
</portlet-app>


I have no idea whats wrong.

Thanks for any help in advance,

-- Benjamin

Reply via email to