[jboss-user] [JBoss Seam] - Re: OSGI Plans
Gavin, Has your plans in regards to OSGi progressed any? Just curious. We have current need for a pluggable JBoss Seam web application as a frontend to a commercial mapping engine. JBoss Seam (RichFaces) with Eclipse Equinox OSGi implementation is the proposed architecture. Thanks for Seam--it is really nice work. Jeff View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049738#4049738 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049738 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam Security: isUserInRole() expression
>From my experience (and from this posting) this code does not work on the >frontend. The documentation is incorrect. Allows JSF pages to choose to render a control, depending upon the roles available to the current principal. . you have to use (this does works) rendered="#{s:hasRole('admin')}" View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037720#4037720 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037720 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam Security: isUserInRole() expression
Shane, This is working. The problem was with the SeamFaceletViewHandler. It is required to do the Seam Security using s:hasRole('admin'). That was documented. It appears to require a different format for the JSP pages as follows: ( it likes the | http://java.sun.com/JSP/Page"; | xmlns:h="http://java.sun.com/jsf/html"; | xmlns:f="http://java.sun.com/jsf/core"; | xmlns:s="http://jboss.com/products/seam/taglib"; | xmlns="http://www.w3.org/1999/xhtml"; | version="2.0"> | http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> | | | previously it was: <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %> | <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %> | <%@ taglib uri="http://jboss.com/products/seam/taglib"; prefix="s" %> | <%@ taglib uri="http://jboss.com/products/seam/entityconverter/taglib"; prefix="ec"%> | | http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> | http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036407#4036407 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036407 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam Security: isUserInRole() expression
Thanks Shane, I know this is a configuration issue, either a wrong version of a jar file for something. It should be simple but it is driving me nuts. Do you know of a working example that uses s:hasRole? I tried s:hasRole('admin') as follows and it throws the following exception when I hit that page. Is it using the same Seam taglib or do I have to add a new taglib? | 10:13:42,030 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception | javax.faces.el.EvaluationException: Cannot get value for expression '#{s:hasRole('admin')}' | at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402) | at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075) | at javax.faces.webapp.UIComponentTag.isSuppressed(UIComponentTag.java:884) | at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:313) | at org.apache.jsp.logon_jsp._jspx_meth_h_selectOneMenu_0(logon_jsp.java:311) | at org.apache.jsp.logon_jsp._jspx_meth_h_form_0(logon_jsp.java:245) | at org.apache.jsp.logon_jsp._jspx_meth_f_view_0(logon_jsp.java:152) | at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:97) | at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) | at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) | at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) | at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416) | at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234) | at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59) | at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) | at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) | at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) | at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) | at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) | at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) | at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(Maste
[jboss-user] [JBoss Seam] - Seam Security: isUserInRole() expression
What is required to use isUserInRole() to control component rendering as follows: rendered="#{isUserInRole['admin']}" Any help is very much appreciated. This check is always returning false even though I am sure the user has the "admin" role. At least I can see the role being added to the Identity bean in my Authenticator bean. System.out.println("User: " + Identity.instance().getUsername() + " Adding Role: " + userRole.getRole()); | Identity.instance().addRole(userRole.getRole()); | Output From my Authenticator bean: 15:26:32,301 INFO [STDOUT] User: constant Adding Role: admin | 15:26:32,301 INFO [STDOUT] User: constant Adding Role: user | I think the authenticator.authenticate is working properly because I can use the rendered="#{identity.loggedIn}" successfully. However, I cannot get the isUserInRole() function to work. My Environment: 1. jboss-seam-1.2.1.GA 2. jboss-4.0.5.GA AS with EJB3 profile 3. Seam Security "simplified mode" - this mode supports authentication services and simple role-based security checks. Components.xml | | http://jboss.com/products/seam/components"; | xmlns:core="http://jboss.com/products/seam/core"; | xmlns:security="http://jboss.com/products/seam/security"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xmlns:framework="http://jboss.com/products/seam/framework"; | xsi:schemaLocation= | "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd | http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd | http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.2.xsd | http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd";> | | | | | true | seamapp/#{ejbName}/local | | | java:/seamappEntityManagerFactory | | | | | | | | | Authenticator Bean package com.cox.edm; | | import java.util.List; | | import javax.ejb.Stateless; | import javax.persistence.EntityManager; | import javax.persistence.NoResultException; | import javax.persistence.Query; | | import org.jboss.seam.annotations.In; | import org.jboss.seam.annotations.Name; | import org.jboss.seam.core.FacesMessages; | import org.jboss.seam.security.Identity; | | @Name("authenticator") | public class Authenticator { | | @In(create = true) | private EntityManager entityManager; | | public boolean authenticate() { | try | { | Query query = entityManager.createQuery("from EdmUsers where user_id = :userid and password = :password"); | query.setParameter("userid", Identity.instance().getUsername()); | query.setParameter("password", Identity.instance().getPassword()); | EdmUsers user = (EdmUsers) query.getSingleResult(); | | query = entityManager.createQuery( "from EdmUserRoles where user_id = :userid "); | query.setParameter("userid", Identity.instance().getUsername() ); | List list = (List)query.getResultList(); | | if (list != null) | { | for (EdmUserRoles userRole : list){ | System.out.println("User: " + Identity.instance().getUsername() + " Adding Role: " + userRole.getRole()); |Identity.instance().addRole(userRole.getRole()); | } | } | | return true; | } | catch (NoResultException ex) | { | FacesMessages.instance().add("Invalid username/password"); | return false; | } | | } | | } My Logon.jsp <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %> | <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %> | <%@ taglib uri="http://jboss.com/products/seam/taglib"; prefix="s" %> | http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> | http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> | | | | | | | @import "style/default/screen.css"; | | | | | | | | | | <%@ include file="/menu.jsp" %> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036102#4036102 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&m
[jboss-user] [JBoss Seam] - Re: Cannot find the entityconverter taglib
It is working fine now. It was the Hibernate mapping. Thank you very much for you help with this issue. I have a working example of a seam-gen application enhanced with and your entity converter. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028279#4028279 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028279 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Cannot find the entityconverter taglib
I have this working except for one problem. I get my populated in the "create form" but some "250-char-serialized-string" is save in the database for my "car" column. I am sure I am missing a converter somewhere but I don't know what or where it goes. Your entityConverter works great. It takes my Entity ( SeamtestCars ) and builds the correct options as string. I am guessing hibernate is controlling the insert/update and it is not converting my "car" column to a string before inserting. Am I way off base? Any suggestion? Situation SEAM-GEN application with 2 tables: ( no foreign-key enabled ) Oracle Database 9i 1. SEAMTEST ( column called car ) PK= ID | 2. SEAMTEST_CARS ( id ) PK = ID | I have added the code as suggested in your example. IN: components.xml | | IN: Seamtest.java @ManyToOne | private SeamtestCars car = new SeamtestCars(); | |getters and setters | IN: editSeamtest.jsp | | | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028138#4028138 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028138 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Cannot find the entityconverter taglib
Thanks, I will wait until Monday sometime. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026182#4026182 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026182 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Cannot find the entityconverter taglib
Thanks for the quick response. I am very new to SEAM and I thought I was losing my mind tonight. This seams like a very nice solution for pick list in my application. 1. Do you know your estimated time to have this in in SEAM? Off-topic: Do you know if there is any discussion of integrating this TAGLIB into SEAM-GEN? I am trying to do this manually but it would be very nice if SEAM-GEN could pick up foreign-key constraints and automatically build list for those columns...or at least provide a "meta" data way to define list at generation time. Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026172#4026172 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026172 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Cannot find the entityconverter taglib
I am confused. Any help is greatly appreciated. Using entityconverter-0.1 I am trying to follow instructions in "http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamEntityConverter"; Did this URI change? Top of my JSP page: <%@ taglib uri="http://jboss.com/products/seam/entityconverter/taglib"; prefix="ec"%> JBoss 4.0.5.GA throws the following exception when I hit that page: 22:19:09,068 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: The absolute uri: http://jboss.com/products/seam/entityconverter/taglib cannot be resolved in either web.xml or the jar files deployed with this application at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114) at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316) at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:147) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1556) at org.apache.jasper.compiler.Parser.parse(Parser.java:126) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234) at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)