[JBoss Seam] - Re: Evaluation of action attibute in s:link
by dmitriy.lapko
I'm not sure it is a problem of Seam. It is a limitation of JSF EL. You cannot construct JSF EL dynamically - that is what you would like to have. You cannot have nasted EL constructions.
I just cannot understand, how would you like to fix this limitation - it will break the logic of EL, if you can use JSF page variable to construct expression. For me the problem is in specific logic you would like to have only for action attribute - don't you want this feature for ALL EL expressions?
For example:
| <s:link value="#{curLocale.label}" action="#{localeSelector.selectLanguage(curLocale.value)}"/>
|
If you would like to have the feature you posted in JIRA, then the parser of EL should try to check, is localeSelector also a page variable.
Or in case there is curLocale component in the session scope, what should be done?
Seam doesn't provide it's own parser of expressions, it uses standard but almost everewhere (that is cool :)).
As for me, nested EL can be another powerful feature, which can help new developers to avoid such mistakes - they will be able to construct expressions dynamically with respect to current context, like:
| <s:link value="#{curLocale.label}" action="#{localeSelector.selectLanguage(#{curLocale.value})}"/>
|
But may be it would just make the code more complicated. The decision with <f:param is more clear, you should just to know it and not to try to do what we did with you.
Hope, this topic is closed :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068156#4068156
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068156
18Â years, 9Â months
[Messaging, JMS & JBossMQ] - How to connect to a secured queue from MDB?
by jsnhsu
I've asked this question weeks ago but didn't get any reply. Please help!
I have a secured queue which was configured correctly since I can read the messages from a jms client by creating the connection with username/password . Now I need to have a MDB to read it. I really don't know how to do it. I have the following annotation in the MDB:
| @MessageDriven(mappedName = "jms/QueueListner", activationConfig = {
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")
| ,@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
| ,@ActivationConfigProperty(propertyName="destination", propertyValue="/queue/test")
| ,@ActivationConfigProperty(propertyName="providerAdapterJNDI", propertyValue="java:/DefaultJMSProvider")
| // ,@ActivationConfigProperty(propertyName="user", propertyValue="qreader")
| // ,@ActivationConfigProperty(propertyName="pass", propertyValue="qpassword")
| })
|
The two remarked lines were added by myself. But I don't know the property name keywords of username/password.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068154#4068154
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068154
18Â years, 9Â months
[JBoss Seam] - Re: @DataModelSelection and ClassCastException
by yohann49
I begin to see that i've done all that stuff in a pretty wrong way.
The factory on "lines" returns what it is used by JSF to display the lines. The DataModel were not used to outject lines, or used in a wrong way.
I changed a bit my code and get rid of the factory.
Now, the Datamodel is well outjected, and the DataModelSelection is well injected.
I've got a little problem, however. When I click on the line to select it (an <s:link> with the actionMethod selectline()), it would normally send me to another page, displaying another list.
But the page stays the same, and i have no exception sent.
I show you my new code :
pages.xml :
| <page view-id="/client_prod">
| <navigation from-action="#{LineManager.selectLine(line)}">
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/client_m.xhtml"/>
| </rule>
| </navigation>
| </page>
|
LineManager.java :
| @Stateful
| @Name("LineManager")
| @Scope(SESSION)
| public class LineManager implements LineManagerLocal, Serializable {
|
| @In
| private EntityManager em;
|
| @DataModel("lines")
| List<OrderLine> lines;
|
|
|
| @DataModelSelection("lines")
| private OrderLine currentOrderLine;
|
|
| @Out
| private Order myOrder;
|
| public List<OrderLine> findlines(){
| lines=myOrder.getOrderLines();
| return lines;
| }
| @Factory(value="servs",scope=SESSION)
| public List<Server> searchServers(){
| return currentOrderLine.getServers();
| }
| @Begin(join=true)
| public void viewParameters(Order order){
| myOrder=em.merge(order);
| System.out.println("on rentre dans le line manager");
| findlines();
| }
| public List<OrderLine> getLines(){
| return lines ;
| }
| @Begin(join=true)
| public void selectLine(Long id){
| //currentOrderLine=em.find(OrderLine.class,id);
| }
| public OrderLine getCurrentOrderLine() {
| return currentOrderLine;
|
| }
| public void setCurrentOrderLine(OrderLine currentOrderLine) {
| this.currentOrderLine = currentOrderLine;
| }
| @Remove @Destroy
| public void destroy(){
| }
| public Order getMyOrder() {
| return myOrder;
| }
| public void setMyOrder(Order myOrder) {
| this.myOrder = myOrder;
| }
|
| }
|
the code is a bit messy, since i made several tests. i'll make it up later, when i find a solution to my problem.
Thanks to those who read that
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068149#4068149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068149
18Â years, 9Â months