[JBoss-user] [JBoss Seam] - Re: Strange behavior using JSTL (MyFaces)
Thanks petemuir. using forEach works:) I still don't have clear the reason BTW... Does this has anything to do with the following? http://java.sun.com/products/jsp/reference/techart/unifiedEL.html In the dvd store example jstl tests access components' methods, while I was trying to use elements of a datamodel. This is the only difference I can see; I'm not sure of it at all but it makes sense to think that the h:dataTable element and the c:forEach are evaluated at different times... Is there any document out there describing when components and context variables are used in the different JSF phases? cheers Francesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3944130#3944130 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3944130 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Strange behavior using JSTL (MyFaces)
thanks for the answer, I finally have it clear! cheers Freancesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3944147#3944147 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3944147 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Strange behavior using JSTL (MyFaces)
sorry to pull this up... I've been struggling for a while on a similar problem, and I would like to figure out how seam context variables work. I can get the above working, given that the items come from a seam component, i.e declared with @Name. But I can't get the following working | h:dataTable var=section value=#{component.list} | h:column | c:forEach var=item items=#{section.item} | h:inputText value=#{item.text}/ | /c:forEach | /h:column | /h:dataTable | where template is a seam component, with a @Datamodel section. In this case the forEach is just ignored... I would apreciate if someone could shed some light on this, cheers Francesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3943781#3943781 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3943781 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Context variables for JSTL test
I've been stuck with this issue for a while now, without understanding if it's supposed to be like this or if I'm doing something wrong. I have a dataTable element, that lists questions of a survey. A stripped down version of it follows: | h:dataTable var=section value=#{template.sections} | h:column | h:outputText styleClass=schrift2 value=#{section.title}/ | h:dataTable var=question value=#{section.questions} | h:column | h:outputText value=#{question.text}/br/ | c:choose | c:when test=${question.radio} | !-- radio control here -- | h:outputText value=RADIO/ | /c:when | c:when test=${question.area} | !-- textarea here -- | h:outputText value=AREA/ | /c:when | c:otherwise | h:outputText value=UNKNOWN TYPE/ | /c:otherwise | /c:choose | /h:column | /h:dataTable | /h:column | /h:dataTable | I know I could be doing this through a custom component but I decided to try first the simple stuff. Basically I instantiate the Questionnaire template in my survey CV as follows | @Stateful | @Name(survey) | @Scope(ScopeType.CONVERSATION) | @Interceptors(SeamInterceptor.class) | public class SurveyAction implements Survey { | | Logger log = Logger.getLogger(Register.class); | | @PersistenceContext (type= PersistenceContextType.EXTENDED) | private EntityManager em; | | | @Out | private QuestionnaireTemplate template; | | @Create | public void init() { | ... | template = (QuestionnaireTemplate) em.createQuery(from QuestionnaireTemplate t where t.id=1).getSingleResult(); | quest = new Questionnaire(template); | } | ... | In the web page I just access the template sections, and for every section I list the related questions. What I'd like to achieve with the above is to have RADIO printed when the Question has type radio and so on. Right now the type implementation is baselined to | @Entity | public class Question implements Serializable { | ... | @Transient | public boolean isRadio(){ | log.info(this+ TYPE +type); | return type.equals(single); | } | | @Transient | public boolean isArea(){ | log.info(this+ TYPE +type); | return type.equals(textarea); | } | ... | } | | When I try to display the table, I always get UNKNOWN TYPE, and in the logs I see that isRadio() and isOpen() have not been called. Nevertheless if I add a method isRadio() to the Survey interface and replace the jstl test with | ... | c:when test=${survey.radio} | !-- radio control here -- | h:outputText value=RADIO/ | /c:when | ... | The test is executed correctly. Now, I can probably hack something up to get things working, but I wonder if this is just not supposed to be working like this. I mean, is it that I can use a registered CV for jstl tests but not an object used to iterate over a DataModel? thanks for any hint on this. cheers Francesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3942583#3942583 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3942583 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Security Framework w/Seam
Well, Acegi seems to have a JBoss adapter as well. Unfortunately I haven't had the time to look at it. But looking at it from another point of view: what is that j2ee security is lacking that you would need Acegi for? I'm no expert of Acegi but at a first glance it seems to address the same problems of the J2EE security components... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940081#3940081 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940081 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Dynamically generate form elements
Hi probably this is not a strictly Seam related question, but here it is... Displaying a form i need to display the proper input type (textarea, checkbox,radio etcetc) based on the type of the element. One possibility I see is to use for example jstl tags to create an if-else sequence. Given that the possible types are limited and fixed this doesn't seem to be a problem. Nevertheless it doesn't appeal me much, so I'd like to hear your opininon about this... Another possibility could be having a method like getFormElement(Type) that would add the element through | facesContext.getViewRoot().findComponent(theform).getChildren(); | ... | But doing this I loose readability of the page code, providing a flexibility that probably is not needed... Any hint? Cheers Francesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940122#3940122 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940122 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: Binding to a bean in a jsp page
Have you checked that the jstl implementation is within your classpath? if you use the jakarta impl. ensure that the standard.jar is there... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940149#3940149 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940149 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Dynamically generate form elements
Ok, I have been trying the jstl way... Nevertheless I have been running into the following problem: In my jsp I have | %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % | ... | | h:dataTable var=question value=#{section.questions} | h:column | h:outputText value=#{question.text}/br | c:choose | | c:when test=${question.radio} | h:selectOneRadio value=#{register.selection[question]} required=true | layout=pageDirection | f:selectItems value=#{question.answerTypes}/ | /h:selectOneRadio | /c:when | c:otherwise | h:outputText value=#{question.type}/ | /c:otherwise | /c:choose | /h:column | /h:dataTable | and actually question.isRadio() returns true. The problem is that it always takes the otherwise branch. I don't really understand what's the problem, it's almost the same that the dvd example does (same libraries as well). Can it be of me using jsps instead of facelets? Is it supposed to matter anyway? Thanks for any hint on this! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940153#3940153 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940153 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Security Framework w/Seam
perwik wrote : | I don't understand. How is what you are describing different to @RolesAllowed in EJB3? | | @RolesAllowed(ContentAdmin) | public void doSomething() {} | would only let you check if the current user belongs to one of the groups (roles) that you allow to access that method (in this case ContentAdmin). This would require that you have all roles defined at compile time. I don't want that at all. I want | @RequiredPermission(name=ContentPermission type=read) | public void doSomething() {} | And then I'm free to create groups, put users into them and assign permissions to those groups as needed at runtime. This would allso make it possible to do something like | authz:acl domainObject=${content} hasPermission=read | Only show this if the user is authorized to see it. | /authz:acl | (This was taken from the Acegi Reference Guide) All of this is very possible to do with JAAS, but it looks like some things are still missing in JBoss Security. I'm not saying that we should use Acegi instead of JAAS, I didn't even know Acegi existed until yesterday when I read this thread. Well, AFAIK what you are talking about is the difference between logical and application roles. ContentAdmin is a role known to the application, configured with | security-role | descriptioncontent admin/description | role-nameContentAdmin/role-name | /security-role | and used like | method-permission | role-nameContentAdmin/role-name | method | ... | /method | /method-permission | | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940156#3940156 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940156 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Security Framework w/Seam
Sorry for the bad formatting:S I was adding that if using JAAS, your LoginModule is responsible of mapping principals coming from your identity manager to the application roles. Cheers Francesco View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940157#3940157 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940157 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Security Framework w/Seam
Using seam doesn't prevent you using standard j2ee security models. You can plug JAAS security domains trasparently for example. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3939782#3939782 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3939782 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Seam Architectural Questions
This is a topic I have been thinking of opening as well. It is still unclear to me to which extent using Seam pays off when you have to deal with multiple presentations for example. I would like to see something like sun's blueprints for scoping and injecting Seam into a layered application. For example from one side it is appealing to annotate a data model to use it directly in the presentation, but conceptually the data model should remain independent from higher level layers. I agree, annotations are not as intrusive as interfaces but they still create dependencies. Personally I find diffucult to estimate costs and benefits for technologies like Seam for anything more than really simple contexts View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3939790#3939790 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3939790 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Re: Cant use EntityManager into Converter
anonymous wrote : | Quote: | Actually I did this since I hadn't managed to get the Converter working through faces-config.xml...Is this supposed to be so? | | | I don't understand. I mean that I wasn't able to use the Converter by registering it with | converter | converter-for-classorg.jboss.seam.example.registration.Answer/converter-for-class | converter-classorg.jboss.seam.example.registration.AnswerConverter/converter-class | /converter | So I had to specify the converter with the converter attribute | h:selectOneMenu value=#{register.answer} converter=#{ansbean.converter} | ... | /h:selectOneMenu | And I don't understand why... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3939441#3939441 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3939441 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss Seam] - Cant use EntityManager into Converter
Hi there I'm experimenting a bit with seam, but I'm currently stuck on this issue... I building a simple questionaire page; one has a list of questions with radio answers. In order to display answers like: | h:column | f:facet name=Answer | h:outputText value=Answers/ | /f:facet | h:selectOneRadio value=#{question.selectedAnswer} converter=#{ansbean.converter} | f:selectItems value=#{question.answerMap} / | /h:selectOneRadio | /h:column | I had to write a converter bean, along the lines of the one in the dvd store example. This is basically | | @Stateful | @Name(ansbean) | @Scope(ScopeType.APPLICATION) | @Interceptors(SeamInterceptor.class) | public class AnswersBean implements Answers { | | Logger log = Logger.getLogger(Register.class); | ListAnswer answers; | MapString, Answer answersMap; | | @PersistenceContext(type=EXTENDED) | EntityManager em; | | @Create | public void loadData(){ | //load some stuff from db | } | public Converter getConverter() { | return new AnswerConverter(em); | } | | static public class AnswerConverter implements Converter, Serializable { | | Logger log = Logger.getLogger(AnswerConverter.class); | private EntityManager em; | | public AnswerConverter(EntityManager em) { | this.em = em; | } | | public Object getAsObject(FacesContext facesContext, | UIComponent uiComponent, | String value) throws ConverterException { | | if ((value == null) || value.length() == 0) { | return null; | } | | log.info(INTO CONVERTER Asobject()); | | int id = Integer.valueOf(value).intValue(); | | Answer ret = null; | ret = (Answer) em.createQuery(from Answer where id=?).setParameter(0,id).getSingleResult(); | return ret; | } | | public String getAsString(FacesContext facesContext, | UIComponent uiComponent, | Object object) throws ConverterException { | if (object == null) return null; | | return String.valueOf(((Answer) object).getId()); | | } | } | } | | In my Question entity bean (one to many relationship with Answer) I have created an helper method like | | @Transient | public MapString, Answer getAnswerMap(){ | MapString, Answer results = new TreeMapString, Answer(); | | for (Answer answer : answers) { | result.put(answer.getText(), answer); | } | | answerMap = results; | return answerMap; | } | | The page loads the questionaire fine, but when I submit it I get the following trace: | | 11:32:32,734 ERROR [AnswersBean$AnswerConverter] java.lang.NullPointerException | 11:32:32,734 ERROR [STDERR] java.lang.NullPointerException | 11:32:32,735 ERROR [STDERR] at org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:59) | 11:32:32,736 ERROR [STDERR] at org.jboss.ejb3.entity.ExtendedEntityManager.createQuery(ExtendedEntityManager.java:129) | 11:32:32,736 ERROR [STDERR] at org.jboss.seam.example.registration.AnswersBean$AnswerConverter.getAsObject(AnswersBean.java:104) | 11:32:32,736 ERROR [STDERR] at org.apache.myfaces.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:658) | 11:32:32,736 ERROR [STDERR] at org.apache.myfaces.renderkit.html.HtmlRadioRendererBase.getConvertedValue(HtmlRadioRendererBase.java:288) | 11:32:32,737 ERROR [STDERR] at javax.faces.component.UIInput.getConvertedValue(UIInput.java:289) | 11:32:32,737 ERROR [STDERR] at javax.faces.component.UIInput.validate(UIInput.java:265) | 11:32:32,737 ERROR [STDERR] at javax.faces.component.UIInput.processValidators(UIInput.java:144) | 11:32:32,738 ERROR [STDERR] at javax.faces.component.UIData.process(UIData.java:514) | 11:32:32,738 ERROR [STDERR] at javax.faces.component.UIData.processColumnChildren(UIData.java:498) | 11:32:32,738 ERROR [STDERR] at javax.faces.component.UIData.processValidators(UIData.java:403) | 11:32:32,738 ERROR [STDERR] at javax.faces.component.UIForm.processValidators(UIForm.java:68) | 11:32:32,739 ERROR [STDERR] at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417) | 11:32:32,739 ERROR [STDERR] at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:142) | 11:32:32,739 ERROR [STDERR] at
[JBoss-user] [JBoss Seam] - Re: Cant use EntityManager into Converter
anonymous wrote : | What happens if you use: | | Code: | | @PersistenceContext | EntityManager em; | | | | And remove (type=EXTENDED)? | It fails similarly, the same NullPointerException | at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getNonTxEntityManager(ManagedEntityManagerFactory.java:58) | Should I wrap a testcase including the seam components? About the SFSB: I did it this way having looked at the CategoriesBean class in the dvd store example app... Actually I did this since I hadn't managed to get the Converter working through faces-config.xml...Is this supposed to be so? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3939249#3939249 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3939249 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user