• Post Reply Bookmark Topic Watch Topic
  • New Topic

integrating tapestry and Spring (long)  RSS feed

Dave Wellington
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am starting a project using Spring, Tapestry and Hibernate. I cannot get off the ground with the Spring/Tapestry part, as I am getting the following exception thrown from Tapestry.

Unable to update expression '<parsed expression>' of com.crosswind.mha.tapestry.pages.Home$Enhance_0@d5c653[Home] to com.crosswind.mha.services.AuthenticationService@161def0.

Method "setAuthenticationService" failed for object com.crosswind.mha.tapestry.pages.Home$Enhance_0@d5c653[Home]


Any help would be appreciated. Hopefully I am doing something dumb.

Here is a simplified Home.java, Home.page and Home.html (using Howard's simple login example), all of which seem to do the right thing, per the "Integrating Tapestry and the Spring framework" paper by Colin Sampaleanu.

package com.crosswind.mha.tapestry.pages;

import com.crosswind.mha.entities.people.Person;
import com.crosswind.mha.services.AuthenticationService;
import com.crosswind.mha.services.AuthenticationServiceException;

import com.crosswind.mha.tapestry.util.Visit;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;

* Demonstration of very simple form support.
* @author Howard Lewis Ship
public abstract class Home extends BasePage
// Abstract accessors provided by Tapestry in enhanced
// subclass. We only declare the accessors we need in code,
// but the properties are always read/write.

public abstract String getUserName();
public abstract String getPassword();
public abstract void setMessage(String message);

// our UserService implementation; will come from page definition
// public abstract UserService getUserService();

// our AuthenticationService implementation; will come from page definition
public abstract AuthenticationService getAuthenticationService();

private String errorMessage;

public void login(IRequestCycle cycle)
Person person;

person = validateLogin(getUserName(), getPassword());

if (person != null) {
Visit visit = (Visit) getVisit();
java.lang.String newPage = visit.getStartPage(person);

private Person validateLogin(String userName, String password)
Person person = null;

try {
person = getAuthenticationService().authenticate(userName, password);
} catch (AuthenticationServiceException e) {
errorMessage = e.getMessage();
return null;
if (person == null) {
errorMessage = "Invalid user name or password.";
return person;

<html jwcid="@Shell" title="Login">

<span jwcid="@Conditional" condition="ognl:message">
<font color="red">
<span jwcid="@Insert" value="ognl:message">
Error Message


<form jwcid="@Form" listener="ognl:listeners.login">

<th>User Name:</th>
<input type="text" jwcid="@TextField"
<input type="password" jwcid="@TextField"
value="ognl assword"
<td><input type="submit" value="Login"/></td>


<p><a href="#" jwcid="@PageLink" page="Home">Return to Home page</a>.</p>

<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"

<page-specification class="com.crosswind.mha.tapestry.pages.Home">

<property-specification name="message" type="java.lang.String"/>
<property-specification name="userName" type="java.lang.String"/>
<property-specification name="password" type="java.lang.String"/>

<property-specification name="authenticationService"

Jason Menard
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Walt Whitman",

Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy. One of the things that policy states is that obviously ficticious names are not allowed. Please edit your display name to comply with this policy. Thanks in advance, and we look forward to seeing you around the Ranch.
Dave Wellington
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!