01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.example.testapp.pages;
16:
17: import java.util.Arrays;
18:
19: import org.apache.tapestry.annotations.Inject;
20: import org.apache.tapestry.annotations.Retain;
21: import org.apache.tapestry.ioc.internal.util.InternalUtils;
22: import org.example.testapp.services.Upcase;
23: import org.springframework.web.context.WebApplicationContext;
24:
25: public class Start {
26: @Retain
27: private String _input;
28:
29: // We're matching on type here, just as we would a service provided in a T5 IoC module.
30: @Inject
31: private Upcase _upcaseBean;
32:
33: @Inject
34: private WebApplicationContext _context;
35:
36: void onSuccess() {
37: _input = _upcaseBean.toUpperCase(_input);
38: }
39:
40: public String getInput() {
41: return _input;
42: }
43:
44: public void setInput(String input) {
45: _input = input;
46: }
47:
48: public String getSpringBeans() {
49: return InternalUtils.join(Arrays.asList(_context
50: .getBeanDefinitionNames()));
51: }
52:
53: }
|