-
1. Re: passing param in hasRole call from xhtml
gonorrhea May 27, 2009 7:37 PM (in response to gonorrhea)I misspoke. Both examples are passing one param in the EL for hasRole() call. Was referring to the Seam component method call inside the hasRole()...
-
2. Re: passing param in hasRole call from xhtml
gonorrhea May 27, 2009 7:41 PM (in response to gonorrhea)Why are all the hasRole() examples in the ref doc, SiA and Yuan books hard-coded?
Isn't it bad practice to be hard-coding role data in xhtml?
Imagine if you had a very large 100 page JSF/Seam app. And all the page- and component-level restrictions were hard-coded like that? What a pain it would be to refactor in case of requirements changes related to security/roles...
Is this addressed in Seam 2.1 or 3???
-
3. Re: passing param in hasRole call from xhtml
gonorrhea May 27, 2009 8:19 PM (in response to gonorrhea)Ok, nevermind. It was my mistake after all (as it usually is).
The TestSecurity class was not packaged in the JAR during the ant build. But....
Here is the server.log details regarding this component:
2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.core.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.transaction.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.framework.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.web.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.faces.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.international.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.theme.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.pageflow.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.bpm.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.jms.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.mail.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.security.testSecurity 2009-05-27 10:24:05,291 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.captcha.testSecurity
Note that the logging level is DEBUG. When a method is missing in a local interface that is impelemented by a SFSB/SLSB component, you see a facelets/JSF error report. I like that behavior better than what I just experienced with this missing JavaBean component.
@Seam dev core team: If there isn't a JIRA already for this, I recommend the logging level and exception handling for this be refactored/improved such that it's easier to notice that something critical (like an entire class!) is missing. There was no ERROR level logging in the server.log regarding this missing component which is bad IMO. Behavior similar to the facelet error for missing local interface method would be acceptable/helpful.