FacesMessage with severity ERROR do not prevent calling an action method
Hi, I am using myfaces 1.1, icefaces 1.8.1 on WAS 6.0 The controller (backing bean) action methods handle RuntimeException from the service layer. Depending on the exception an exception handler will put an appropriate message into FacesContext. For that I have created a utility method: public static void putMessage(String key, Severity severity, String summary, String detail) { FacesContext.getCurrentInstance().addMessage(key, new FacesMessage(severity, summary, detail)); } In the controller this method is used to put messages. When the page is displayed the messages appear properly. However when a user clicks on a commandButton then the control goes to the action method bound to the commandButton. This should not happen because there are FacesMessages with FacesMessage.SEVERITY_ERROR. I checked immediate=true has not been set on the commandButton component. Is my understanding not correct that if there are FacesMessages with Severity = SEVERITY_ERROR in the FacesContext then the invoke application phase will not happen and the control would come back to the current page in error? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: FacesMessage with severity ERROR do not prevent calling an action method
True, you are right. The problem was that the first request goes as an AJAX request submitting on a part of the form. If there are errors, messages are shown. Now the user clicks on any other control which submits the rest of the page barring the one which was previously submitted. That caused the action to be executed as expected because that part of the page is never submitted. Sorry for the confusion and thanks a lot for your response. Regards, Madhav From: Michael Kurz [mailto:michi.k...@gmx.at] Sent: Wednesday, January 20, 2010 7:05 PM Hi, for clearification: does the click on the command button take place AFTER the page with the error messages was rendered? Because if it is so, this is the expected behavior. The messages in the FacesContext are only available for the current request, which is the one producing the error. If you click on a command button on this page a new request with a new FacesContext is started. Unless this produces the same error the messages will be gone. regards Michael Madhav Bhargava schrieb: Hi, I am using myfaces 1.1, icefaces 1.8.1 on WAS 6.0 The controller (backing bean) action methods handle RuntimeException from the service layer. Depending on the exception an exception handler will put an appropriate message into FacesContext. For that I have created a utility method: public static void putMessage(String key, Severity severity, String summary, String detail) { FacesContext.getCurrentInstance().addMessage(key, new FacesMessage(severity, summary, detail)); } In the controller this method is used to put messages. When the page is displayed the messages appear properly. However when a user clicks on a commandButton then the control goes to the action method bound to the commandButton. This should not happen because there are FacesMessages with FacesMessage.SEVERITY_ERROR. I checked immediate=true has not been set on the commandButton component. Is my understanding not correct that if there are FacesMessages with Severity = SEVERITY_ERROR in the FacesContext then the invoke application phase will not happen and the control would come back to the current page in error? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: FacesMessage with severity ERROR do not prevent calling an action method
Hi Volkar, Thanks for your response. I will add that to the method so that it does not have to be explicitly done by the developers in their action methods. From: weber.vol...@googlemail.com [mailto:weber.vol...@googlemail.com] On Behalf Of Volker Weber Hi Madhav, the livecycle did not depend on messages in the context. To prevent executing actions and direct skip to renderPhase you need to call FacesContext.getCurrentInstance().renderResponse(); e.g. in your putMessage() method. Regards, Volker 2010/1/20 Madhav Bhargava madhav_bharg...@infosys.com: Hi, I am using myfaces 1.1, icefaces 1.8.1 on WAS 6.0 The controller (backing bean) action methods handle RuntimeException from the service layer. Depending on the exception an exception handler will put an appropriate message into FacesContext. For that I have created a utility method: public static void putMessage(String key, Severity severity, String summary, String detail) { FacesContext.getCurrentInstance().addMessage(key, new FacesMessage(severity, summary, detail)); } In the controller this method is used to put messages. When the page is displayed the messages appear properly. However when a user clicks on a commandButton then the control goes to the action method bound to the commandButton. This should not happen because there are FacesMessages with FacesMessage.SEVERITY_ERROR. I checked immediate=true has not been set on the commandButton component. Is my understanding not correct that if there are FacesMessages with Severity = SEVERITY_ERROR in the FacesContext then the invoke application phase will not happen and the control would come back to the current page in error? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- inexso - information exchange solutions GmbH Bismarckstraße 13 | 26122 Oldenburg Tel.: +49 441 4082 356 | FAX: +49 441 4082 355 | www.inexso.de
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Sorry for the delay in response. The spring security filters are not invoked at all when a JSF forward happens. What we have done as a workaround is that login page has now been made a simple non JSF JSP. We redirect from login page to another page which is just a dummy page. This redirect causes spring security to set up SecurityContext properly. So we are able to use spring security component level authorizations properly. However the URL level authorization is still an issue. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Can you sort out if the filter itself is not called or if the filter behaves wrong? 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yeah this is the place. Back to the problem. I still cannot come up with a workaround :( From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr The magic happens in JspViewHandlerImpl's renderView() method: public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { externalContext.dispatch(viewId); } Regards, Jakob 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yes, I am not using facelets. I had a look at the NavigationHandlerImpl and here is the excerpt from it: Method: handleNavigation if (navigationCase != null) { if (log.isTraceEnabled()) { log.trace(handleNavigation fromAction= + fromAction + outcome= + outcome + toViewId = + navigationCase.getToViewId() + redirect= + navigationCase.isRedirect()); } if (navigationCase.isRedirect() (!PortletUtil.isPortletRequest(facesContext))) { // Spec section 7.4.2 says redirects not possible in this case for portlets ExternalContext externalContext = facesContext.getExternalContext(); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String redirectPath = viewHandler.getActionURL(facesContext, navigationCase.getToViewId()); try { externalContext.redirect(externalContext.encodeActionURL(redirectPath)); } catch (IOException e) { throw new FacesException(e.getMessage(), e); } } else { ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); //create new view String newViewId = navigationCase.getToViewId(); UIViewRoot viewRoot = null; if (isPartialStateSavingOn(facesContext)) { viewRoot = viewHandler.restoreView(facesContext,newViewId); } else { viewRoot = viewHandler.createView(facesContext, newViewId); } facesContext.setViewRoot(viewRoot); facesContext.renderResponse(); } In the above code, redirect happens properly however for a forward there is no RequestDispatcher.forward or ExternalContext.dispatch called. So I do not know where a forward happens. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Hi Tomasz, That's all correct! However, I don't think he is using Facelets, because he mentioned JSP-pages... Regards, Jakob 2010/1/12 Tomasz Pasierb tompa...@poczta.fm Hi, as I understand you use a commandButton and as a result a different page (a secured one) is rendered but spring security does not seem to intercept the url, is that right? If so and if the solution used by you uses Facelets then this may be the problem. When using Facelets as opposed to pure (older) jsf+jsp approach there is no forward when a new view is rendered that is a result of a navigation case forward. I've been investigating this recently. When JSP view handler is used it checks which view should be rendered next and does a forward to this new view which spring security can intercept. The Facelet view handler however seems to load the view (xhtml) and render it without making the actual forward. As a result no interception can happen and usually it is triggered with the next request. You need to either use redirects or make GET requests to logically separate views - I know this is not natural with jsf versions prior to 2.0, but this new spec seems to change everything :-) - use can easily generate GET requests with the new version. Hope this helps ;) Regards, Tom Pasierb Madhav Bhargava pisze: Hi All, I am using myfaces 1.1, icefaces 1.8.1
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Sorry for the confusion. There was some problem with log4j configuration on WAS 6 and therefore I was not able to generate DEBUG logs out of spring security. The issue turned out to be a ws-commons-logging.jar. Anyways back to the issue: In the log it shows that the filter is actually getting called but with an older URL. So the spring security filter configuration is fine but now it’s the problem only with JSF. The jsp:forward thing works fine as I am doing a forward from index.jsp to login.jsp If you want the DEBUG logs then I can provide them. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr »The spring security filters are not invoked at all when a JSF forward happens.« Then the issue has to be a misconfiguration problem, because a normal filter is called for the JSF forward (I tested that). However, I don't know spring security filters well enough to point out what the real problem is. sorry! 2010/1/18 Madhav Bhargava madhav_bharg...@infosys.com Sorry for the delay in response. The spring security filters are not invoked at all when a JSF forward happens. What we have done as a workaround is that login page has now been made a simple non JSF JSP. We redirect from login page to another page which is just a dummy page. This redirect causes spring security to set up SecurityContext properly. So we are able to use spring security component level authorizations properly. However the URL level authorization is still an issue. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Can you sort out if the filter itself is not called or if the filter behaves wrong? 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yeah this is the place. Back to the problem. I still cannot come up with a workaround :( From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr The magic happens in JspViewHandlerImpl's renderView() method: public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { externalContext.dispatch(viewId); } Regards, Jakob 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yes, I am not using facelets. I had a look at the NavigationHandlerImpl and here is the excerpt from it: Method: handleNavigation if (navigationCase != null) { if (log.isTraceEnabled()) { log.trace(handleNavigation fromAction= + fromAction + outcome= + outcome + toViewId = + navigationCase.getToViewId() + redirect= + navigationCase.isRedirect()); } if (navigationCase.isRedirect() (!PortletUtil.isPortletRequest(facesContext))) { // Spec section 7.4.2 says redirects not possible in this case for portlets ExternalContext externalContext = facesContext.getExternalContext(); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String redirectPath = viewHandler.getActionURL(facesContext, navigationCase.getToViewId()); try { externalContext.redirect(externalContext.encodeActionURL(redirectPath)); } catch (IOException e) { throw new FacesException(e.getMessage(), e); } } else { ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); //create new view String newViewId = navigationCase.getToViewId(); UIViewRoot viewRoot = null; if (isPartialStateSavingOn(facesContext)) { viewRoot = viewHandler.restoreView(facesContext,newViewId); } else { viewRoot = viewHandler.createView(facesContext, newViewId); } facesContext.setViewRoot(viewRoot); facesContext.renderResponse(); } In the above code, redirect happens properly however for a forward there is no RequestDispatcher.forward or ExternalContext.dispatch called. So I do not know where a forward happens. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Hi Tomasz, That's all correct! However, I don't think he is using Facelets, because he mentioned JSP-pages... Regards, Jakob 2010/1/12 Tomasz Pasierb tompa...@poczta.fm Hi, as I understand you use a commandButton and as a result a different page (a secured one) is rendered
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
No problems Jakob. I really appreciate the time you have already spent. If I come up with a solution then I will post it on this forum. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Sent: Monday, January 18, 2010 4:42 PM I'm really sorry, but I can't figure out the problem. Maybe anyone else could take a look at this log... 2010/1/18 Madhav Bhargava madhav_bharg...@infosys.com Attached is the log file. Look for lined which have (URLInterceptor.java) This will give you the URL that has been intercepted by the custom filter which sits before any spring filter. Right now all it does is print out the URL that it intercepted. To refresh your memory here is the flow again in brief: 1. *http://localhost:9080/contextRoot/*http://localhost:9080/contextRoot/is invoked and it internally it redirects it to the welcome page (/index.jsp) 2. index.jsp does a jsp:forward to /login.jsp 3. User enters the credentials and as of now since we do not have Siteminder for authentication the action attribute points to /jsp/secure/hprelanding.jspx (first JSF page) so a redirect is send. 4. On hprelanding page an automatic click happens on a hidden command button which calls a backing bean action method. Since I am using icefaces the click of a button request is sent using the URL: * http://localhost:9080/HPRE/block/**send-receive-updates*http://localhost:9080/HPRE/block/send-receive-updates 5. You will find many other URL's in between which is all caused by icefaces. 6. The action method will do nothing but forward the request to operationlanding.jspx page which should only be visible to users who have ROLE_OPERATIONS however that URL never comes up. Instead the next URL of importance is again hprelanding.jspx one. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.comsethfromaust...@gmail.com] On Behalf Of Jakob Korherr Sent: Monday, January 18, 2010 3:45 PM It would be great to see some logs! 2010/1/18 Madhav Bhargava madhav_bharg...@infosys.com Sorry for the confusion. There was some problem with log4j configuration on WAS 6 and therefore I was not able to generate DEBUG logs out of spring security. The issue turned out to be a ws-commons-logging.jar. Anyways back to the issue: In the log it shows that the filter is actually getting called but with an older URL. So the spring security filter configuration is fine but now it’s the problem only with JSF. The jsp:forward thing works fine as I am doing a forward from index.jsp to login.jsp If you want the DEBUG logs then I can provide them. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.comsethfromaust...@gmail.com] On Behalf Of Jakob Korherr »The spring security filters are not invoked at all when a JSF forward happens.« Then the issue has to be a misconfiguration problem, because a normal filter is called for the JSF forward (I tested that). However, I don't know spring security filters well enough to point out what the real problem is. sorry! 2010/1/18 Madhav Bhargava madhav_bharg...@infosys.com Sorry for the delay in response. The spring security filters are not invoked at all when a JSF forward happens. What we have done as a workaround is that login page has now been made a simple non JSF JSP. We redirect from login page to another page which is just a dummy page. This redirect causes spring security to set up SecurityContext properly. So we are able to use spring security component level authorizations properly. However the URL level authorization is still an issue. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.comsethfromaust...@gmail.com] On Behalf Of Jakob Korherr Can you sort out if the filter itself is not called or if the filter behaves wrong? 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yeah this is the place. Back to the problem. I still cannot come up with a workaround :( From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.comsethfromaust...@gmail.com] On Behalf Of Jakob Korherr The magic happens in JspViewHandlerImpl's renderView() method: public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { externalContext.dispatch(viewId); } Regards, Jakob 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yes, I am not using facelets. I had a look at the NavigationHandlerImpl and here is the excerpt from it: Method: handleNavigation if (navigationCase != null) { if (log.isTraceEnabled()) { log.trace(handleNavigation fromAction
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Yeah this is the place. Back to the problem. I still cannot come up with a workaround :( From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr The magic happens in JspViewHandlerImpl's renderView() method: public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { externalContext.dispatch(viewId); } Regards, Jakob 2010/1/13 Madhav Bhargava madhav_bharg...@infosys.com Yes, I am not using facelets. I had a look at the NavigationHandlerImpl and here is the excerpt from it: Method: handleNavigation if (navigationCase != null) { if (log.isTraceEnabled()) { log.trace(handleNavigation fromAction= + fromAction + outcome= + outcome + toViewId = + navigationCase.getToViewId() + redirect= + navigationCase.isRedirect()); } if (navigationCase.isRedirect() (!PortletUtil.isPortletRequest(facesContext))) { // Spec section 7.4.2 says redirects not possible in this case for portlets ExternalContext externalContext = facesContext.getExternalContext(); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String redirectPath = viewHandler.getActionURL(facesContext, navigationCase.getToViewId()); try { externalContext.redirect(externalContext.encodeActionURL(redirectPath)); } catch (IOException e) { throw new FacesException(e.getMessage(), e); } } else { ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); //create new view String newViewId = navigationCase.getToViewId(); UIViewRoot viewRoot = null; if (isPartialStateSavingOn(facesContext)) { viewRoot = viewHandler.restoreView(facesContext,newViewId); } else { viewRoot = viewHandler.createView(facesContext, newViewId); } facesContext.setViewRoot(viewRoot); facesContext.renderResponse(); } In the above code, redirect happens properly however for a forward there is no RequestDispatcher.forward or ExternalContext.dispatch called. So I do not know where a forward happens. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Hi Tomasz, That's all correct! However, I don't think he is using Facelets, because he mentioned JSP-pages... Regards, Jakob 2010/1/12 Tomasz Pasierb tompa...@poczta.fm Hi, as I understand you use a commandButton and as a result a different page (a secured one) is rendered but spring security does not seem to intercept the url, is that right? If so and if the solution used by you uses Facelets then this may be the problem. When using Facelets as opposed to pure (older) jsf+jsp approach there is no forward when a new view is rendered that is a result of a navigation case forward. I've been investigating this recently. When JSP view handler is used it checks which view should be rendered next and does a forward to this new view which spring security can intercept. The Facelet view handler however seems to load the view (xhtml) and render it without making the actual forward. As a result no interception can happen and usually it is triggered with the next request. You need to either use redirects or make GET requests to logically separate views - I know this is not natural with jsf versions prior to 2.0, but this new spec seems to change everything :-) - use can easily generate GET requests with the new version. Hope this helps ;) Regards, Tom Pasierb Madhav Bhargava pisze: Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
-Original Message- From: Michael Kurz [mailto:michi.k...@gmx.at] Madhav Bhargava schrieb: To add if you see the spring security application config, I have the following set: security:http security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ /security:http The URL for the outcome to be forwarded to matches the second interceptor pattern which is /jsp/operations/user/operationsLanding.iface However what the filter receives is /jsp/secure/hprelanding.jspx which is the old URL from where the control is being forwarded. This is not how it happens when using jsp:forward. For clarification: Is the navigation to the new page operationsLanding.iface performed (do you actually see it in the browser)? - Michael Yes,the request is properly forwarded to operationsLanding.jspx and I can view the page. I had put a breakpoint in one of the spring security classes and I could see the old URL which got successfully mapped against pattern /**/secure/** which should not have happened. If I have a normal JSP application where there is no JSF then it works fine. I meant the navigation is not handled by JSF. Regards, Madhav
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Yes, I have made the appropriate configuration for spring security filters so that specially in the case that you have described below this property will make sure that the authentication is done again. However I do not think that it has anything to do with a stale URL being passed to the filter at the server side. I can understand that the browser will have an old URL but at the server side the URL intercepted by the filter should not be stale. Moreover the control is being forwarded to the correct page and the page is visible as well so do not know how can a old ULR be passed at the server side and a new page be displayed at the client side. Thanks, Madhav From: Michael Kurz [mailto:michi.k...@gmx.at] Hm, I thought the same first but he has attribute once-per-request set to false: security:http once-per-request=false... - Michael Jakob Korherr schrieb: Hi Madhav, I now know what the problem is. I wrote a small test webapp and came to the following conclusion: JSF uses RequestDispatcher.forward(..) to render the second view. Thus the filter should be invoked for the forward. However, the filter is/was already invoked for the first request and it cannot be invoked twice for one request. Only for test reasons, remove dispatcherREQUEST/dispatcher from your filter config in the web.xml and the filter will be invoked for RequestDispatcher.forward(..), because it was not invoked for the original request. I know this does not solve your problem, but I think there is maybe a workaround for this.. I myself just don't know one.. Maybe define the filter twice would solve the problem, but that's just a guess. Regards, Jakob 2010/1/12 Madhav Bhargava madhav_bharg...@infosys.com -Original Message- From: Michael Kurz [mailto:michi.k...@gmx.at] Madhav Bhargava schrieb: To add if you see the spring security application config, I have the following set: security:http security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ /security:http The URL for the outcome to be forwarded to matches the second interceptor pattern which is /jsp/operations/user/operationsLanding.iface However what the filter receives is /jsp/secure/hprelanding.jspx which is the old URL from where the control is being forwarded. This is not how it happens when using jsp:forward. For clarification: Is the navigation to the new page operationsLanding.iface performed (do you actually see it in the browser)? - Michael Yes,the request is properly forwarded to operationsLanding.jspx and I can view the page. I had put a breakpoint in one of the spring security classes and I could see the old URL which got successfully mapped against pattern /**/secure/** which should not have happened. If I have a normal JSP application where there is no JSF then it works fine. I meant the navigation is not handled by JSF. Regards, Madhav
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
I had added spring security code in my workspace for debugging reasons and I suspected that how can a new page be shown when the URL passed to the filter at the server is old. So I put a dummy filter in front of spring security just to print out the URL that is getting intercepted by spring security filter chain. So now I find that when a JSF forward happens via NavigationHandler then there is no URL that is actually intercepted by the spring filter. What I saw during debugging was not the correct picture. SO I am back at the same problem. The filter for JSF forwards is not getting invoked at all. Regards, Madhav From: Madhav Bhargava Yes, I have made the appropriate configuration for spring security filters so that specially in the case that you have described below this property will make sure that the authentication is done again. However I do not think that it has anything to do with a stale URL being passed to the filter at the server side. I can understand that the browser will have an old URL but at the server side the URL intercepted by the filter should not be stale. Moreover the control is being forwarded to the correct page and the page is visible as well so do not know how can a old ULR be passed at the server side and a new page be displayed at the client side. Thanks, Madhav From: Michael Kurz [mailto:michi.k...@gmx.at] Hm, I thought the same first but he has attribute once-per-request set to false: security:http once-per-request=false... - Michael Jakob Korherr schrieb: Hi Madhav, I now know what the problem is. I wrote a small test webapp and came to the following conclusion: JSF uses RequestDispatcher.forward(..) to render the second view. Thus the filter should be invoked for the forward. However, the filter is/was already invoked for the first request and it cannot be invoked twice for one request. Only for test reasons, remove dispatcherREQUEST/dispatcher from your filter config in the web.xml and the filter will be invoked for RequestDispatcher.forward(..), because it was not invoked for the original request. I know this does not solve your problem, but I think there is maybe a workaround for this.. I myself just don't know one.. Maybe define the filter twice would solve the problem, but that's just a guess. Regards, Jakob 2010/1/12 Madhav Bhargava madhav_bharg...@infosys.com -Original Message- From: Michael Kurz [mailto:michi.k...@gmx.at] Madhav Bhargava schrieb: To add if you see the spring security application config, I have the following set: security:http security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ /security:http The URL for the outcome to be forwarded to matches the second interceptor pattern which is /jsp/operations/user/operationsLanding.iface However what the filter receives is /jsp/secure/hprelanding.jspx which is the old URL from where the control is being forwarded. This is not how it happens when using jsp:forward. For clarification: Is the navigation to the new page operationsLanding.iface performed (do you actually see it in the browser)? - Michael Yes,the request is properly forwarded to operationsLanding.jspx and I can view the page. I had put a breakpoint in one of the spring security classes and I could see the old URL which got successfully mapped against pattern /**/secure/** which should not have happened. If I have a normal JSP application where there is no JSF then it works fine. I meant the navigation is not handled by JSF. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Yes, I am not using facelets. I had a look at the NavigationHandlerImpl and here is the excerpt from it: Method: handleNavigation if (navigationCase != null) { if (log.isTraceEnabled()) { log.trace(handleNavigation fromAction= + fromAction + outcome= + outcome + toViewId = + navigationCase.getToViewId() + redirect= + navigationCase.isRedirect()); } if (navigationCase.isRedirect() (!PortletUtil.isPortletRequest(facesContext))) { // Spec section 7.4.2 says redirects not possible in this case for portlets ExternalContext externalContext = facesContext.getExternalContext(); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String redirectPath = viewHandler.getActionURL(facesContext, navigationCase.getToViewId()); try { externalContext.redirect(externalContext.encodeActionURL(redirectPath)); } catch (IOException e) { throw new FacesException(e.getMessage(), e); } } else { ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); //create new view String newViewId = navigationCase.getToViewId(); UIViewRoot viewRoot = null; if (isPartialStateSavingOn(facesContext)) { viewRoot = viewHandler.restoreView(facesContext,newViewId); } else { viewRoot = viewHandler.createView(facesContext, newViewId); } facesContext.setViewRoot(viewRoot); facesContext.renderResponse(); } In the above code, redirect happens properly however for a forward there is no RequestDispatcher.forward or ExternalContext.dispatch called. So I do not know where a forward happens. Regards, Madhav From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Hi Tomasz, That's all correct! However, I don't think he is using Facelets, because he mentioned JSP-pages... Regards, Jakob 2010/1/12 Tomasz Pasierb tompa...@poczta.fm Hi, as I understand you use a commandButton and as a result a different page (a secured one) is rendered but spring security does not seem to intercept the url, is that right? If so and if the solution used by you uses Facelets then this may be the problem. When using Facelets as opposed to pure (older) jsf+jsp approach there is no forward when a new view is rendered that is a result of a navigation case forward. I've been investigating this recently. When JSP view handler is used it checks which view should be rendered next and does a forward to this new view which spring security can intercept. The Facelet view handler however seems to load the view (xhtml) and render it without making the actual forward. As a result no interception can happen and usually it is triggered with the next request. You need to either use redirects or make GET requests to logically separate views - I know this is not natural with jsf versions prior to 2.0, but this new spec seems to change everything :-) - use can easily generate GET requests with the new version. Hope this helps ;) Regards, Tom Pasierb Madhav Bhargava pisze: Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping And in my spring application context I have followed the advice from spring forums and done necessary settings: Excerpt is: security:http entry-point-ref=preAuthenticatedProcessingFilterEntryPoint once-per-request=false security:intercept-url pattern=/index.jsp filters=none / security:intercept-url pattern=/login.jsp filters=none / security:intercept-url pattern
Spring FilterSecurityInterceptor not been called for myfaces forwards
Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping And in my spring application context I have followed the advice from spring forums and done necessary settings: Excerpt is: security:http entry-point-ref=preAuthenticatedProcessingFilterEntryPoint once-per-request=false security:intercept-url pattern=/index.jsp filters=none / security:intercept-url pattern=/login.jsp filters=none / security:intercept-url pattern=/authenticationservlet filters=none/ security:intercept-url pattern=**/jsp/common/** filters=none/ security:intercept-url pattern=/**/css/** filters=none/ security:intercept-url pattern=/**/*.js filters=none/ security:intercept-url pattern=/images/** filters=none/ security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ security:intercept-url pattern=/** access=IS_AUTHENTICATED_ANONYMOUSLY / /security:http Now when I forward a request from index.jsp to login.jsp then the spring filters are called with the login.jsp URL even though the browser shows the old URL. However when from within an action method a navigation case is handled then it is not intercepted by the spring filters at all. However if I give a redirect/ then it is properly intercepted with the correct URL as expected. What can be the reason? Regards, Madhav
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Thanks for your response Jakob. What you have mentioned is already known to me. That is the reason I have put a dispatcherFORWARD/dispatcher For Spring security filter. I should have made it a little more clear. Apologies for that. The forward from index.jsp to login.jsp is via jsp:forward. These are not JSF pages. This forward is captured by Spring security filter. However when a forward happens from within JSF via NavigationHandler then this forward is not caught by spring security filter. I am not sure why a jsp:forward forward will be caught every time and not when done via myfaces. So essentially I not worried about browser showing me the previous URL because that is an expected behavior but the new URL is always caught by the filter which in my case is the exact problem. Regards, Madhav -Original Message- From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of Jakob Korherr Sent: Tuesday, January 12, 2010 4:21 AM To: MyFaces Discussion Subject: Re: Spring FilterSecurityInterceptor not been called for myfaces forwards Hi Madhav, JSF always submits back to the original view, if you hit a h:commandButton or h:commandLink. So if you are on index.jsp and hit for example a h:commandLink, you will get a request for index.jsp. However, after the action method on the server is finished, the server renders the new view, depending on the outcome of the action method, in your case login.jsp. But your browser still displays index.jsp in the address bar, because that was the page you requested. When you add redirect / in the faces-config, JSF will instead of just rendering the new view, redirect to it. Thus you have a second http round trip and your browser's address bar will display the new view. I hope this explains things. Regards, Jakob Korherr 2010/1/11 Madhav Bhargava madhav_bharg...@infosys.com Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping And in my spring application context I have followed the advice from spring forums and done necessary settings: Excerpt is: security:http entry-point-ref=preAuthenticatedProcessingFilterEntryPoint once-per-request=false security:intercept-url pattern=/index.jsp filters=none / security:intercept-url pattern=/login.jsp filters=none / security:intercept-url pattern=/authenticationservlet filters=none/ security:intercept-url pattern=**/jsp/common/** filters=none/ security:intercept-url pattern=/**/css/** filters=none/ security:intercept-url pattern=/**/*.js filters=none/ security:intercept-url pattern=/images/** filters=none/ security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ security:intercept-url pattern=/** access=IS_AUTHENTICATED_ANONYMOUSLY / /security:http Now when I forward a request from index.jsp to login.jsp then the spring filters are called with the login.jsp URL even though the browser shows the old URL. However when from within an action method a navigation case is handled then it is not intercepted by the spring filters at all. However if I give a redirect/ then it is properly intercepted with the correct URL as expected. What can be the reason? Regards, Madhav
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
Hi Michael, Following are the servlet mappings: servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.jspx/url-pattern /servlet-mapping !-- Persistent Faces Servlet Mapping -- servlet-mapping servlet-namePersistent Faces Servlet/servlet-name url-pattern*.iface/url-pattern /servlet-mapping The navigation case in faces-config.xml is: navigation-rule navigation-case from-outcomeOPERATION_LANDING/from-outcome to-view-id/jsp/operations/user/operationsLanding.iface/to-view-id /navigation-case /navigation-rule This has been configured as per the icefaces documentation. If we disregard spring security filter issue the forward happens properly. Spring security filter gets invoked once after the return OPERATION_LANDING from within the action method has been executed. The strange part is that the URL is still the previous one. It is strange because when using jsp:forward from index.jsp to login.jsp spring security filter gets both the URL's. What could be the issue? Regards, Madhav From: Michael Kurz [mailto:michi.k...@gmx.at] Hi, which mapping do you use for your faces servlet: postfix (like *.jsf) or prefix (like /faces/*)? Maybe the real JSF urls are not listed in your intercepter config. regards Michael Madhav Bhargava schrieb: Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping And in my spring application context I have followed the advice from spring forums and done necessary settings: Excerpt is: security:http entry-point-ref=preAuthenticatedProcessingFilterEntryPoint once-per-request=false security:intercept-url pattern=/index.jsp filters=none / security:intercept-url pattern=/login.jsp filters=none / security:intercept-url pattern=/authenticationservlet filters=none/ security:intercept-url pattern=**/jsp/common/** filters=none/ security:intercept-url pattern=/**/css/** filters=none/ security:intercept-url pattern=/**/*.js filters=none/ security:intercept-url pattern=/images/** filters=none/ security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ security:intercept-url pattern=/** access=IS_AUTHENTICATED_ANONYMOUSLY / /security:http Now when I forward a request from index.jsp to login.jsp then the spring filters are called with the login.jsp URL even though the browser shows the old URL. However when from within an action method a navigation case is handled then it is not intercepted by the spring filters at all. However if I give a redirect/ then it is properly intercepted with the correct URL as expected. What can be the reason? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent
RE: Spring FilterSecurityInterceptor not been called for myfaces forwards
To add if you see the spring security application config, I have the following set: security:http security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ /security:http The URL for the outcome to be forwarded to matches the second interceptor pattern which is /jsp/operations/user/operationsLanding.iface However what the filter receives is /jsp/secure/hprelanding.jspx which is the old URL from where the control is being forwarded. This is not how it happens when using jsp:forward. Regards, Madhav -Original Message- From: Madhav Bhargava Hi Michael, Following are the servlet mappings: servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.jspx/url-pattern /servlet-mapping !-- Persistent Faces Servlet Mapping -- servlet-mapping servlet-namePersistent Faces Servlet/servlet-name url-pattern*.iface/url-pattern /servlet-mapping The navigation case in faces-config.xml is: navigation-rule navigation-case from-outcomeOPERATION_LANDING/from-outcome to-view-id/jsp/operations/user/operationsLanding.iface/to-view-id /navigation-case /navigation-rule This has been configured as per the icefaces documentation. If we disregard spring security filter issue the forward happens properly. Spring security filter gets invoked once after the return OPERATION_LANDING from within the action method has been executed. The strange part is that the URL is still the previous one. It is strange because when using jsp:forward from index.jsp to login.jsp spring security filter gets both the URL's. What could be the issue? Regards, Madhav From: Michael Kurz [mailto:michi.k...@gmx.at] Hi, which mapping do you use for your faces servlet: postfix (like *.jsf) or prefix (like /faces/*)? Maybe the real JSF urls are not listed in your intercepter config. regards Michael Madhav Bhargava schrieb: Hi All, I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, WAS 6.0 (app server) I have configured spring security for my JSF application along with SiteMinder as an external authentication mechanism. It works fine till a forward happens from within myfaces. Here is my spring servlet filter chain declaration: filter description Spring delegating filter which will initiate the spring security filter chain /description display-namespringSecurityFilterChain/display-name filter-namespringSecurityFilterChain/filter-name filter-class org.springframework.web.filter.DelegatingFilterProxy /filter-class /filter filter-mapping filter-namespringSecurityFilterChain/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping And in my spring application context I have followed the advice from spring forums and done necessary settings: Excerpt is: security:http entry-point-ref=preAuthenticatedProcessingFilterEntryPoint once-per-request=false security:intercept-url pattern=/index.jsp filters=none / security:intercept-url pattern=/login.jsp filters=none / security:intercept-url pattern=/authenticationservlet filters=none/ security:intercept-url pattern=**/jsp/common/** filters=none/ security:intercept-url pattern=/**/css/** filters=none/ security:intercept-url pattern=/**/*.js filters=none/ security:intercept-url pattern=/images/** filters=none/ security:intercept-url pattern=/**/secure/** access=ROLE_USER / security:intercept-url pattern=/**/operations/** access=ROLE_OPERATIONS/ security:intercept-url pattern=/** access=IS_AUTHENTICATED_ANONYMOUSLY / /security:http Now when I forward a request from index.jsp to login.jsp then the spring filters are called with the login.jsp URL even though the browser shows the old URL. However when from within an action method a navigation case is handled then it is not intercepted by the spring filters at all. However if I give a redirect/ then it is properly intercepted with the correct URL as expected. What can be the reason? Regards, Madhav
RE: Performance issues with JSF
Shashi wrote: Hi All - We have built a J2EE application with JSF (MyFaces, Ajax4JSF) ,Spring and IBatis. What we find is, each of the screen takes lot of time to load. We find no performance issue with Spring or Ibatis (after verifying via JProfiler). Jprofiler shows the JVM memory is occupied b JSF objects. I found that the screen loading is taking time for two reasons. 1.The JSF screens (which has cook menu) take time to load. 2.The overall screen painting in the browser takes time to load. Our JSF screens are not too complicated and even the simplest screen takes time to load. Note that each of the screens always loads JSCookMenu. We visited apache site for tuning JSF. As per their suggestion we did the following 1. We set the State saving mechanism as server side. 2. Serialization of session objects was set to false. 3. Compression of objects was set to false. 4. Streaming Add Resource and t:documentHead were added. But none of these improved the performance. The overall screen takes time and I'm wondering if we should do effective caching of images,CSS and js files. I visited plenty of websites and tried to move all these client specific files under the head tag, loaded the images via CSS but nothing helps. We have high capacity machines and I dont think desktop config is playing a role. We thought the problem could be bcos of network traffic or slow performance of underlying platform websphere server. We checked other application running in the same envrironment and they are extremely fast. The only difference b/n our application and the other is JSF. I'm short of solutions. Any valuable input will be greatly appreciated. You might want to check on the following: 1. Utilize HttpAnalyzer or any other similar tool to check what is the response received for every action. Since you have used Ajax in your page you need to check the response that you are getting back on each ajax call and whether it is only what should be returned. 2. There are some optimizations that are listed on Ajax4Jsf site which in past has proven to be the guilty party for performance related issues. 3. Check what is the size of the response. If the page is too large then you can consider introducing a gzipfilter to compress the response and thereby reducing the network bandwidth usage. 4. Check if objects are not getting released. Some of the Ajax4Jsf components like a4j:keepAlive keep the objects in memory for longer period than expected. 5. Also checked if there are too many session scoped beans and thereby slowly adding to memory usage and eventually affecting everything. 6. There are other parameters in myfaces configuration like number of views in session. Try changing that as well. 7. Check if the page is not heavy with different types of content (images, audio/video etc..). Go for incremental loading. Thanks, Madhav
RE: t:dataScroller problem
Andrea wrote: Hi all, sorry for the previous blank mail (but MS does dent BLANK mail if you use Linux+firefox). I have a problem regarding t:dataScroller and pageIndexVar state. I am trying to save the page index state into a sessio back bean so that i can remember the page the user was browsing. t:dataScroller pageIndexVar=#{SessionBackBean.pageindex}. Anyway it does not remember any value. Is there someone that solved this problem and can share some code? Thank you very much. Andrea. pageIndexVar is set at request level for usage of child components within the datascroller component. IMO you will not be able to do what you wish to do. It's the same as var attribute on t:datatable. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
GZipping JSF Response
Hi All, I have a heavy page and I am trying to reduce the response size by gzipping the Http Response going back to the client from the server. Since I cannot install mod_deflate/mod_gzip on IBM HTTP server I have tried to use the GZipFilter (provided by ehcache) and I also tried to create my own custom filter. The contents are getting zipped but when the filter writes the response, it prints the compressed response to the console instead of sending the compressed response to the browser. Can gzipping work with JSF pages? Thanks Regards, Madhav ext: 36110 CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: GZipping JSF Response
Yes. Application server: Websphere 6.x I have attached the files with this mail. Since it was printing the gzipped response on the console I double checked the response wrapper but could not find anything. Is this because you cannot gzip using a filter in JSF? (It should not be because the response contains generated HTML) Thanks, Madhav -Original Message- From: Adrian Mitev [mailto:adrian.mi...@googlemail.com] Sent: Friday, April 17, 2009 5:31 PM To: MyFaces Discussion Subject: Re: GZipping JSF Response What application server do you use? Websphere? On Fri, Apr 17, 2009 at 2:38 PM, Madhav Bhargava madhav_bharg...@infosys.com wrote: Hi All, I have a heavy page and I am trying to reduce the response size by gzipping the Http Response going back to the client from the server. Since I cannot install mod_deflate/mod_gzip on IBM HTTP server I have tried to use the GZipFilter (provided by ehcache) and I also tried to create my own custom filter. The contents are getting zipped but when the filter writes the response, it prints the compressed response to the console instead of sending the compressed response to the browser. Can gzipping work with JSF pages? Thanks Regards, Madhav ext: 36110 CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- Although nobody can come back and make a new start, anyone can start now and make a new end GZipCompressionFilter.java Description: GZipCompressionFilter.java GZIPResponseStream.java Description: GZIPResponseStream.java GZipResponseWrapper.java Description: GZipResponseWrapper.java
RE: GZipping JSF Response
Hi Cagatay, I tried using the GZipFilter that comes along with ehcache as well. I configured the filter in web.xml and the mapping URL was just “*.jsf”. It used to give the same problem. Somehow the gzipped content is getting written to the IDE console instead of sending that to the browser. Any pointer would be appreciated. Regards, Madhav From: Cagatay Civici [mailto:cagatay.civ...@gmail.com] I've used gzip filter with jsf and no problems, was working in was6 as well afair. On Fri, Apr 17, 2009 at 3:06 PM, Madhav Bhargava madhav_bharg...@infosys.commailto:madhav_bharg...@infosys.com wrote: Yes. Application server: Websphere 6.x I have attached the files with this mail. Since it was printing the gzipped response on the console I double checked the response wrapper but could not find anything. Is this because you cannot gzip using a filter in JSF? (It should not be because the response contains generated HTML) Thanks, Madhav -Original Message- From: Adrian Mitev [mailto:adrian.mi...@googlemail.commailto:adrian.mi...@googlemail.com] Sent: Friday, April 17, 2009 5:31 PM To: MyFaces Discussion Subject: Re: GZipping JSF Response What application server do you use? Websphere? On Fri, Apr 17, 2009 at 2:38 PM, Madhav Bhargava madhav_bharg...@infosys.commailto:madhav_bharg...@infosys.com wrote: Hi All, I have a heavy page and I am trying to reduce the response size by gzipping the Http Response going back to the client from the server. Since I cannot install mod_deflate/mod_gzip on IBM HTTP server I have tried to use the GZipFilter (provided by ehcache) and I also tried to create my own custom filter. The contents are getting zipped but when the filter writes the response, it prints the compressed response to the console instead of sending the compressed response to the browser. Can gzipping work with JSF pages? Thanks Regards, Madhav ext: 36110 CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- Although nobody can come back and make a new start, anyone can start now and make a new end
RE: GZipping JSF Response
-Original Message- From: Simon Kitching [mailto:skitch...@apache.org] Sent: Friday, April 17, 2009 7:50 PM To: MyFaces Discussion Subject: Re: GZipping JSF Response Madhav Bhargava schrieb: Hi Cagatay, I tried using the GZipFilter that comes along with ehcache as well. I configured the filter in web.xml and the mapping URL was just “*.jsf”. It used to give the same problem. Somehow the gzipped content is getting written to the IDE console instead of sending that to the browser. It's probably just a filter order problem. A servlet engine nests filters in the order they are declared in the web.xml file. So make sure your gzip filter is the first filter declared in your web.xml file...that will make compression be the last thing done before the data is sent out. Regards, Simon That was the problem, Huh!!! Sometimes you just miss some of the most basic of things. Thanks for your quick response. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Feature to disable/enable components using JS
Hi All, At present if you need to enable a disabled component then either you call an actionListener or make an AJAX call to re-render that component by changing a property bounded to the disable attribute of the component. What this does is it makes a page a little heavy especially when you have many of such validations on a complex page. Is it not possible to have a feature where you can bind a JS function instead of binding a class level property to the disabled attribute of any JSF component? Something like: t:inputText id=someID value=#{someBean.someValue} disabled=#{jsFunctionToDisable()}/ This will help in improving the response time of the page. If this is possible today then do let me know. Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: How to access session scope attributes via JSF EL
Hi Andrew, Thanks for the response. I am setting a session attribute in custom PhaseListener after validation phase is over. Before the response is rendered the property in session scope has already been set to either true or false. I am not sure why accessing the property is not yielding me the proper value. Thanks, Madhav Andrew wrote: Unless you set #{sessionScope.someBooleanProperty} to true it will return null, and null is the same as false in terms of the disabled attribute. -Andrew On Wed, Mar 4, 2009 at 11:54 PM, Madhav Bhargava madhav_bharg...@infosys.commailto:madhav_bharg...@infosys.com wrote: Hi All, In a JSP I need to disable a component based on an attribute's value in HttpSession. http://developers.sun.com/docs/jscreator/help/jsp-jsfel/jsf_expression_language_intro.html The above link mentions that session scope can be accessed using an implicit object - sessionScope I tried to use session scope as follows: t:inputText id=someID value=#{someBean.someProperty} disabled =#{sessionScope.someBooleanProperty}/ The session attribute gets set properly but #{sessionScope.someBooleanProperty} always returns false. I am assuming I am doing something wrong here. What would be the correct way to use session attributes? Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: valueChangeListener + JSF lifecycle
Madhav Bhargava schrieb: Hi All, I was under the impression that Value change listeners will be called only when there is no validation exception on the page. However on my page if there is a validation failure and a message is displayed to the user. Now if the user changes a value say in a drop down and a value change listener is attached to it then it gets called. Following is the code for the drop down: t:panelGrid columns=2 s:selectOneRow id=radioLayerOne groupName=selection value=#{ppmdController.selectedRow} disabled=#{ppmdController.selectedValue || benefitController.disableScreenElements || templateOverviewController.disableScreenElements } valueChangeListener=#{ppmdController.checkForErrors} f:selectItem itemValue=ABC itemLabel= id=rad/f:selectItem a4j:support event=onclick id=ajaxOne reRender=Rx_Quantity,id_minQty,id_minDaySupply,Days_Supply,id_strtrDose,id_strtrDoseBypassDays,id_strtrDoseMaintBypassDays,id_maxRetailDays,txtNoMoreThanFills,menuAlwdPerOptn,calStrtDate,chkboxDeductible,chkboxOutOfPkt,chkboxMaxBft,menuMailSrvc,id_CmpQty,selectedProvider,selectedNetwork,selectedClaims,myPpmdfloater actionListener=#{ppmdController.fetchLayerTwo} oncomplete=Richfaces.hideModalPanel('ajaxLoadingModalBox');enableMaxRxQtyDysSplyPPMD(); /a4j:support /s:selectOneRow /t:panelGrid Should the value change listener be called when there is a validation exception? Simon wrote: The spec is clear that a ValueChangeEvent should only occur if validation passes. I've got a copy of the JSF2.0 early draft handy, and in section 3.2.6.3: quote EditableValueHolder is a source of ValueChangeEvent events, which are emitted when the validate() processing of the Process Validations phase of the request processing lifecycle determines that the previous value of this component differs from the current value, and all validation checks have passed (i.e. the valid property of this component is still true). /quote However before you report a bug, please check whether this still happens in a plain MyFaces environment. I see you are using tomahawk + sandbox + a4j all together here, which is a complex combination. And when you have questions, you should always specify what version of MyFaces and what version of Java you are using. Neither of those critical pieces of information are in your original email. Regards, Simon Apologies for not mentioning the JSF version. Here are the details: Sun JSF RI 1.1_02 Tomahawk 1.1.7 Tomahawk-sandbox 1.1.7 Richfaces - 3.1.6 I will create a simple JSF project and will try out the same thing and if I find the same behavior I will post a bug. Thanks for your response. Regards, Madhav -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style) CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Check if anything has been changed on the form
Hi All, We are trying to fine tune the DAO layer where we are using Hibernate as our ORM. Since we have too many detached objects, every time we go and save which is quite often (because of implicit save) too many queries get fired and the application responds slowly. This happens even if nothing is changed by the user on the UI. I was hoping to find a dirty flag setter in JSF where it can be checked first and only if the form has been changed will the call to other layers is made. There are a couple of options that we considered: 1. Using JS we iterate all the elements on the page and check if something has changed. However the JS gives an error if there are just too many elements on the page. Most of our pages are long and complex - don't ask me why - just a client requirement :( 2. Attach value change listeners for every component that can be modified. What if nothing gets changed and therefore no ValueChangeEvent is queued. How will this be checked? 3. Hack model update phase and try and set a dirty flag if anything is updated during that phase. Do not know how to do that either? The solution needs to be light on performance. Any pointer would be really appreciated. Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
valueChangeListener + JSF lifecycle
Hi All, I was under the impression that Value change listeners will be called only when there is no validation exception on the page. However on my page if there is a validation failure and a message is displayed to the user. Now if the user changes a value say in a drop down and a value change listener is attached to it then it gets called. Following is the code for the drop down: t:panelGrid columns=2 s:selectOneRow id=radioLayerOne groupName=selection value=#{ppmdController.selectedRow} disabled=#{ppmdController.selectedValue || benefitController.disableScreenElements || templateOverviewController.disableScreenElements } valueChangeListener=#{ppmdController.checkForErrors} f:selectItem itemValue=ABC itemLabel= id=rad/f:selectItem a4j:support event=onclick id=ajaxOne reRender=Rx_Quantity,id_minQty,id_minDaySupply,Days_Supply,id_strtrDose,id_strtrDoseBypassDays,id_strtrDoseMaintBypassDays,id_maxRetailDays,txtNoMoreThanFills,menuAlwdPerOptn,calStrtDate,chkboxDeductible,chkboxOutOfPkt,chkboxMaxBft,menuMailSrvc,id_CmpQty,selectedProvider,selectedNetwork,selectedClaims,myPpmdfloater actionListener=#{ppmdController.fetchLayerTwo} oncomplete=Richfaces.hideModalPanel('ajaxLoadingModalBox');enableMaxRxQtyDysSplyPPMD(); /a4j:support /s:selectOneRow /t:panelGrid Should the value change listener be called when there is a validation exception? Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
How to access session scope attributes via JSF EL
Hi All, In a JSP I need to disable a component based on an attribute's value in HttpSession. http://developers.sun.com/docs/jscreator/help/jsp-jsfel/jsf_expression_language_intro.html The above link mentions that session scope can be accessed using an implicit object - sessionScope I tried to use session scope as follows: t:inputText id=someID value=#{someBean.someProperty} disabled =#{sessionScope.someBooleanProperty}/ The session attribute gets set properly but #{sessionScope.someBooleanProperty} always returns false. I am assuming I am doing something wrong here. What would be the correct way to use session attributes? Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
selectOneRow component issue
Hi All, I am using selectOneRow component in a t:datatable. On some occasions I need to disable the group of radio buttons not allowing the user to toggle to any other row in the table. There is a disabled attribute for this component but even if I explicitly set disabled=true for this component then also it receives focus. I found a similar issue being logged sometime back: http://mail-archives.apache.org/mod_mbox/myfaces-dev/200705.mbox/%3c29164240.1178678115593.javamail.j...@brutus%3e I see the attribute now but it does not disable the component. I guess this is a basic flaw with the component. I am using tomahawk 1.1.7 tomahawk sandbox 1.1.7 along with Sun JSF RI 1.1_02 Any help would be appreciated. Thanks Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: JSF EL does not allow method calls
On Mon, Feb 16, 2009 at 2:48 PM, Simon Kitching skitch...@apache.orgmailto:skitch...@apache.org wrote: Madhav Bhargava schrieb: Hi All, I have a requirement wherein I have to disable UI components based on whether there are any error messages in the Message Queue (t:messages). facesContext is an implicit object so I thought of using it like - #{facesContext.getMessages.hasNext} However when it was not working because you can only specify properties of a class and JSF variable and property resolver will then internally try and call the getter/setter of that property. I find that rather limiting because I do not find the need to define a class level property when all I need is to process and output a Boolean. Is there any way apart from overriding the PropertyResolver/VariableResolver? Simon wrote: No, EL does not allow method calls. It only allows reading/writing properties. However isn't this enough for what you want to do? You could create a simple class: public class MessageChecker { public boolean isMessagePresent() { return FacesContext.currentInstance().getMessages().hasNext(); } } Then register this class as an app-scope managed bean. JSF components can then do disabled=#{messageChecker.messagePresent} Yes this means creating a trivial class, and having an instance of it in memory in order to call a static method from the JSF components. This could be considered ugly. But on the other hand, the JSF pages are now much better isolated from the details of the implementation. Regards, Simon Your solution will not work for messages which get added to the FacesContext during the validation phase. Method isMessagePresent() will not be called. That is the reason I was looking at accessing the messages as an EL expression. If there is a validation/conversion exception thrown then it will directly go to the render response phase after completing the validation phase. I will try and use a scriptlet to get access to messages and see if that is going to work. Not the best way of doing things but I will have to live with that as of now. Thanks for your response Simon. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
JSF EL does not allow method calls
Hi All, I have a requirement wherein I have to disable UI components based on whether there are any error messages in the Message Queue (t:messages). facesContext is an implicit object so I thought of using it like - #{facesContext.getMessages.hasNext} However when it was not working because you can only specify properties of a class and JSF variable and property resolver will then internally try and call the getter/setter of that property. I find that rather limiting because I do not find the need to define a class level property when all I need is to process and output a Boolean. Is there any way apart from overriding the PropertyResolver/VariableResolver? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: JSF EL does not allow method calls
You will not be able to use faceContext.messages because messages is not a property in FacesContextImpl class. I am using Sun JSF RI and i cannot find any property named messages/message and therefore when you invoke facesContext.messages then it will throw a PropertyNotFoundException. THanks, Madhav On Mon, Feb 16, 2009 at 4:12 PM, Walter Mourão walter.mou...@gmail.comwrote: It looks to me you can use #{not empty facesContext.messages} in this case. Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br On Mon, Feb 16, 2009 at 6:18 AM, Simon Kitching skitch...@apache.orgwrote: Madhav Bhargava schrieb: Hi All, I have a requirement wherein I have to disable UI components based on whether there are any error messages in the Message Queue (t:messages). facesContext is an implicit object so I thought of using it like - #{facesContext.getMessages.hasNext} However when it was not working because you can only specify properties of a class and JSF variable and property resolver will then internally try and call the getter/setter of that property. I find that rather limiting because I do not find the need to define a class level property when all I need is to process and output a Boolean. Is there any way apart from overriding the PropertyResolver/VariableResolver? No, EL does not allow method calls. It only allows reading/writing properties. However isn't this enough for what you want to do? You could create a simple class: public class MessageChecker { public boolean isMessagePresent() { return FacesContext.currentInstance().getMessages().hasNext(); } } Then register this class as an app-scope managed bean. JSF components can then do disabled=#{messageChecker.messagePresent} Yes this means creating a trivial class, and having an instance of it in memory in order to call a static method from the JSF components. This could be considered ugly. But on the other hand, the JSF pages are now much better isolated from the details of the implementation. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style) -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: JSF EL does not allow method calls
On Mon, Feb 16, 2009 at 2:48 PM, Simon Kitching skitch...@apache.orgwrote: Madhav Bhargava schrieb: Hi All, I have a requirement wherein I have to disable UI components based on whether there are any error messages in the Message Queue (t:messages). facesContext is an implicit object so I thought of using it like - #{facesContext.getMessages.hasNext} However when it was not working because you can only specify properties of a class and JSF variable and property resolver will then internally try and call the getter/setter of that property. I find that rather limiting because I do not find the need to define a class level property when all I need is to process and output a Boolean. Is there any way apart from overriding the PropertyResolver/VariableResolver? No, EL does not allow method calls. It only allows reading/writing properties. However isn't this enough for what you want to do? You could create a simple class: public class MessageChecker { public boolean isMessagePresent() { return FacesContext.currentInstance().getMessages().hasNext(); } } Then register this class as an app-scope managed bean. JSF components can then do disabled=#{messageChecker.messagePresent} Yes this means creating a trivial class, and having an instance of it in memory in order to call a static method from the JSF components. This could be considered ugly. But on the other hand, the JSF pages are now much better isolated from the details of the implementation. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style) This might be an option i can consider at the moment if i do not want to write a custom EL resolver. Also as matthias pointed out that method invocations are going to be a part of JSF EL soon. Thanks for your quick response. I will try it out and let you know if that works for me. In case i come out with a cleaner solutions then i will post it here. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
RE: How to display popup using t:popup only on click of a link?
We made a custom control during that time, however I would suggest that you have a look at ContextMenu component from richfaces. It will hopefully satisfy your need. Regards, Madhav -Original Message- From: Sharath2k [mailto:sharath...@yahoo.co.in] Sent: Thursday, January 22, 2009 4:05 AM To: users@myfaces.apache.org Subject: Re: How to display popup using t:popup only on click of a link? Hi Madhav, This might be late reply, but Im also having the same scenario.Can you pls share your solution. Thanks and Regards, Chandu Madhav Bhargava-2 wrote: Hi All, I have a requirement where I need to mimic the directory structure of windows. The tree directory structure can be changed by right clicking on one of the items, similar to what windows has. What I have done is the following: I have defined a tree structure using t:tree2 component. The only problem with that component is that it does not restore open state as the t:panelNavigation2 component does. Each of the facets in the tree encloses just a t:commandLink component. This command link component is wrapped with t:popup. So now when the user hovers over a node in the tree (which is a link) then a popup is displayed. All this is fine but I have a few problems: 1.I want the popup to be displayed on click of the link and not on mouse over event. How can I change the behavior of t:popup so that it gets displayed on mouse click event and not mouse over event? 2.Say if there is some way in which the first requirement can be met then how do I pass the value of the node back to the backing bean? It can be done by having a hidden variable and having an onclick event on the node (since each node is also a link). But I was looking at using t:updateActionListener and then passing back the value of the node and setting a property in the backing bean. How do I access another component's value and pass it on the click of a menu item (a command button) in the popup. To clarify point number 2: Consider the following tree layout: Root DummyNode1 DummySub1.1 DummyNode2 DummySub2.1 DummySub2.2 DummySub2.3 Now when I click DummyNode2 then a popup with the following content should be shown: Add Sub Folder Modify Folder Properties Etc... So now when the user clicks Add Sub Folder I need to pass DummyNode2 to the backing bean. What is the best way to do this? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- View this message in context: http://www.nabble.com/How-to-display-popup-using-t%3Apopup-only-on-click-of-a-link--tp10194343p21593621.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
RE: Using Ajax with MyFaces
What you can do is the following: When the page loads show a loading gif using a status component from ajax4jsf which will then change to data table when the div in which the table is contained gets some data to be displayed. Either you can enclose the other 2 data tables in a4j:outputPanel or just re-render them using support component. I believe that if you have any further queries regarding a4j library then this will not be the correct forum to post your queries. Richfaces has better AjAX support than myfaces at present. Shashi wrote: Madhav, i actually have a page which has three tables in it. I get data to table 1 from db which is very fast. Table 2 and table 3 should be populated from webservice calls. As the webservice calls are very slow it is taking a long time for the page to get loaded.So somebody suggested to load the page with table1 first and then using ajax populate the other two tables after the page loads without any user action..Hope u understood my reqmt..any help please? does myfaces give any component or can i use ajax with myfaces without any prob..this is my config (myfaces 1.1.6, tomahawk-1.1.8, tiles with jdk 1.4) --- On Thu, 15/1/09, Madhav Bhargava madhav_bharg...@infosys.com wrote: From: Madhav Bhargava madhav_bharg...@infosys.com Subject: RE: Using Ajax with MyFaces To: MyFaces Discussion users@myfaces.apache.org, shasimi...@yahoo.com shasimi...@yahoo..com Date: Thursday, 15 January, 2009, 6:03 AM Shashi wrote: Hi all, I'm using myfaces 1.1.6, tomahawk-1.1.8, tiles with jdk 1.4. I've a page which has three data tables. I want the data in the two tables to be populated after the page loads.Can i do it using AJAX. I am new to AJAX. Or is there any component in Sandbox for this requirement. Already i'm facing lot of problems cos i'm trying to use trinidad for breadcrumb which i could not resolve yet. If i include rich faces now, I'm scared I'll have incompatibility issues. My aim is to populate one table(which is a web service call) automatically after the page loads. That too without any client interaction. Please help as we have very less time for development. Your requirement is not clear. You can always pre-populate a backing bean which is associated to the page and then transfer control to that page. Alternatively you can call a javascript on page load and then issue an AJAX submit. Put the data table in a4j:outputPanel. When the page is refreshed the data table will then have the data that you desire. Regards, M CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** Download prohibited? No problem. CHAThttp://in.rd.yahoo.com/tagline_webmessenger_1/*http:/in.webmessenger.yahoo.com/ from any browser, without download.
RE: Using Ajax with MyFaces
Shashi wrote: Hi all, I'm using myfaces 1.1.6, tomahawk-1.1.8, tiles with jdk 1.4. I've a page which has three data tables. I want the data in the two tables to be populated after the page loads.Can i do it using AJAX. I am new to AJAX. Or is there any component in Sandbox for this requirement. Already i'm facing lot of problems cos i'm trying to use trinidad for breadcrumb which i could not resolve yet. If i include rich faces now, I'm scared I'll have incompatibility issues. My aim is to populate one table(which is a web service call) automatically after the page loads. That too without any client interaction. Please help as we have very less time for development. Your requirement is not clear. You can always pre-populate a backing bean which is associated to the page and then transfer control to that page. Alternatively you can call a javascript on page load and then issue an AJAX submit. Put the data table in a4j:outputPanel. When the page is refreshed the data table will then have the data that you desire. Regards, M CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
How to get hold of the event queue in JSF?
Hi All, I am using Sun JSF RI 1.1_02, Tomahawk -1.1.6, tomahawk-sandbox-1.1.6, richfaces-3.1.6 I have a page where there is are 2 drop downs: t:selectOneMenu id=provTypCd style=width:163 value=#{durMaintenanceController.provTypCd} f:selectItems id=selitms1 value=#{durMaintenanceController.providerList}/f:selectItems a4j:support event=onchange actionListener=#{durMaintenanceController.fetchRtsMdl} reRender=rtsMdlkey,percentageVal,descrptn,texterlMdsLmt1,Limit1,texterlMdsLmt2,Limit2-AboveLimit1, texterlMdsLmt3,Limit3-AboveLimit2,texterlMdsLmt4,Limit4-AboveLimit3,texterlMdsLmt5,Limit5-AboveLimit4, texterlMdsLmt6,Limit6-AboveLimit5,texterlMinPctAbv6/a4j:support /t:selectOneMenu t:selectOneMenu id=rtsMdlkey style=width:163 value=#{durMaintenanceController.strdMdlKey} f:selectItems id=selitms21 value=#{durMaintenanceController.earlyRefillAppliesList}/f:selectItems a4j:support event=onchange actionListener=#{durMaintenanceController.fetchEarlyRefillValues} reRender=percentageVal,descrptn,texterlMdsLmt1,Limit1,texterlMdsLmt2,Limit2-AboveLimit1, texterlMdsLmt3,Limit3-AboveLimit2,texterlMdsLmt4,Limit4-AboveLimit3,texterlMdsLmt5,Limit5-AboveLimit4, texterlMdsLmt6,Limit6-AboveLimit5,texterlMinPctAbv6 /a4j:support /t:selectOneMenu And there are 2 input text boxes: (Note: I am not using required=true because there is a problem with Sun JSF RI with the way they handle messages on validation errors) t:inputText id=percentageVal size=23 align=left forceId=true value=#{durMaintenanceController.lkupPercentage} maxlength=5 f:converter converterId=com.wellpoint.benefitbuilder.NullConverter / custom:requiredValidator / custom:validateDoubleRange minimum=0 maximum=100 / /t:inputText t:inputText id=descrptn size=23 align=left maxlength=100 forceId=true value=#{durMaintenanceController.description} f:converter converterId=com.wellpoint.benefitbuilder.NullConverter / custom:requiredValidator / /t:inputText Now on change of the second drop down I need to refresh the values in the text boxes but not validate them. However I only need to validate them when an input button is clicked. Now I enclosed these text boxes in a s:subForm component. After which the validation errors were gone when the page got submitted using ajax4jsf support but since the subForm component was not submitted the processModelUpdates was not called for the components within the subForm. Upon re-render of a4j:support then show the older values. I guess I will not be able to use s:subForm along with a4j:support. Is there any way I can get access to eventQueue so that I can check what are the events queued by the end of apply request phase. Looking at the events I can check in my validators whether to validate the field or not. That is the only solution that comes to mind right now. However I am stuck because I do not know how to get hold of the event queue. Can anyone throw some light? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: MyFaces / Tomahawk / Tiles (NoClassDefFoundError)
You might want to register the listener in web.xml: listener listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class /listener --- I'm having some trouble understanding how to get Tiles working. I followed the directions on this page: http://myfaces.apache.org/tomahawk/tiles.html Now I've managed to prevent my project from deploying. Here's the stacktrace I get when I try to deploy: Dec 22, 2008 9:54:02 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener java.lang.NoClassDefFoundError: org/apache/struts/tiles/DefinitionsFactoryException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.getConstructor(Class.java:1657) at org.apache.myfaces.config.FacesConfigurator.getApplicationObject(FacesConfigurator.java:741) at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:644) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:277) at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:131) at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:64) at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:83) at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:72) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1229) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1465) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:821) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:349) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at
s:subForm and a4j:support created re-rendering problems
Hi All, I am using Sun JSF RI - 1.1_02, tomahawk 1.1.6, tomhawk-sanbox-1.1.5 Later versions of tomahawk include subForm component. However we are stuck up with the above versions and therefore we use s:subForm instead of t:subForm We have a drop down. On change of that drop down we call a method via a4j:support and try and re-render different components on the page. The problem is that some of the components (part of re-render list) are inside another subForm and those components do not get re-rendered and for them update model is not been called, so they always show the last value. How can I force an update model for the components inside the subForm so that when re-rendered they show updated values? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Attach the current JSF View as an attachment
Matt wrote : Hi Madhav, This is an interesting requirement. Off the top of my head I'd say you could probably make a custom component to wrap the section you want to capture. Then in that components renderer, in the encodeBegin method you switch the responseWriter to a StringWriter or some other writer. Then in encodeEnd you save the contents of the StringWriter somewhere you can use it later and set back the correct responseWriter, and if you still want to write the response you can do so. Also you need to override rendersChildren and have it return true. The code would look something like this. private ResponseWriter oldWriter; private StringWriter sWriter; // encodeBegin sWriter = new StringWriter(); HtmlResponseWriterImpl writer = new HtmlResponseWriterImpl(sWriter, text/html,utf-8); oldWriter = context.getResponseWriter(); context.setResponseWriter(writer); //encodeEnd StringBuffer sb = sWriter.getBuffer(); // do what you want with the sb context.setResponseWriter(oldWriter); // if you want to output it as well... oldWriter.write(sb.toString()); I think this may work for what you want to do. Matt Initially i tried doing that using a call to a method on click of a link but then i realized that it will still output the entire HTML including the left navigation, header and footer. I created a custom component to capture the part of the Page. I provided 2 attributes - targetPath - where to save the Html output and isCaptured - to conditionally capture It works well. Thanks for all your help. Regards, Madhav From: Madhav Bhargava [mailto:madhav_bharg...@infosys.com] Sent: mercredi 3 décembre 2008 11:51 To: MyFaces Discussion Subject: Attach the current JSF View as an attachment Hi All, I have a rather unique requirement - On a JSF page I have a command button. On click of this button I want to capture the generated HTML for the current view I am on, truncate the left navigation, header and the footer. Extract the body HTML and open a save dialog box to save this HTML page with only body as attachment. Any ideas of how it could be done using JSF? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
t:inputCalendar component converter problems
Hi All, I wanted to decorate the default converter that comes along with HtmlCalendarRenderer class for t:inputCalendar component. I was able to actual processing of converting string to Object to the HtmlCalendarRenderer class using the following code: Method: getAsObject() UIInput inputComponent = (UIInput)component; inputComponent.setConverter(null); String rendererType = inputComponent.getRendererType(); Renderer renderer = facesContext.getRenderKit().getRenderer(inputComponent.getFamily(), rendererType); Object convertedValue = renderer.getConvertedValue(facesContext, component, value); The converter in question is a generic converter and applies to any UIInput component. The problem is with getAsString method. The component nor its renderer does not expose any method through which I can delegate the conversion to String to the actual getAsString class. What I was looking for was access to the default converter for any component if none have been specified, but did not find a way to get hold of it. Is there any way around if I need to have a generic converter for all UIInput type components to act as a decorator? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Displaying messages over the content - generated by the content?
felix.bec...@t-systems.com schrieb: Hi, I've got a JSF page divided in 2 parts - the status message area and the content area. The content area is positioned under the status message area. In the status area all messages for the user should be shown - for example success messages, error messages and exceptions. In my content area I've got a tr:dataTable value=#{myBean.values}... When the method getValues() of myBean throws an exception, I'm catching this exception. I want to display this exception in the status message area - but this does not work - apparently because the status area is already rendered when the content el-methods are called. Is there any solution for this problem? Is it possible to render the status area at last? I can't think of an easy solution for this. Output generated during rendering is (at least theoretically) sent over the network to the remote browser as it is created. So as you point out, your status area has already been written before you encounter the exception. There is no TCP feature to unsend data. One obvious option would be to move your status area to the bottom of the page. Or you could write out the status area at the bottom of the page, then use CSS positioning rules to make it *appear* at the top of the page. Or use javascript to move the generated messages block from the bottom of the page to the top. Note that JSF messages created during: * conversion * validation * action-handling are no problem. It is only exceptions during rendering that would be an issue. I can't think why you would be getting errors during fetching of rendered data; I've not had to deal with that before except when wanting to display some kind of result set too large message. Maybe you can move the fetching of this data up into the action method of your bean? Regards, Simon One quick solution can be to call a javascript function on onload. This function can do an ajax submit and re-render the status area of your JSP. If there are any error messages then that will displayed else nothing will be displayed. If you want more control then do not add the FacesMessage to the FacesContext, instead handle it yourself. Regards, Madhav -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style) CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Displaying messages over the content - generated by the content?
Madhav Bhargava schrieb: felix.bec...@t-systems.com schrieb: Hi, I've got a JSF page divided in 2 parts - the status message area and the content area. The content area is positioned under the status message area. In the status area all messages for the user should be shown - for example success messages, error messages and exceptions. In my content area I've got a tr:dataTable value=#{myBean.values}... When the method getValues() of myBean throws an exception, I'm catching this exception. I want to display this exception in the status message area - but this does not work - apparently because the status area is already rendered when the content el-methods are called. Is there any solution for this problem? Is it possible to render the status area at last? One quick solution can be to call a javascript function on onload. This function can do an ajax submit and re-render the status area of your JSP. If there are any error messages then that will displayed else nothing will be displayed. If you want more control then do not add the FacesMessage to the FacesContext, instead handle it yourself. Simon wrote: Will re-rendering messages using a separate ajax request work? FacesMessage objects are attached to the FacesContext, not the view. And a FacesContext is a request-scoped object. So AFAIK, a second request will always see an empty messages list... Regards, Simon Yes you are right. What I was talking about was a simple hack. For specific messages like the ones that are generated during the render response you do not add it to the FacesContext. Instead you maintain them into a separate list whose scope is say conversation scope rather than a request scope. When the page is rendered, onbody is called which will see if there are any messages. Component like t:messages will inherently read from FacesContext. You can create your own component extending say t:messages and read from a different source as well. CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
t:messages component's strange behavior when used with Tiles and Sun JSF
Hi, I am using Sun JSF 1.1_02, Tomahawk 1.1.6 and struts tiles and RSA 7.0 (websphere runtime 6.0) as the development IDE. I have the following code in my JSP: t:messages/t:messages t:inputText id=descrptn size=23 align=left maxlength=100 required=true forceId=true value=#{durMaintenanceController.description} /t:inputText I took the Messages.properties file from within jsf-impl.jar and overrode: javax.faces.component.UIInput.REQUIRED=Validation Error: Value is required for {0} When the JSP page gets rendered I submit the page leaving this required field as blank. As expected an validation error message is shown on the screen, but the bad part is that the component ID of the component is not displayed. The following is displayed: Validation Error: Value is required for {0} As you can see the parameter should have been replaced by the ID of this component. This is rather strange. Can anyone point out the problem here? Thanks, madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Attach the current JSF View as an attachment
Hi All, I have a rather unique requirement - On a JSF page I have a command button. On click of this button I want to capture the generated HTML for the current view I am on, truncate the left navigation, header and the footer. Extract the body HTML and open a save dialog box to save this HTML page with only body as attachment. Any ideas of how it could be done using JSF? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
extend tomahawk sandox selectManyPickList
Hi All, I have a requirement where I have 2 lists (left and right) and the following behavior is required: 1. The user can only select one item from the left list to be moved to the right. 2. The user can only choose one item either from the left or the right list. This will make sure that if there are any javascript events invoked the select value will only be a single item. Tomahawk sandbox has a component s:selectManyPickList defined. It meets the basic requirement of a typical picklist however to my dismay it does not provide control to the user to allow multiple/single selection while moving elements between lists or selecting items from either list to invoke some external events. The following HTML code gets generated by this component: select id=form:listValue_AVAILABLE name=form:listValue_AVAILABLE multiple=true size=10 ondblclick=A4J.AJAX.Submit('_viewRoot','form',event,{'parameters':{'form:a4jDesc':'form:a4jDesc'} ,'actionUrl':'/BenefitBuilder/web/jsp/supervisor/drugListMaintenanceScreen.jsf'} ) style=width=25pc option value=9Fertility Drugs/option . I would have been happy if the component user had control over setting of the multiple attribute. I tried to find the code for sandbox components but was not able to locate it. I was thinking of extending this component and adding an additional attribute which will give me the required behavior. Does anyone know if I can get the above mentioned behavior without extending the component in its current form? If that is not possible then it will be great if I can get some pointers to where I can find the sandbox code so that I can have a look at the component classes. Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Can tomahawk be used without myfaces
Hi Anton, Unfortunately we are using Sun RI 1.1 implementation (as we are still stuck with JDK 1.4.2). The matrix does not have any entry for the same which will reveal its compatibility with tomahawk. Thanks, M Look on this page http://wiki.apache.org/myfaces/CompatibilityMatrix Hope it will help 2008/11/24 Madhav Bhargava [EMAIL PROTECTED]: Hi All, I am using the following JSF jars provided as part of websphere 6.0 server lib: Jsf-api.jar - present in AppServer/lib Ws-jsf.jar - present in AppServer/lib jsf-ibm.jar - present in WEB-INF/lib Since the JSF RI provided by Sun and IBM do not have inherent support for Tiles I thought of using Tomahawk JspTilesViewHandlerImpl. So I included tomahawk 1.1.5 binary in the WEB-INF/lib I changed the faces-config.xml to have view-handler point to org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl Since I was still not using any of the tomahawk components I did not include the extensionFilter (org.apache.myfaces.webapp.filter.ExtensionsFilter) in web.xml. When I tried deploying my application it gave an exception whose stack trace is attached with this mail. The same exception was thrown even after I had configured extensionFilter in web.xml Can tomahawk (1.1.5 or 1.1.6) be used with the JSF RI provided as part of Sun and IBM? In other words can tomahawk be used without using myfaces as the RI? Ideally it should but I have noticed that in the JSF world of today things are far from ideal. Any help would really be appreciated. Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: Can tomahawk be used without myfaces
Hi Pawel, What was the version of tomahawk and Sun RI libraries that you used? Thanks, M Hi, Although I'm not able to help you with websphere deployment, I can assure you that generally speaking, YES, it is possible to run Tomahawk without Myfaces implementation of JSF. In our projects we were forced to switch to RI implementation due to buggy myfaces libraries, but we didn't want to drop Tomahawk extensions and we went successful. The difference is, that we use Tomcat 6.x instead of websphere. Greetings Pawel Madhav Bhargava [EMAIL PROTECTED] wrote on 2008-11-24 11:19:27: Hi Anton, Unfortunately we are using Sun RI 1.1 implementation (as we are still stuck with JDK 1.4.2). The matrix does not have any entry for the same which will reveal its compatibility with tomahawk. Thanks, M Look on this page http://wiki.apache.org/myfaces/CompatibilityMatrix Hope it will help 2008/11/24 Madhav Bhargava [EMAIL PROTECTED]: Hi All, I am using the following JSF jars provided as part of websphere 6.0 server lib: Jsf-api.jar - present in AppServer/lib Ws-jsf.jar - present in AppServer/lib jsf-ibm.jar - present in WEB-INF/lib Since the JSF RI provided by Sun and IBM do not have inherent support for Tiles I thought of using Tomahawk JspTilesViewHandlerImpl. So I included tomahawk 1.1.5 binary in the WEB-INF/lib I changed the faces-config.xml to have view-handler point to org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl Since I was still not using any of the tomahawk components I did not include the extensionFilter (org.apache.myfaces.webapp.filter.ExtensionsFilter) in web.xml. When I tried deploying my application it gave an exception whose stack trace is attached with this mail. The same exception was thrown even after I had configured extensionFilter in web.xml Can tomahawk (1.1.5 or 1.1.6) be used with the JSF RI provided as part of Sun and IBM? In other words can tomahawk be used without using myfaces as the RI? Ideally it should but I have noticed that in the JSF world of today things are far from ideal. Any help would really be appreciated. Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to orfrom this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Can tomahawk be used without myfaces
Hi All, I am using the following JSF jars provided as part of websphere 6.0 server lib: Jsf-api.jar - present in AppServer/lib Ws-jsf.jar - present in AppServer/lib jsf-ibm.jar - present in WEB-INF/lib Since the JSF RI provided by Sun and IBM do not have inherent support for Tiles I thought of using Tomahawk JspTilesViewHandlerImpl. So I included tomahawk 1.1.5 binary in the WEB-INF/lib I changed the faces-config.xml to have view-handler point to org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl Since I was still not using any of the tomahawk components I did not include the extensionFilter (org.apache.myfaces.webapp.filter.ExtensionsFilter) in web.xml. When I tried deploying my application it gave an exception whose stack trace is attached with this mail. The same exception was thrown even after I had configured extensionFilter in web.xml Can tomahawk (1.1.5 or 1.1.6) be used with the JSF RI provided as part of Sun and IBM? In other words can tomahawk be used without using myfaces as the RI? Ideally it should but I have noticed that in the JSF world of today things are far from ideal. Any help would really be appreciated. Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** [11/24/08 6:11:01:772 GMT] 000f jsf E com.ibm.ws.jsf.configuration.FacesConfigParser fatalError FatalError while parsing faces-config.xml org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown Source) at org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDExternalSubset(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at com.ibm.ws.jsf.configuration.FacesConfigParser.parse(FacesConfigParser.java:283) at com.ibm.ws.jsf.configuration.FacesConfigParser.parse(FacesConfigParser.java:257) at com.ibm.ws.jsf.util.FacesConfigUtil.parseJSFApplicationConfig(FacesConfigUtil.java:202) at com.ibm.ws.jsf.util.FacesConfigUtil._parseJSFConfiguration(FacesConfigUtil.java:122) at com.ibm.ws.jsf.util.FacesConfigUtil.parseJSFConfiguration(FacesConfigUtil.java:82) at com.sun.faces.util.Util.verifyFactoriesAndInitDefaultRenderKit(Util.java:465) at com.ibm.ws.jsf.configuration.FacesConfig.initialize(FacesConfig.java:96) at com.ibm.ws.jsf.extprocessor.JSFExtensionFactory.createExtensionProcessor(JSFExtensionFactory.java:108) at com.ibm.ws.webcontainer.webapp.WebApp.initializeExtensionProcessors(WebApp.java:1143) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:403) at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:117) at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:128) at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:939) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:892) at
Running into NullPointerException when running Myfaces + tiles on WebSphere 6.0
Hi All, I am using Myfaces 1.1.5, tomahawk 1.1.5, struts-tiles, ajax4jsf on Websphere 6.0 and i am running into an exception (stack trace is attached with this mail) I have already gone through the link http://wiki.apache.org/myfaces/Websphere_Installation and done loads of googling but nothing seems to resolve the problem. Setting PARENT_LAST on Class Loader option at MODULE level does not solve the problem. Webshere still picks up the Sun RI jars (jsf-api.jar and ws-jsf.jar) that are bundled along with Websphere 6.0. We cannot remove these jars because we have a shared production environment and there are other applications that are using the RI implementation instead of myfaces. Any suggestions would greatly be appreciated. It is too late in the project too move to facelets :(. If this problem cannot be solved then please suggest some alternate templating frameworks which will work well with JSF. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** [11/19/08 16:05:38:214 IST] 005e ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown : java.lang.NullPointerException at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1043) at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState(JspStateManagerImpl.java:200) at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:270) at org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:83) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:231) at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116) at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:150) at org.jenia.faces.template.handler.ViewHandler.restoreView(ViewHandler.java:263) at org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.restoreView(JspTilesViewHandlerImpl.java:323) at org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.restoreView(JspTilesViewHandlerImpl.java:323) at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116) at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:150) at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92) at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127) at
Re: Running into NullPointerException when running Myfaces + tiles on WebSphere 6.0
Hi Johannes, If you read the article again you will notice that there are 2 sections - One section contains the steps for making myfaces work after removing the Sun RI jar files and using Parent First. The other section contains the steps for making myfaces work without removing Sun RI jar files and then using Parent Last. As i have mentioned earlier on that option of removing the Sun RI jar files is not an option as we have a shared production environment and therefore we cannot go for option one. thanks, M On Wed, Nov 19, 2008 at 9:15 PM, jhomuth [EMAIL PROTECTED]wrote: Hi Madhav, I don't know if I understand you wrong or you have make a mistake by reading the guide. There is provided you should use PARENT_FIRST and not PARENT_LAST (Websphere 6.0) as you have written. Or did you mean you used PARENT_LAST instead of PARENT_FIRST, and that didn't solve the problem??? If yes, then forget my mail!! - J Madhav Bhargava wrote: Hi All, I am using Myfaces 1.1.5, tomahawk 1.1.5, struts-tiles, ajax4jsf on Websphere 6.0 and i am running into an exception (stack trace is attached with this mail) I have already gone through the link http://wiki.apache.org/myfaces/Websphere_Installation and done loads of googling but nothing seems to resolve the problem. Setting PARENT_LAST on Class Loader option at MODULE level does not solve the problem. Webshere still picks up the Sun RI jars (jsf-api.jar and ws-jsf.jar) that are bundled along with Websphere 6.0. We cannot remove these jars because we have a shared production environment and there are other applications that are using the RI implementation instead of myfaces. Any suggestions would greatly be appreciated. It is too late in the project too move to facelets :(. If this problem cannot be solved then please suggest some alternate templating frameworks which will work well with JSF. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- Johannes Homuth --- SOURCEPARK Gesellschaft für Softwareentwicklung mbH Johannes Homuth Helmholtzstr. 2-9 Gebäude M 10587 Berlin Tel:+49 (0)30/398 068 316 Fax:+49 (0)30/398 068 39 e-mail: [EMAIL PROTECTED] www:www.sourcepark.de --- Sitz der Gesellschaft: Berlin Handelsregister: Amtsgericht Berlin-Charlottenburg, HRB 80254 Geschäftsführer: Matthias Barmeier, Harald Dürr --- Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: Dependency Injection in Validators
Seam supports this kind of injection via @in and @out annotations http://www.javabeat.net/jboss-seam/2007/06/jboss-seam-introduction/ Another way would be to integrate Spring + JSF. Yet another way would be to manage business layer with Spring and then you an instance of a bean which implements ApplicationContextAware to get you any spring bean reference to any other bean not managed by Spring. ~madhav On Mon, Mar 31, 2008 at 1:42 PM, Cedric Hurst [EMAIL PROTECTED] wrote: Hello all... does anyone know if it's possible to use dependency injection inside JSF validators? My code is as follows: package com.ibm.wasce.customerLocator.web.jsf; import javax.ejb.EJB; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.component.UIComponent; import com.ibm.wasce.customerLocator.ejb.interfaces.CustomerBeanLocal; public class CustomerNumberValidator implements Validator { @EJB(name=CustomerBeanLocal) CustomerBeanLocal customerSessionBean; public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { System.out.println(customerSessionBean); if(customerSessionBean.findCustomerByCustomerNumber((String)value) != null) { FacesMessage message = MessageGenerator.getCustomerNumberAlreadyExistsMessage(); throw new ValidatorException(message); } } } The problem is that customerSessionBean is coming up as null. Of course, this behavior makes sense because the validator is not a managed bean. But is there a way to treat it as if it was? -- View this message in context: http://www.nabble.com/Dependency-Injection-in-Validators-tp16397217p16397217.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
t:popup problems still persist
Hi All, I am using myfaces 1.1.5, tomahawk 1.1.5 in my web application which runs on IE 6. I have the following structure in my JSP: t:div style=margin-top: 40px;height: 160px; overflow-y: auto ; border: 1px solid gray; t:dataTable t:column t:popup Content for the popup /t:popup /t:column /t:dataTable /t:div The problem is that the t:popup is not visible when it is nested inside a popup. There was a similar discussion way back in 2005 on this list and i was not able to see any solution coming out of that discussion. Here is the thread: http://mail-archives.apache.org/mod_mbox/myfaces-users/200512.mbox/[EMAIL PROTECTED] Unfortunately the problem still remains un-resolved. Is there any solution to this problem or we need to look at an alternative component? Thanks for any help. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
tomahawk inputFileUpload component times out for large files
Hi All, Following is the environment i am working with: Weblogic 8.1 sp4 myfaces 1.1.5 tomahawk 1.1.5 IE 6.0 SP2 In my application i am using inputFileUpload component which internally uses apache commons FileUpload. For larger files the request times out and throws the following exception: 11:04:45,622 ERROR MultipartRequestWrapper:96 - Exception while uploading file. org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out at org.apache.commons.fileupload.FileUploadBase.parseRequest( FileUploadBase.java:429) at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest( MultipartRequestWrapper.java:85) .. I google a bit for a resolution but did not find any concrete solutions to the problem. I went into the tomahawk source code and i found that the following peice of code causes that exception: List requestParameters = null; try{ *requestParameters = fileUpload.parseRequest(request); *} catch (FileUploadBase.SizeLimitExceededException e) { // TODO: find a way to notify the user about the fact that the uploaded file exceeded size limit if(log.isInfoEnabled()) log.info(user tried to upload a file that exceeded file-size limitations.,e); requestParameters = Collections.EMPTY_LIST; }catch(FileUploadException fue){ * log.error(Exception while uploading file., fue); *requestParameters = Collections.EMPTY_LIST; } I did not find any property in the component tld documentation that would help me set a timeout and overwrite the timeout defined at the server. Any help would be greatly appreciated. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
t:popup bug in tomahawk 1.1.5
Hi All, We have a label and an input text next to it. Place the cursor on the input text and now move the mouse over the label. The popup showing the tooltip comes up. The problem is that on IE the blinking cursor is still shown on the tooptip. I did try and dig out if there was a JIRA raised and i found this: http://www.mail-archive.com/[EMAIL PROTECTED]/msg09075.html According to it was marked as closed. Ideally the fix should be present in tomahawk 1.1.5 and myfaces 1.1.5 which i am using at present. Please let me know if this defect is being again worked upon. Thanks, madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
bug in t:panelTabbedPane component
Hi All, Environment: browser: IE 6.0.2 myfaces: 1.1.5 tomahawk: 1.1.5 On IE the many a times the tabs are shown as buttons and not tabs. This does not always happens. Following is the code in the JSP: t:panelTabbedPane bgcolor=#FF serverSideTabSwitch=true selectedIndex=#{uiQuickSearchListPopulator.selectedTabIndex} styleClass=TABBEDPANE style=height: 100%; padding-right: 5%; padding-left:0px; padding-bottom: 0%; padding-top: 25px; t:tabChangeListener type=com.pfizer.pgrd.like.ui.search.TabChangeListenerImpl / t:panelTab id=tab1 label=Quick Search style=width: 800px; font-weight: bold; jsp:include flush=true page=quickSearch.jsp/jsp:include /t:panelTab t:panelTab label=Advanced Search styleClass=PANELTAB style=width: 800px;; font-face: verdana; font-weight: bold; jsp:include flush=true page=advancedSearch.jsp/jsp:include /t:panelTab /t:panelTabbedPane CSS styleclass used: .TABBEDPANE{ font-family:Arial, Helvetica, sans-serif; font-size: 10px; width: 70%; cellspacing: 10px; cellpadding: 3px; rules: none; border: 1px solid gray; } I found that a similar issue has been raised earlier: http://www.nabble.com/t:panelTabbedPane-tab-%3Cinput%3E-style-t505803.html http://mail-archives.apache.org/mod_mbox/myfaces-users/200601.mbox/[EMAIL PROTECTED] Unfortunately no concrete solutions was provided. Is this issue being worked upon? Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: t:popup bug in tomahawk 1.1.5
Sorry, forgot to provide the code: JSP code: t:popup id=tooltipTA style=#{( uiQuickSearchListPopulator.quickSearchListController.selectedTA==null||uiQuickSearchListPopulator.quickSearchListController.selectedTA=='')?null:'border:1px solid #00;bgcolor:#FF;width:100px;background-color:#ff'} closePopupOnExitingElement=true closePopupOnExitingPopup=true displayAtDistanceX=10 displayAtDistanceY=10 rendered=true a4j:region id=taRegion t:inputTextHelp value=#{ uiQuickSearchListPopulator.quickSearchListController.selectedTA} id=taSuggest size=40 maxlength=255 a4j:support event=onblur action=#{ uiQuickSearchListPopulator.reRenderCountTA} reRender=tooltipTA,taLMFCount,taMADCount,quickTotLMFCount,quickTotMADCount,SearchName/a4j:support /t:inputTextHelp rich:suggestionbox id=taSuggestBox for=taSuggest style =font-size:12px tokens= frequency=0 selfRendered=true ignoreDupResponses=true rules=#{uiQuickSearchListPopulator.rules} suggestionAction=#{ uiQuickSearchListPopulator.autocompleteTA} var=result fetchValue=#{result.taName} rows=#{ uiQuickSearchListPopulator.intRows} first=#{uiQuickSearchListPopulator.intFirst} minChars=#{uiQuickSearchListPopulator.minchars} shadowOpacity=#{uiQuickSearchListPopulator.shadowOpacity} border=#{uiQuickSearchListPopulator.border} width=#{ uiQuickSearchListPopulator.width} height=#{uiQuickSearchListPopulator.height} shadowDepth=#{uiQuickSearchListPopulator.shadowDepth} cellpadding=#{uiQuickSearchListPopulator.cellpadding} h:column h:outputText value=#{result.taName} / /h:column a4j:support event=onselect action=#{ uiQuickSearchListPopulator.getLMFMADCountTA} reRender=tooltipTA,taLMFCount,taMADCount,SearchName,quickTotLMFCount,quickTotMADCount/a4j:support /rich:suggestionbox /a4j:region f:facet name=popup t:div rendered=#{!( uiQuickSearchListPopulator.quickSearchListController.selectedTA==null||uiQuickSearchListPopulator.quickSearchListController.selectedTA=='' )} t:panelGrid columns=2 t:outputText value=TA: style=font-weight: bold; font-size: 10; / t:outputText value=#{ uiQuickSearchListPopulator.quickSearchListController.selectedTA} style=font-size:10; white-space: nowrap; / /t:panelGrid /t:div /f:facet /t:popup Thanks, Madhav On 8/24/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Hi All, We have a label and an input text next to it. Place the cursor on the input text and now move the mouse over the label. The popup showing the tooltip comes up. The problem is that on IE the blinking cursor is still shown on the tooptip. I did try and dig out if there was a JIRA raised and i found this: http://www.mail-archive.com/[EMAIL PROTECTED]/msg09075.html According to it was marked as closed. Ideally the fix should be present in tomahawk 1.1.5 and myfaces 1.1.5 which i am using at present. Please let me know if this defect is being again worked upon. Thanks, madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
disable input text box generated from t:inputFileUpload
Hi All, I have a requirement where the user should not be given control to directly type in the path of a file. The user needs to necessarily click the browse button and then the path will then be populated in the disabled on client side input text that gets generated via this component. I could only find one disabled property on that component but that does not do the trick. Do you have any suggestions? Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
RE: disable input text box generated from t:inputFileUpload
Hi Andrew, Thanks for the reply.Ideally we should have a feature similar to disableOnClientSide for t:inputFileUpload component. I am not sure about others but i feel that on many of the UI's the user is required to necessarily browse and not enter it manually to avoid user errors. What you have suggested is a patch. I had tried implementing it but faced some problems. Thanks, Madhav From: Andrew Robinson [mailto:[EMAIL PROTECTED] Sent: Fri 7/20/2007 6:41 AM To: MyFaces Discussion Subject: Re: disable input text box generated from t:inputFileUpload input file is not stylable (IE lets you do a little). There are many hacks out there to style it. Some involve putting an image over it, and such. Just google for searches like input file css style. If you set the width small enough, the text box goes away. The problem is that the font on the button can change per user and per browser vendor, so it is near impossible to know how wide to make it. On 7/19/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Hi All, I have a requirement where the user should not be given control to directly type in the path of a file. The user needs to necessarily click the browse button and then the path will then be populated in the disabled on client side input text that gets generated via this component. I could only find one disabled property on that component but that does not do the trick. Do you have any suggestions? Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do winmail.dat CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
set up myfaces to run in a clustered environment
Hi All, We have already developed an application using JSF which is now going to be moved to a clustered environment. We have the following parameters set in web.xml: 1. org.apache.myfaces.SERIALIZE_STATE_IN_SESSION set to false 2. javax.faces.STATE_SAVING_METHOD set to server What are the changes required to make myfaces work in a weblogic clustered environment? I was unable to find any documentation on the net for the same. Any help will be appreciated. Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
How to implement a vertical splitter in a data table
Hi All, I have a requirement in which i need to implement a vertical splitter in a data table. This vertical splitter will divide the data table into 2 parts. Each part of the data table will have a horizontal scroll. The user can keep one side of the data table as it is and scroll horizontally on the other side of the data table. I am not sure if it can be implemented using t:datatable. Any help will be appreciated. Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: How to implement a vertical splitter in a data table
Hi Adrian, Couple of problems with using a t:dataList: 1. No sorting functionality available by clicked on column headers 2. Two data Lists will not be connected 3. Splitter can also be moved which is how it is normally implemented in non-JSF world Is there any other component/JSF library that has this feature? Thanks, Madhav On 6/10/07, Adrian Mitev [EMAIL PROTECTED] wrote: I don't see how it's possible with t:dataTable.Probably two agglutinated tables implemented using probably t:dataList. 2007/6/10, Madhav Bhargava [EMAIL PROTECTED]: Hi All, I have a requirement in which i need to implement a vertical splitter in a data table. This vertical splitter will divide the data table into 2 parts. Each part of the data table will have a horizontal scroll. The user can keep one side of the data table as it is and scroll horizontally on the other side of the data table. I am not sure if it can be implemented using t:datatable. Any help will be appreciated. Thanks, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
I just cannot make InputSuggestAjax component work
Hi All, Environment: Weblogic 8.1 JDK 1.4.2.x Myfaces 1.1.5 Tomahawk 1.1.5 Tomahawk sandbox 1.1.5 I have taken the lead from the example at http://www.irian.at which is again present at http://wiki.apache.org/myfaces/InputSuggestAjax Instead of an Address bean i have a KeyValuePair bean. This bean has 2 properties - key (String), value (Object). I want to display the values in the drop down that would come up when the user starts typing something and then the selected bean will then be passed to the model. Using the key field of the selected bean i will then compose a query for the database. JSP code: s:inputSuggestAjax suggestedItemsMethod=#{ajaxsuggest.suggest} itemLabelMethod=#{ajaxsuggest.getLabel} value=#{ ajaxsuggest.selectedBean} f:converter converterId=inputSuggestAjaxConverter/ /s:inputSuggestAjax Methods in Controller/Managed bean for inputSuggestAjax component: public List suggest(String prefix) { List matchingList = new ArrayList(); Iterator iter = items.iterator(); while(iter.hasNext()) { KeyValuePair bean = (KeyValuePair)iter.next(); if (bean.getValue().toString().startsWith(prefix)) { matchingList.add(bean); } } return matchingList; } public String getLabel(Object selectedBean) { if (null != selectedBean selectedBean instanceof KeyValuePair) { Iterator iter = items.iterator(); while(iter.hasNext()) { KeyValuePair bean = (KeyValuePair)iter.next(); if (bean.getKey().equals(((KeyValuePair)selectedBean).getKey())) { return (String)bean.getValue(); } } } return null; } Just to test i am populating the items List in the controller itself: public InputSuggestAjaxController() { items = new ArrayList(); items.add(new KeyValuePair(1, India)); items.add(new KeyValuePair(2, US)); items.add(new KeyValuePair(3, Russia)); items.add(new KeyValuePair(4, China)); items.add(new KeyValuePair(5, Indonasia)); items.add(new KeyValuePair(6, Iran)); items.add(new KeyValuePair(7, Uganda)); } Custom Converter for this component: public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException { if (null != value) { KeyValuePair bean = new KeyValuePair(); bean.setKey(value); return bean; } return null; } public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException { if (null != value) { if (value instanceof KeyValuePair) { return (String)((KeyValuePair)value).getValue(); }else if (value instanceof String) { return value.toString(); } } return null; } public class KeyValuePair implements Serializable { private String key = null; private Object value = null; //getter and setter methods... } The problem is that when the user starts typing nothing is suggested even though the control goes to suggest method and a list is created properly. getLabel method gets called and even the method in the converter gets called. But somehow it does not show up. Browser that i am using is IE 6 Any help in this regard will be greatly appreciated. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: t:navigationMenuItem with icon and label?
Yes, that is a problem with this component. I tried using the same to render both the icon and the label but then it does not work as expected. U can use t:commandNavigation2 component instead. ~madhav On 6/4/07, Michael Obster [EMAIL PROTECTED] wrote: Hi, is it possible to render icon and label together? I have seen whane I use t:navigationMenuItem icon=/pages/images/i_request_start_s.gif itemLabel=Antrag action=buyrequest / I only see the icon in the menu, but no label Antrag :-(. Writing it without the icon t:navigationMenuItem itemLabel=Antrag action=buyrequest / I get the label Antrag. But what should I do if I need both? Anybody have an idea? Cheers, Michael -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
How to display popup using t:popup only on click of a link?
Hi All, I have a requirement where I need to mimic the directory structure of windows. The tree directory structure can be changed by right clicking on one of the items, similar to what windows has. What I have done is the following: I have defined a tree structure using t:tree2 component. The only problem with that component is that it does not restore open state as the t:panelNavigation2 component does. Each of the facets in the tree encloses just a t:commandLink component. This command link component is wrapped with t:popup. So now when the user hovers over a node in the tree (which is a link) then a popup is displayed. All this is fine but I have a few problems: 1. I want the popup to be displayed on click of the link and not on mouse over event. How can I change the behavior of t:popup so that it gets displayed on mouse click event and not mouse over event? 2. Say if there is some way in which the first requirement can be met then how do I pass the value of the node back to the backing bean? It can be done by having a hidden variable and having an onclick event on the node (since each node is also a link). But I was looking at using t:updateActionListener and then passing back the value of the node and setting a property in the backing bean. How do I access another component's value and pass it on the click of a menu item (a command button) in the popup. To clarify point number 2: Consider the following tree layout: Root DummyNode1 DummySub1.1 DummyNode2 DummySub2.1 DummySub2.2 DummySub2.3 Now when I click DummyNode2 then a popup with the following content should be shown: Add Sub Folder Modify Folder Properties Etc... So now when the user clicks Add Sub Folder I need to pass DummyNode2 to the backing bean. What is the best way to do this? Thanks, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: action not working in t:navigationMenuItem
action needs to be specified as an EL expression - Something like - #{someBean.someActionMethod} On 4/4/07, Jatin [EMAIL PROTECTED] wrote: I am using tomahawk menu to perform navigation. I have coded the action attribute, but it is not working. Here is the code t:jscookMenu layout=hbr theme=ThemeIE id=menu rendered=true t:navigationMenuItem itemLabel=Employee t:navigationMenuItem itemLabel=Search By Id action=empById/ t:navigationMenuItem itemLabel=Search By Name action=empByName/ t:navigationMenuItem itemLabel=Add action=addEmp/ /t:navigationMenuItem /t:jscookMenu What am I missing -- View this message in context: http://www.nabble.com/action-not-working-in-t%3AnavigationMenuItem-tf3524173.html#a9831896 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: not displaying icon in t:navigationMenuItem
I am not sure what you are trying out here. I assume that you are using navigationMenuItem inside t:panelNavigation2 component. If yes then the last time i worked with this component i had major problems displaying icon along with text in the menu. That is the reason i shifted to using t:commandNavigation2 component instead of using t:navigationMenuItem I am not sure what is the problem that ur facing unless you give me more information. ~madhav On 4/4/07, Jatin [EMAIL PROTECTED] wrote: I am using t:navigationMenuItem without using the icon attribute. But inspite of that the (null) icon is displayed in the menu. Am I missing something ? -- View this message in context: http://www.nabble.com/not-displaying-icon-in-t%3AnavigationMenuItem-tf3524124.html#a9831734 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: action not working in t:navigationMenuItem
My apologies. Was not in the correct frame of mind. You can specify an outcome directly as the value for an action attribute. Make sure that the action outcome is present in the faces configuration file in one of the navigation rules. ~madhav On 4/4/07, Jatin [EMAIL PROTECTED] wrote: Can't I use hardcoded actions (which are allowed in JSF RI). Madhav Bhargava wrote: action needs to be specified as an EL expression - Something like - #{someBean.someActionMethod} On 4/4/07, Jatin [EMAIL PROTECTED] wrote: I am using tomahawk menu to perform navigation. I have coded the action attribute, but it is not working. Here is the code t:jscookMenu layout=hbr theme=ThemeIE id=menu rendered=true t:navigationMenuItem itemLabel=Employee t:navigationMenuItem itemLabel=Search By Id action=empById/ t:navigationMenuItem itemLabel=Search By Name action=empByName/ t:navigationMenuItem itemLabel=Add action=addEmp/ /t:navigationMenuItem /t:jscookMenu What am I missing -- View this message in context: http://www.nabble.com/action-not-working-in-t%3AnavigationMenuItem-tf3524173.html#a9831896 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do -- View this message in context: http://www.nabble.com/action-not-working-in-t%3AnavigationMenuItem-tf3524173.html#a9832529 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
A litle Help - building myfaces in eclipse using maven
Hi All, I have followed the instructions @ http://wiki.apache.org/myfaces/Eclipse_IDE to build myfaces in eclipse. mvn install and mvn eclipse:eclipse works fine and it builds all the sub-projects successfully. The next step as per the documentation is to include all the sub-projects individually. I import all the subprojects by repeatedly pointing the root location to the subproject root. I have installed a maven eclipse plugin as well and after importing all the sub projects I enable them to use maven. I have also specified the dependencies on shared libraries as per the documentation in the same site. When it starts building then it gives the following error: 3/23/07 1:55:28 PM IST: Project build error Cannot find parent: org.apache.myfaces.maven:myfaces-master for project: org.apache.myfaces.tomahawk:tomahawk-project:pom:1.1.6-SNAPSHOT 3/23/07 2:33:42 PM IST: Reading /myfaces-shared-core/pom.xml 3/23/07 2:33:42 PM IST: Local repository folder does not exist There is a local repository - @ d:/maven/repository where all the dependent libraries were imported at the time mvn install was run. Am I missing something here? Please help. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: Wierd behavior - valueChangeListener does not get called with selectOneMenu
Hi Mike, Thanks for the reply. Yes you are right, i went thru the documenation again right after i had posted this query . The javascript function that i need to call is *subFormID_*submit() If there is a subForm then only this requirement arises else you can simply give onchange=submit() and it will work. I will check out the submitOnEvent component in sandbox. Thanks again. ~madhav On 3/17/07, Mike Kienenberger [EMAIL PROTECTED] wrote: If possible, I'd replace onchange=document.forms[0].submit();return false; with the submitOnEvent sandbox component. My guess is that you need to use the javascript documented here: http://myfaces.apache.org/sandbox/subForm.html I've had no issues with a subForm, a selectOneMenu, a submitOnEvent, and a commandButton triggering an action when an option is chosen from the menu. The other possiblity to investigate is if validation is failing for some other component on your page -- make sure you've got a t:messages component for debugging. On 3/14/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Hi All, *Following is the JSP code:* s:subForm id=subFormId *x- Cut x* t:panelGrid columns=1 width=450px t:selectOneMenu id=decline_value styleClass=selectOneMenu onchange=document.forms[0].submit();return false; value=#{ physicianEConsultation.uiBean.declineValue} valueChangeListener=#{ physicianEConsultation.detailsChanged} required=true f:selectItem itemLabel=--Select-- itemValue=/ f:selectItems value=#{ physicianEConsultation.declineReasonList}/ /t:selectOneMenu t:message for=decline_value styleClass=error/t:message /t:panelGrid *x- Cut x* /s:subForm In the above code we have a select one menu component. If the user changes the selection then an onchange event is fired which will then submit the form. Once the form is submitted then in process validations phase the ValueChangeListener should be called. *Weird behavior:* With the above piece of code the value change listener does not get called even when the user changes a selection in the drop down component. However if you add – immediate = true then the ValueChangeListener is called. I added t:messages to the JSP to check if there were any validation errors which would cause the JSF to skip directly to the render response phase. But there are no validation errors. * * *There is another observation that I made:* If I remove t:subForm component, then with the above code the ValueChangeListener is called as expected. Is this a problem with t:subForm component? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
RE: inputhidden and backingbean
You can do the following: context.getExternalContext().getRequestParameterMap().get(key) ~madhav -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Brummeline Braaten Sent: Thursday, March 15, 2007 3:15 PM To: users@myfaces.apache.org Subject: inputhidden and backingbean How can I get the value of a inputhidden from the backingbean? My jsp code is like this: h:column id=kategorikolonne t:commandLink style=category_list styleClass=category id=kategorilink action=#{tabnavigering.velgKategori} t:outputText value=#{rader.categoryName} id=kategorinavn/ t:inputHidden value=#{rader.categoryId} id=kategoriid/ /t:commandLink /h:column When I click on the commandlink the method velgkategori is invoked. I would like to find the kategoriid in my bean so that I can use it in other methods. How do I do that? CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Wierd behavior - valueChangeListener does not get called with selectOneMenu
Hi All, Following is the JSP code: s:subForm id=subFormId x- Cut x t:panelGrid columns=1 width=450px t:selectOneMenu id=decline_value styleClass=selectOneMenu onchange=document.forms[0].submit();return false; value=#{physicianEConsultation.uiBean.declineValue} valueChangeListener=#{physicianEConsultation.detailsChanged} required=true f:selectItem itemLabel=--Select-- itemValue=/ f:selectItems value=#{physicianEConsultation.declineReasonList}/ /t:selectOneMenu t:message for=decline_value styleClass=error/t:message /t:panelGrid x- Cut x /s:subForm In the above code we have a select one menu component. If the user changes the selection then an onchange event is fired which will then submit the form. Once the form is submitted then in process validations phase the ValueChangeListener should be called. Weird behavior: With the above piece of code the value change listener does not get called even when the user changes a selection in the drop down component. However if you add - immediate = true then the ValueChangeListener is called. I added t:messages to the JSP to check if there were any validation errors which would cause the JSF to skip directly to the render response phase. But there are no validation errors. There is another observation that I made: If I remove t:subForm component, then with the above code the ValueChangeListener is called as expected. Is this a problem with t:subForm component? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
change the order in which action and actionListener methods are called
Hi All, Normally the actionListeners that are registered with any UICommand component are called first and then the action methods are called. Since there can be more than one ActionListener methods that can be attached to a UICommand component - Is there a way in which one of the ActionListener methods can be scheduled/marked to execute after the action method has been executed? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: change the order in which action and actionListener methods are called
Sorry for this question folks. No that is not possible. On 3/13/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Hi All, Normally the actionListeners that are registered with any UICommand component are called first and then the action methods are called. Since there can be more than one ActionListener methods that can be attached to a UICommand component – Is there a way in which one of the ActionListener methods can be scheduled/marked to execute after the action method has been executed? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
component for Reading RSS feeds?
Hi All, After googling a bit I found 2 components that can read RSS feeds: 1. Sun blueprint ui:rssBar component 2. Facesrss Has anyone used these components and are there any other stable alternatives? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how do you pass/set parameters upon ActionListener execution?-puzzled
Thanks a lot Simon for all the help. I will have to debug the component. If I find something interesting then I will share with the list. Cheers, madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 1:07 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?-puzzled Madhav, Well, people here seem to be quite sure that the t:updateActionListener is correct; I certainly don't *see* any problems with it, nor do I *experience* any problems. If you are going to say It should not be a problem with getter and setter then I'm not sure that this list can be much more help. Looks like you'll have to step through the updateActionListener with a debugger - or build your own custom version with extra logging in it. Regards, Simon Madhav Bhargava wrote: Hi Simon, The version of Myfaces that I am using is from a nightly build version 1.1.5. Tomahawk version is 1.1.5 as well (some nightly build) displayText is a String property and getter and setter have been generated using Eclipse so I am sure that there is no problem with the signature. It should not be a problem with getter and setter as literal String values are getting set properly in the backing bean. Regards, Madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:35 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?-puzzled Sorry I didn't read the whole mail. How exactly is msg defined? I don't see here what version of Tomahawk you are working with. For version 1.1.3 (which is what I have at hand) the value is fetched just using a standard call to getValue(), so there's nothing special there. However afterwards it tries to do some type-conversion: Object v = getValue(); if (v != null v instanceof String) { Class type = updateBinding.getType(context); } updateBinding.setValue(context, v); If expression breadCrumbNavigatorBean.displayText doesn't reference a String property then there might be a conversion problem. Note that exactly what defines a javabean property is slightly more complex than just having a setter method. For example, the setter must not be static, and there must not be a getter method with a conflicting signature. You could check by using java.bean.Introspector on this class and verify that it does agree that there is indeed a writeable String property displayText. Ok, it's not likely that this is wrong but t:updateActionListener is in wide use and there are no known problems with it so something odd is going on.. Cheers, Simon Madhav Bhargava wrote: As I mentioned in point number 2 it works. displayText property in the backing bean will get populated with dummyValue The immediate inference of this result was that there is something wrong with my EL expression. But then when I used t:outputLabel tag with the same EL expression it outputted the correct value. This means that there is nothing wrong with the EL expression. The key is properly defined in the Messages.properties file as well. ~madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:20 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?- puzzled What happens if you do this? t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=dummyValue/ Madhav Bhargava wrote: Hi Werner, I double checked the jsp and the backing bean but it just refuses to parse the EL expression. This is what I have done: *Jsp Code:* t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.getExistingRemindersList} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=#{msg['breadcrumb.label.reminders']}/ /t:commandLink In the* backing bean* I just defined a String property with the name displayText. */Following is the observation:/* 1. The displayText in the backing bean is null. In other words the EL expression does not get parsed resulting in a null value. 2. If a literal string is given in place of an EL expression then the value is correctly populated in the backing bean. 3. Based on the result from point number 2 - I tried just outputting the value of the EL expression using: t:outputLabel value=#{msg['breadcrumb.label.reminders']} styleClass=outputLabelText/ The same expression is now parsed properly and the value appears on the page. This means
RE: how do you pass/set parameters upon ActionListener execution?-puzzled
Thanks a lot Simon for the insight. I really appreciate it. When is this //TODO going to be fixed/implemented? Regards, Madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Thursday, March 08, 2007 4:43 AM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?-puzzled Ok, I looked at the LoadBundleTag class, and there is a nice comment at the start :-) /** * TODO: * We should find a way to save loaded bundles in the state, because otherwise * on the next request the bundle map will not be present before the render phase * and value bindings that reference to the bundle will always log annoying * Variable 'xxx' could not be resolved error messages. * * @author Manfred Geiler (latest modification by $Author: bdudney $) * @version $Revision: 225368 $ $Date: 2005-07-27 06:14:51 +1200 (Wed, 27 Jul 2005) $ */ This code is the same in Tomahawk 1.1.3 and trunk: http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/or g/ apache/myfaces/taglib/core/LoadBundleTag.java So there's the explanation. The f:loadBundle tag doesn't do anything until the render phase, ie #{msg} is not valid during previous phases. However the t:updateActionListener obviously must evaluate its expression at update-model phase, so the message bundle has not yet been loaded. As the comment says, what is really needed is for the f:loadBundle tag to attach the name(s) of resource bundles to be loaded to the component tree (eg as attributes in UIViewRoot) and for these to be loaded during restore-view phase. Regards, Simon Madhav Bhargava wrote: I guess I know what the problem is. The EL expression that I have used is: #{msg['breadcrumb.label.reminders']} This expression refers to a key (breadcrumb.label.reminders) in the message bundle(Messages.properties) When this value goes to the updateActionListener tag's doStartTag method it tries to create a ValueBinding out of this EL expression. This is where it returns null as the value binding cannot be created. To circumvent this problem in the setter method for displayText I added the following: ... ... ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName, locale, getCurrentClassLoader(params)); this.displayText= Bundle.getString(key); In the JSP I pass: t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=breadcrumb.label.reminders/ *Now it works!!* I guess you cannot pass a EL that references a message bundle as a value for t:updateActionListener. The only thing that I cannot understand is - I have f:loadBundle basename=com.bingo.tringo.bundle.Messages var=msg/ in the Jsp. The same EL expression works when given as a value to t:outputLabel component but then it does not work when given as a value to t:updateActionListener If someone can throw some light then that will be great. Regards, madhav -Original Message- From: Madhav Bhargava [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 1:36 PM To: MyFaces Discussion Subject: RE: how do you pass/set parameters upon ActionListener execution?-puzzled Thanks a lot Simon for all the help. I will have to debug the component. If I find something interesting then I will share with the list. Cheers, madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 1:07 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?-puzzled Madhav, Well, people here seem to be quite sure that the t:updateActionListener is correct; I certainly don't *see* any problems with it, nor do I *experience* any problems. If you are going to say It should not be a problem with getter and setter then I'm not sure that this list can be much more help. Looks like you'll have to step through the updateActionListener with a debugger - or build your own custom version with extra logging in it. Regards, Simon Madhav Bhargava wrote: Hi Simon, The version of Myfaces that I am using is from a nightly build version 1.1.5. Tomahawk version is 1.1.5 as well (some nightly build) displayText is a String property and getter and setter have been generated using Eclipse so I am sure that there is no problem with the signature. It should not be a problem with getter and setter as literal String values are getting set properly in the backing bean. Regards, Madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent
RE: date in jenia calendar is off by one
It is not a problem with Jenia calendar. It is the timezone that is used to convert the submitted value at the server side. To make sure that the server JVM timezone is taken use s:convertDateTime tag. Now you can set the system timezone to anything that you want. ~madhav From: Adrian Mitev [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 5:32 AM To: MyFaces Discussion Subject: Re: date in jenia calendar is off by one It is obvious that the problem is not in jenia callendar 2007/3/6, raindogs [EMAIL PROTECTED]: I'm attempting to implement the jenia calendar and, while it all seemed great at first, I now realize that I'm getting an off-by-one error on the day. In the test I just ran, I selected March 15th as the date. The input box displayed 03/15/2007, but the value that actually gets passed into the backing bean is Wed Mar 14 19:00:00 CDT 2007. I'm really scratching my head on this one, as I haven't heard of anyone else having this problem. All of the relevant info is below, any help would be much appreciated. Thanks, Alex -- JSP Page snippet -- ** h:outputText value=Activation Date / h:inputText value=#{locationForm.activationDate} id=activationDate f:convertDateTime pattern=MM/dd// /h:inputText h:outputText value= escape=false/ jp:popupCalendar for=activationDate format=MM/dd/ h:outputText value=Choose Date/ /jp:popupCalendar ** - Backing Bean Methods (activationDate is delared as java.util.Date) -- public Date getActivationDate() { return this.activationDate; } public void setActivationDate(Date activationDate) { this.activationDate = activationDate; } --- WEB-INF\lib --- ajax4jsf.jar commons-beanutils-1.7.0.jar commons-codec-1.3.jar commons-collections-3.1.jar commons-digester-1.6.jar commons-el-1.0.jar commons-fileupload.jar commons-lang-2.1.jar commons-logging-1.0.4.jar commons-validator-1.2.0.jar jenia4faces-commons_1.2.jar jenia4faces-popup_1.2.jar jstl-1.1.0.jar myfaces-api-1.1.5.jar myfaces-impl-1.1.5.jar ojdbc14.jar oro-2.0.8.jar oscache-2.3.2.jar portlet-api.jar struts.jar tomahawk-1.1.3.jar -- web.xml -- ?xml version=1.0? !-- * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * UPDATED: Marty Hall changed to use .faces suffix, * faces-config.xml filename, and servlets 2.4. * See tutorial at http://www.coreservlets.com/JSF-Tutorial/. * Note: uncomment the filter entries at the bottom *to use Tomahawk extended components. -- web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 context-param param-namejavax.faces.CONFIG_FILES/param-name param-value /WEB-INF/faces-config.xml /param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueclient/param-value /context-param context-param param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.PRETTY_HTML/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.DETECT_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.AUTO_SCROLL/param-name param-valuetrue/param-value /context-param !-- Listener, that does all the startup work (configuration, init). -- listener listener-classorg.apache.myfaces.webapp.StartupServletContextListener /listener-class /listener !-- Faces Servlet Marty Hall: changed .jsf back to standard of .faces -- servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class
how do you pass/set parameters upon ActionListener execution?
Hi All, I have a requirement wherein I have to pass some values when an ActionListener is invoked. I am aware of 2 ways: 1. f:param 2. t:updateActionListener The only problem is that both of the above only do what they do when an action method is invoked. Since I want the values inside my ActionListener method none of the above will work for me. The only way left for me as of now is having a hidden field and writing an onclick javascript which will then populate the hidden field with the value that I want. I am not sure whether having hidden fields to hold values is a good solution. Is there any other more elegant way to pass in values which can then be accessed from inside the ActionListener method? Rgds, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how do you pass/set parameters upon ActionListener execution?
Hi Werner, Yes, you are right. But I still cannot get the values in my backing bean. Jsp code: t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.showAddReminderScreen} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.participant.displayText} value=#{msg['nav.msg.remiders']}/ /t:commandLink BreadCrumbNavigator.java (managed bean named as per config file is breadCrumbNavitatorBean) private BreadCrumbParticipant participant = null; public BreadCrumbParticipant getParticipant() { if (null == participant) { participant = new BreadCrumbParticipant(); } return participant; } And there are setter method as well. Now when I access participant in the action listener method -updateBreadCrumb, then the participant itself is not null but the displayText property set using t:updateActionListener is null. Any ideas what is going wrong here? Regards, Madhav -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz Sent: Tuesday, March 06, 2007 3:16 PM To: users@myfaces.apache.org Subject: Re: how do you pass/set parameters upon ActionListener execution? This is not quite true, the updateActionListener sets the parameters bevore the invocation of the action this is due to jfs lifecycle where the apply request values is before the action, which phase depends on your immediate value: I quote the original docs here: Both the fetching of value and the updating of property occur in the invoke-application phase unless immediate is set on the ActionSource component in which case they both occur in the apply-request-values phase. The update is guaranteed to occur before the invocation of the method specified by attribute action on the ActionSource (because all actionListeners are executed before the action attribute). so you basically already have the params available before you go into the action. so you do not have params per se in an action but you can push params into your bean bevore invoking the action. Madhav Bhargava schrieb: Hi All, I have a requirement wherein I have to pass some values when an ActionListener is invoked. I am aware of 2 ways: 1. f:param 2. t:updateActionListener The only problem is that both of the above only do what they do when an action method is invoked. Since I want the values inside my ActionListener method none of the above will work for me. The only way left for me as of now is having a hidden field and writing an onclick javascript which will then populate the hidden field with the value that I want. I am not sure whether having hidden fields to hold values is a good solution. Is there any other more elegant way to pass in values which can then be accessed from inside the ActionListener method? Rgds, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: date in jenia calendar is off by one
Hi Andrew, When you say user's locale do u also mean that the the tag will use the timezone information from the user's browser instead of using the server timezone? could you throw some more light on it? Rgds, Madhav On 3/6/07, Andrew Robinson [EMAIL PROTECTED] wrote: FYI, the convertDateTime converter from Seam defaults to the user's locale instead of UTC. On 3/6/07, raindogs [EMAIL PROTECTED] wrote: I'm sorry if my original post made it sound like I was saying there was something wrong with the Jenia Calendar. My intention was to show what I was doing and ask if someone could spot how I was using it incorrectly. Thanks a lot for the tip on the timezone issue, it all worked fine once I sorted that out. Alex Madhav Bhargava-2 wrote: It is not a problem with Jenia calendar. It is the timezone that is used to convert the submitted value at the server side. To make sure that the server JVM timezone is taken use s:convertDateTime tag. Now you can set the system timezone to anything that you want. ~madhav From: Adrian Mitev [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 5:32 AM To: MyFaces Discussion Subject: Re: date in jenia calendar is off by one It is obvious that the problem is not in jenia callendar 2007/3/6, raindogs [EMAIL PROTECTED]: I'm attempting to implement the jenia calendar and, while it all seemed great at first, I now realize that I'm getting an off-by-one error on the day. In the test I just ran, I selected March 15th as the date. The input box displayed 03/15/2007, but the value that actually gets passed into the backing bean is Wed Mar 14 19:00:00 CDT 2007. I'm really scratching my head on this one, as I haven't heard of anyone else having this problem. All of the relevant info is below, any help would be much appreciated. Thanks, Alex -- JSP Page snippet -- ** h:outputText value=Activation Date / h:inputText value=#{locationForm.activationDate } id=activationDate f:convertDateTime pattern=MM/dd// /h:inputText h:outputText value= escape=false/ jp:popupCalendar for=activationDate format=MM/dd/ h:outputText value=Choose Date/ /jp:popupCalendar ** - Backing Bean Methods (activationDate is delared as java.util.Date) -- public Date getActivationDate() { return this.activationDate; } public void setActivationDate(Date activationDate) { this.activationDate = activationDate; } --- WEB-INF\lib --- ajax4jsf.jar commons-beanutils-1.7.0.jar commons-codec-1.3.jar commons-collections-3.1.jar commons-digester-1.6.jar commons-el-1.0.jar commons-fileupload.jar commons-lang-2.1.jar commons-logging-1.0.4.jar commons-validator-1.2.0.jar jenia4faces-commons_1.2.jar jenia4faces-popup_1.2.jar jstl-1.1.0.jar myfaces-api-1.1.5.jar myfaces-impl-1.1.5.jar ojdbc14.jar oro-2.0.8.jar oscache-2.3.2.jar portlet-api.jar struts.jar tomahawk-1.1.3.jar -- web.xml -- ?xml version=1.0? !-- * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * UPDATED: Marty Hall changed to use .faces suffix, * faces-config.xml filename, and servlets 2.4. * See tutorial at http://www.coreservlets.com/JSF-Tutorial/. * Note: uncomment the filter entries at the bottom *to use Tomahawk extended components. -- web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 context-param param-namejavax.faces.CONFIG_FILES/param-name param-value /WEB-INF/faces-config.xml /param-value /context-param context-param param
RE: how do you pass/set parameters upon ActionListener execution? - puzzled
Hi Werner, I double checked the jsp and the backing bean but it just refuses to parse the EL expression. This is what I have done: Jsp Code: t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.getExistingRemindersList} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=#{msg['breadcrumb.label.reminders']}/ /t:commandLink In the backing bean I just defined a String property with the name displayText. Following is the observation: 1. The displayText in the backing bean is null. In other words the EL expression does not get parsed resulting in a null value. 2. If a literal string is given in place of an EL expression then the value is correctly populated in the backing bean. 3. Based on the result from point number 2 - I tried just outputting the value of the EL expression using: t:outputLabel value=#{msg['breadcrumb.label.reminders']} styleClass=outputLabelText/ The same expression is now parsed properly and the value appears on the page. This means that there is nothing wrong with the EL expression. I am not sure what is going on? Why will t:updateActionListener refuse to parse an EL expression that references a message bundle? Regards, Madhav -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz Sent: Tuesday, March 06, 2007 4:10 PM To: users@myfaces.apache.org Subject: Re: how do you pass/set parameters upon ActionListener execution? I had similar usescases (although not using internationalisation) in my current up a dozend times, the mechanism itself works, I can only guess here, first of all which myfaces version do you use and which tomahawk version. I can recommend to go to the latest 1.1.5 stable and use the tomahawk and sandbox nightlies. Secondly check for typos nav.msg.remiders seems like one there is an n missing in reminders typowise, which could be the cause for an empty string issued. Werner Madhav Bhargava schrieb: Hi Werner, Yes, you are right. But I still cannot get the values in my backing bean. *Jsp code:* t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.showAddReminderScreen} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.participant.displayText} value=#{msg['nav.msg.remiders']}/ /t:commandLink CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how do you pass/set parameters upon ActionListener execution?- puzzled
As I mentioned in point number 2 it works. displayText property in the backing bean will get populated with dummyValue The immediate inference of this result was that there is something wrong with my EL expression. But then when I used t:outputLabel tag with the same EL expression it outputted the correct value. This means that there is nothing wrong with the EL expression. The key is properly defined in the Messages.properties file as well. ~madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:20 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?- puzzled What happens if you do this? t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=dummyValue/ Madhav Bhargava wrote: Hi Werner, I double checked the jsp and the backing bean but it just refuses to parse the EL expression. This is what I have done: *Jsp Code:* t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.getExistingRemindersList} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=#{msg['breadcrumb.label.reminders']}/ /t:commandLink In the* backing bean* I just defined a String property with the name displayText. */Following is the observation:/* 1. The displayText in the backing bean is null. In other words the EL expression does not get parsed resulting in a null value. 2. If a literal string is given in place of an EL expression then the value is correctly populated in the backing bean. 3. Based on the result from point number 2 - I tried just outputting the value of the EL expression using: t:outputLabel value=#{msg['breadcrumb.label.reminders']} styleClass=outputLabelText/ The same expression is now parsed properly and the value appears on the page. This means that there is nothing wrong with the EL expression. I am not sure what is going on? Why will t:updateActionListener refuse to parse an EL expression that references a message bundle? Regards, Madhav -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz Sent: Tuesday, March 06, 2007 4:10 PM To: users@myfaces.apache.org Subject: Re: how do you pass/set parameters upon ActionListener execution? I had similar usescases (although not using internationalisation) in my current up a dozend times, the mechanism itself works, I can only guess here, first of all which myfaces version do you use and which tomahawk version. I can recommend to go to the latest 1.1.5 stable and use the tomahawk and sandbox nightlies. Secondly check for typos nav.msg.remiders seems like one there is an n missing in reminders typowise, which could be the cause for an empty string issued. Werner Madhav Bhargava schrieb: Hi Werner, Yes, you are right. But I still cannot get the values in my backing bean. *Jsp code:* t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.showAddReminderScreen} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.participant.displayText} value=#{msg['nav.msg.remiders']}/ /t:commandLink CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how do you pass/set parameters upon ActionListener execution?-puzzled
Hi Simon, The version of Myfaces that I am using is from a nightly build version 1.1.5. Tomahawk version is 1.1.5 as well (some nightly build) displayText is a String property and getter and setter have been generated using Eclipse so I am sure that there is no problem with the signature. It should not be a problem with getter and setter as literal String values are getting set properly in the backing bean. Regards, Madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:35 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?-puzzled Sorry I didn't read the whole mail. How exactly is msg defined? I don't see here what version of Tomahawk you are working with. For version 1.1.3 (which is what I have at hand) the value is fetched just using a standard call to getValue(), so there's nothing special there. However afterwards it tries to do some type-conversion: Object v = getValue(); if (v != null v instanceof String) { Class type = updateBinding.getType(context); } updateBinding.setValue(context, v); If expression breadCrumbNavigatorBean.displayText doesn't reference a String property then there might be a conversion problem. Note that exactly what defines a javabean property is slightly more complex than just having a setter method. For example, the setter must not be static, and there must not be a getter method with a conflicting signature. You could check by using java.bean.Introspector on this class and verify that it does agree that there is indeed a writeable String property displayText. Ok, it's not likely that this is wrong but t:updateActionListener is in wide use and there are no known problems with it so something odd is going on.. Cheers, Simon Madhav Bhargava wrote: As I mentioned in point number 2 it works. displayText property in the backing bean will get populated with dummyValue The immediate inference of this result was that there is something wrong with my EL expression. But then when I used t:outputLabel tag with the same EL expression it outputted the correct value. This means that there is nothing wrong with the EL expression. The key is properly defined in the Messages.properties file as well. ~madhav -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:20 PM To: MyFaces Discussion Subject: Re: how do you pass/set parameters upon ActionListener execution?- puzzled What happens if you do this? t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=dummyValue/ Madhav Bhargava wrote: Hi Werner, I double checked the jsp and the backing bean but it just refuses to parse the EL expression. This is what I have done: *Jsp Code:* t:commandLink value=Add Reminders styleClass=linkClass action=#{reminderController.getExistingRemindersList} actionListener=#{breadCrumbNavigatorBean.updateBreadCrumb} rendered=#{!physicianHomeController.showRemindersMoreLink} t:updateActionListener property=#{breadCrumbNavigatorBean.displayText} value=#{msg['breadcrumb.label.reminders']}/ /t:commandLink In the* backing bean* I just defined a String property with the name displayText. */Following is the observation:/* 1. The displayText in the backing bean is null. In other words the EL expression does not get parsed resulting in a null value. 2. If a literal string is given in place of an EL expression then the value is correctly populated in the backing bean. 3. Based on the result from point number 2 - I tried just outputting the value of the EL expression using: t:outputLabel value=#{msg['breadcrumb.label.reminders']} styleClass=outputLabelText/ The same expression is now parsed properly and the value appears on the page. This means that there is nothing wrong with the EL expression. I am not sure what is going on? Why will t:updateActionListener refuse to parse an EL expression that references a message bundle? Regards, Madhav -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz Sent: Tuesday, March 06, 2007 4:10 PM To: users@myfaces.apache.org Subject: Re: how do you pass/set parameters upon ActionListener execution? I had similar usescases (although not using internationalisation) in my current up a dozend times, the mechanism itself works, I can only guess here, first of all which myfaces version do you use and which tomahawk version. I can recommend to go to the latest 1.1.5 stable and use the tomahawk and sandbox nightlies. Secondly check for typos nav.msg.remiders seems like one there is an n missing in reminders typowise, which could be the cause for an empty string
t:commandNavigation2 activeOnViewId attribute does not work as described in an earlier thread
Hi All, I have left navigation menu (t:panelNavigation2 and embedded t:commandNavigation2 components) and a breadcrumb component. To keep both in synch I added activeOnViewId to the t:commandNavigation2 components. But when the breadcrumb is clicked and the control is taken to another view ID then the previously open/selected left navigation menu items do not change any state. Say for instance my breadcrumb says - Home Inbox My left Navigation menu state - Message Center Inbox Now when I click on breadcrumb Home link then the left navigation should change to Home and the Message Center should close and be in a not selected state. This does not happen even though I have added proper view ID's to each of the links. Any reason of why this will not work? Rgds, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: how does UICommand execute the action binding?
Thanks Mike, So what i understand is that if only from-action is given, then irrespective of the outcome the control will go to the view id specified. For instance the folllowing rule is define din the faces config file: navigation-rule from-view-id/bingo.jsp/from-view-id navigation-case from-action#{sombean.someAction}/from-action to-view-id/tringo.jsp/to-view-id /navigation-case /navigation-rule Does the above rule mean that if someAction method is executed then irrespective of the outcome the control will always go to tringo.jsp? If my interpretation is correct then can you think of any place where this might be used? Now consider a second example: navigation-rule from-view-id/bingo.jsp/from-view-id navigation-case from-action#{sombean.someAction}/from-action from-outcomesuccess/from-outcome to-view-id/tringo.jsp/to-view-id /navigation-case /navigation-rule Does it mean that only if the output after executing someAction is success only then the control will go to tringo.jsp? If that is the case then why not just give the from-outcome, why is the combination of both the tags is required? Consider a third case: navigation-rule from-view-id/bingo.jsp/from-view-id navigation-case from-action#{sombean.someAction}/from-action to-view-id/tringo.jsp/to-view-id /navigation-case navigation-case from-outcomesuccess/from-action to-view-id/tringo123.jsp/to-view-id /navigation-case /navigation-rule Now if someAction method is executed and the outcome is success then where will the control go? Will it go to tringo.jsp as defined by the first navigation-case or will it go to tringo123.jsp as defined in the second navigation case as both the cases are satisfied? ~madhav On 3/3/07, Mike Kienenberger [EMAIL PROTECTED] wrote: See this thread: http://www.mail-archive.com/users@myfaces.apache.org/msg34510.html and this document http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFConfigure7.html On 3/3/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Thanks Volker, I figured that out, but still i cannot understand the usage of from-action. I needed the above information because i needed to call an action method and then transfer the control the navigation handler programmatically. I was able to achieve the same by first creating a MethodBinding, invoking it, getting the return value as an outcome and passing the same to the handleNavigation method of the NavigationHandler. It worked for me. ~madhav On 3/3/07, Volker Weber [EMAIL PROTECTED] wrote: Hi Madhav, the action methodBinding is handled in the defaultActionListener, which is invoked also in broadcast() from UICommand. NavigationHandler.handleNavigation() is done in processAction of defaultActionListener: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ActionListenerImpl.java?view=markup Regards, Volker 2007/3/2, Madhav Bhargava [EMAIL PROTECTED] : Hi All, HtmlCommandLink and HtmlCommandButton extend UICommand component class. UICommand creates 2 MethodBindings – action and actionListener. I was looking at the code for UICommand class and I could locate where the registered actionListeners were getting executed – * broadcast* method but I was not able to figure out where the action method was getting invoked and how does NavigationHandler takes control from there on. In NavigationHandler javadoc the following is mentioned: public abstract void *handleNavigation*(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome) *Parameters:* context - The FacesContexthttp://java.sun.com/javaee/javaserverfaces/1.1/docs/api/javax/faces/context/FacesContext.htmlfor the current request fromAction - The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means outcome - The logical outcome returned by a previous invoked application action (which may be null) Does it mean that if I create a MethodBinding out of an action EL expression and then invoke the same, then will it execute the action method and then automatically call the method specified above to navigate to next view according to the navigation rules defined? Any insight into this will be helpful. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its
Re: how does UICommand execute the action binding?
Thanks Volker, I figured that out, but still i cannot understand the usage of from-action. I needed the above information because i needed to call an action method and then transfer the control the navigation handler programmatically. I was able to achieve the same by first creating a MethodBinding, invoking it, getting the return value as an outcome and passing the same to the handleNavigation method of the NavigationHandler. It worked for me. ~madhav On 3/3/07, Volker Weber [EMAIL PROTECTED] wrote: Hi Madhav, the action methodBinding is handled in the defaultActionListener, which is invoked also in broadcast() from UICommand. NavigationHandler.handleNavigation() is done in processAction of defaultActionListener: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ActionListenerImpl.java?view=markup Regards, Volker 2007/3/2, Madhav Bhargava [EMAIL PROTECTED] : Hi All, HtmlCommandLink and HtmlCommandButton extend UICommand component class. UICommand creates 2 MethodBindings – action and actionListener. I was looking at the code for UICommand class and I could locate where the registered actionListeners were getting executed – *broadcast*method but I was not able to figure out where the action method was getting invoked and how does NavigationHandler takes control from there on. In NavigationHandler javadoc the following is mentioned: public abstract void *handleNavigation*(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome) *Parameters:* context - The FacesContexthttp://java.sun.com/javaee/javaserverfaces/1.1/docs/api/javax/faces/context/FacesContext.htmlfor the current request fromAction - The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means outcome - The logical outcome returned by a previous invoked application action (which may be null) Does it mean that if I create a MethodBinding out of an action EL expression and then invoke the same, then will it execute the action method and then automatically call the method specified above to navigate to next view according to the navigation rules defined? Any insight into this will be helpful. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
how does UICommand execute the action binding?
Hi All, HtmlCommandLink and HtmlCommandButton extend UICommand component class. UICommand creates 2 MethodBindings - action and actionListener. I was looking at the code for UICommand class and I could locate where the registered actionListeners were getting executed - broadcast method but I was not able to figure out where the action method was getting invoked and how does NavigationHandler takes control from there on. In NavigationHandler javadoc the following is mentioned: public abstract void handleNavigation(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome) Parameters: context - The FacesContext http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/javax/faces/con text/FacesContext.html for the current request fromAction - The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means outcome - The logical outcome returned by a previous invoked application action (which may be null) Does it mean that if I create a MethodBinding out of an action EL expression and then invoke the same, then will it execute the action method and then automatically call the method specified above to navigate to next view according to the navigation rules defined? Any insight into this will be helpful. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how to avoid validation
Use subForm component. From: Srinivas V [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:01 PM To: MyFaces Discussion Subject: how to avoid validation I have a selectBox, some text boxes and a commandbutton. on change of select box I need to show some text boxes. On click of the commandbutton i need to validate the validate the textboxes. But on change of select box it is validating the text boxes. How to avoid this validation on change of select box for which i submit the page? Any ideas will be appriciated. Regards srinivas CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how to avoid validation
You can have a look at: http://www.irian.at/myfaces-sandbox/home.jsf On the page you will examples for all the components of sanbox. You can look at SubForm - Partial validation and model update with SubForms http://www.irian.at/myfaces-sandbox/subForm.jsf Other place you can look for example code is the source repository : http://myfaces.apache.org/source-repository.html You can browse the online source repo and check out the examples. These will the same that are present at irian site given above. ~madhav From: Srinivas V [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:13 PM To: MyFaces Discussion Subject: Re: how to avoid validation can you give me an example? On 3/2/07, Madhav Bhargava [EMAIL PROTECTED] wrote: Use subForm component. From: Srinivas V [mailto: [EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:01 PM To: MyFaces Discussion Subject: how to avoid validation I have a selectBox, some text boxes and a commandbutton. on change of select box I need to show some text boxes. On click of the commandbutton i need to validate the validate the textboxes. But on change of select box it is validating the text boxes. How to avoid this validation on change of select box for which i submit the page? Any ideas will be appriciated. Regards srinivas CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how does UICommand execute the action binding?
One more thing: Can anyone explain the parameters that are required in the handleNavigation method. Why is fromAction and outcome both required? Also to properly identify to-view-id from-view-id also might be required? Does handleNavigation handle that implicitely and is therefore not required to be a parameter? ~madhav From: Madhav Bhargava [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 1:55 PM To: MyFaces Discussion Subject: how does UICommand execute the action binding? Hi All, HtmlCommandLink and HtmlCommandButton extend UICommand component class. UICommand creates 2 MethodBindings - action and actionListener. I was looking at the code for UICommand class and I could locate where the registered actionListeners were getting executed - broadcast method but I was not able to figure out where the action method was getting invoked and how does NavigationHandler takes control from there on. In NavigationHandler javadoc the following is mentioned: public abstract void handleNavigation(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome) Parameters: context - The FacesContext http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/javax/faces/con text/FacesContext.html for the current request fromAction - The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means outcome - The logical outcome returned by a previous invoked application action (which may be null) Does it mean that if I create a MethodBinding out of an action EL expression and then invoke the same, then will it execute the action method and then automatically call the method specified above to navigate to next view according to the navigation rules defined? Any insight into this will be helpful. Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how to avoid validation
I am not sure about the version it was added. I would get the latest versions of tomahawk/sanbox. From: Srinivas V [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 3:44 PM To: MyFaces Discussion Subject: Re: how to avoid validation also when is subForm tag added to sandbox? which version? I am having initial version. On 3/2/07, Srinivas V [EMAIL PROTECTED] wrote: For command link t:commandLink id=genreport1 value=#{msgBundle.EPCMGR_Reports_ViewReport} action=#{reportsBean.getReport} target=_new rendered=#{ reportsBean.renderViewReport} styleClass=kiosk_cmd_link_for_report actionFor=inputValuesForm /t:commandLink I am getting an exception Attribute actionFor invalid for tag commandLink according to TLD When is actionFor added? is it in tomahawk initial release? (myfaces 1.1) On 3/2/07, Madhav Bhargava [EMAIL PROTECTED] wrote: You can have a look at: http://www.irian.at/myfaces-sandbox/home.jsf On the page you will examples for all the components of sanbox. You can look at SubForm - Partial validation and model update with SubForms http://www.irian.at/myfaces-sandbox/subForm.jsf Other place you can look for example code is the source repository : http://myfaces.apache.org/source-repository.html You can browse the online source repo and check out the examples. These will the same that are present at irian site given above. ~madhav From: Srinivas V [mailto: [EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:13 PM To: MyFaces Discussion Subject: Re: how to avoid validation can you give me an example? On 3/2/07, Madhav Bhargava [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Use subForm component. From: Srinivas V [mailto: [EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:01 PM To: MyFaces Discussion Subject: how to avoid validation I have a selectBox, some text boxes and a commandbutton. on change of select box I need to show some text boxes. On click of the commandbutton i need to validate the validate the textboxes. But on change of select box it is validating the text boxes. How to avoid this validation on change of select box for which i submit the page? Any ideas will be appriciated. Regards srinivas CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
RE: how to avoid validation
I am not sure which version of tomahawk are you using? Check out the TLD documentation at: http://myfaces.apache.org/tomahawk/tlddoc/index.html You will find actionFor attribute as part of both t:commandLink and t:commandButton Rgds, Madhav From: Srinivas V [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 3:40 PM To: MyFaces Discussion Subject: Re: how to avoid validation For command link t:commandLink id=genreport1 value=#{msgBundle.EPCMGR_Reports_ViewReport} action=#{reportsBean.getReport} target=_new rendered=#{ reportsBean.renderViewReport} styleClass=kiosk_cmd_link_for_report actionFor=inputValuesForm /t:commandLink I am getting an exception Attribute actionFor invalid for tag commandLink according to TLD When is actionFor added? is it in tomahawk initial release? (myfaces 1.1) On 3/2/07, Madhav Bhargava [EMAIL PROTECTED] wrote: You can have a look at: http://www.irian.at/myfaces-sandbox/home.jsf On the page you will examples for all the components of sanbox. You can look at SubForm - Partial validation and model update with SubForms http://www.irian.at/myfaces-sandbox/subForm.jsf Other place you can look for example code is the source repository : http://myfaces.apache.org/source-repository.html You can browse the online source repo and check out the examples. These will the same that are present at irian site given above. ~madhav From: Srinivas V [mailto: [EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:13 PM To: MyFaces Discussion Subject: Re: how to avoid validation can you give me an example? On 3/2/07, Madhav Bhargava [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Use subForm component. From: Srinivas V [mailto: [EMAIL PROTECTED] Sent: Friday, March 02, 2007 2:01 PM To: MyFaces Discussion Subject: how to avoid validation I have a selectBox, some text boxes and a commandbutton. on change of select box I need to show some text boxes. On click of the commandbutton i need to validate the validate the textboxes. But on change of select box it is validating the text boxes. How to avoid this validation on change of select box for which i submit the page? Any ideas will be appriciated. Regards srinivas CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
t:datatable with commandLink and parameter
Sending it again. For some reason the mail never got delivered. _ From: Madhav Bhargava Sent: Wednesday, February 28, 2007 11:29 AM To: 'MyFaces Discussion' Subject: RE: t:datatable with commandLink and parameter Hi Craig, According to the tutorial at the link: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFConfigure7.html The navigation criteria are defined by optional from-outcome and from-action elements. The from-outcome element defines a logical outcome, such as success. The from-action element uses a method-binding expression to refer to an action method that returns a String, which is the logical outcome. The method performs some logic to determine the outcome and returns the outcome. Does it mean that from-action will not execute the action method but only derive the outcome of the action method? If yes then what happens when the return String value is a result of the computation that goes inside the action method? And if it executes the action method then what is the difference from using from-outcome as it is finally going to go to the outcome produced by the action method. Could you please throw some more light on from-action usage? Rgds, Madhav -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Wednesday, February 28, 2007 7:24 AM To: MyFaces Discussion Subject: Re: t:datatable with commandLink and parameter On 2/27/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Simon, I don't have any JSF books handy. What's the difference between from-action and from-outcome? I thought outcome was the string returned from an action method? You can use either or both. * from-action describes the EL expression that triggered calling your action. This is useful if you have multiple buttons on the form, bound to different actions. (It's also legal to have more than one command component bound to the same action method ... for example, a next page or previous page link at both the top and bottom of a long page. * from-outcome describes the logical outcome returned by whatever action was invoked. This is useful if you want to go different places depending on what happened inside an action. If you use just from-action, your navigation rule is triggered whenever that action is executed, no matter what outcome was returned. If you use just from-outcome, your navigation rule is triggered when that outcome is returned by any action that was processed. Or, you can use them together to define more precisely when this navigation should be triggered. Craig On 2/27/07, Simon Kitching [EMAIL PROTECTED] wrote: Mike Kienenberger wrote: By the way, I don't think this is legal: from-action#{ userBackingBean.prepareForEdit}/from-action If it is legal, I doubt that's the correct syntax. Yep. The from-action value is meant to match the string *returned* from an action method. It is not an EL expression. I suggest you find a good JSF book and read the section on navigation. Regards, Simon CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
where to find source code for trinidad breadcrumb
Hi All, Can anyone point out the location where I can find the code for Trinidadbreadcrumb component? I have been looking for it for quite some time and I am unable to locate it. There was a mail on the same non-availability of breadcrumb code and at that time also the code could not be found. Regards, Madhav -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
RE: breadcrumb design
Yes. Unfortunately I am not able to locate the code for it in the svn for Trinidad. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthias Wessendorf Sent: Thursday, February 22, 2007 1:47 PM To: MyFaces Discussion Subject: Re: breadcrumb design trinidad already has that component -M On 2/22/07, AMIR-TAHMASSEB Marc [EMAIL PROTECTED] wrote: Hi Madhav, I'm also planning to create a Breadcrumb component. My philosophie about breadcrumb is the it shows the position of the page in the site map and note the position of the page in the user navigation history. According to this you eliminate the problem of the browser back button. For me there is two possibilities : - each page know where it is. - only an object defined as a Site Map Manager, know where is a page. Using the second possibility, you can imagine that each page give its name to the Site Map Manager and then this one give back a list representing labels and actions for the breadcrumb. This is what I want to do but my biggest probleme is that I don't know how to pass an attribute from a jsp to a Bean, before rendering the jsp... regards, Marc Amir-Tahmasseb From: Madhav Bhargava [mailto:[EMAIL PROTECTED] Sent: 21 February 2007 10:44 To: MyFaces Discussion Subject: breadcrumb design Hi All, I am in the process of creating a component for breadcrumb generation for my project. I have following in mind: Create a custom component for breadcrumb, with a renderer and a tag class. Create a model bean that will back this component and will contain the latest breadcrumb links and their navigation outcomes. This bean will be at the session level Create a breadcrumb event and queue that event in the decode method of the renderer. This event will then be broadcasted to all the interested listeners. In my case it will be the left menu which will have to reflect where the user is. Every page which requires a breadcrumb will have a breadcrumb tag defined in the page. There will be a hidden field on every page that will store the depth (or the index of the last link) of the breadcrumb. Using this value the list of links in the model will be updated. Following are some problems that I am currently facing: There can be many links present all over the place which can result in the page control going to some page else which means that there will be a change in the breadcrumb as well. How do you capture such events and make the breadcrumb change? How do you take care of the browser back button? Regards, Madhav -- Matthias Wessendorf http://tinyurl.com/fmywh further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
breadcrumb design
Hi All, I am in the process of creating a component for breadcrumb generation for my project. I have following in mind: 1. Create a custom component for breadcrumb, with a renderer and a tag class. 2. Create a model bean that will back this component and will contain the latest breadcrumb links and their navigation outcomes. This bean will be at the session level 3. Create a breadcrumb event and queue that event in the decode method of the renderer. This event will then be broadcasted to all the interested listeners. In my case it will be the left menu which will have to reflect where the user is. Every page which requires a breadcrumb will have a breadcrumb tag defined in the page. There will be a hidden field on every page that will store the depth (or the index of the last link) of the breadcrumb. Using this value the list of links in the model will be updated. Following are some problems that I am currently facing: 1. There can be many links present all over the place which can result in the page control going to some page else which means that there will be a change in the breadcrumb as well. How do you capture such events and make the breadcrumb change? 2. How do you take care of the browser back button? Regards, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: stateChangeNotifier does not work with t:commandButton properly
Hi Nako, Thanks for the pointer. I have to use a command button. Is there anyway (apart from styling the command link as a button) to check if there is a change in the form when the user tries to go some where else? Thanks, Madhav On 1/31/07, Nacho Estrada [EMAIL PROTECTED] wrote: Some months ago... http://comments.gmane.org/gmane.comp.jakarta.myfaces.user/26829 Any changes? On 1/29/07, Madhav Bhargava [EMAIL PROTECTED] wrote: I just looked at the renderer code for this component: In the encodeJavascript method following line is present: sb.append(*setTimeout('* + replacedClientId + *Notifier.prepareNotifier()',500);\n*); This will add a timeout of 500. However this setting does not have any effect on command links. Moreover should not this value be configurable? If someone does not want a timeout, rather wants to use to necessary choose before moving ahead then he/she will not be able to do it. ~madhav -- *From:* Madhav Bhargava [mailto:[EMAIL PROTECTED] *Sent:* Monday, January 29, 2007 1:12 PM *To:* MyFaces Discussion *Subject:* stateChangeNotifier does not work with t:commandButton properly Hi All, I have been looking for a component like s:stateChangeNotifier for quite some time and I am glad that it is there is sandbox finally. The problem with this component is that it does not work properly with t:commandButton component. Consider the following code: s:stateChangedNotifier confirmationMessage=There are changes in the form. You will loose all data if you choose to leave the form. Do you want to cancel? excludedIds=_patientRegistration_proceed, _patientRegistration_reset disabled=false/ And then you have the following buttons: t:commandButton id=_patientRegistration_proceed forceId=true value=Proceed action=#{patientRegistrationWizardBean.proceed} actionFor=patientRegistration/ t:commandButton id=_patientRegistration_reset forceId=true value=#{msg['button.demographicdetails.reset']} action=#{ patientRegistrationWizardBean.reset}/ t:commandButton id=_patientRegistration_cancel forceId=true value=Cancel action=#{patientRegistrationWizardBean.cancel}/ Now the problem is that when I click the Cancel button then the popup only appears for 2 seconds and then it vanishes and the control goes to the action method attached with the command button. However, this problem is not there with the command link. I have something like: t:commandLink id=_patientRegistration_dummy forceId=true value=dummy/ Now if I click this link then the modal popup stays there till you click a link. I have following questions: 1. Does this component only work with t:commandLink component? 2. If I have a datagrid and one of the columns in the datagrid is a link View Details. Say if there are 20 rows displayed in one page and there are other command buttons on the page to control navigation. Then will I have to put all the ID's for all the links in the column to prevent the popup appearing on click of any of the View Details link? Rgds, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
valueChangeListener does not work in s:subForm component
Hi All, I have a form which has a subForm for partial submits and validation. This sub form has a drop down, following is the code: x--- Cut ---x s:subForm id=test . . . t:selectOneMenu id=selSites onchange=submit() valueChangeListener=#{appointmentSchedulingWizardBean.detailsChanged} value=#{appointmentSchedulingWizardBean.wizard.schedulingDetailsCapture State.site} required=true f:selectItem itemLabel=-Select- itemValue= / f:selectItems value=#{appointmentSchedulingWizardBean.wizard.siteList} / /t:selectOneMenu . . . /s:subForm x--- Cut ---x Problem: Value Change listener for the drop down does not get called. There is a slight flicker on the page which suggests that the form is submitted but I guess none of the values in the subForm are submitted due to which the value change listener is also not called. However if we take this piece of code for the drop down and put it out of a sub form then it will call the value change listener for the component. How do you invoke the value change listener in case of a component inside a subForm? Rgds, Madhav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: Jsf_tree_64
ADF client side state saving is faster and ligther. You can give that a shot. On 1/31/07, Gattu, Praveen [EMAIL PROTECTED] wrote: Ok I tried using the compression flag with the client side save state and it cut down the page size by 2/3. That satisfies my needs for now. However is there a compression ratio parameter that I could tweak. I couldn't find any from the documentation. Also I was reading some blogs from Jacob Hookom, about stateless JSF session, does anyone know whats the status of this. http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin_1.html -Praveen -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 11:16 AM To: MyFaces Discussion Subject: Re: Jsf_tree_64 Gattu, Praveen wrote: Hi Folks - We are using the myfaces(1.1.5 snapshot). I got couple of questions regarding the state save. So far we were using the server side save state to reduce the page size of our pages, but noticed that with this approach, our app cannot work behind a load balancer. We are using Tomcat as webserver, and we donot intend to use tomcat clustering. In order to avoid this we switched to client side save state. Although this solved the load balancing issue, we saw the page sizes increase by 10-15x. A page with server side save state with a size of 18kb, now measures ~300kbyes with client side save state. I noticed that the framework is using jsf_tree_64 hidden field for all the command links, to store some form of data. What is this field used for in the framework? Saving the current component tree. It needs to be stored somewhere, and if you don't want it in the http session (server-side state) then it has to be stored in the form (client-side state). Is there a way to avoid this hidden field, without using the server side save state? Nope. Are there any other approaches I should be looking to solve both load balancing and low page size? Perhaps a sticky load balancer, ie one that is http-session-aware and therefore directs all requests for a specific session to a single tomcat instance? I can't see any other alternatives, if you're opposed to clustering; the tomcat instance that handles the submit must have the component tree data available, and the only options are (a) in the http session, or (b) embedded in the posted data. Regards, Simon -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: Jsf_tree_64
http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_astatesaving~html/ refer the above link for more information. It says that - Client-side state saving with ADF Faces uses tokens and does not require writing to a huge, hidden field that is sent between the client and the server with each request. A simple token instead is stored on the client, which identifies a block of state stored back on the HttpSession. ~madhav On 1/31/07, Madhav Bhargava [EMAIL PROTECTED] wrote: ADF client side state saving is faster and ligther. You can give that a shot. On 1/31/07, Gattu, Praveen [EMAIL PROTECTED] wrote: Ok I tried using the compression flag with the client side save state and it cut down the page size by 2/3. That satisfies my needs for now. However is there a compression ratio parameter that I could tweak. I couldn't find any from the documentation. Also I was reading some blogs from Jacob Hookom, about stateless JSF session, does anyone know whats the status of this. http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin_1.html -Praveen -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 11:16 AM To: MyFaces Discussion Subject: Re: Jsf_tree_64 Gattu, Praveen wrote: Hi Folks - We are using the myfaces(1.1.5 snapshot). I got couple of questions regarding the state save. So far we were using the server side save state to reduce the page size of our pages, but noticed that with this approach, our app cannot work behind a load balancer. We are using Tomcat as webserver, and we donot intend to use tomcat clustering. In order to avoid this we switched to client side save state. Although this solved the load balancing issue, we saw the page sizes increase by 10-15x. A page with server side save state with a size of 18kb, now measures ~300kbyes with client side save state. I noticed that the framework is using jsf_tree_64 hidden field for all the command links, to store some form of data. What is this field used for in the framework? Saving the current component tree. It needs to be stored somewhere, and if you don't want it in the http session (server-side state) then it has to be stored in the form (client-side state). Is there a way to avoid this hidden field, without using the server side save state? Nope. Are there any other approaches I should be looking to solve both load balancing and low page size? Perhaps a sticky load balancer, ie one that is http-session-aware and therefore directs all requests for a specific session to a single tomcat instance? I can't see any other alternatives, if you're opposed to clustering; the tomcat instance that handles the submit must have the component tree data available, and the only options are (a) in the http session, or (b) embedded in the posted data. Regards, Simon -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do