如何在没有action触发的情况下实例化一个组件
2007-03-04 12:06
531 查看
郁闷,整了这么长时间,都没整出个结果。好多情况下就是这样,你越是不想干的事,不得不干,想干的事又没时间干。
这几天在seam forum上提问,终于有回答:
SmokingAPipe
If the cnMessages component has not been accessed from a page, then Seam will not have initialized it (ie, called the factory). Just because your other class is trying to access it, Seam doesn't know anything about that and won't magically call the factory method. That class will have to call the factory method manually, or do it some other way.
... ...
You need to have a @Begin method that initializes the cnMessages member. You're calling getCnMessage() before cnMessages has been set to anything. Tell me where is cnMessages being set? If you can answer that question you'll see what's going on.
下一步该怎样呢?
这几天在seam forum上提问,终于有回答:
SmokingAPipe
If the cnMessages component has not been accessed from a page, then Seam will not have initialized it (ie, called the factory). Just because your other class is trying to access it, Seam doesn't know anything about that and won't magically call the factory method. That class will have to call the factory method manually, or do it some other way.
... ...
You need to have a @Begin method that initializes the cnMessages member. You're calling getCnMessage() before cnMessages has been set to anything. Tell me where is cnMessages being set? If you can answer that question you'll see what's going on.
下一步该怎样呢?
相关文章推荐
- 如何在没有action触发的情况下实例化一个组件
- 在没有任何工具的情况下,如何将一个正方形七等分
- 有一个进程, 在朝某ip, port发数据, 在没有源码的情况下, 如何获知ip, port是多少呢?------还是用strace啦
- [置顶] 如何在没有官方API的情况下写一个第三方客户端
- 如何使用Action.Invoke()触发一个Storyboard
- 在没有个人/公司网站的情况下,如何利用同一个二维码自动识别手机系统(Android/IOS)跳转不同下载页面
- FileSystemWatcher是软件程序开发常用到的一个监控组件,但是这个控件的Changed 时间方法老是触发2次或者多次,触发多次的情况
- jquery easyui 中的按钮如何触发一个 事件
- Android 使用多个Intent 进行activity跳转 而没有finish的情况,如何直接退出系统
- Struts2 如何实现同一个action不同方法进行传值
- 如何让你的程序在没有root的情况下访问系统敏感数据
- 如何查看app log(在没有源码的情况下)
- 如何查看服务器一个端口的占用情况(netstat -an)
- 手把手教你系列 - RN如何实现一个ExpandableList(可展开列表)组件
- 如何写一个正经的音乐播放器 四 意外情况
- 一个Action如何调用两个不同的方法
- 如何在没有tomcat情况下直接连接JMX监控JVM
- 如何将一个没有流量的站做到日20000 IP
- 发现一个Fragment没有走FragmentManager的registerFragmentLifecycleCallbacks的情况
- ATL之如何聚合一个组件