wood burning stoves 2.0
The moose likes Struts and the fly likes integrating tapestry and Spring (long) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "integrating tapestry and Spring (long)" Watch "integrating tapestry and Spring (long)" New topic

integrating tapestry and Spring (long)

Dave Wellington

Joined: Jun 14, 2004
Posts: 4
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

Joined: Nov 09, 2000
Posts: 6450
"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

Joined: Jun 14, 2004
Posts: 4
I agree. Here's the link: http://aspose.com/file-tools
subject: integrating tapestry and Spring (long)
jQuery in Action, 3rd edition