我有以下课程:
public class MyClass {
@Inject
private MyAnotherClass myAnotherClass;
public MyClass() {
//Perform operations on myAnotherClass.
}
}
Run Code Online (Sandbox Code Playgroud)
我需要在构造函数中做一些需要实例的东西myAnotherClass.不幸的myAnotherClass是,在构造函数中的代码运行后注入,这意味着我正在执行操作null...
我当然可以MyAnotherClass myAnotherClass = new MyAnotherClass()直接在构造函数中将它实例化为经典的方式(),但我不认为在这种情况下做正确的事情.
你会建议什么解决方案来解决这个问题?
我是tapestry5(5.3.6)的新手,在显示标签和文字时遇到问题.
<h1>
<t:pagelink page="index">First Tutorial</t:pagelink>
</h1>
Run Code Online (Sandbox Code Playgroud)
上面的标签总是显示为"第一个教程",挂毯总是以小写的形式展示每件事.
任何想法如何配置tapestry以保留字符串的大小写.
我有一个页面需要简单验证绑定到我的页面类中的双变量的文本字段.这是通过jquery-formatcurrency实现的,它也设置值("0.0"到"$ 0.00").
<t:textfield t:id="bills" value="projection.current"/>
Run Code Online (Sandbox Code Playgroud)
然而,现在当该字段触发模糊事件或页面提交时,tapestry说:
You must provide a numeric value for bills
Run Code Online (Sandbox Code Playgroud)
(显然是由于"$")
所以我的想法是禁用这一页的验证,因为jquery-formatcurrency可以处理验证.然后我可以覆盖翻译器,因为它在tapestry文档中声明了覆盖Translator with Events以处理表单字段.
提前致谢.
我使用带有spring和hibernate的tapestry 5,我尝试构建我的应用程序抛出我的这个异常??? !!! ???什么是问题,任何建议都会是这样的relif ????
[WARNING] Some problems were encountered while building the effective model for com.fit:rent-a-car:war:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 194, column 18
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 235, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
.....
.....
[ERROR] ioc.Registry No service implements …Run Code Online (Sandbox Code Playgroud)