JSF-Java-EJB
我是 J2EE 新手,并且在使用 EJB 时遇到问题。我已经有了一个运行良好的 JSF 表单。我向此表单添加一个新字段并将其绑定到 java 类 (1),向相应的 java 类 (2) 添加 getter 和 setter 方法,并尝试将此对象发送到我的分析器类 (3)(它分析形成对象并使用它们从数据库获取查询)。 1).jsf
<td>
<webuijsf:label for="textArea333" text="fee"/>
</td>
<td colspan="2">
<webuijsf:textArea binding="#{user$form.test}" id="textArea333" rows="1" required="true"/>
</td>
2).java
public TextArea test = new TextArea();
public TextArea getTest(){
return test;
}
public void setTest(TextArea test){
this.test = test;
}
System.out.println("test in java class " + tested); // works fine
request.addParameter("test", tested); // request object is used for sending data to //analyzer class
System.out.println(request.toString()); // works fine
3)分析器类: ...
else if (argument.getReportArgument().getName().equals("netcost")) {
netcost = (Integer) argument.getValue().getObject();
System.out.println("netcost" + cost); // works fine
}else if(argument.getReportArgument().getName().equals("test")){
test = (Integer)argument.getValue().getObject();
System.out.println("test" + test); // doesn't work.
}
在第 3 步之前它工作正常,但我无法从我的分析器类中到达我的测试参数。我可以得出其他论点(如上面的一个 - 成本论点),但我无法得出我新创建的论点。我应该为我的分析器类做额外的事情吗?您对我缺少什么有什么意见吗?正如我所说,我是 J2EE 新手,我可能会跳过一个重要的步骤。
I am new to J2EE and having problem with EJB. I already have a JSF form that is working fine. I am adding a new field to this form and binding it to the java class (1), adding getter and setter methods to the corresponding java class (2) and trying to send this object to my analyzer class (3) (which analyzes the form objects and uses them for getting queries from the database).
1).jsf
<td>
<webuijsf:label for="textArea333" text="fee"/>
</td>
<td colspan="2">
<webuijsf:textArea binding="#{user$form.test}" id="textArea333" rows="1" required="true"/>
</td>
2) .java
public TextArea test = new TextArea();
public TextArea getTest(){
return test;
}
public void setTest(TextArea test){
this.test = test;
}
System.out.println("test in java class " + tested); // works fine
request.addParameter("test", tested); // request object is used for sending data to //analyzer class
System.out.println(request.toString()); // works fine
3) analyzer class:
...
else if (argument.getReportArgument().getName().equals("netcost")) {
netcost = (Integer) argument.getValue().getObject();
System.out.println("netcost" + cost); // works fine
}else if(argument.getReportArgument().getName().equals("test")){
test = (Integer)argument.getValue().getObject();
System.out.println("test" + test); // doesn't work.
}
It is working fine until step 3, but I can not reach my test argument from my analyzer class. I can reach other arguments (like the one above - cost argument), but I can not reach my newly-created argument. Should I do extra sth for my analyzer class? Do you have any opinion about what am I missing? As I said I am new to J2EE, I may be skipping one important step..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论