首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wicket + Atmosphere + Guice

Wicket + Atmosphere + Guice
EN

Stack Overflow用户
提问于 2013-03-01 23:34:52
回答 1查看 693关注 0票数 2

我正在尝试配置气氛,这就是我在EventBus上发布事件时得到的结果

代码语言:javascript
复制
java.lang.IllegalStateException: MeteorServlet not defined in web.xml
at org.atmosphere.cpr.Meteor.build(Meteor.java:170) ~[atmosphere-runtime-1.0.8.jar:1.0.8]
at org.atmosphere.cpr.Meteor.build(Meteor.java:151) ~[atmosphere-runtime-1.0.8.jar:1.0.8]
at org.atmosphere.cpr.Meteor.build(Meteor.java:137) ~[atmosphere-runtime-1.0.8.jar:1.0.8]
at org.atmosphere.cpr.Meteor.build(Meteor.java:124) ~[atmosphere-runtime-1.0.8.jar:1.0.8]
at org.apache.wicket.atmosphere.AtmosphereBehavior.onResourceRequested(AtmosphereBehavior.java:107) ~[wicket-atmosphere-0.7.jar:0.7]
... 56 common frames omitted

我使用Wicket,这是AjaxButton onSubmit实现:

代码语言:javascript
复制
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
      EventBus.get().post(message.getModelObject());
}

我正在使用Guice配置Atmosphere。在我的ServletModule实现中:

代码语言:javascript
复制
Map<String, String> params = new HashMap<String, String>();
            params.put("applicationClassName", "org.mycompany.MyWebApplication");
            params.put(ApplicationConfig.PROPERTY_SERVLET_MAPPING, "/session/**");
            params.put(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true");
            params.put(ApplicationConfig.WEBSOCKET_PROTOCOL, "org.atmosphere.websocket.protocol.EchoProtocol");
            params.put(ApplicationConfig.BROADCAST_FILTER_CLASSES, "org.apache.wicket.atmosphere.TrackMessageSizeFilter");
            filter("/session/**").through(AtmosphereFilter.class, params);

这是我的atmosphere.xml:

代码语言:javascript
复制
<atmosphere-handler context-root="/session/**"
    class-name="org.atmosphere.handler.ReflectorServletProcessor">
</atmosphere-handler>

我想以编程方式配置滤镜,我可以使用大气滤镜来实现吗?如果是,我做错了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-29 19:39:07

问题就解决了。使用MeteorServlet而不是AtmosphereFilter,那么就不需要atmosphere.xml了,你应该把WicketFilter初始化参数传递给MeteorServlet

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15161339

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档