在servlet中调用seam组件步骤
1、在components.xml中,增加
2、在servlet中,即可使用
3、注意web.xml中的配置url-pattern
参考:
[url=http://blog.csdn.net/bq_cui/archive/2007/05/23/1622455.aspx]http://blog.csdn.net/bq_cui/archive/2007/05/23/1622455.aspx[/url]
1、在components.xml中,增加
<web:context-filter url-pattern="*.servlet"/>
2、在servlet中,即可使用
User user = (User) Component.getInstance("user");
3、注意web.xml中的配置url-pattern
参考:
[url=http://blog.csdn.net/bq_cui/archive/2007/05/23/1622455.aspx]http://blog.csdn.net/bq_cui/archive/2007/05/23/1622455.aspx[/url]