commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Lario" <>
Subject [Jelly] Process Templates with taglib and Beans
Date Thu, 01 Jan 2004 22:50:11 GMT
I am trying to process a template that accesses a bean.  I have set name
using context.setVariable("name","robert"); If I leave in ${c1.lastName}
in the template I get a class def found error. If I remove the line
${c1.lastName} the template processes as expected.  What am I missing?
Is there any good documentation on how to define taglibs?  
Any help would be greatly appreciated - I have been stuck on this for
several days.
Here is the template :
<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:define="jelly:define"
  <define:taglib uri="myDummyTagLib">      
    <define:bean name="customer"
            <define:attribute name="lastName" required="true"/>
 <my:customer var="c1" lastName="smith"/>
    the following line ${c1.lastName} is what causes the error:
    if I remove the line then this file is processed as expected.  Also
note, to test to see that
    the Customer class is accessible, I added an X to then end of
com.diem.templates.Customer in classname of
    define:bean above - got an error as expected - thus indicating that
Customer is found
    ${name}'s Page
    ${name}'s Homepage
Here is the bean :
package com.diem.templates;
public class Customer {
    private String lastName;
    public Customer() {
    public String getLastName() {
        return this.lastName;
    public void setLastName(String lastName) {
        this.lastName = lastName;

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message