When using the Spring framework, you must load the corresponding underlying service on each page,
When using tapestry and spring in combination, the engine class must support:
Add the following method to the myengine file:
Protected void setupforrequest (requestcontext context ){
Super. setupforrequest (context );
// Insert applicationcontext in global, if not there
Map global = (MAP) getglobal ();
Applicationcontext AC = (applicationcontext) Global. Get ("appcontext ");
If (AC = NULL ){
AC = webapplicationcontextutils. getwebapplicationcontext (
Context. getservlet (). getservletcontext ()
);
Global. Put ("appcontext", AC );
}
}
Then use the following statement in the page file:
<Property-specification name = "list" type = "datalist">
Global. appcontext. getbean ("tablesource ")
</Property-Specification>
If the name is list, the static method corresponding to the Java file must be
Public abstract treedao getlist ();