java - Using custom created components in tapestry -
i started learning tapestry framework. following book example creating custom component , using in code. reason text component not showing (i see hello world text). here .java , tml files:
public class index { public index() { } public string gethello() { return "hello world!"; } }
index tml :
<html xmlns:t="http://tapestry.apache.org/schema/ tapestry_5_3.xsd"> <head> <title>tapestry 5 book</title> </head> <body> <t:mycomponent/> <h1> ${hello} </h1> </body> </html>
mycomponent.java
public class mycomponent { public string getstuff() { return "random stuff"; } }
mycomponent.tml
<span> ${stuff} </span>
i .java files in corresponding packages (pages , components in main/java...) , .tml files in corresponding packages in resources. question is, why component text not showing ?
everything looks ok me, it's case of absolutely verifying mycomponent.tml in right place, , visible on classpath @ runtime. issue ide configuration, example.
for component class org.example.mycomponent, typical place src/main/resources/org/example/mycomponent.tml, have make sure ide exporting files inside src/main/resources.
Comments
Post a Comment