如何在SEAM中调用bean初始化链末尾的启动bean
14:00:04,449 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.servlet.characterEncodingFilter
14:00:04,450 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.redirectFilter
14:00:04,451 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.exceptionFilter
14:00:04,452 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.multipartFilter
14:00:04,452 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.identityFilter
14:00:04,453 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.rewriteFilter
这些是 JBoss SEAM 应用程序在 JBoss 6 上启动后打印的最后一组行
@Name("myStartup")
@Startup
@Scope(APPLICATION)
@BypassInterceptors
public class MyStartup {
@Create
public void create() {
System.out.println("SERVER STARTED SUCCESSFULLY");
}
}
。我的目的是在 SeamFilter 初始化后打印上述消息(在 JBoss 6 控制台上)。我该怎么做?
14:00:04,449 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.servlet.characterEncodingFilter
14:00:04,450 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.redirectFilter
14:00:04,451 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.exceptionFilter
14:00:04,452 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.multipartFilter
14:00:04,452 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.identityFilter
14:00:04,453 INFO [org.jboss.seam.servlet.SeamFilter] Initializing filter:
org.jboss.seam.web.rewriteFilter
These are the last set of lines which gets printed post the JBoss SEAM application startup on JBoss 6.
@Name("myStartup")
@Startup
@Scope(APPLICATION)
@BypassInterceptors
public class MyStartup {
@Create
public void create() {
System.out.println("SERVER STARTED SUCCESSFULLY");
}
}
My intention was to print the above message (on JBoss 6 console) after SeamFilter initializes. How should I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在普通组件上尝试此注释。删除该组件上的
@Startup
。You can try this annotation on a normal component. Remove the
@Startup
on this component.如果想法只是在所有接缝消息之后显示某些状态,则至少有两种方法:
第一种是使用 Shervin 的解决方案并抑制/conf/jboss-log4j.xml:
org.jboss.seam.servlet.Filter INFO
消息 < code>$JBOSS_HOME/server/或者实现一个过滤器:
If the idea is only to show some status AFTER all seam messages, there are at least 2 ways:
First is to use a Shervin's solution and suppress
org.jboss.seam.servlet.Filter INFO
messages in$JBOSS_HOME/server/<your-profile>/conf/jboss-log4j.xml
:Or implement a filter: