Search code examples
javatapestry

How can y use Tapestry component with String parameters?


This is the code of my tapestry component : (it works)

import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
public class SimpleChart {
    @Property
    @Parameter(value="123")
    private String title;
}

But when I write "abc" instead of "123", It doesn't work anymore. I need to replace the number with a sentence. Can anyone help me ?


Solution

  • Look at the documentation. You forgot the defaultPrefix :

    @Parameter(defaultPrefix = BindingConstants.LITERAL, value="abc")