Tag: primefaces

使用PrimePush时出现NullPointerException

当我尝试初始化我的eventBus时,我得到一个NullPointerException: 位于sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)的sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)的de.mrsfinster.web.livefeed.bean.FeedBean.init(FeedBean.java:179)中的java.lang.NullPointerException在org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation $ SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:77)的java.lang.reflect.Method.invoke(未知来源)的sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源) org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:126)位于org.jboss.weld.interceptor的org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:102)。在org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler的org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:28)中的proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43)。 在de.mrsfinster.web.livefeed.bean.FeedBean上调用(CombinedInterceptorAndDecoratorStackMethodHandler.java:53)$ org.jboss.weld.interceptor.util.InterceptionUtils.executePostConstruct中的$ Proxy $ _ $$ _ WeldSubclass.lifecycle_mixin _ $$ _ postConstruct(未知来源) (InterceptionUtils.java:38)org.jboss.weld.interceptor.util.InterceptionUtils.executePostConstruct(InterceptionUtils.java:50)atg.jboss.weld.injection.producer.BeanInjectionTarget.postConstruct(BeanInjectionTarget.java:68)at at Org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:153)位于org.jboss.weld.context.AbstractContext的org.jboss.weld.util.bean.IsolatedForwardingBean.create(IsolatedForwardingBean.java:44)。在org.jboss.weld.context.PassivatingContextWrapper的$(AbstractContext.java:96)org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:742)中的org.jboss.weld.manager.BeanManagerImpl.java:742)中的org.jboss.weld.context.PassivatingContextWrapper $ AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:76) .jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:107)a t org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:90)at org.jboss.as.jsf.injection.weld.ForwardingELResolver.getValue(ForwardingELResolver.java:46)at javax.el.CompositeELResolver.getValue (CompositeELResolver.java:188)com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)at com.sun。 el.parser.AstIdentifier.getValue(AstIdentifier.java:116)at com.sun.el.parser.AstValue.getBase(AstValue.java:151)at com.sun.el.parser.AstValue.getTarget(AstValue.java: 170)在com.sun.el.parser.AstValue.invoke(AstValue.java:275)的com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)at org.jboss.weld.util.el.ForwardingMethodExpression .invoke(ForwardingMethodExpression.java:40)org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpress ion.java:40)at.com.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)at com.sun .faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128)at javax.faces.component.UIComponent $ ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2584)at javax.faces.event.SystemEvent.processListener (SystemEvent.java:108)位于com.sun.faces的com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2190)的javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)。 application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2135)at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:289)at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)在org.jboss.as.jsf.injection.weld.ForwardingApplication.publishEvent(ForwardingApplicatio) n.java:299)com.sun.faces.lifecycle.RenderponsePhase.exe执行(RenderResponsePhase.java:107)com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)com.sun.faces .lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)位于io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)的javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)位于org.wildfly.extension.undertow.security的io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)。 SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)在io.undertow.servlet.handlers.security.Serv letOuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)at […]

如何在jsf datatable中访问Map键

我收到错误javax.el.PropertyNotFoundException: /member/apps/cms/edit.xhtml @228,49 value=”#{props.key}”: Property ‘key’ not found on type java.util.HashMap$Values尝试显示下面的javax.el.PropertyNotFoundException: /member/apps/cms/edit.xhtml @228,49 value=”#{props.key}”: Property ‘key’ not found on type java.util.HashMap$Values时的javax.el.PropertyNotFoundException: /member/apps/cms/edit.xhtml @228,49 value=”#{props.key}”: Property ‘key’ not found on type java.util.HashMap$Values 。 这是我的contentEditorBacking的相关部分: @ManagedBean @ViewScoped public class ContentEditorBacking { private Map properties = new LinkedHashMap(); public Collection getProperties() throws Exception{ return properties.values(); } public static […]

Primefaces页面布局与树状菜单作为导航

