简体   繁体   中英

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 ?

Look at the documentation . You forgot the defaultPrefix :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM