How to load the underlying server in combination with tapestry and spring

Source: Internet
Author: User

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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.