我正在使用带有`的Primefaces 3.1,有四个位置。 在西部位置(西)我添加了树状菜单。 JSF代码如下 我在TreeBean中 root = new DefaultTreeNode(“Root”, null); TreeNode node0 = new DefaultTreeNode(“Color”, root); TreeNode node00 = new DefaultTreeNode(“Red”, node0); TreeNode node01 = new DefaultTreeNode(“Blue”, node0); TreeNode node02 = new DefaultTreeNode(“Green”, node0); 当我展开并单击其中一个节点并点击相应节点时,是否可以进行导航,如何在布局的中心位置显示jsf页面。 即如果我点击节点蓝色,理想情况下我想将另一个jsf页面加载到布局的中心位置。 任何帮助都非常值得赞赏。 谢谢 更新1 我添加了以下代码,它导航到start.xhtml。 但是start.xhtml不显示在我的布局中,start.xhtml显示为新页面。 public void onNodeSelect(NodeSelectEvent event) { try { System.out.println(” here ” + event.getTreeNode().getData()); FacesContext .getCurrentInstance() […]

Primefaces登录申请

可能重复: JSF HTTP会话登录 我使用Primefaces来实现我的Web应用程序。 在我的实现中,用户可以登录系统,然后他们可以通过复制该URL而无需再次登录来再次加载重定向的页面。 我怎么能阻止这个? 这是我的登录逻辑: public String doLogin() { if(username != null && username.equals(“admin”) && password != null && password.equals(“admin”)) { msg = “table?faces-redirect=true”; } else if(user_name.contains(username) && pass_word.contains(password) && !user_name.contains(“admin”)) { msg = “table1?faces-redirect=true”; } } return msg; }

如何在最后一个标签附近添加添加新标签的按钮?

有没有人知道如何添加一个按钮来添加位于最后创建的选项卡附近的新选项卡? 如果不清楚我的情况,只需查看浏览器中的选项卡和添加新选项卡的按钮;-)这正是我想要管理的内容。 我正在使用MyFaces + PrimeFaces。

在JSF中有一个“常量”类

我正在使用JSF / Primefaces构建一个Web应用程序。 我需要一个“常量”类,即一个由常量组成的类。 这些常量主要是将在整个应用程序中使用的导航命令。 我这样做的原因是为了避免在ad-hoc基础上实例化字符串。 我如何实现这一点,使得可以从支持bean和XHTML文件访问常量? 我已经尝试使用@ApplicationScoped并使用Singleton模式(Singleton类)但由于范围问题我无法使用它。 或许我只是使用错误的方法。 欢迎任何想法/建议。

JSF:当禁用组件时,其值不会进入请求映射参数。 有解决方法吗?

我有一个下拉列表p:selectonemenu和一个复选框p:selectbooleancheckbox ,当我选中复选框时,我想将selectonemenu设置为一个特定的值。 而且我不希望用户更改它,因此我将selectonemenu disabled属性设置为true 。 但是,当它被禁用时,它的值不会出现在请求参数映射中,当我执行facescontext.getcurrentinstance().getexternalcontext().getrequestparametermap() ,我需要它的值到这个映射。 有办法解决这个问题吗? 我将font-end写入遗留的Servlet系统,在那里他们使用请求映射参数来获取表单属性值。

Primefaces Picklist转换器

我使用的是Primefaces 4.0和JSF 2.2。 我使用了带转换器的选项列表。 问题是我在转换器中没有得到正确的arg2 。 它总是说0 。 我的期望是这是元素的id,我可以从源/目标列表中解析它。 有任何想法吗? 我的Converter的灵感来自如何为 编写自定义转换器 。 我的领料单声明如下: Alle Ladestellen Gewählte Ladestellen

登录后,在重新访问时自动登录JSF应用程序

对于典型的最典型的面向互联网的网站,当您通过关闭选项卡登录和离开网站时( 不登出 ),然后在连续重访时,您可能不需要重新指定您的凭据或登录,您直接登录。 如何在后端发生这一切? 如何在我的JSF 2.1应用程序上启用此类机制? 在Tomcat7服务器上使用JSF 2.1

如何获取公共Webcontent资源的InputStream?

我在WAR中打包了一组图像,并使用 在 描述它们。 图像位于/resources/icons文件夹中。 我希望能够在提交时选择图像并将此图像的副本保存到磁盘。 如何才能做到这一点? 如何获得此图像的引用( InputStream或其他)?