Re: how to add post-data to a redirect from an action
Georg Füchsle schrieb: hallo, I have to call another application out from JSF. To call this application i have to send (xml) data via post to the start-url of this application. I found some example on the web: code ExternalContext extContext = FacesContext.getCurrentInstance().ctx.getExternalContext(); String name = URLEncoder.encode(INTERFACENAME, utf-8); String someData = ?xml version='1.0' encoding='UTF-8'? data caller value='giofyxle'/app value='2'//data/xml; String value = URLEncoder.encode(someData , UTF-8); String viewId = http://www.server.com/startapp/index.html+ '?' + name + = + value; String urlLink = extContext.encodeActionURL(viewId); extContext.redirect(urlLink); /code I tried this code. its calls the new application, but the data is sent via GET: http://www.server.com/startapp/index.html?INTERFACENAME==%3C%3Fxml+version%3D%271.0%27+encoding. So the intefacedata is easily be read by the user. Has anyone any idea how i can make a rediract with POST data? When you say call another application out, do you mean that you want the *user's browser* to send a POST command to some other server, and then display the result returned from that server (without any further processing)? HTTP provides no way to do this; the http-redirect facilities only do GET commands. See the HTTP specification for more details. What your code above does (extContext.redirect) just generates an http redirect response, and the user's browser then processes this response and does the redirect. HTML provides no way to do this either AFAIK. JSF just uses HTTP and HTML, so JSF also has no way to do this. I think you will need to use javascript, ie generate an HTML page that contains an html form with the fields you want, and some javascript that then does document.getElementById(formId).submit() or something similar. Or does call another application outmean that after a JSF submit, you want *your server* to send a POST command to some other server, then process the result before sending back a new page to the user? You can use the apache commons-httpclient library to do things like this. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
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
Re: Error trying to rebuild trinidad-impl project
aurel.sa...@vectorsoftware.ro schrieb: Hello, I want to make rebuild locally source sode of trinidad but I get errors when I trying to install trinidad-impl project (mvn install ) The system is out of resources : java.lang.OutOfMemoryError java heap source . I have 2Gb RAM memory . Can you provide me some url with docs that can help me with this issue? It doesn't matter how much ram you have if Java isn't configured to use it :-) Try: export MAVEN_OPTS=-Xmx1024m -Xms512m Google MAVEN_OPTS for more info. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [Orchestra] Ask for how to set conversation.access in spring framework?
On Sat, 2009-04-11 at 16:56 +0800, Palvin wrote: Hi, Who can provide a usage details of orchestra? I've configued myfacesspring, in spring's context file point the manag bean's scope to conversation.access run in browser, the page error message is:No Scope registered for scope 'conversation.access' Caused by: java.lang.IllegalStateException - No Scope registered for scope 'conversation.access'. I don't know how to configure the conversation.access scope, is it drived from orchestra project? On the other hands, I've downloaded the orchestra package and found it's only 24k [file:myfaces-orchestra-core15-1.0.jar], can't found any demo of it in apache.org. Have you read this page? http://myfaces.apache.org/orchestra/myfaces-orchestra-core/installation.html There is an example webapp. Not all of it works unfortunately, but the simpler examples do. See the Project Information | Source Repository section of the orchestra examples project homepage: http://myfaces.apache.org/orchestra/myfaces-orchestra-examples-project/index.html If you have any more questions about Orchestra, please put [Orchestra] in the subject line of your email (I've fixed this reply). Putting [myfaces] there isn't very useful, as we know this is about myfaces - it was sent to the myfaces email list :-) Regards, Simon
Re: [Orchestra] Ask for how to set conversation.access in spring framework?
On Sat, 2009-04-11 at 19:05 +0200, Simon Kitching wrote: On Sat, 2009-04-11 at 16:56 +0800, Palvin wrote: Hi, Who can provide a usage details of orchestra? I've configued myfacesspring, in spring's context file point the manag bean's scope to conversation.access run in browser, the page error message is:No Scope registered for scope 'conversation.access' Caused by: java.lang.IllegalStateException - No Scope registered for scope 'conversation.access'. I don't know how to configure the conversation.access scope, is it drived from orchestra project? On the other hands, I've downloaded the orchestra package and found it's only 24k [file:myfaces-orchestra-core15-1.0.jar], can't found any demo of it in apache.org. Have you read this page? http://myfaces.apache.org/orchestra/myfaces-orchestra-core/installation.html There is an example webapp. Not all of it works unfortunately, but the simpler examples do. See the Project Information | Source Repository section of the orchestra examples project homepage: http://myfaces.apache.org/orchestra/myfaces-orchestra-examples-project/index.html If you have any more questions about Orchestra, please put [Orchestra] in the subject line of your email (I've fixed this reply). Putting [myfaces] there isn't very useful, as we know this is about myfaces - it was sent to the myfaces email list :-) Oh and by the way, you need the orchestra-core jarfile in your project to use orchestra. The orchestra-core15 package is just a few optional extras for java1.5 users. Regards, Simon
Re: [Trinidad] Ask for the backing bean's scope in application.
Palvin schrieb: Hi, I'm studing usage the trinidad components recently and I've found that some of the tutorials set the backing bean's scope is session in their demon always and I'm doubt it's performance in auctual project. Who can provide some advise about it. If anyone can provide a more actual tutorials it's very appreciation of my. This is really a general JSF question, not specific to Trinidad. You are quite right to be worried about the use of session. It works fine for simple demo and tutorial applications, but applications with lots of users do have to be worried about session-scope usage. Unfortunately there isn't an easy answer. This subject could easily fill a couple of chapters in a good JSF textbook - but as far as I know, no JSF textbook has yet written about this subject. The best solution is to just use request-scope for everything. However in practice this can be very inconvenient to do. There are a number of libraries that provide a conversation scope for beans, which is somewhere in between request and session scope. In other words, it works like session-scope, but makes it easier to remove objects from the session when they are no longer needed. You might like to look at: * Myfaces Orchestra * Trinidad page flow * Seam * Spring WebFlow The Myfaces Orchestra site has an overview of what conversation scope is, and what the difference is between the above implementations. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: cookmenu strange problem
gbattine schrieb: Hello guys, I've to ask your help with a problem I can't solve. I'm tring to use Myfaces-Tomahawk Cookmenu. To do it I followed this tutorial http://www.roseindia.net/jsf/apache-myfaces-tomahawk/tomahawk_jscookMenu_tag.shtml I'm not able to understand where I fail, but when I run application it gives me exception javax.servlet.ServletException: Filter execution threw an exception org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390) root cause java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUpload You need to add the commons-fileupload library to your path: http://commons.apache.org/fileupload/ http://repo2.maven.org/maven2/commons-fileupload/commons-fileupload/ The ExtensionsFilter unfortunately does two different things: * serve javascript and other resources for tomahawk components * handle file uploads You need the ExtensionsFilter to do the first one. But that means you need to add commons-fileupload jarfile to your project even if you don't use the t:fileupload component. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Suffix added to component id when including files
Sujal Nagarkar schrieb: Hi, While using jsp:include in a jsf page, the included page control ids are modified. Pc1 is added to end of each control. If anyone has a solution for this, please do reply. This is intentional; it allows jsp:include to be used inside a foreach loop without causing duplicate JSF component ids, and various other cases. Sun's Mojarra JSF implementation does the same. Why does this matter to you? Your applications generally should not care what id is assigned to components by the JSF framework. Having said that, I would personally be happy to see a configuration switch in myfaces to allow this id-munging to be disabled. It helps only in some odd corner cases that most people never encounter, and does make the ids ugly. If someone were to write a patch to add such a config option, it would get my +1 vote (or does such a config option exist already?). Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: ValueChangeListener called twice
Hi Joe, On Mon, 2009-04-06 at 13:31 -0500, Knudsen, Joe wrote: Can a valueChangeListener be called twice? I am using both a binding= and a value= on a h:selectOneMenu, and the valueChangeListener gets called twice. Wonder if that is an issue with MyFaces I am using version 1.2.5. I think I can refactor out the binding statement or I could add logic to look for the multiple calling. Any ideas? A valueChangeListener should only be called once. During the process values phase of a request, each component in the tree is told to check the submitted form. The component looks for a submitted value with id equal to the component clientId. It then runs its converters (if any) and its validators (if any). Then it reads the property it is bound to (via the value attribute on the component), and if that is different from the value it just got from the form (after conversion) then it queues a ValueChangeEvent for later processing. Each component is told to do the above just once per request, so it will queue at most one ValueChangeEvent. So I don't know why you would be getting two callbacks. Do be careful with bindings. A binding should NEVER be used to bind a component to anything except a request-scoped backing bean. Well, you can do it if you explicitly clear the property at the end of each request, but that's often not easy to do. In general, avoid binding completely wherever possible. I suppose that if somehow due to bad bindings, there were two components with the same id in the component tree, then both of them would do the above processing, and so two change events would be generated. Not sure if it is possible to get that scenario, but definitely something to check... I would first try checking for duplicated components in the tree; just walk the tree starting from the UIViewRoot, and check whether your problem component is in the tree twice. You could also put a breakpoint in the myfaces code and see what ValueChangeEvents are being registered (see UIViewRoot.queueEvent). Regards, Simon
Re: Missing tld?
The tlds are there. I just downloaded from the official maven repo: http://repo2.maven.org/maven2/org/apache/myfaces/core/myfaces-impl/1.2.6/ jar tf myfaces-impl-1.2.6.jar | grep tld META-INF/myfaces_html.tld META-INF/myfaces_core.tld Regards, Simon Roberto Leibman schrieb: I didn't trust eclipse to tell me, I used jar directly, and there are no tld's in the myfaces-impl or myfaces-api that come with 1.2.6: robe...@uberwald:~/workspace/thirdparty/lib/jsf$ ls myfaces-api-1.2.6.jar myfaces-impl-1.2.6.jar tomahawk12-1.1.8.jar robe...@uberwald:~/workspace/thirdparty/lib/jsf$ ls -1 | xargs -i jar -tf {} | grep tld META-INF/tomahawk.tld Thanks, though. Roberto Leonardo Uribe wrote: Hi It is a problem from eclipse. You can find those files inside myfaces jar files (look for two files called myfaces_core.tld and myfaces_html.tld on myfaces-impl jar). regards Leonardo Uribe On Thu, Apr 2, 2009 at 8:29 PM, Roberto Leibman robe...@freezlets.com mailto:robe...@freezlets.com wrote: I downloaded the latest version of myfaces, I had been using 1.1 and want to see what's new in 1.2. My first stumbling block is the missing tld's. Eclipse gives me the following error - Cannot find the tag library descriptor for http://java.sun.com/jsf/core; This tld was previously included in the myfaces jar, I downloaded some examples from the myfaces site which included myfaces 1.2.4 and the tld's were inside there! However, the latest version (1.2.6) does NOT include them. Did I miss something obvious? Thanks Roberto
Re: Missing tld?
I checked the tar.gz download bundle. And the tlds are also there. I downloaded myfaces-core-1.2.6-bin.tar.gz and checked the md5sum is correct. Then I unpacked it. In the myfaces-core-1.2.6-bin/lib subdir: jar tf myfaces-impl-1.2.6.jar | grep tld META-INF/myfaces_html.tld META-INF/myfaces_core.tld Which bundle did you download from the download site, and exactly which mirror did you get it from? And does the md5 checksum match for the bundle you downloaded? Regards, Simon Roberto Leibman schrieb: You're right, they are there. They don't seem to be in the copy available from http://myfaces.apache.org/download.html! Simon Kitching wrote: The tlds are there. I just downloaded from the official maven repo: http://repo2.maven.org/maven2/org/apache/myfaces/core/myfaces-impl/1.2.6/ jar tf myfaces-impl-1.2.6.jar | grep tld META-INF/myfaces_html.tld META-INF/myfaces_core.tld Regards, Simon Roberto Leibman schrieb: I didn't trust eclipse to tell me, I used jar directly, and there are no tld's in the myfaces-impl or myfaces-api that come with 1.2.6: robe...@uberwald:~/workspace/thirdparty/lib/jsf$ ls myfaces-api-1.2.6.jar myfaces-impl-1.2.6.jar tomahawk12-1.1.8.jar robe...@uberwald:~/workspace/thirdparty/lib/jsf$ ls -1 | xargs -i jar -tf {} | grep tld META-INF/tomahawk.tld Thanks, though. Roberto Leonardo Uribe wrote: Hi It is a problem from eclipse. You can find those files inside myfaces jar files (look for two files called myfaces_core.tld and myfaces_html.tld on myfaces-impl jar). regards Leonardo Uribe On Thu, Apr 2, 2009 at 8:29 PM, Roberto Leibman robe...@freezlets.com mailto:robe...@freezlets.com wrote: I downloaded the latest version of myfaces, I had been using 1.1 and want to see what's new in 1.2. My first stumbling block is the missing tld's. Eclipse gives me the following error - Cannot find the tag library descriptor for http://java.sun.com/jsf/core; This tld was previously included in the myfaces jar, I downloaded some examples from the myfaces site which included myfaces 1.2.4 and the tld's were inside there! However, the latest version (1.2.6) does NOT include them. Did I miss something obvious? Thanks Roberto
Re: TOMAHAWK t:inputCalendar java script problem popup
Klaus SCHUSTER schrieb: Hi, I am using a t:inputCalendar tag from Tomahawk 1.1.8: [code] t:inputCalendar id=mycal addResources=false monthYearRowClass=yearMonthHeader weekRowClass=weekHeader popupButtonStyleClass=standard_bold currentDayCellClass=currentDayCell value=#{BB.geburtsdatum} renderAsPopup=true popupTodayString=Heute ist der: helpText=MM/DD/ /t:inputCalendar h:outputText value=#{BB.geburtsdatum} / [/code] geburtsdatum is a DATE in my BB with its getter and setter. The t:inputCalendar is embedded in an form. When I open the JSF Page with Internet Explorer 6 I get the following JavaScript error: [code] org_apache_myfaces_PopupCalendar() is undefined [/code] Does this happen with browsers more modern than IE6? That is pretty old... The other likely issue is to do with the ExtensionsFilter. Somewhere in the generated HTML page there should be something that looks roughly like script src=/mywebapp/faces/myfacesExtensionResource/123456/inputCalendar.js /script This is what loads the javascript that the calendar component needs. But these urls require you to set up the tomahawk ExtensionsFilter, as described by this page: http://myfaces.apache.org/tomahawk/extensionsFilter.html If you use firefox, then the live http headers extension will tell you whether the url loads correctly or not. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Antwort: Re: TOMAHAWK t:inputCalendar java script problem popup
Klaus SCHUSTER schrieb: Hi, Thanks for the fast reply. Personally, I find emails in mixed posting style hard to read, and therefore don't bother to read them. It's entirely your choice, but *if* you want any replies from me, then you should avoid doing this (as pointed out in my signature). Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: TOMAHAWK t:inputCalendar java script problem popup
Klaus SCHUSTER schrieb: Simon Kitching skitch...@apache.org schrieb am 01.04.2009 11:30:36: Klaus SCHUSTER schrieb: Hi, I am using a t:inputCalendar tag from Tomahawk 1.1.8: [code] t:inputCalendar id=mycal addResources=false monthYearRowClass=yearMonthHeader weekRowClass=weekHeader popupButtonStyleClass=standard_bold currentDayCellClass=currentDayCell value=#{BB.geburtsdatum} renderAsPopup=true popupTodayString=Heute ist der: helpText=MM/DD/ /t:inputCalendar h:outputText value=#{BB.geburtsdatum} / [/code] geburtsdatum is a DATE in my BB with its getter and setter. The t:inputCalendar is embedded in an form. When I open the JSF Page with Internet Explorer 6 I get the following JavaScript error: [code] org_apache_myfaces_PopupCalendar() is undefined [/code] Does this happen with browsers more modern than IE6? That is pretty old... I am currently using Internet Explorer 7. It is not possible to use Firefox for my web project. The other likely issue is to do with the ExtensionsFilter. Somewhere in the generated HTML page there should be something that looks roughly like script src=/mywebapp/faces/myfacesExtensionResource/123456/inputCalendar.js /script This is what loads the javascript that the calendar component needs. But these urls require you to set up the tomahawk ExtensionsFilter, as described by this page: http://myfaces.apache.org/tomahawk/extensionsFilter.html If you use firefox, then the live http headers extension will tell you whether the url loads correctly or not. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style) I am already using the extension filter as mentioned at the given link. Here is my web.xml containing all necessary inputs: filter-mapping filter-nameMyFacesExtensionsFilter/filter-name url-pattern/faces/myFacesExtensionResource/*/url-pattern /filter-mapping filter-mapping filter-nameMyFacesExtensionsFilter/filter-name url-pattern*.faces/url-pattern /filter-mapping filter-mapping filter-nameMyFacesExtensionsFilter/filter-name servlet-nameFaces Servlet/servlet-name /filter-mapping servlet I am using *.faces urls therefore is the url-pattern set to this file extension. I only see the following java Script tags in my renederd JSF File: script type=text/javascript src=/mywebapp/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12385798/inputTextHelp.HtmlTextHelpRenderer/inputTextHelp.js Is it possible to set this required java script js file manually? I am using Websphere Application Server 6.1 As a quick workaround for whatever the problem is, you could certainly unpack the tomahawk jarfile, find the right javascript files, and add them directly to your project. Then you would need to manually add the right script src=... tags into any page that uses t:inputCalendar. See the end of the email for the list of javascript files needed by the inputCalendar in popup mode. However t:inputCalendar definitely works; the app I work on every day uses it. There is a small probability that this is something due to the servlet engine (I use tomcat, not websphere) or the JSF impl (I use mojarra, not myfaces). But I'm pretty sure we would have had many more problem reports if this was a common issue. Are you using Trinidad? I remember seeing some emails in this list about problems with ExtensionsFilter and trinidad (the filters need to be declared in web.xml in just the right order for them to work). You say, however, that the html page doesn't have any script tag at all that is referencing an inputCalendar script. That is odd. You mentioned before that you have been experimenting with changing the myfaces resources-handling code. Are you sure you didn't leave any of your changes in by accident? Class org.apache.myfaces.custom.calendar.HtmlCalendarRenderer has this: if(inputCalendar.isAddResources()) addScriptAndCSSResources(facesContext, inputCalendar); The inputCalendar.isAddResources method looks ok. You will find just an abstract method with annotation on AbstractHtmlInputCalendar; the actual component class HtmlInputCalendar is auto-generated. The generated code (found in target/myfaces-builder-plugin dir after doing build) has: public boolean isAddResources() { if (_addResourcesSet) { return _addResources; } ValueBinding vb = getValueBinding(addResources); if (vb != null) { return ((Boolean) vb.getValue(getFacesContext())).booleanValue(); } return true; } In other words, it *does* return true by default, so this looks ok. The addScriptAndCSSResources method does: if(javascriptLocation==null) { addresource.addJavaScriptAtPosition(facesContext
Re: Javascript in button element
For normal command-button usage, the current html page is submitted and *completely* replaced by a new HTML page. So it makes no sense to talk about running javascript after the action. Are you perhaps using these command-buttons within an AJAX pane, and want some javascript to execute after the AJAX request that the button triggers has completed? drizzo schrieb: but onClick event is triggered after the action tag or before? If is before, there is a way to excute a scritp after the action? Anton Gavazuk wrote: Of course use onClick attribute. 2009/3/26 drizzo danilo.ri...@accenture.com Hi everybody, i have this code: tr:commandButton id=responseButton action=#{responseMgdBean.rResponse} icon=/images/ico_#{responseButton.behaviour}.gif binding=#{dealCalculatorMgdBean.buttonAccepted} text=#{responseButton.label} rendered=#{responseButton.visible} shortDesc=#{responseButton.responseValue} blocking=true tr:setActionListener from=#{responseButton.responseValue} to=#{responseMgdBean.responseValue} / tr:setActionListener from=#{responseButton.behaviour} to=#{responseMgdBean.behaviour} / tr:setActionListener from=#{dealCalculatorMgdBean.dealVariantIds} to=#{responseMgdBean.selectedVariantIds} / /tr:commandButton now I should run a js code before or after to execute the action. Which the best solution to do this? Is it possible use the onClick attribute? Please can you help me? Thanks -- View this message in context: http://www.nabble.com/Javascript-in-button-element-tp22719877p22719877.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Javascript in button element
Maybe he means that the JSF page is in a popup window? Or maybe it is in an html Frame? Danilo, you need to write your question better. We cannot read your mind and guess what you are really asking about... Rafa Pérez schrieb: Parent page? If you are inside a dialog, then you can define a returnListener method in the opener button to execute some logic when the dialog is closed. HTH, -- Rafa On Thu, Mar 26, 2009 at 2:54 PM, drizzo danilo.ri...@accenture.com mailto:danilo.ri...@accenture.com wrote: i should notify to parent page the result of the action. so i need wait the action is finished... i don't if is it possible Danilo Simon Kitching wrote: For normal command-button usage, the current html page is submitted and *completely* replaced by a new HTML page. So it makes no sense to talk about running javascript after the action. Are you perhaps using these command-buttons within an AJAX pane, and want some javascript to execute after the AJAX request that the button triggers has completed? drizzo schrieb: but onClick event is triggered after the action tag or before? If is before, there is a way to excute a scritp after the action? Anton Gavazuk wrote: Of course use onClick attribute. 2009/3/26 drizzo danilo.ri...@accenture.com mailto:danilo.ri...@accenture.com Hi everybody, i have this code: tr:commandButton id=responseButton action=#{responseMgdBean.rResponse} icon=/images/ico_#{responseButton.behaviour}.gif binding=#{dealCalculatorMgdBean.buttonAccepted} text=#{responseButton.label} rendered=#{responseButton.visible} shortDesc=#{responseButton.responseValue} blocking=true tr:setActionListener from=#{responseButton.responseValue} to=#{responseMgdBean.responseValue} / tr:setActionListener from=#{responseButton.behaviour} to=#{responseMgdBean.behaviour} / tr:setActionListener from=#{dealCalculatorMgdBean.dealVariantIds} to=#{responseMgdBean.selectedVariantIds} / /tr:commandButton now I should run a js code before or after to execute the action. Which the best solution to do this? Is it possible use the onClick attribute? Please can you help me? Thanks
Re: JSF's Warnings and INFO messages in my LOG
Myfaces core 1.1.x and 1.2.x use apache commons-logging. So does tomahawk. Commons-logging just forwards logged messages to some other logging library, eg log4j or java.util.logging, depending on what libraries you have in your classpath. So it is this *other* logging library that you need to configure in order to control what gets output. If your WEB-INF/lib directory contains log4j.jar, then you will need to add a log4j.properties or log4j.xml file into your WEB-INF/classes dir to configure log4j. See the log4j project for further instructions. If your WEB-INF/lib directory does not contain log4j.jar then this is probably being logged via the java.util.logging implementation provided in the java standard libraries. So you will need to configure that; see the javadoc for the java.util.logging classes for details. Regards, Simon On Tue, 2009-03-24 at 15:00 -0700, Richard Yee wrote: It depends on what logging library you are using. Try setting the default logging level to ERROR or FATAL. Otherwise, just set the logging level for org.apach.myfaces to something higher than INFO. -Richard On Tue, Mar 24, 2009 at 2:56 PM, daniel ccss danielcc...@gmail.com wrote: Anybody, I really want to eliminate myfaces´s messages: Example of the messages: Mar 24, 2009 2:26:35 PM org.apache.myfaces.config.FacesConfigurator feedWebAppConfig INFO: Reading config /WEB-INF/faces-config.xml Mar 24, 2009 2:26:36 PM org.apache.myfaces.config.FacesConfigurator logMetaInf INFO: MyFaces-package : myfaces-api not found. Mar 24, 2009 2:26:36 PM org.apache.myfaces.config.FacesConfigurator logMetaInf INFO: MyFaces-package : myfaces-impl not found. Mar 24, 2009 2:26:36 PM org.apache.myfaces.config.FacesConfigurator logMetaInf INFO: MyFaces-package : tomahawk-sandbox not found. Mar 24, 2009 2:26:36 PM org.apache.myfaces.config.FacesConfigurator logMetaInf INFO: MyFaces-package : tomahawk not found. Mar 24, 2009 2:26:36 PM org.apache.myfaces.shared_impl.util.LocaleUtils toLocale WARNING: Locale name in faces-config.xml null or empty, setting locale to default locale : en_US Mar 24, 2009 2:26:37 PM net.sf.jsfcomp.ext.onload.OnLoadPhaseListener init INFO: OnLoadPhaseListener created Mar 24, 2009 2:26:37 PM org.apache.myfaces.config.FacesConfigurator handleSerialFactory INFO: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory Mar 24, 2009 2:26:37 PM org.apache.myfaces.webapp.StartupServletContextListener initFaces INFO: ServletContext '/software/oracle/oas10r3_3/j2ee/SIACAgenda/applications/SIACAgenda/SIACAgenda/' initialized. 09/03/24 14:26:37 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized Thanks On Tue, Mar 24, 2009 at 1:59 PM, daniel ccss danielcc...@gmail.com wrote: Hi all, I need to disable the JSF´s warning and info messages in my log, how can I do that?? i´m using JSF: myfaces, tomahawk Thanks
Re: Difficulties of initializing a custom component
lightbulb432 schrieb: Where's the correct place to initialize a JSF custom component (in this case, a subclass of HtmlForm)? Because much of my initializing involves manipulating the component's children components, I decided to override getChildren() and do my initialization there - BAD IDEA! ...it turns out that getChildren() is called BEFORE restoreState(), so when you submit the form, restoreState isn't called and getChildren() fails because it's in an uninitialized state. I was thinking about using initializers or constructors, but then I figured to avoid it because some initialization could depend on the component properties getting populated first. (And initializers/constructors would be called before those properties get populated, via their setters.) It looks like I'm running out of options - what's the best practice on this? Thanks. Do you want to initialize this component just once, or repeat the logic once for each http request? To initialize the component when first created, I would suggest that the best place is just before rendering starts. So encodeBegin() seems like a good idea here. Of course if you only want this done once then you would need a boolean initialized flag on the component, and skip initializing if this is set. If you also want to re-initialize the component at the start of a postback, then perhaps decode() is the best place; it seems nicely symmetric with using encodeBegin as the other hook. Using restoreState for initialize-on-postback is also possible, but restoreState is not called if the SERIALIZE_STATE_IN_SESSION configuration flag is false. It is true by default, and I would recommend to always leave it as true, so this is not a big issue. Nevertheless, using decode avoids this problem. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: t:inputFileUpload language
Hi Christian, On Fri, 2009-03-20 at 09:16 -0700, Christian Poecher wrote: Hi Faces users, I am using Trinidad 1.1.6 and use the t:inputFileUpload component. Our application runs mostly on German clients (probably some south-east asians clients soon as well), but our app is completely localized in English. When I use the t:inputFileUpload component it renders a Browse... Button, which will be displayed in the clients OS language. So we end up having a web page in English with just a single Button in a different language. Although not critical, we would like to change it into English as well. Does anyone have a suggestion? File upload controls in HTML are fairly primitive; they provide no option to configure the language (see the HTML spec). And of course all JSF components in the end just generate HTML, so are limited by the abilities of HTML. I suspect it is possible for clever javascript/DOM tricks to create a hidden file-upload button that is clicked by another (normal) html button. However that is not currently part of Tomahawk's fileupload component AFAIK. I believe Trinidad has some clever hacks to make file upload look nicer; I don't know the details though. Regards, Simon
Re: Unsubscribe
Goda, Sunil schrieb: Kindly Unsubscribe me Use the unsubscribe link here (presumably you used the subscribe link there to subscribe..) http://myfaces.apache.org/mail-lists.html
Re: t:selectItems with a map
On Sun, 2009-03-15 at 01:37 +0200, Cagatay Civici wrote: I remember adding this feature in 2006 :) If you have a map you actually don't need t:selectItems much. f:selectItems would suffice where labels are the keys and values are the map values. How would you do that? The f:selectItems docs is clear that it expects an array or list of SelectItem objects. So there appears no way to generate SelectItems automatically. Do you mean that the backing bean would provide a special hand-written method to create a SelectItem element for each (key,value) in the map? That certainly works, but is not quite as nice as having t:selectItems do that for you. Regards, Simon
Re: t:selectItems with a map
On Sun, 2009-03-15 at 13:28 +, Johannes Ruthenberg wrote: Hi everyone! First, a big thank you to Cagatay! I was about to agree with Simon that f:selectItems couldn't do this (judging from the documentation), but it seems that I didn't even try it without the other attributes. I just tried it out and this actually works like expected (selectedRoles being a Long[] and allRoles a MapString, Long): h:selectManyCheckbox id=selectedRoles value=#{myBean.selectedRoles} f:selectItems value=#{myBean.allRoles}/ /h:selectManyCheckbox The same with t:selectItems does not work, even if the documentation states that it should. ;-) Hmm..interesting. This behaviour of building a list of SelectItems from a Map is actually implemented in the SelectItemsIterator class. (1) I'm not sure that this is standard JSF behaviour, ie I am not sure that code depending on this will run on any JSF implementation other than MyFaces. (2) By adding custom Map handing inside the t:selectItems component, this prevents the SelectItemsIterator functionality from working. The SelectItemsIterator class never sees that the value is of type Map because the t:selectItems has already replaced the map with a list of SelectItems it has built itself. The situation seems really messy to me, but it's not clear what the best solution would be. I have created a JIRA issue for this: https://issues.apache.org/jira/browse/TOMAHAWK-1403 Thanks for reporting this Johannes, and sorry you struck such an odd issue shortly after starting with JSF! Regards, Simon
Re: [TOMAHAWK][1.2] what is iconProvider?
On Sat, 2009-03-14 at 08:25 +0200, Anton Gavazuk wrote: Hi all, looked through the list of tags and found iconProvider tag - org.apache.myfaces.custom.tree.taglib.IconProviderTag does anyone know anything about the tag - what is it? I don't know. But from the packagename it appears to be something associated with the old tomahawk tree component. So unless you are using the old tree component, I would expect that it is not useful. Regards, Simon
Re: t:selectItems with a map
On Fri, 2009-03-13 at 20:06 +, Johannes Ruthenberg wrote: Hi! I'm new to this list and to JSF in general. I have a problem with the t:selectItems component and would be grateful for any advice. I'm using MyFaces 1.2.5, Tomahawk 1.1.8 and Facelets. I have this in my file: h:selectManyCheckbox id=selectedRoles value=#{myBean.selectedRoles} layout=pageDirection t:selectItems value=#{myBean.allRoles} var=role itemLabel=#{role} itemValue=#{role} / /h:selectManyCheckbox selectedRoles is a Long[] array, allRoles is a MapString, Long, mapping the role name to their ID. What I want is the ID as value of the checkbox and the name as label text. Above code generates the ID as both the value and the label text though. Now page [1] has a more detailed explanation of the possibilities of the value attribute than [2], but I did check the source code of org.apache.myfaces.custom.selectitems.AbstractUISelectItems and it seems to be the same for both the JSF 1.1 and 1.2 version of the component. [1] http://myfaces.apache.org/tomahawk-project/tomahawk/tagdoc/t_selectItems.html [2] http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_selectItems.html The documentation under [1] says: value: An EL expression that specifies the contents of the selection list. The expression can refer to one of the following: 1. A single SelectItem 2. An array or Collection of SelectItem instances 3. A Map. The contents of the Map are used to create SelectItem instances, where the SelectItem's label is the map's key value, and the SelectItem's value is the map's value. When using a map, it is recommended that an ordered implementation such as java.util.TreeMap is used. Number 3 is exactly what I want, I'm even using a TreeMap. I would expect to get the keys as labels and the values as checkbox values automatically with just using t:selectItems value=#{myBean.allRoles}/. But looking in the source code, I don't see anything to provide this functionality. Unfortunately I also don't see a way to configure the component with the other attributes to do this, since only the value of the Map.Entry is set as request attribute. Meaning, I can't just do something like: t:selectItems value=#{myBean.allRoles} var=mapEntry itemLabel=#{mapEntry.key} itemValue=#{mapEntry.value} / So, am I missing something here? Is there a way to do this? Or is the documentation simply wrong? Have you tried this? t:selectItems value=#{myBean.allRoles}/ Regards, Simon
Re: t:selectItems with a map
Hi Johannes, On Sat, 2009-03-14 at 19:10 +, Johannes Ruthenberg wrote: Simon Kitching wrote on 14.03.2009 15:39: Have you tried this? t:selectItems value=#{myBean.allRoles}/ I have, but I get a NullPointerException if I do. Caused by: java.lang.NullPointerException at org.apache.catalina.connector.Request.getAttribute(Request.java:877) at org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263) at javax.servlet.ServletRequestWrapper.getAttribute(ServletRequestWrapper.java:82) at org.apache.myfaces.context.servlet.RequestMap.getAttribute(RequestMap.java:47) at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:104) at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:38) at org.apache.myfaces.custom.selectitems.AbstractUISelectItems.putIteratorToRequestParam(AbstractUISelectItems.java:131) at org.apache.myfaces.custom.selectitems.AbstractUISelectItems.createSelectItems(AbstractUISelectItems.java:107) at org.apache.myfaces.custom.selectitems.AbstractUISelectItems.getValue(AbstractUISelectItems.java:75) at org.apache.myfaces.shared_impl.util.SelectItemsIterator.hasNext(SelectItemsIterator.java:128) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:557) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:542) at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.renderCheckboxList(HtmlCheckboxRendererBase.java:117) at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.encodeEnd(HtmlCheckboxRendererBase.java:65) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624) ... 76 more Looking at the actual implementation of the t:selectItems tag, I think this is consistent (it sets the current map value to the request under the provided variable name and then calls a method which retrieves this and tries to get the label and value for the select item -- this fails if no variable name is given). It just doesn't fit what the tag is supposed to do as per the documentation, at least as I understand it. I could simply built the list of SelectItem instances myself and set this in my bean. But I actually wouldn't want to handle more of the internal UI elements than necessary, so if the tag could do this, I think that would be the better approach. I also wonder if the documentation is wrong here or the tag class (a matter of perspective, I guess). ;-) I'm looking at the code now, and it seems clear enough to me. Class SelectItemsTag has this comment: // Generated from class org.apache.myfaces.custom.selectitems.AbstractUISelectItems. This is part of our automatic-tag-generation: generally, tag classes are generated from annotations on the component class. So the component class is AbstractUISelectItems. And AbstractUISelectItems has: public Object getValue() { Object value = super.getValue(); return createSelectItems(value); } Method createSelectItems contains: List items = new ArrayList(); if (value instanceof SelectItem[]) { return (SelectItem[]) value; } else if (value instanceof Collection) { } else if (value instanceof Map) { Map map = (Map) value; for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) { Entry currentItem = (Entry) iter.next(); putIteratorToRequestParam(currentItem.getValue()); SelectItem selectItem = createSelectItem(); removeIteratorFromRequestParam(); items.add(selectItem); } } return (SelectItem[]) items.toArray(new SelectItem[0]); So clearly, when evaluating the value expression returns a Map, then the component returns an array of SelectItem objects that have been built from the map values. This code is from the current trunk. Unfortunately due to svn rearrangements in Sept 2008 when the new tomahawk build framework was introduced, it isn't easy to track svn history for components anymore. However I'm pretty sure this is not a new feature. It certainly was there in september 2008, and you say you are using 1.1.8 which was released in November 2008. You say you are using tomahawk-1.1.8, which is the latest release. Are you sure about that? However from memory I'm pretty sure this is not a new feature... Regards, Simon
Re: Refresh View after HTTPSession Timeout
Hi, The solution I use is to put a ping script in the page which sends a request to the server every couple of minutes. With that, the session never times out while the browser window is open, and so the problem never occurs. Of course this requires javascript, but is javascript is disabled then so are all AJAX operations so then your filter will handle everything ok. I don't know of any solution to properly handle session-timeout for ajax requests. However I don't use ajax much. Maybe one of the ajax experts here can comment on that... Regards, Simon Ravizzz schrieb: Simon, You are right, Except the links to other jsp/html pages all other components like table and tabs give us this problem. Do you know any sort of solution for this? Simon Kitching wrote: My guess is that your timeout-handling approach is failing to work with any AJAX or frame-based pages, and that these tabs are just one case where ajax or frames are being used. The problem is that when a browser is refreshing a whole page, a filter can return an http-redirect command and the browser will then replace the current page with the redirected-to url. When the browser is just fetching a frame, only the frame contents will get directed, not the whole frameset. And when a browser is using XmlHttpRequest to do an AJAX operation, there is no obvious way for a filter to tell the browser to give up and redirect the current window to a new url. At least not one I know of (I presume sending back an http-redirect doesn't work..) Regards, Simon Ravizzz schrieb: We have implemented similar way of session timeout in our application using filter in web.xml. But we are facing one problem with this way of timeout. Once Session expires proper logout doesn’t not happen while clicking on tabs created in jspx using \tr:panelTabbed\ tags This is very specifically for the tabs and everything works fine while clicking on link or buttons etc In server logs we get Session Timed Out message, however at UI nothing happens, same teb is displayed and never logs out. Additionally we get the below message in logs:- [3/4/09 16:19:01:125 IST] 0035 StateManagerI E org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView Could not find saved view state for token -1909e0a Any help or pointers would be appreciated. chrishane wrote: I have a generic search screen (standard input form) that displays the results on the next page using a tr:table. If the user hits the refresh button any time prior to the HTTPSession timeout, then the form is resubmitted and the search generated again (could display different results if the underlying data has been updated - which is what we want to happen). If the user leaves (for a time greater than the HTTPSession timeout) the results screen, comes back and hits the refresh button after the timeout, the Find screen is displayed again. I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client side state saving. One of the first errors in the log is: 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView SEVERE: Could not find saved view state for token 7cad43c0 Which is why I'm assuming it is the HTTPSession timeout. Is there anything I can do so that the refresh will re-run the search and not show the Find screen? Thanks, Chris -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Memory issue : MyFaces objects in session
Hi Seema, On Thu, 2009-03-12 at 10:37 -0700, seemamani wrote: We are using MyFaces 1.1.5 in our web application deployed in WAS 6.1. Recently we faced some memory issues due to session size. We have set the STATE_SAVING_METHOD as server in web.xml. Our WebSphere support team found several of the myfaces classes used in the session data. They want us to analyze why there is so much data in session and optimize wherever possible. Here is the list of classes that they sent. org.apache.myfaces.application.jsp.JspStateManagerImpl$SerializedViewCollection org.apache.myfaces.application.jsp.JspStateManagerImpl$SerializedViewKey org.apache.myfaces.application.TreeStructureManager$TreeStructComponent org.apache.myfaces.application.ApplicationImpl javax.faces.component._AttachedStateWrapper javax.faces.FactoryFinder How can we reduce these information in the session. Apart from what is mentioned in the below link, is there anything else we need to do? http://wiki.apache.org/myfaces/Performance The first 5 are expected. These objects are all related to the cache of previously-visited views. One (most recent) is kept to support normal JSF operations. Up to N older views are kept to support back-button usage. The performance page you quote describes how to reduce the NUMBER_OF_VIEWS_IN_SESSION to reduce memory usage (ie support less back-button depth). And that page also describes the SERIALIZE_STATE_IN_SESSION (enabled by default anyway) and COMPRESS_STATE_IN_SESSION options. Of course the best way to reduce session size is to use client-side state, in which case zero session space is needed for the view trees. The disadvantage is that network traffic increases (page size is larger).. I'm a little surprised to see FactoryFinder in this list. Are you sure this is right? I've just checked, and FactoryFinder is indeed a class with just static methods. So there should not even be *one* instance. It does have a few static members, but they should not be particularly large. Regards, Simon
Re: Refresh View after HTTPSession Timeout
My guess is that your timeout-handling approach is failing to work with any AJAX or frame-based pages, and that these tabs are just one case where ajax or frames are being used. The problem is that when a browser is refreshing a whole page, a filter can return an http-redirect command and the browser will then replace the current page with the redirected-to url. When the browser is just fetching a frame, only the frame contents will get directed, not the whole frameset. And when a browser is using XmlHttpRequest to do an AJAX operation, there is no obvious way for a filter to tell the browser to give up and redirect the current window to a new url. At least not one I know of (I presume sending back an http-redirect doesn't work..) Regards, Simon Ravizzz schrieb: We have implemented similar way of session timeout in our application using filter in web.xml. But we are facing one problem with this way of timeout. Once Session expires proper logout doesn’t not happen while clicking on tabs created in jspx using \tr:panelTabbed\ tags This is very specifically for the tabs and everything works fine while clicking on link or buttons etc In server logs we get Session Timed Out message, however at UI nothing happens, same teb is displayed and never logs out. Additionally we get the below message in logs:- [3/4/09 16:19:01:125 IST] 0035 StateManagerI E org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView Could not find saved view state for token -1909e0a Any help or pointers would be appreciated. chrishane wrote: I have a generic search screen (standard input form) that displays the results on the next page using a tr:table. If the user hits the refresh button any time prior to the HTTPSession timeout, then the form is resubmitted and the search generated again (could display different results if the underlying data has been updated - which is what we want to happen). If the user leaves (for a time greater than the HTTPSession timeout) the results screen, comes back and hits the refresh button after the timeout, the Find screen is displayed again. I am using Trinidad 1.0 Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client side state saving. One of the first errors in the log is: 2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView SEVERE: Could not find saved view state for token 7cad43c0 Which is why I'm assuming it is the HTTPSession timeout. Is there anything I can do so that the refresh will re-run the search and not show the Find screen? Thanks, Chris -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: JSP page not getting rendered when using f:view tag
krishna Gummadi schrieb: hi , Iam new to using my faces and trinidad. Iam just building a samll login jsp and binding it to my backing bean . Surprisingly .. if my jsp has f:view tag , after running the jsp i see empty page with out any errors . If i change the f:view to f:subview i can see my page displayed after i run the jsp . Iam using default-render-kit-id_org_._apache_._myfaces_._trinidad_.core/default-render-kit-id in my faces config.xml .. and my jsp is as follows : %@ taglib uri=/http://java.sun.com/jsf/html/ prefix=/h/% %@ taglib uri=/http://java.sun.com/jsf/core; /prefix=/f/% %@ taglib uri=/http://myfaces.apache.org/trinidad/ prefix=/tr/% %@ page language=/java/% html body id=/login/ f:view // h:form h:inputText title=/User ID :/ value=#{myUserBean.username} / h:commandButton id=/cb1/ value=/Login/ action=#{myUserBean.login} / /h:form / f:view / body / html Could any one please let me know why my page is not getting rendered when using f:view tag ? PS: I do not have any JSF RI implementation jars in my library.. (1) What url are you using to access your page? You should use http://somehost:someport/appname/login.jsf Note the suffix: .jsf, not .jsp. (2) If you take the trinidad renderkit line out, what happens? (3) What version of Myfaces are you using? (4) Myfaces uses commons-logging as its logging library. Do you see anything useful in the logfiles if you enable logging? Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Tomahawk - Compatible version for MyFaces 1.2.5
Really weird. As a wild guess, perhaps Trinidad's AJAX stuff forces client-side state-saving, and then when you do a non-ajax postback then things get confused because you have both server and client-side state? It might be worth asking about that in a separate email thread, putting TRINIDAD in the subject... Regards, Simon andi303 schrieb: Simon, your description pointed me in the right direction. I'm aware of the JSF lifecycle, but there is another thing I haven't recognized yet: As you said before, the HTTP header contains the ViewStates, however, I'm using _server_ side state saving! I haven't yet figured out the problem, but if I - switch to client side state saving and - remove Trinidad, everything works fine. Ok, this can only be a temporary solution, I will continue searching for the real problem. Regards, Andreas Simon Kitching wrote: Hi Andy, You said that you were having problems with h:commandLink: Some of the links do not work correctly, but i can't see any difference. If i click on some of the links (mostly MyFaces or Tomahawk commandLinks), I'm always getting the same error: /pages/xlist.jsp No saved view state could be found for the view identifier: /pages/xlist.jsp In JSF, an h:commandLink triggers a *form submit*. The general process is: * restore view * process all submitted values from the form * validate all components * update model for all components * run the action associated with the commandLink (which usually changes the current view) * render the current view The action can be a literal string, in which case navigation occurs using the defined nav rules. Or it can be a method, in which case that method can do whatever it wants, then return a nav string. But as shown above, the very first thing that needs to be done is to restore the view for the page that the commandLink is in. When client side state saving is used, the view is stored in a hidden field in the form. When server side state saving, then the form just has a hidden field containing a key to the relevant saved tree in the session's view cache. From the live headers stuff below, a form submit does seem to be happening. There are: subFup=close ..SUBMIT=1 ViewState=... The presence of this ViewState field says that you are using *client side* state saving, not server-side state saving. That means that the NUMBER_OF_VIEWS_IN_SESSION setting is unused (views are stored in the page, not the session). So the question now is why MyFaces Core can't restore the view from this submitted field for some links on your pages. MyFaces does normally encrypt the ViewState hidden field by default, then decrypt it on submit. by default it also generates a new random key when restarted, which means that after restart browsers holding pages rendered before the restart get an error. But (a) this doesn't seem to match your description, and (b) the error usually says Bad Padding or similar. I would check for any servlet filters in your app that might be doing redirects or messing with the submitted form params. I can't currently think of anything that would just affect *some* links in your app... Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Getting started Version 1.2.6 vs version 1.1.6
anth...@berglas.org schrieb: There are two versions to download on the website, 1.2.6 and 1.1.6. And then the getting started blank.war in http://www.apache.org/dyn/closer.cgi/myfaces/binaries/tomahawk-examples-1.1.8-bin.ziptomahawk-examples-1.1.8-bin.zip seems to have 1.1.6. What is the difference between these versions? Not documented anywhere. If the Myfaces numbers relate to JSF numbers, then is it important to start with 1.2.6? Should I upgrade the tomahawk example? What else needs to change? Myfaces Core 1.2.x -- JSF1.2 Myfaces Core 1.1.x -- JSF1.1 See: http://myfaces.apache.org/download.html You should use JSF1.2 if possible. Tomahawk also has different releases for JSF1.1 and JSF1.2, but instead of a different version number, we use different maven artifact ids (for technical reasons). The artifacts are: tomahawk-1.1.6 tomahawk12-1.1.6 Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Tomahawk - Compatible version for MyFaces 1.2.5
Hi Andy, You said that you were having problems with h:commandLink: quote Some of the links do not work correctly, but i can't see any difference. If i click on some of the links (mostly MyFaces or Tomahawk commandLinks), I'm always getting the same error: /pages/xlist.jsp No saved view state could be found for the view identifier: /pages/xlist.jsp /quote In JSF, an h:commandLink triggers a *form submit*. The general process is: * restore view * process all submitted values from the form * validate all components * update model for all components * run the action associated with the commandLink (which usually changes the current view) * render the current view The action can be a literal string, in which case navigation occurs using the defined nav rules. Or it can be a method, in which case that method can do whatever it wants, then return a nav string. But as shown above, the very first thing that needs to be done is to restore the view for the page that the commandLink is in. When client side state saving is used, the view is stored in a hidden field in the form. When server side state saving, then the form just has a hidden field containing a key to the relevant saved tree in the session's view cache. From the live headers stuff below, a form submit does seem to be happening. There are: subFup=close ..SUBMIT=1 ViewState=... The presence of this ViewState field says that you are using *client side* state saving, not server-side state saving. That means that the NUMBER_OF_VIEWS_IN_SESSION setting is unused (views are stored in the page, not the session). So the question now is why MyFaces Core can't restore the view from this submitted field for some links on your pages. MyFaces does normally encrypt the ViewState hidden field by default, then decrypt it on submit. by default it also generates a new random key when restarted, which means that after restart browsers holding pages rendered before the restart get an error. But (a) this doesn't seem to match your description, and (b) the error usually says Bad Padding or similar. I would check for any servlet filters in your app that might be doing redirects or messing with the submitted form params. I can't currently think of anything that would just affect *some* links in your app... Regards, Simon andi303 schrieb: Simon, Thanks again for your help! I've spend most of the last two days to find the problem, but without success... - I'm only using one browser window. - I've no custom JavaScript on the page, only those from Tomahawk and RichFaces - I've tried to change the context-param org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION to a higher value, however, this doesn't change anything. - I'm not sure with that jsf_view_id thing you've mentioned. Here is the output from live http headers content: j_id_jsp_1011870818_22%3AxlistDataTable%3A0%3AsubFup=closej_id_jsp_1011870818_22_SUBMIT=1javax.faces.ViewState=ZpeMYvZXeBD6wSJfx8QdBJaMWkGJaIJBuce1WLpZUVMkhStvHv5n1XOQEsQdqkqtYDU3DRfOViFXdldNETvqf%2Bh3dsFtW%2FzvoYhKj3z%2F%2F2kEmfOZziQa0Q%3D%3Dj_id_jsp_1011870818_22%3A_idcl=j_id_jsp_1011870818_22%3AxlistDataTable%3A3%3Aj_id_jsp_1011870818_32 Maybe I understand things wrong: Why is there a saved view state of the link? I've never visited this link before... I would be very happy if you have some further suggestions. Regards, Andreas Simon Kitching wrote: Hmm. I presume you are using server-side state-saving here. Are you using multiple browser windows at the same time? Myfaces keeps a cache of the last N views in the session. Therefore if you perform N+1 submits using one window, then try to use the other window you will get this problem. Unfortunately there is no easy solution for this. Note that the value N is configurable; I think it defaults to 20. Otherwise, I suggest using the firefox live http headers plugin or similar to see what is actually being submitted to the server. There should be one field named jsf_view_id or similar; this contains the key to look up the saved viewstate. If this is missing for some reason (eg because of some custom javascript you have in your page) then that would cause this problem. I can't think of any other likely cause at the moment... Regards, Simon
Re: Tomahawk - Compatible version for MyFaces 1.2.5
Hmm. I presume you are using server-side state-saving here. Are you using multiple browser windows at the same time? Myfaces keeps a cache of the last N views in the session. Therefore if you perform N+1 submits using one window, then try to use the other window you will get this problem. Unfortunately there is no easy solution for this. Note that the value N is configurable; I think it defaults to 20. Otherwise, I suggest using the firefox live http headers plugin or similar to see what is actually being submitted to the server. There should be one field named jsf_view_id or similar; this contains the key to look up the saved viewstate. If this is missing for some reason (eg because of some custom javascript you have in your page) then that would cause this problem. I can't think of any other likely cause at the moment... Regards, Simon andi303 schrieb: Thanks for your help. I've managed to get MyFaces 1.2.5 working together with Tomahawk12-1.1.8, Trinidad 1.2.11 and RichFaces 3.3.0. Most of the pages are looking good, however, i still have one problem: Some of the links do not work correctly, but i can't see any difference. If i click on some of the links (mostly MyFaces or Tomahawk commandLinks), I'm always getting the same error: /pages/xlist.jsp No saved view state could be found for the view identifier: /pages/xlist.jsp Any ideas what this means? The session is not expired... Simon Kitching wrote: You are reading the tabel wrong (I agree it's not an easy table to read). The dashes mean no information. So the table says that myfaces 1.2.3 is definitely NOT compatible with Tomahawk 1.1.6, but otherwise there is no information at all here about recent myfaces + recent tomahawk. This table is a user-community-maintained resource (on the wiki). The user community obviously isn't bothering to maintain it. The page says clearly that the myfaces developers will not keep this table up-to-date. Regards, Simon -- -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Check if anything has been changed on the form
Madhav Bhargava schrieb: 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 L 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. So what you really need is to know whether a ValueChangeEvent has been queued for any component, right? One way to do that would be to use a custom ViewHandler in order to return a custom UIViewRoot object that wraps the real one. Then you could override the UIViewRoot.queueEvent method, and check in there whether the event being queued is a ValueChangeEvent. If at the start of the update-model phase, one or more ValueChangeEvents has been queued during the request then you have a real change to the model. You could store this flag as a request-scope property or similar. Note that each input component is responsible for detecting that the model property it is bound to has a different value, and queueing a ValueChangeEvent on itself. But queuing an event on itself just causes the call to bubble up the component tree until it reaches the UIViewRoot, where the event is stuck on a global queue. So UIViewRoot.queueEvent is eventually called for all events. Possibly the original queued event gets wrapped on the way up (eg tables create a wrapper so they can restore the correct row when the event is executed), but I would expect that any wrapper for a ValueChangeEvent would also be a subclass of ValueChangeEvent. This seems generally useful; maybe such a patch would even be accepted into the MyFaces UIViewRoot impl (though of course if you want your app to run on Mojarra too then you'd need a separate implementation anyway). I don't quite understand your point (2) above : if nothing gets changed, and no ValueChangeEvent is triggered, isn't that ok? In this case your model isn't changed and that is what you wanted to know. By the way, I believe that JSF2.0 will state that during the update-model phase, setters are only called on model properties where the property value *has* changed, ie where a ValueChangeEvent has been queued for that component because calling the property getter returned a different value than the component contains internally. However the JSF1.1 spec didn't say this, and both Sun and MyFaces currently call property setters for all input components, regardless of whether the value has changed or not. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Orchestra Core 1.3.1 Released
The Apache MyFaces Orchestra team is pleased to announce the release of Apache MyFaces Orchestra Core 1.3.1 This is a bugfix release that fixes a small number of issues with release 1.3. There is no need to upgrade if you are not experiencing any of the issues listed in the release notes. Get a full overview at Orchestra's homepage [1]. The release notes for 1.3.1 can be found here: * http://svn.apache.org/repos/asf/myfaces/orchestra/tags/core-1_3_1/RELEASE-NOTES.txt The distribution is available at * http://myfaces.apache.org/orchestra/download.html Apache MyFaces Orchestra is available in the central Maven repository under Group ID org.apache.myfaces.orchestra. Regards, Simon [1] http://myfaces.apache.org/orchestra
Re: Tomahawk - Compatible version for MyFaces 1.2.5
andi303 schrieb: Hm. Are you sure? Take a look at the compatibility matrix: http://wiki.apache.org/myfaces/CompatibilityMatrix Regards, Andreas It looks to me as if newer versions of Tomahawk doesn't necessarily work with newer versions of MyFaces... You are reading the tabel wrong (I agree it's not an easy table to read). The dashes mean no information. So the table says that myfaces 1.2.3 is definitely NOT compatible with Tomahawk 1.1.6, but otherwise there is no information at all here about recent myfaces + recent tomahawk. This table is a user-community-maintained resource (on the wiki). The user community obviously isn't bothering to maintain it. The page says clearly that the myfaces developers will not keep this table up-to-date. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
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? 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 -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [JSF][CORE] selectOneRadio id generation
Guy Bashan schrieb: Hi, I just noticed that the HTML generated for selectOneRadio creates table with the id given to the selectOneRadio component. This creates a problem when you want to get the control by its ID. doing: document.getElementById('radioComponentId') gives the table instead of the radio button control. This isn't a direct answer to your question, but in general using getElementById is dangerous/awkward when using JSF. You would be better off using a real AJAX library if you can. Otherwise you might find some of the tips here useful: http://wiki.apache.org/myfaces/forceId#head-801527c2f31f404d73f943966595e2d0dd200d76 Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Tomahawk - Compatible version for MyFaces 1.2.5
andi303 schrieb: Hi all, I'm searching for a compatible version of Tomahak for MyFaces 1.2.5. Has anyone tried it? Any recent version of Tomahawk should work ok with MyFaces 1.2.5. A few years ago, Tomahawk and MyFaces-core versions had to be carefully matched, but that has been fixed for quite a while now. Note that there are now two flavours of Tomahawk, specfically for JSF1.1 and JSF1.2. The JSF1.1 flavour will actually work ok on JSF1.2 as well, but choosing the JSF1.2 flavour gives slightly better performance, better error-messages etc. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Dynamic DataTables
On Fri, 2009-02-27 at 16:17 -0500, Vinaya Tirikkovalluru wrote: Hi, I hope some of you might have already got the code to generate the Dynamic DataTables. If you want help on emailing lists, you really need to write more descriptive emails than this. Dynamic DataTables could mean many different things... Perhaps the tomahawk t:columns component is what you are looking for? http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_columns.html Regards, Simon
Re: Orchestra Conversation Scope
j4ever schrieb: Hello everyone, i’m developing a web application with JSF, Spring, Hibernate and Orchestra and accoutering a problem with the orchestra’s conversation scope. I have configured all my managed beans with Spring and have used thereby a “manual” conversation scope (Orchestra) for some beans. The “session” and “request” beans all work as expected. But for the “manual” beans, I’ve noticed through debugging that the constructor of the bean is called when I submitted the corresponding JSF page (e.g. through a click to a button to execute some action). This is, the bean is initialized again with a new instance, although I have not end the conversation. So the page is redisplayed with the values of the new instance of the bean. This is of course not the behavior I intend to implement. I want the page to be refreshed with the new values of the beans, obtained after action processing. I guess, this is the quintessence of orchestra conversation scoped functionalities and I just don’t understand why I can’t get this work. May be I‘ve Overseen something. So I would appreciate any help. Many thanks in advance. Hugues This is the archestra relevant part of my Spring configuration: !-- the orchestra conversation scopes -- bean class=org.springframework.beans.factory.config.CustomScopeConfigurer property name=scopes map entry key=conversation.access bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=lifetime value=access/ /bean /entry entry key=conversation.manual bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=lifetime value=manual/ /bean /entry /map /property /bean … bean id=rolesBean class=com..accounting.business.beans.RolesBean scope=conversation.manual aop:scoped-proxy / constructor-arg ref=baseDAO / constructor-arg ref=accountingService / constructor-arg ref=messagesManager / constructor-arg ref=login / /bean In the URL shown in your browser, do you see ...?conversationContext=1 If this query parameter is not there, or if it changes on each request then you are getting a new conversation context for each request, which would explain your problem. Orchestra automatically adds this query parameter to all links/forms in a page, so this should work automatically. But maybe your app is doing something that prevents this query param from being added... Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
RE: JSF EL does not allow method calls
On Thu, 2009-02-19 at 11:16 +0530, Madhav Bhargava wrote: On Mon, Feb 16, 2009 at 2:48 PM, Simon Kitching 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. I don't think your evaluation is quite right. IMO there is a problem, but not the one you think. Am I right in thinking that your pages correctly *render* (ie when using my suggestion, components do get disabled when rendered), but that you then have problems when the page later gets submitted back to the server? Firstly, disabled is probably the wrong thing to use. A disabled HTML component never submits any data back to the server on submit, which often confuses JSF components. Usually, setting readonly is better than setting disabled. Secondly, I presume that you want these not accessable input components to be ignored on the server after postback, ie they should not be validated. But setting the disabled flag is not going to affect server-side validation at all. The JSF components are still in the component tree, and are still marked as rendered, so they will look for their input in the submitted data (and not find it) then try to validate themselves. Even if you set read-only on the component, it will still try to do this. The only thing that suppresses the component's attempts to fetch data from the submitted form data and do validation is when rendered=false. And checking the list of *messages* during postback is not really what you want here. What I think you want is that during postback on the server, input components are skipped if there were messages present *at the time the page was rendered*. But that information is simply no longer available; the messages list is *thrown away* at the end of each request. One option is to use read-only, and ensure that when read-only is set then the value property is something that will not cause a validation failure. Alternatively, you need to somehow store info about whether messages were rendered or not in some variable that still exists on postback (unlike the messages list, which has been thrown away). Every JSF component has a map of attributes that you can store arbitrary data into, and which is then persisted into the tree. So maybe you could store an attribute on the view-root to indicate whether the previous pass had messages or not. Then use this in the rendered property of components, in order to prevent them from attempting to validate themselves during postback. There are also a couple of libraries around that extend the validation facilities of JSF. You might want to search the myfaces wiki for validation. Regards, Simon
Re: [JSF][CORE] No View State Exception
Guy Bashan schrieb: I am having a weird issue with JSF: I set the session expiration in my application to 1 minute (for testing purposes). I load the web application. the entrance page is a simple login page with 2 fields (username/password). I wait for 1 minute for session to expire. I try to login. I get this exception: 2009-02-17 10:48:33,522 [http-8080-2] ERROR org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain javax.servlet.ServletException: /login.jspxNo saved view state could be found for the view identifier: /login.jspx Caused by: javax.faces.application.ViewExpiredException: /login.jspxNo saved view state could be found for the view identifier: /login.jspx at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:88) Why am I getting it? this is really annoying... This is expected. Your page submit is including the id of a server-side view state that no longer exists - what should the server do in this case? No postback processing can occur when the view cannot be restored, as there are no JSF input or command components to look for data in the submitted form. You can use the error-page element in the web.xml to cause a redirect to the login page (or some other page). The original url and thrown exception (and its causes) are available as request-scoped objects I think. Or use a filter to catch the ViewExpiredException and do whatever you want in this case. Or put some javascript in the login page that pings the server every few minutes, so the session does not expire. Or avoid using JSF for the login page. You'll still have this issue on other pages, but it is more understandable to the user that they have timed out on some page in the middle of the app rather than having timed out in the login page. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: how to rotate t:dataTable ?
kareda schrieb: Hi, I need to display a list of products in jsf vertically - so every product is in its own COLUMN, not ROW as usually. Can it be done with Tomahawk dataTable? or maybe using some other component? Is this possible at all in HTML? As far as I know, a table element always renders rows horizontally and columns vertically. If it isn't possible in HTML, then it isn't possible with JSF [1]. [1] Well, I suppose a component could render some weird stuff that isn't a table but looks like one. But AFAIK no such thing currently exists. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: JSF EL does not allow method calls
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)
Re: commandButton: onclick: disable
SANTINI, Rafael schrieb: Hi, Why when onclick=this.disabled=true; return true in a commandButton the action is not executed? I'm trying disable the button after a click. Disabled controls are never sent to the webserver on submit: http://www.w3.org/TR/html401/interact/forms.html#h-17.12 Use readonly instead. -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [Orchestra] Presence / absence of conversation?
Guillaume Bilodeau schrieb: Thank you Simon for your detailed answer! I've spent the last few months using Seam and I now realize that the term conversation has a totally different meaning in Orchestra, as you explained. The documentation does explain it clearly, I suppose initially I went through it too quickly and assumed it was working like Seam. A step-by-step tutorial using common use cases would greatly help in making all this more clear though. Well, I wouldn't say totally different meaning. In both Seam and Orchestra, it is a scope that is longer than request but shorter than session. But Orchestra conversation scope is more fine grained. I'll add a note to the docs to make this clear for Seam users. The conversation.access scope seems like a great way to implement flash scope and that would especially useful for storing messages that need to survive a redirect. Is there a common replacement for FacesContext.messages and h:messages that uses this scope? No, there isn't. It's an interesting idea, but messages are stored as a field within the FacesContext, and a FacesContext is always a request-scoped object. So storing messages in the conversation instead is a significant behavioural change. And really we *do* want messages regenerated on each postback. I think a solution targeted specifically at the keep messages over redirect issue is useful, but using a conversation as storage isn't the right tool. By the way, other libs use the term flash scope to mean something rather different than Orchestra's access scope. We did initially call our thing flash scope then renamed it when we realized it would cause confusion. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Problem Using Orchestra with Realm after Session-Timeout
Mario Ivankovits schrieb: Hi! -Original Message- From: Filip Lyncker [mailto:lync...@lyth.de] Sent: Thursday, February 12, 2009 11:29 AM Yep, here it is: javax.faces.application.ViewExpiredException: viewId:/pages/start/actuell.jsf - View /pages/start/actuell.jsf could not be restored. if (is11CompatEnabled(facesContext)) { // the faces What you can do ist to figure out how to enable the JSF 1.1 compat mode, which then will simply rerender the page. Or you try/catch the ViewExpired exception in an filter (probably) and forward to your login/menu/whatever page. The first suggestion might restore the page in an invalid state as all the beans are gone, so I'd opt for the second suggestion (try/catch). Unhappily I've never done this myself (... I should have ...). I'd start with a servlet filter .. or a PhaseListener. Anyone else with a better solution? Yes, a third one: If you are using richfaces you can use the a4j:poll component on each page which polls the server, lets say, once every minute. This will prevent the session from timeout as long as the browser points to your application. This also allows you to configure a very short session timeout (5 minutes) as nothing bad happens as long as the browser is open. This is very much like a RichClient behaviour. BTW: This is the solution we use in our application. Mario is quite right: in JSF1.2 the behaviour has changed when the view cannot be restored (eg due to session timeout). The old behaviour was to just render the requested page, while the new behaviour is to throw ViewExpiredException. I hadn't even realized this - thanks for the info Mario! So whatever bug you were getting before is now gone - getting a ViewExpiredException is the correct and expected behaviour in this case. As Mario noted, the new behaviour is actually better. For many pages, attempting to just render them won't work properly as the application state isn't correctly set up. For example, in a master-detail type scenario, if the user is on the detail page when the session expires, then trying to re-render it with all-new backing beans is probably just going to crash or cause some other kind of weird behaviour. You can use the error-page element in the web.xml to specify a page to redirect to when an exception is thrown. However if I remember correctly, all kinds of JSF exceptions get wrapped in one generic type so it is not possible to redirect to a page specifically for ViewExpiredException handling using this mechanism. I could be wrong here though.. So if you need more customized behaviour in this case, you will probably need to configure your web.xml to specify a filter (I don't think a PhaseListener will work). In the exceptionhandler/filter you should be able to explicitly do the old JSF1.1 behaviour if you really want, just by extracting the original URL from the request then forwarding to that URL (but using GET, so no attempt to restore the view is done). Better would probably just be to forward to a page that says sorry your session timed out; click here to go to the webapp home page. Or as Mario pointed out, use ajax components or some explicit javascript to poll the server, thus ensuring that http session timeouts never occur while the browser window is open. This approach works really nicely, as long as you have some common header or footer that every page includes, so that the poll logic only needs to be implemented in one place. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: BadPadding Exception and more
On Thu, 2009-02-12 at 12:57 -0800, Heiß Michael wrote: Hi, I have created a webapplication using myfaces 1.2.6 / tomahawk 1.1.8 and richfaces 3.2.2 and tested this application successfully using a local tomcat 6 webserver. Now i tried to depoly the application to our windows 2003 x64 testserver who also runs tomcat 6, but now i got one error message after the other. When i call an action or actionListener i get and BadPaddingException or ViewExpiredException every time. I have read the issue MYFACES-1838 but the workarounds (set secret, turn off encryption, server side state saving) did not help me. Even they lead to new exceptions that tells me that the stream header is currupt. (StreamCorruptedException) Now i simply do not know where to search for errors, because the application is working on my local server tomcat server without problems. I suspect you have made some mistake when following the instructions you found. As far as I know, the BadPaddingException is *always* caused by the server trying to decode encrypted client-side state using a different key than the data was encrypted with. If you have really disabled encryption on the server, then AFAIK this exception cannot happen. Therefore you must still have encryption enabled You can certainly tell whether you have correctly switched from client-side-state to server-side-state: just look at the html generated for a simple page. If there is a hidden field with a large amount of ascii-encoded data in it, then you still have client-side-state-saving turned on (possibly encrypted or not; that's harder to tell from just looking at the field in the html). Regards, Simon
Re: [Orchestra] Presence / absence of conversation?
On Thu, 2009-02-12 at 12:39 -0800, Guillaume Bilodeau wrote: Hi guys, I have just started playing with Apache Orchestra and am struggling to find extensive documentation on the project. Are there any good tutorials out there? The main web site does give some information but it feels too general for now since I don't yet have a good understanding of the framework. There is a book available (Myfaces and Facelets) which has a chapter on Orchestra. But there is no online tutorial as far as I know. I'm sorry the intro pages on the Orchestra website don't give you the overview you need. These pages were intended to do that: http://myfaces.apache.org/orchestra/myfaces-orchestra-core/introduction.html http://myfaces.apache.org/orchestra/myfaces-orchestra-core/conversation.html Feel free to ask questions, and when you do figure Orchestra out, please let us know what we should add there! There is an example webapp that demonstrates how to use orchestra. The example apps are a bit rough (not everything works) but the basics are demonstrated. You can download it from svn here: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/ Otherwise, I have setup Orchestra to run in my web application and I'm wondering how to verify if things are working correctly. The first thing I noticed is that without even declaring any beans of scope conversation.*, the application URL now has a conversationContext parameter appended to it. Does this mean that a conversation has been opened or is it just for internal usage? A context is a container for conversations, mainly meant to allow different browser windows to work independently (a real problem with normal JSF). But initially, this container is empty, ie no conversations yet exist. I have also declared a simple Credentials bean of scope conversation.access which is bound to a login form and then used by a LoginController bean. Within the LoginController.login() method, the Credentials bean is correctly injected and has the right information, but calling Conversation.getCurrentInstance() returns null. Wasn't a conversation started when the first lookup to Credentials was done? That call to getCurrentInstance will only work from *within* the Credentials bean. The call returns the conversation that the caller is in. With Spring or Seam conversations, a request has a conversation. With Orchestra, a *bean* can belong to a conversation. So asking what is the current conversation returns null except from within a bean that is of conversation scope. Internally, AOP interceptors are used to set up the current conversation when methods on that bean are invoked, and unset it when the method call returns. See the docs on the orchestra website for further details. Regards, Simon
Re: orchestra/datatable/datascroller LazyInitializationException
Mario Ivankovits schrieb: Hi! -Original Message- From: Carl Howarth [mailto:carl.howa...@dlapiper.com] Sent: Wednesday, February 11, 2009 11:56 AM bean name=searchParametersBean class=com.xxx.SearchParametersBean scope=conversation.access property name=serviceBean ref=serviceBean / property name=searchResultsBean ref=searchResultsBean / /bean bean name=searchResultsBean class=com.xxx.SearchResultsBean scope=conversation.access/ Before orchestra, all collections were EAGERly fetched and the results set was kept alive in the search results bean using a t:saveState / tag. Do you still use t:saveState too? Just in case, this should not be required .. nor used as then the entity is detached. Also, when passing back the result, just pass back the primary key and reload the entity from the result bean. An entity from another conversation is detached once the conversation is invalidated/not accessed anymore, thus reload the entity in the target conversation to have it associated with the right EntityManager/PersistenceContext. Ah yes. As Mario says, two beans that are in different conversations cannot pass entity beans between themselves, because the different conversations have different sessions, and a bean loaded from one session cannot be used in a different session. One solution (as Mario noted) is to just pass the key between the two backing beans, and have the detail bean reload the entity using its own persistence session. The other approach is to put both beans in the same conversation, by setting the conversationName property on the bean declarations. The disadvantage here is that when you re-enter the detail page for a second time, the backing bean is *not* recreated, because the conversation it was in has not been deleted. So probably passing by key is the best solution. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Problem Using Orchestra with Realm after Session-Timeout
I don't think this is anything to do with Orchestra. This message: WARNUNG: executePhase(RESTORE_VIEW1, org.apache.myfaces.orchestra.lib.jsf. orchestrafacescontextfactor...@108e435) threw exception java.lang.NullPointerException at com.sun.faces.lifecycle.RestoreViewPhase.execute( RestoreViewPhase.java:163) says that Sun's class RestoreViewPhase.java:163 threw the exception, and that it happened to be called from an executePhase that had an OrchestraFacesContextFactory instance as a parameter. It doesn't mean that the OrchestraFacesContextFactory class had anything to do with the problem. It *might* be something related to orchestra, but you would have to look at that line in the Mojarra (Sun JSF RI) source code to tell what the actual problem is. And as Kito pointed out, you really MUST say what software versions you are using if you want help. Even after Kito pointed this out, you still have not said what version of Mojarra you are using... And by the way, Orchestra 1.3 is available... Regards, Simon Filip Lyncker schrieb: Dear Kito, We are using JSF(RI) and Orchestra.core v1.2 ... so do you have some ideas for me? thanks regards, filip Kito Mann schrieb: Folio, Which version of the reference implementation are you using, and which version of Orchestra? Sent from my iPhone http://www.jsfcentral.com http://www.Virtua.com On Feb 10, 2009, at 2:02 PM, Filip Lyncker lync...@lyth.de wrote: Dear Group , I have a problem in an enviroment with orchestra,jsf,spring and authentikation using a tomcat realm. If the session timed out the user is redirected from the secured area to the login page wich is in the free-area. But the realm seems to store the last request. After login in the app crashes with a null pointer like shown in the following... Maybe I need to configure orchestra or spring in any way to handle that request? thanks a lot for help .. cheers Filip [21:01:28] Nabil : 10.02.2009 20:27:52 com.sun.faces.lifecycle.LifecycleImpl phase WARNUNG: executePhase(RESTORE_VIEW 1,org.apache.myfaces.orchestra.lib.jsf.orchestrafacescontextfactor...@108e435) threw exception java.lang.NullPointerException at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:163) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.lyth.huntersBase.util.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 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 java.lang.Thread.run(Thread.java:619) 10.02.2009 20:27:52 org.apache.catalina.core.StandardWrapperValve invoke SCHWERWIEGEND: Servlet.service() for servlet Faces Servlet threw exception
Re: Problem Using Orchestra with Realm after Session-Timeout
Hi, I presume you're using server-side state-saving. So the browser accesses foo.jsf, and is returned a page containing a special hidden field that is the key of the saved state within the user's http session on the server. Then the user's http session times out. The user clicks a submit button which posts back to foo.jsf, passing the hidden state key as one of the form values. The webserver realizes that the user has no http session, and therefore no login. It therefore saves the current posted params, and redirects to a login page. When the user fills in username/password and submits, the server authenticates then continues with the original saved submit. As you see in your filter, the http-session is a new one. All the above is normal servlet container behaviour. The JSF implementation will then see a request to restore state from the session, with a specific key. But the session is empty, so the specified view state cannot be ignored. What normally happens then is that the JSF implementation will just log an unable to restore view message to its logfile, and simply *render* the specified page rather than doing a postback, just as if the user had done a GET request for the url rather than a POST request. Quite why you are getting an exception at this point rather than just seeing the specified page rendered is unknown. There is probably some library or class in your app that is assuming that on POST there is a restored view - though in this special failed to find view case there is not. The question is *what* code is causing this problem. The easiest way is probably to download the source jarfile for your mojarra (Sun RI) version and put a breakpoint on the com.sun.faces.lifecycle.RestoreViewPhase.execute method. Then just try it, and step through the mojarra code until you see what the problem is. Getting the source jarfile for MyFaces JSF is easy; we publish it in the Maven repository along with the binary jarfiles. I don't know where to find the source for Mojarra releases... Regards, Simon Filip Lyncker schrieb: Dear Simon, you're right, im sorry, Im using the version 1.2.03 of RI JSF. Yes I know there is a newer version also from orchestra. But first I tried to understand the problem than just to upgrade the version of my frameworks b/c I allways had a lot other problems than ... let me describe it a bit more: i include the SessionTimeoutFilter because I hope to find something there. If the session-timeout occurs, ill be redirected to the login page. If I relogin now, first I can stop in that filter. But the session is valid, but its a new one. If i would know what to do here everything would be fine: 1. I need to recognize that the user is coming from the loginpage ( and not from another party of my app ) 2. than I need to delete the restored stuff ( request URL or whatever) that will be crash my app or frameworks in the next second. as described in the servlet spezfication : If the user is authorized, the client is redirected to the resource using the stored URL path. this seems to be the problem , im not sure what all is transported in that url, or if there are more infos in it, but I think that maybe the orchestra or something around it, doesnt like the garbage from the user before.. thanks again for helping me... Regards, Filip Simon Kitching schrieb: I don't think this is anything to do with Orchestra. This message: WARNUNG: executePhase(RESTORE_VIEW1, org.apache.myfaces.orchestra.lib.jsf. orchestrafacescontextfactor...@108e435) threw exception java.lang.NullPointerException at com.sun.faces.lifecycle.RestoreViewPhase.execute( RestoreViewPhase.java:163) says that Sun's class RestoreViewPhase.java:163 threw the exception, and that it happened to be called from an executePhase that had an OrchestraFacesContextFactory instance as a parameter. It doesn't mean that the OrchestraFacesContextFactory class had anything to do with the problem. It *might* be something related to orchestra, but you would have to look at that line in the Mojarra (Sun JSF RI) source code to tell what the actual problem is. And as Kito pointed out, you really MUST say what software versions you are using if you want help. Even after Kito pointed this out, you still have not said what version of Mojarra you are using... And by the way, Orchestra 1.3 is available... Regards, Simon Filip Lyncker schrieb: Dear Kito, We are using JSF(RI) and Orchestra.core v1.2 ... so do you have some ideas for me? thanks regards, filip Kito Mann schrieb: Folio, Which version of the reference implementation are you using, and which version of Orchestra? Sent from my iPhone http://www.jsfcentral.com http://www.Virtua.com On Feb 10, 2009, at 2:02 PM, Filip Lyncker lync...@lyth.de wrote: Dear Group , I have a problem in an enviroment with orchestra,jsf,spring and authentikation
Re: regarding my apache jars 1.6
srinivas schrieb: when i have switched myfaces jars from 1.0 to 1.0.6, I am getting this error log java.lang.ClassNotFoundException: org.apache.myfaces.component.html.util.ExtensionsFilter Is there anything I am missing ? The application works fine with myfaces 1.0 jars. The ExtensionsFilter is a tomahawk class. Note that nothing in myfaces-core uses tomahawk classes, so it is something else in your app that is referencing this class. It looks like when you upgraded your app you somehow deleted the tomahawk jarfile. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [orchestra] Navigation with new conversation context
Hi Bernd, Dipl. -Ing. Winterstein Bernd schrieb: Hello, I try to open a new conversation context in a new browser window when navigating to another page. The backing bean of the new page is in flash scope. The old one is manual scope. But when I use the o:separateConversationContext tag around the form the new page opens the current page again. Any ideas? Regards, Bernd o:separateConversationContext h:form rich:dataTable id=resultsTable value=#{doctorAnalysisController.results} var=info rows=20 f:facet name=caption h:outputText value=Suchergebnisse / /f:facet rich:column sortBy=#{info.doctor.piaId} f:facet name=header h:outputText value=Nr. / /f:facet a4j:htmlCommandLink value=#{info.doctor.piaId} action=doctorDetails !-- navigation to detail view -- actionListener=#{contactHistory.addContactId} !-- this is a session scope utility bean -- target=_blank f:attribute name=contactId value=#{info.doctor.id} / /a4j:htmlCommandLink /rich:column /rich:dataTable rich:datascroller align=left id=resultsTableScroller for=resultsTable / /h:form /o:separateConversationContext Orchestra intercepts all calls to HttpServletResponse.encodeURL(url) and ensures the param ?conversationContext=n is added. Using o:separateConversationContext simply sets a flag to suppress this. But you are using ajax controls. My suspicion is that when a partial submit occurs, richfaces doesn't process any of the JSF components outside the activated one. So for example when the a4j:htmlCommandLink is activated, the o:separateConversationContext component simply never gets run. I can't be sure, as I've never tried using an ajax commandLink inside an o:separateConversationContext tag before. But it seems the most likely cause. If this is true, then I'm not sure what the solution could be. If richfaces really does not support running any ancestor components, then how can the htmlCommandLink be marked as one that should be in a new context? Perhaps a custom ActionListener could be created which looks in the ancestry of the component that triggers the action, and activates an o:separateConversationContext if it finds one. It should be possible to do this without needing to modify Orchestra itself, ie you wouldn't need to wait for an Orchestra patch in order to solve this issue (though obviously it would be good for Orchestra to do this by default). Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [sandbox]s:graphicImageDynamic simple url
alvaro tovar schrieb: hello i am loking for the url of s:graphicImageDynamic, look like /faces/myFacesExtensionResource/org.apache.myfaces.custom.graphicimagedynamic.GraphicImageDynamicRenderer/12332460/?idR='+trueId[1]+'_renderer=com.redi5.backingbean.util.ImageDynamic' also i see that the number 12332460 is not a constant, is there a url generic for the image? This url is generated by Tomahawk's AddResources/ExtensionsFilter feature that allows static resources (.js, .css, .png etc) to be served out of a jarfile rather than having to be unpacked into the local filesystem. The /faces/myFacesExtensionResource/* path will be handled by the Tomahawk ExtensionsFilter. The next part (org.*.GraphicImageDynamicRenderer) is the class that the tomahawk resources framework will invoke to actually return the resource. The number is supposed to be generated at tomahawk jarfile compilation time. This allows the browser to cache the specified resource, but changes when a new jarfile is released so that stale cached resources do not get used. This compile-time processing was actually broken for a while (don't know if it has been fixed yet) causing this number to actually be the webapp startup time; this also works ok for resource caching (although not quite as efficient). The url you quote looks a bit weird though. Normally the actual resource name (eg foo.png) would be present at the end of the url. And if I remember correctly, resource urls don't have query parameters (these would intefere with caching). In addition, the query params really look screwed up here. But I don't know anything about the s:graphicImageDynamic component As with all sandbox components, you are welcome to use the code but they are not tested or reviewed to the level of proper (non-sandbox) tomahawk components... Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Should backingbeans implement Stateholder or not?
Hi Andrej, On Wed, 2009-01-28 at 19:36 +0100, Andrej Konkow wrote: Hi all, I have following problem: I have a jsf-page using a simple requestscoped backingbean, without any customcomponents etc.. I am using t:saveState to keep data between the requests. The backingbean is inheriting from a common base class in which a HtmlInputDate is being used for an attributetype. Everything is working fine as long as I have defined the following in my web.xml: param-nameorg.apache.myfaces.SERIALIZE_STATE_IN_SESSION/param-name param-valuefalse/param-value When changing this config to true I get the following: [2009-01-26 20:14:25,968] [http-8080-2] [ERROR] javax.faces.webapp._ErrorPageWriter - An exception occurred javax.faces.FacesException: java.io.NotSerializableException: org.apache.myfaces.custom.date.HtmlInputDate I'm not quite sure whether this is a bug or a feature but I was not aware that backingbeans should implement the Stateholder-interface... I had a short discussion in: https://issues.apache.org/jira/browse/MYFACES-2141 No, backing beans do not need to implement StateHolder. That is necessary if you create a custom component (which is what I thought you were doing because I didn't read your problem description carefully enough). What you need to do in your case is declare the member you store the component-binding in as transient. Then when the view is serialized and the backing bean gets serialized with it (because of t:saveState), the java standard serialization does not try to serialize the non-serializable member. When the view is restored on the next postback jsf will reinitialize the binding value so marking this member as transient should be all that you need. Unfortunately in this case, it means modifying the common base class you are inheriting from; hope you can do that. If you cannot do that, then you might have to customize the serialization process (create a writeObject method or similar) to first set the binding to null before invoking normal serialization. Effectively you are breaking the rule that bindings should only be to request-scoped beans by using t:saveState which makes the bean scope something longer than just request. Nulling out the binding before serializing the bean fixes this.. Could anybody please bring light into my thoughts? :-) The reason for me to try this change was that pages that work fine in a normal clickflow throw an exception when waiting, let's say 90 min. javax.servlet.ServletException /jsp/app/time/projecttimes.jsfNo saved view state could be found for the view identifier: /jsp/app/time/projecttimes.jsf Unfortunately, I don't think that using t:saveState will help you here anyway. The problem looks like the http session is timing out (90 minutes) so when the postback occurs, the old saved view is gone. Putting your backing bean into the saved view won't change anything; when the session goes and therefore the saved view is gone, you will always get this error message. This SERIALIZE_STATE_IN_SESSION flag just controls whether the data stored in the session is compressed (serialized) or not. Leaving this at the default value (true) is good because it also tests at the end of each request that the view state *can* be serialized. Http-sessions can be serialized in a number of situations: * servlet engines can flush them to disk when memory is low * clustered servers need to serialize sessions to transfer them between machines in the cluster * server hot-restart feature serializes sessions on stop and deserializes them on restart. If you set SERIALIZE_STATE_IN_SESSION to false, then the app appears to work until you try to do one of the above. Then you get a big surprise. It is better to have this set to true so that the program tells you about potential problems earlier. What I often do is embed a simple piece of javascript into pages which sends a ping request to the server every minute or so. Then http sessions will never time out while the browser is open. The http-session timeout can then be set to a nice low value, like 10 minutes, which helps ensure that memory is cleaned up when people really do leave the site. Or you could use client-side state saving. Then if the session times out, it doesn't matter (as long as you have no other important data in the session) because the saved view tree (including your bean because of t:saveState) is part of the data posted by the client. Regards, Simon
Re: JSF datable empty rows, position of components in UI
Ayub Khan schrieb: Hi, Could any give some tips in resolving the below issues ? 1) Display empty rows of data table in JSF, if the list which is bounded to datable is empty then I need to view atleast one empty row. 2) UI has one datable and a form below it, I need to show the empty table if there are no records and there should be little space (gap) between Table and the form below. Currently there is no space between table and form and their position is also not fixed. Like as I add rows to the table the form below it is getting pushed below. How to fix the position of these two and also have a space between them. h:panelGroup rendered=#{mybean.numRecords == 0} here goes the stuff you want to render when there are no records /h:panelGroup h:dataTable rendered=#{mybean.numRecords 0} here goes the normal table /h:dataTable Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: JSF 1.2 supports Bookmarking ???
Hi, Here's one way to manually insert query params into urls, and process them. There may well be more elegant solutions, but this works. You can build links with query params in them like this: h:outputLink f:param name=id value=20/ /h:outputLink In an action method, you can manually do redirects like this: String handleSomeCommand() { String someUrl = /showUser?id=20; FacesContext fc = FacesContext.getCurrentContext(); fc.getExternalContext.redirect(someUrl); return null; } You can process query params by doing do something like this: h:outputText value=hack to get callback on start of page rendered=#{myBean.doInit}/ and in backing bean: public boolean doInit() { if (this.initialized) return; // here get the request params via facesContext.externalContext // and initialise properties on this backing bean using the // query params, eg setting currentUser based on the value of // a query-param with name id ... return false; } Regards, Simon bansi schrieb: Hi Simon, Thank you so much for wonderful explanation of the problem. It provides lots of insights into the problem. I hope its useful to other members on the forum. Luckily my requirement is to Have couple of pages where we want urls with parameters in them. But i don't know how to accomplish the following Then you can manually add the necessary links and use tricks to manually check for and handle the parameters. An simple example will be greatly appreciated Simon Kitching wrote: On Sun, 2009-01-18 at 08:52 -0800, bansi wrote: I am using JSF 1.2, RichFaces 3.1 wondering if any of these technologies support Bookmarking. Googling i found PrettyFaces, RestFaces extend JSF to support Bookmarking But we don't want to add new frameworks to our project and would like to get it done with available frameworks. Any pointers/suggestions will be greatly appreciated Bookmarkable pages within a webapp are a problem with JSF. The main issues are: (1) The general problem is that JSF is intended to be a framework for building webapps with very rich/complex pages, ie pages with lots of html input components in them. And that means that there can be lots of data being passed back to a server on each submit. Therefore JSF takes the approach of using POST requests almost all the time - and those of course don't bookmark well. Some other frameworks do much better at generating bookmarkable urls - but may be much worse at handling complex pages. Like all things, finding one approach that handles both simple and complex requirements isn't easy. (2) JSFs default approach for navigating from one page to another is for the first page to do a post, user logic determines what page to navigate to, and then a forward occurs internally within the webserver to render the next page, all within the same http request cycle. This is the most efficient for network traffic, but leads to the well-known browser url shows previous page problem because the browser shows what url it POSTed to, not what page eventually got rendered. You can fix (2) by using redirect/ in JSF navigation rules, at the cost of some performance. Unfortunately this also makes the server-side logic harder though. The normal approach of passing data from one page to the next page is via request-scoped variables, but that just doesn't work if a redirect/ is used, as the new page is rendered in a different http request. The Tomahawk RedirectTracker stuff tries to work around this, but it's not terribly elegant. See the myfaces wiki for further info on the limitations of redirect/ Note however that using redirect still doesn't help if you want to create links that have *parameters* in them, eg /showUser?id=20 JSF just assumes any params are in a form, not in a query. If you have just a couple of pages where you want urls with parameters in them, then you can manually add the necessary links and use tricks to manually check for and handle the parameters. But if it's more than a couple of pages, then using one of the libraries you listed above is definitely a better idea. The committee that is designing JSF are aware of the issue, but they haven't come up with any standard solution yet. Regards, Simon
Re: JSF 1.2 supports Bookmarking ???
On Sun, 2009-01-18 at 08:52 -0800, bansi wrote: I am using JSF 1.2, RichFaces 3.1 wondering if any of these technologies support Bookmarking. Googling i found PrettyFaces, RestFaces extend JSF to support Bookmarking But we don't want to add new frameworks to our project and would like to get it done with available frameworks. Any pointers/suggestions will be greatly appreciated Bookmarkable pages within a webapp are a problem with JSF. The main issues are: (1) The general problem is that JSF is intended to be a framework for building webapps with very rich/complex pages, ie pages with lots of html input components in them. And that means that there can be lots of data being passed back to a server on each submit. Therefore JSF takes the approach of using POST requests almost all the time - and those of course don't bookmark well. Some other frameworks do much better at generating bookmarkable urls - but may be much worse at handling complex pages. Like all things, finding one approach that handles both simple and complex requirements isn't easy. (2) JSFs default approach for navigating from one page to another is for the first page to do a post, user logic determines what page to navigate to, and then a forward occurs internally within the webserver to render the next page, all within the same http request cycle. This is the most efficient for network traffic, but leads to the well-known browser url shows previous page problem because the browser shows what url it POSTed to, not what page eventually got rendered. You can fix (2) by using redirect/ in JSF navigation rules, at the cost of some performance. Unfortunately this also makes the server-side logic harder though. The normal approach of passing data from one page to the next page is via request-scoped variables, but that just doesn't work if a redirect/ is used, as the new page is rendered in a different http request. The Tomahawk RedirectTracker stuff tries to work around this, but it's not terribly elegant. See the myfaces wiki for further info on the limitations of redirect/ Note however that using redirect still doesn't help if you want to create links that have *parameters* in them, eg /showUser?id=20 JSF just assumes any params are in a form, not in a query. If you have just a couple of pages where you want urls with parameters in them, then you can manually add the necessary links and use tricks to manually check for and handle the parameters. But if it's more than a couple of pages, then using one of the libraries you listed above is definitely a better idea. The committee that is designing JSF are aware of the issue, but they haven't come up with any standard solution yet. Regards, Simon
Re: How to Configure Search results using JSF/MyFaces
On an almost-off-topic subject: I've always found Hibernate's maxResult facility to be quite useless. It limits the number of *SQL ROWS* returned, not the number of *objects*. Therefore when table joins are involved (and they often are) then the actual number of *objects* that will be returned can be significantly different from the maxResult setting. Have other people had this problem, and if so is there a known solution? Cheers, Simon On Sun, 2009-01-18 at 17:07 +, Cagatay Civici wrote: This is not a UI thing and I think should be handled at data access rather than UI level. Hibernate api supports maxResult so you can limit the number of rows returned. On Sun, Jan 18, 2009 at 4:57 PM, bansi mail2ba...@yahoo.com wrote: We use JSF 1.2, RichFaces 3.1, Spring 2.5, Hibernate 3.2 and have following requirement The maximum number of rows returned must be configurable so that users don't query too much information. We are able to successfully implement search using RichFaces walk method of Serializable data model which provides dataScroller for pagination Any pointers/suggestions will be greatly appreciated
Re: [ORCHESTRA] ReentrantLock
Hi Kito, On Fri, 2009-01-16 at 17:44 -0600, Kito Mann wrote: I'm seeing the following output in the logs from Orchestra: org.apache.myfaces.orchestra.lib._ReentrantLock lockInterruptibly Waited for longer than 3 milliseconds for access to lock org.apache.myfaces.orchestra.lib._reentrantl...@1ec61ec6 which is locked by thread WebContainer : 0 I'm not convinced there is a specific problem yet, but can someone explain under what circumstances I should expect to see this? This is coming from Orchestra code that automatically makes sure that a single ConversationContext is accessed only by one thread at a time. When the request starts, a lock in the context is acquired. If a request is already using that context then the new request has to wait until the previous request is completed. So this kind of message can occur when a view takes longer than 30 seconds to process, and then the same user tries to trigger a concurrent access (eg is impatient and clicks on a submit button again). If that's the situation in which you see this message, then all is ok. If you see this in simple quickly-rendered pages, then there is definitely a problem somewhere. I do remember that there was a bug with Orchestra's locking code that was fixed a while ago. The fix is definitely in the latest release though - I presume you're using version 1.3. The name of the thread that has the lock is WebContainer: 0, which looks a bit odd to me. Which servlet engine is this? I'm sure Tomcat does not name its threads like this. Are you still experimenting with WebSphere? I suppose it might give its request handling threads such a name, but it looks more like some kind of special thread instead. It could be useful to log the thread id for ordinary requests (eg just change the log4j message format string) and see if WebContainer:0 really is a normal request-handling thread. If not, it would be useful to know what else that thread does... Regards, Simon
Re: Input components with disabled=true
On Thu, 2009-01-15 at 20:28 +0100, Luca Graf wrote: Hello together, I got an problem with input components like h:selectBooleanCheckbox when i use the attribute disabled=true. My scenario is that i have two checkboxes. The second is initially set to disabled=true. Now the user should only get access to the second if he changed the value of the first before. My approach was, if the user changed the value of checkbox1 then i set the attribute of checkbox2 via javascript to disabled=false. Example: h:selectBooleanCheckbox id=checkbox1 onchange=var element=document.getElementById('checkbox2'); if(element.disabled) element.disabled = false; else element.disabled = true; h:selectBooleanCheckbox id=checkbox2 disabled=false/ On the first it looks good, after the user has changed the value of the first checkbox, the second is now accessible via html. But it looks that the value is doesn't send in the request to the server, like the normal behavior for an input element with disabled=true. It is not enough to set disabled=false in HTML to get the value of checkbox2 to the server? Use readonly instead of disabled. They appear the same to the user, but browsers send the state of readonly HTML elements back to the server on submit. Browsers ignore disabled HTML elements on submit, which is causing the problem. Regards, Simon
Re: [myfaces-core] javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
I meant issue https://issues.apache.org/jira/browse/MYFACES-1838 Simon Kitching schrieb: I've added a note on the bugzilla issue https://issues.apache.org/jira/browse/MYFACES-1786: quote I don't believe this is a bug at all. Unless I've misunderstood something, it's just missing configuration. I think any of the following (in order of preference) should solve this: (1) in web.xml, define init-parameter org.apache.myfaces.SECRET to be some reasonably long string. The server will then use the same encryption secret after restart (instead of generating a key itself), and so will be able to decrypt old sessions. (2) in web.xml, define init-parameter org.apache.myfaces.USE_ENCRYPTION to be false, in order to disable client-side state encryption. Of course this potentially opens a security hole in the app. (3) use server-side state saving (only client-side state is encrypted) /quote I also added a note on related issue MYFACES-1786: quote state *should* be encrypted by default; no system should default to being insecure. /quote And by the way, this is all related to myfaces-core, and is nothing whatsoever to do with Trinidad. I've therefore changed the email subject line. Felix's original complaint is a little different from the jira issue referenced. That issue triggers only on servlet-container restart while Felix was claiming the problem popped up spontaneously. I suspect that there was actually a container restart happening there (eg the container is configured to watch for changes, and some watched file is being touched). Felix, you might want to check your logs : I bet that whenever this happens you are also getting a complete webapp restart, ie you've got something weird in your environment. Regards, Simon Cagatay Civici schrieb: I've seen this error even in myfaces 1.2.2. There's an annoying problem with client side viewstate encryption. On Wed, Jan 14, 2009 at 2:53 PM, Matthias Wessendorf mat...@apache.org mailto:mat...@apache.org wrote: Hi know that there is some param on myfaces core for this. So, does that work with MyFaces 1.2.6 standalone ? Did this used to before upgrading to Trinidad 1.2.10 ? -M On Wed, Jan 14, 2009 at 2:52 AM, felix.bec...@t-systems.com mailto:felix.bec...@t-systems.com wrote: Hi, I've got a serious problem with my frontends. Extremely sudden the exception below is thrown. Restarting the Container does not work. Redeploying doesn't help immediately. I have to close all browser windows an redeploy the application many times until it works. The error is not reproducible and there is no root cause from one of our own classes. A simple frontend page (small login) which works fine hundreds of time suddenly fails and the whole application is down after this exception. Trinidad Version: 1.2.10 MyFaces 1.2.6 Is this problem / are any workarounds known? Shall I open a ticket in the JIRA? Regards Felix == logs/localhost.2009-01-14.log == Jan 14, 2009 5:42:54 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Faces Servlet threw exception javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA13*..) at javax.crypto.Cipher.doFinal(DashoA13*..) at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:369) at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:411) at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:291)
Re: Tomahawk besides trinidad
Leonardo Uribe schrieb: On Tue, Jan 13, 2009 at 4:46 AM, omid p vermind...@gmail.com mailto:vermind...@gmail.com wrote: Hi, I successfully use tomahawk but after i config trinidad in myproject some of component does not work correctly for example after i set action for h:commandLink action=#{beanName.method} / or h:commandButton action=#{beanName.method} / action never fired Hi Trinidad has its own renderkit that overrides original h:commandLink and h:commandButton. The problem seems to be on your configuration. One thought occurs to me.. I presume trinidad overrides the tomahawk stuff by adding a definition in its faces-config.xml file. As far as I can remember, the following is true (please feel free to correct me if I've got something wrong): The order in which faces-config.xml files are processed by a JSF implementation is not defined in the spec. There is an informal agreement between Apache and Sun that we process them in alphabetical order of the jarfile-name - which means that happily tomahawk-*.jar will be processed before trinidad-*.jar, and therefore trinidad settings will override tomahawk. But if the original poster is using an old or unusual JSF implementation, or has renamed the jars for some reason then the order of jarfile processing might be different. And if trinidad's jar is processed *before* tomahawk's one then things will not work as expected. omid: if you are using the MyFaces JSF implementation, then the logfiles will contain information on which faces-config files are being processed on startup (and in which order). Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Possible Leak in MyFaces Orchestrea
Hi Steve, I've created a bugreport for Orchestra to track this: http://issues.apache.org/jira/browse/ORCHESTRA-35 I think your suggestion of using the HttpSessionListener interface is a good one. Unless someone objects, I will update Orchestra's ConversationManagerSessionListener to implement this interface and handle sessionDestroyed directly rather than relying on the container. I can't see how it could cause problems for other containers. Iterating over the attrs is a minor performance hit for apps with very large numbers of http-session attributes, but if the webpp is so complex then this loop is unlikely to be significant. I will try to find time to do this in the next few days. There are a couple of other minor Orchestra fixes that it would be nice to get addressed, so it is probably time to look at getting an orchestra-3.1 release out in the next month or so. Thanks for your very clear problem report.. Regards, Simon Steve Ronderos schrieb: Simon, Sorry about the top-post I wasn't thinking (and my email client is a piece...). I too looked around for the spec on what should happen when a session times out. We are using OC4J :-( . I'll file a bug report with them. There was a workaround I was toying with that could be added to Orchestra if you think it is valuable. I was essentially going to add an HttpSessionListener that removes attributes when the session times out. *public* *class* AttributeRemovalSessionListener *implements* HttpSessionListener { *public* *void* sessionCreated(HttpSessionEvent se) {} *public* *void* sessionDestroyed(HttpSessionEvent se) { EnumerationString e = _se.getSession().getAttributeNames()_; *while* (e.hasMoreElements()) { se.getSession().removeAttribute(e.nextElement()); } } } With proper exception handling I believe that these methods and the HttpSessionListener interface could instead be added to the ConversationManagerSessionListener. I have tested the above listener in OC4J and it works, if you think it is worth looking into I could test it out on some other Containers to make sure that it doesn't make a mess of things. Do you think this kind of solution is worth investigating? Otherwise I can look at other workarounds. Thanks, Steve Ronderos From: Simon Kitching skitch...@apache.org To: MyFaces Discussion users@myfaces.apache.org Date: 12/31/2008 10:03 AM Subject: Re: Possible Leak in MyFaces Orchestrea Hi Steve, First, PLEASE do not top-post (ie put your reply at the top of an email) when someone has previously used bottom-posting. It is really annoying and makes the email almost impossible to read sensibly. See: http://en.wikipedia.org/wiki/Posting_style I've double-checked the servlet spec, and while I can't find explicit wording that says that session timeout triggers removeAttribute on all top-level attributes of the session, the docs here do imply it: http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionBindingListener.html Apache Tomcat is the servlet engine I use mostly, and it certainly does do this. So a bugreport to your servlet-container vendor is probably a good idea. I'm happy to add a workaround in orchestra for this problem, though, if we can find one. I don't see how adding HttpSessionBindingListener to ConversationManager will help though; that will mean the ConversationManager needs to be able to obtain a reference to the ConversationManagerSessionListener which is not easily done. Possibly the ConversationManagerSessionListener could add a dummy object into each session, and this dummy object can then implement HttpSessionBindingListener and contain a reference to the ConversationManagerSessionListener. It probably needs to be transient though (should't be distributed in clustered environments). And it somehow also needs to handle session passivation/activation correctly. If you can create a suitable patch for this issue, I would be happy to review and apply it. Otherwise I'll try to find some time to come up with a solution but it won't be for at least a few weeks. By the way, what servlet container are you using (not that crappy Websphere I hope; it's riddled with non-spec-compliant behaviour...) Regards, Simon On Tue, 2008-12-30 at 10:43 -0600, Steve Ronderos wrote: Simon, Thanks for responding! I didn't know about the ConversationManagerSessionListener, after poking at it for a little, I think I understand how it all works now. Unfortunately I'm still experiencing the leak. I see in the Listener that it removes the ConversationManager objects in the method attributeRemoved. Is it required for an HttpSession to remove it's attributes and therefore cause attributeRemoved to be called? I believe the web container we are using does not cause attributeRemoved to be called
Re: using orchestra with jsf
sarathmavilla schrieb: Simon Kitching wrote: Hi Sarath, On Wed, 2008-12-31 at 02:46 -0800, sarathmavilla wrote: hi, iam new to myfaces orchestra and i dont know how to use it in my application. i search for samples of conversations, but i cant get it. can u please give the samples how to use conversation in jsf application with parent child conversations used in popup windows and tab windows. i tried using beans with our own conversation scope.but i cant get the values from popup windows to my main window. where can i get the samples for this whole. The examples module is listed on the orchestra website: http://myfaces.apache.org/orchestra/myfaces-orchestra-examples-project/index.html There isn't much description there, but the source repository link points to here: http://svn.apache.org/repos/asf/myfaces/orchestra/trunk/examples/ from where you can download some examples. As far as I remember, there aren't any examples dealing with multiple windows though. When a new window (or browser tab) is opened, you need to make sure that the URL does NOT contain a conversationContext query parameter; the o:separateConversationContext tag can help with this. The new window then runs in its own ConversationContext, ie it cannot access any of the conversation-scoped variables from the original window. Having two separate windows accessing the same conversation data has such nasty consequences that it is just better to avoid this completely. So if you need to pass data back to the original conversation somehow, then you need to do it using some way other than modifying objects in conversation-scope. The way I usually do it is the old-fashioned approach of storing data as query-params in the URL. Regards, Simon Hi Simon, thnks for responding. Can u tell me the simple way to get an existing bean in conversation ??? I'm not quite sure what you are asking here. Can you explain your question more? Regards, Simon
Re: using orchestra with jsf
Hi Sarath, On Wed, 2008-12-31 at 02:46 -0800, sarathmavilla wrote: hi, iam new to myfaces orchestra and i dont know how to use it in my application. i search for samples of conversations, but i cant get it. can u please give the samples how to use conversation in jsf application with parent child conversations used in popup windows and tab windows. i tried using beans with our own conversation scope.but i cant get the values from popup windows to my main window. where can i get the samples for this whole. The examples module is listed on the orchestra website: http://myfaces.apache.org/orchestra/myfaces-orchestra-examples-project/index.html There isn't much description there, but the source repository link points to here: http://svn.apache.org/repos/asf/myfaces/orchestra/trunk/examples/ from where you can download some examples. As far as I remember, there aren't any examples dealing with multiple windows though. When a new window (or browser tab) is opened, you need to make sure that the URL does NOT contain a conversationContext query parameter; the o:separateConversationContext tag can help with this. The new window then runs in its own ConversationContext, ie it cannot access any of the conversation-scoped variables from the original window. Having two separate windows accessing the same conversation data has such nasty consequences that it is just better to avoid this completely. So if you need to pass data back to the original conversation somehow, then you need to do it using some way other than modifying objects in conversation-scope. The way I usually do it is the old-fashioned approach of storing data as query-params in the URL. Regards, Simon
Re: Possible Leak in MyFaces Orchestrea
Hi Steve, First, PLEASE do not top-post (ie put your reply at the top of an email) when someone has previously used bottom-posting. It is really annoying and makes the email almost impossible to read sensibly. See: http://en.wikipedia.org/wiki/Posting_style I've double-checked the servlet spec, and while I can't find explicit wording that says that session timeout triggers removeAttribute on all top-level attributes of the session, the docs here do imply it: http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionBindingListener.html Apache Tomcat is the servlet engine I use mostly, and it certainly does do this. So a bugreport to your servlet-container vendor is probably a good idea. I'm happy to add a workaround in orchestra for this problem, though, if we can find one. I don't see how adding HttpSessionBindingListener to ConversationManager will help though; that will mean the ConversationManager needs to be able to obtain a reference to the ConversationManagerSessionListener which is not easily done. Possibly the ConversationManagerSessionListener could add a dummy object into each session, and this dummy object can then implement HttpSessionBindingListener and contain a reference to the ConversationManagerSessionListener. It probably needs to be transient though (should't be distributed in clustered environments). And it somehow also needs to handle session passivation/activation correctly. If you can create a suitable patch for this issue, I would be happy to review and apply it. Otherwise I'll try to find some time to come up with a solution but it won't be for at least a few weeks. By the way, what servlet container are you using (not that crappy Websphere I hope; it's riddled with non-spec-compliant behaviour...) Regards, Simon On Tue, 2008-12-30 at 10:43 -0600, Steve Ronderos wrote: Simon, Thanks for responding! I didn't know about the ConversationManagerSessionListener, after poking at it for a little, I think I understand how it all works now. Unfortunately I'm still experiencing the leak. I see in the Listener that it removes the ConversationManager objects in the method attributeRemoved. Is it required for an HttpSession to remove it's attributes and therefore cause attributeRemoved to be called? I believe the web container we are using does not cause attributeRemoved to be called. Inside of the container we use when the session is invalidating the attributes are searched for instances of HttpSessionBindingListener. Each instance that is found has its valueUnbound method called. If I'm interpreting this correctly, that means that for ConversationManager objects not to leak in my container, they will need to implement this HttpSessionBindingListener interface and remove themselves from the ConversationWiperThread in the valueUnbound method. Or the container would have to call removeAttribute when the session times out. Does this sound correct? At this point do you think it is an issue with my web container that I should file with the vendor? Or is this something that needs to change in Orchestra to accommodate the container. Thanks, Steve Ronderos From: Simon Kitching skitch...@apache.org To: MyFaces Discussion users@myfaces.apache.org Date: 12/27/2008 03:59 AM Subject: Re: Possible Leak in MyFaces Orchestrea __ On Tue, 2008-12-23 at 10:30 -0600, Steve Ronderos wrote: Hello Orchestra Users, I posted the following message to the developers mailing list a few weeks ago and had no response. I was wondering if anyone has any information on a potential memory leak that I see in Orchestra 1.2. It appears to me that conversationManagers in ConversationWiperThread.java gets new ConversationManager objects added to it but they are only removed through some serialization method (I don't fully understand the distributed serialization stuff since I have never used it). I think that this leak is pretty small... on the order of 10s of bytes per ConversationManager, but for long lasting high traffic apps that could eventually become a problem. Is there something that I have overlooked that ensures that these are cleaned up? Is this an accepted shortcoming of Orchestra? Should I file a JIRA issue? Hi Steve, I don't believe there is a problem here. There is one ConversationManager instance per http-session. It gets created when needed (when something calls ConversationManager.getInstance) and is deleted when the http-session gets deleted. There is one ConversationWiperThread instance per webapp. It never creates or destroys ConversationManager instances. However it does peek inside them in order to destroy Conversation and ConversationContext objects that timeout. Unfortunately, there is no javax.servlet api for getting a list of all the HttpSession objects
Re: How to get hold of the event queue in JSF?
Madhav Bhargava schrieb: However I am stuck because I do not know how to get hold of the event queue. Can anyone throw some light? I won't comment on the general approach; I haven't got time at the moment to understand all of that. Specifically about the event queue: The event-queue is held on the UIViewRoot class as a private member. The UIComponent.queueEvent method will add objects to the queue. The UIViewRoot then removes the events from the queue at the appropriate time and calls event.getComponent().broadcast(event) on each as it is removed. But I'm not aware of any way to peek at the event queue. The events do bubble up from the component that queued it to the UIViewRoot, so if you placed some other component in the ancestry that overrides the queueEvent method, then it will see the event being queued. Not very elegant though. Otherwise I think you'll need to try to solve your problem by some other way. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Possible Leak in MyFaces Orchestrea
On Tue, 2008-12-23 at 10:30 -0600, Steve Ronderos wrote: Hello Orchestra Users, I posted the following message to the developers mailing list a few weeks ago and had no response. I was wondering if anyone has any information on a potential memory leak that I see in Orchestra 1.2. It appears to me that conversationManagers in ConversationWiperThread.java gets new ConversationManager objects added to it but they are only removed through some serialization method (I don't fully understand the distributed serialization stuff since I have never used it). I think that this leak is pretty small... on the order of 10s of bytes per ConversationManager, but for long lasting high traffic apps that could eventually become a problem. Is there something that I have overlooked that ensures that these are cleaned up? Is this an accepted shortcoming of Orchestra? Should I file a JIRA issue? Hi Steve, I don't believe there is a problem here. There is one ConversationManager instance per http-session. It gets created when needed (when something calls ConversationManager.getInstance) and is deleted when the http-session gets deleted. There is one ConversationWiperThread instance per webapp. It never creates or destroys ConversationManager instances. However it does peek inside them in order to destroy Conversation and ConversationContext objects that timeout. Unfortunately, there is no javax.servlet api for getting a list of all the HttpSession objects. Therefore in order for the ConversationWiperThread to know what ConversationManager objects exist, the ConversationManagerSessionListener class registers itself as a SessionListener object on the webapp, and detects when a ConversationManager object is added to an HttpSession. The ConversationWiperThread does add these references into a non-weak map, so if they were never removed from the map that would indeed be a leak - when the http session is destroyed there would still be a reference to the ConversationManager. However if you look at ConversationManagerSessionListener you will see that when an http session is destroyed, the ConversationManager instance (if any) in that session is removed from the wiper-thread's map. So as far as I know, there is no leak. There is also one other issue: the container can passivate a session (write it out to disk to free up memory). In this case, we also need to remove the ConversationManager from the wiper-thread. The sessionWillPassivate and sessionDidActivate methods in ConversationManagerSessionListener should handle that case too. If you see any other way in which a memory leak can occur, please let us know. Regards, Simon
Re: [JSF] using ActionListener for executing different actions from table
Anton Gavazuk schrieb: Hi all, Im making the master-detail scenario via ActionListeners and want to use the same ActionListener is there any easy way to know which link in table row performs the action? This should be covered by most JSF textbooks. There is also a page on the myfaces wiki. This page: http://wiki.apache.org/myfaces/ has a link to here: http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters which hopefully answers your question. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: htmLib tag library query
Yep, you should definitely ditch htmLib. It's only a workaround for the problems JSF1.1+JSP had mixing static and dynamic content. With JSF1.2+JSP, this is solved. Or even better, move to Facelets. That still doesn't solve the original question though: is it better to lay out pages using raw html tags or h:panelGrid. Personally, I would suggest using plain html + CSS is better. The h:panelGrid generates html table components for html layout, which is generally regarded as being ugly; instead a page's html should represent the meaningful structure of the data, then CSS style rules should be used to control the actual layout on the page. Of course this approach does mean (a) your team may need to improve their knowledge of CSS, and (b) backwards support for old browsers is not so easy (in particular, CSS positioning is dodgy in IE6 and completely broken in earlier IE versions). Regards, Simon Ali Ok schrieb: Hi Ayub, Main purpose of that library is providing HTML tag flexibility before JSF 1.2. Before JSF 1.2, nonJSF HTML tags should be enclosed in f:verbatim. So, htmLib is helping you writing HTML tags without f:verbatim, because it has most HTML tags as JSF tags. If you are suggested to avoid htmLib, you can use JSF 1.2 compliant MyFaces version and just write HTML tags. Of course there is some limitations. For example, you can't just write a h:commandButton inside a form instead of h:form. Also, you can use Facelets for rendering. Regards, Ali 2008/12/18 Ayub Khan ayub...@gmail.com mailto:ayub...@gmail.com Hi, We are using htmLib tag library listed at http://www.jsftutorials.net/htmLib/ website. We are using this tag as it will give us flexibility to design the complex forms in jsf. We have not found any issues with this tag. However my architect is suggesting not to use this tag, his argument is that its not a standard jsf tag and instead use h:panelGrid tag. I am not able to use h:panelGrid as it does not give me enough felxibility on the layout of components. Could any one let me know their openions here ? Regards Ayub -- -- Two roads diverged in a wood And I took the one less traveled by And that has made all the difference. Robert Frost.
Re: [JSF] using ActionListener for executing different actions from table
Ah. So in that case, Andrew understood your question correctly and I did not. You really *did* mean which link in table row... Yes, you *can* add an id to each of the commandLink components; there is only one instance of each column no matter how many rows there are in the table (table components uses the flyweight pattern). Note that the clientId is different for each row, as the table automatically ensures that components have clientId values of tableId:rownum:componentId So just go ahead and add the ids, then as you (and Andrew) point out, the ActionEvent passed to the processClick method will return the component whose id (not clientId) you can then check. By the way, I normally ignore emails that have mixed posting style (see my original sig). But as it's Christmas... Regards, Simon On Fri, 2008-12-19 at 21:10 +0200, Anton Gavazuk wrote: Hi Simon, Andrew thanks for the answers, sure, my question is confusing - I meant how to do something like: h:table !-- its link1 -- h:column h:commandLink action=actionA actionListener=processClick /h:column !-- its link2 -- h:column h:commandLink action=actionB actionListener=processClick /h:column /h:table So my question was how to define in processClick that user clicks on link1 or on click 2? you cannot put certain Id in link component - its table, so id must be unique and its generated by component, and actionEvent.getComponent() returns something like id_lnk_141413 - sure, not very meaningful :) So for now I have gone with separate methods for every actionListener. Cheers, Anton 2008/12/19 Simon Kitching skitch...@apache.org: Anton Gavazuk schrieb: Hi all, Im making the master-detail scenario via ActionListeners and want to use the same ActionListener is there any easy way to know which link in table row performs the action? This should be covered by most JSF textbooks. There is also a page on the myfaces wiki. This page: http://wiki.apache.org/myfaces/ has a link to here: http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters which hopefully answers your question. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: javax.faces.application.ViewExpiredException:
Vinaya Tirikkovalluru schrieb: Hi, We have upgraded from Tomahawk 1.1.6 to Tomahawk 1.1.8 After this, we have been getting a lot of javax.faces.application.ViewExpiredExceptions I was under the impression that javax.faces.application.ViewExpiredException is caused only when the session expires. Anybody else had this problem earlier? Could any one please tell me what are the other scenarios where this is caused? Firstly, note that this applies only when server-side-state-saving is enabled. A ViewExpiredException will never occur with client-side-state-saving. Myfaces keeps a cache of previous views in the session. At the start of each render phase, a new view key is allocated, and written into a hidden field in the html form. At the end of the render phase, the current view is stored into the cache using that key. On postback, if the view key specified by the posted form data does not match any entry in the cache, then a ViewExpiredException is reported. The cache has a fixed size, so that a user session does not grow continuously; when a view is stored into a full cache, the oldest entry is discarded. This allows a fixed-size number of back button clicks to work (the submitted form will contain an old view key). The actual number is configurable. Unfortunately this approach does not work too well if an application has multiple windows open; there is still just one cache, so if one window is used repeatedly then it will eventually push the saved view for other open windows out of the cache; then submitting the other window will cause a ViewExpiredException. Unfotunately http provides no way to know which window is which, so it is not possible to have a per-window cache. But all this view-cache-management is done by the jsf core implementation, *not* tomahawk. So I cannot think why upgrading Tomahawk is causing problems for you. Hopefully the above info will help you figure out what the actual problem is.. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: t:inputFileUpload Default URL
Hi Marcus, AFAIK, what you want cannot be done. The upload file functionality is build upon the standard HTML input type=file tag. Nothing can be done by the JSF framework that the input type=file tag does not support. And this html tag does not provide any option to set the starting directory. As I'm sure you can understand, browsers must not allow html pages to read stuff from the local disk unless the user explicitly agrees. Anything else would be a huge security hole. So the only way for a page to get files sent from the browser back to the server is via this one input type=file tag (unless you start using signed applets or activeX or similar). As you can see here http://w3schools.com/tags/att_input_type.asp the input type=file tag does support an accept attribute that will filter what types of files will be displayed, but provides no way for the html page to suggest a starting directory. There are no other options for this html tag. As Ali noted, the dir attribute on the t:inputFileUpload tag is nothing to do with directory names; dir is short for language direction, ie supports languages like Arabic that are written right-to-left as well as languages like English (left-to-right). Regards, Simon m4rkuz schrieb: Sorry If I did not make myself clear, Let me explain further, I have a t:inputFileUpload that is represented as a input text and a button, when you click the button a dialog apears asking to select a file, what I want to do is to make this dialog opens a default dinamic folder on the disk, like when you an user click it it would open a dialog showing the default path for that user.. Any ideas? Marcus V. Sánchez D. __ Enterprise Developer. Sun Certified Java Programmer (SCJP) PD: English is not my native language, help me a little ;) On Wed, Dec 17, 2008 at 4:48 AM, Ali Ok al...@aliok.info mailto:al...@aliok.info wrote: Hi Marcus, What do you mean setting a default value in the dir attribute? Are you modifying tld file? Do you mean you want to change text direction to RTL? Regards, Ali Ok 2008/12/16 m4rkuz m4r...@gmail.com mailto:m4r...@gmail.com Hi everyone, I'm suscessfully using the t:inputFileUpload tag, but now I have a problem setting a default value in the dir attribute of the Tag... any Ideas? Best Regards, Marcus V. Sánchez D. __ Enterprise Developer. -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [Orchestra] NullPointerException in org.apache.myfaces.orchestra.conversation.ConversationWiperThread
Hi Petr, Juza Petr schrieb: Hello, I have noticed that our application generates the following error (to standard output): Exception in thread org.apache.myfaces.orchestra.conversation.ConversationWiperThread java.lang.NullPointerException at org.apache.myfaces.orchestra.conversation.ConversationManager.findConver sationContextId(ConversationManager.java:140) at org.apache.myfaces.orchestra.conversation.ConversationManager.removeAndI nvalidateConversationContext(ConversationManager.java:343) at org.apache.myfaces.orchestra.conversation.ConversationManager.checkTimeo uts(ConversationManager.java:626) at org.apache.myfaces.orchestra.conversation.ConversationWiperThread._run(C onversationWiperThread.java:113) at org.apache.myfaces.orchestra.conversation.ConversationWiperThread.run(Co nversationWiperThread.java:90) I haven't found any visible effects of this error in the application. We use MyFaces Orchestra version 1.3, JSF 1.2, MyFaces (1.2.4) implementation with Tomahawk (1.1.7), jdk1.5.0_16 and facelets (1.1.14). I've had a quick look at the code, and it does look like an orchestra bug. I've therefore created an issue: http://issues.apache.org/jira/browse/ORCHESTRA-34 As noted in that bugreport, the effect is that conversation and conversation-context timeouts are disabled, as the wiper thread stops. But there should be no other side-effects. As long as you use access-scoped conversations, and correctly close your manual-scoped conversations there will be no problem. For abandoned manual-scoped conversations, the memory will be leaked until the user's http-session expires. I'm not sure why I don't see this exception in my logs; I'll look into this when I can find some free time. Thanks for reporting this. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: how to prevent extensive logging for myfaces and tomahawk when server starts?
Andreas Niemeyer schrieb: Hi, When the application server starts, there is an extensive logging outcome from the myfaces libraries. How can I suppress this? Can I remove the faces-config from the jars? Myfaces and Tomahawk both use Apache commons-logging, which will of course forward to whatever real logging library you have in your classpath. So you just need to configure whatever real logging library is being used to filter out the message categories you don't want. This is standard logging configuration stuff, and not specific to myfaces. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Post form to external url with method invocation
jiri.pejc...@gmail.com schrieb: Hi, I'm implementing a payment to a bank from JSF application. I need to pass some prameters to an external https URL of the bank by POST method. I could do it with just plain form: FORM name=form action=https://address.cz; METHOD=POST INPUT TYPE=HIDDEN name=MID value=123 INPUT TYPE=HIDDEN name=AMT value=12345.60 But I also need to call a bean method that logs the submitted values to database. Maybe I could post the form from bean action method but how? The Apache httpclient project provides a library that makes it easy to generate http requests. You could use this lib from within your action method. See: http://hc.apache.org/httpclient-3.x/ Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Configure ConversationContext timeout in Orchestra
Hi Steve, I've double-checked, and it does indeed look like there is no way to configure the ConversationContext timeout. Do you want to *increase* or *reduce* the default timeout? If you are looking at reducing the timeout then I would mostly agree with Jacob: setting the ConversationContext timeout is not usually very important. The ConversationManager (which holds the ConversationContexts) is in the http-session, so as soon as the session times out all this data goes. This is normally sufficient. And a ConversationContext object itself doesn't take up much memory; the Conversation objects held in it do, but they *will* time out and be removed. There are two cases in which reducing the context timeout is mildly useful: (i) when a webapp only uses Orchestra in a few not-often-used parts. In this case, the session will stay alive while the user is active in other parts of the app. (ii) when a user has opened multiple browser windows, does some orchestra-relatde requests then closes some browser windows. In this case, there is (or should be) a separate context per windows, but the ones for the closed windows will continue to exist until the (non-configurable) timeout (or the http session expires). If you want to *increase* the timeout, so data doesn't get discarded when the user is inactive then this is trickier. I would suggest using javascript or meta-tags in the generated html page to do periodic pings of the server; this is a more general solution to http session timeouts that I often use. It ensures that the http session remains alive for as long as the browser is open, regardless of the http session timeout selected. Despite the above, there really *should* be a configuration option for this, so I have created issue http://issues.apache.org/jira/browse/ORCHESTRA-33 Regards, Simon Jacob Mathew-2 wrote: What is the motivation for setting a timeout for the context? Ultimately you are interested in the deletion of beans in a conversation right? Can you not achieve that by setting the timeouts on the conversations directly? Every bean in a conversationContext is inside a conversation... -Jacob On Fri, Dec 12, 2008 at 11:40 AM, Steve Ronderos steve.ronde...@ni.comwrote: Hello Users, I've looked around for documentation on how to override the 30 minute time out default that is set for ConversationContext in Orchestra. I'm able to configure the Conversation timeout fine for both conversation.access and conversation.manual, but I have been unable to find the configuration for ConversationContexts. Does anyone know how I can configure this setting? Thanks, Steve Ronderos -- View this message in context: http://www.nabble.com/Configure-ConversationContext-timeout-in-Orchestra-tp20982286p21009794.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
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. 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 -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: JSF servlet request in action method or navigation rule to get binary servlet data?
I think that what Andreas is doing is: (1) access a JSF page -- renders html (2) click on command-component in page, causing a submit (3) in action-handler method, send an http-redirect to the browser (4) browser then does a GET to the redirect address, which maps to a servlet (5) the servlet generates a PDF as response, with appropriate http-headers (6) the server sees that the response mime-type is not HTML, so creates a new window to hold the PDF. The original browser window is left with the same HTML it had at (1) The browser window has simply not changed at all since (1), although a JSF lifecycle has run on the server. So of course any messages are still displayed. Andreas, I have had to do something similar in the past, but took a different approach. In the action-handler method I just put some data in session-scope, and then rendered a JSF page that contains some javascript to do a GET request to the pdf-generation servlet (a META refresh tag might also work). The PDF servlet then used the session-scoped data to generate the appropriate PDF document. Regards, Simon Bernd Bohmann schrieb: Hello Andreas, is your action immediate=true ? Regards Bernd Andreas Niemeyer schrieb: yippi :) Thank you all! Regards, Andreas Richard Yee schrieb: Try using divelement.style.display=none Regards, Richard On Wed, Dec 10, 2008 at 6:27 AM, Andreas Niemeyer [EMAIL PROTECTED] wrote: Hi, It works. The only problem is the left space from the invisible div tag. Regards, Andreas div id=error_messages style=color: darkred;visibility: visible t:messages id=error_messages showDetail=true showSummary=false / /div h:commandButton id=reportbutton onclick=clearMessages('error_messages') value=#{msgs.CreateReportButton} action=#{pdfreport.createPDFReport} / JavaScript: function clearMessages(aMessagesID) { var divelement = document.getElementById(aMessagesID); divelement.style.visibility='hidden'; } Andreas Niemeyer schrieb: Hello Helmut, Good proposal to handle this about JavaScript before send the form. I'll give it a trial. Kind regards, Andreas Helmut Swaczinna schrieb: Hello Andreas, I don't think Tobago or JSF can clear the messages for you. But you can clear the messages on the page yourself with some javascript before the action for the PDF generation gets submitted. For example: ... action=controller.createPDF onclick=clearMessagesAndSubmit('@autoId') ... function clearMessagesAndSubmit(actionId) { // Find messages and clear them Var message = document.getElenemtById('page:message'); message.value = ; Tobago.submitAction(actionId, false); } I haven't tried this, but I think it should work. Regards Helmut - Original Message - From: Andreas Niemeyer [EMAIL PROTECTED] To: users@myfaces.apache.org Sent: Wednesday, December 10, 2008 11:11 AM Subject: Re: JSF servlet request in action method or navigation rule to get binary servlet data? Hello Bernd, Yes, I did. There seems to be no way to get previous messages away due I don't get the page reloaded. I'll open a new thread and try to describe in more detail the requirements. Thank you. Regards, Andreas Bernd Bohmann schrieb: Hello Andreas, are you calling FacesContext.getCurrentInstance().responseComplete() ? Regards Bernd Andreas Niemeyer schrieb: Hello Bernd, Thank you for response. Unfortunatly I have to use this servlet as a pdf dynamic provider. The redirect works fine so far, but another thing happened. Due some validation rules in the same method, a previous custom FacesMessage stays displayed and only after a page reload it goes away. Have someone an idea? Regards, Andreas Bernd Bohmann schrieb: Hello Andreas, maybe this help: http://wiki.apache.org/myfaces/Sending_Files You don't need a Servlet for sending binary data from jsf. The magic is the responseComplete() method. Please look at the Section 2.1.3 Faces Request Generates Non-Faces Response of the jsf 1.1 spec. Regards Bernd Andreas Niemeyer schrieb: Hi, I would like to send form data from a JSF page for a servlet request with a navigation rule. The servlet returns a content type of application/pdf and is running in a context path. If I call it from within a action method, it works with following code: public String createPDFReport() { ... FacesContext context = FacesContext.getCurrentInstance(); ExternalContext ext = context.getExternalContext(); String vServletPath = /context_path/pdf-test; ext.redirect(ext.encodeResourceURL(vServletPath)); ... return call_servlet; } My context is a portal, I'm using the JSF portal bridge. The web.xml looks like: ... servlet servlet-namepdf-test/servlet-name
Re: Thread safety for Orchestra access scope
Hi Jacob, Thanks very much for your comments. I don't believe that guessing the conversationcontextid is significant, because the id is per-session. As you point out, someone *can* maliciously try to guess the value, thereby creating race conditions for data *in their own session*. But I don't see any way to expand that to corrupt data in other sessions or create a denial-of-service for anyone else. If you can think of a way someone can use this to affect anyone other than themself, please let me know! Note that having two tabs or windows with the same conversationContextId is a bad idea; separate windows should have separate conversationContextId values. The per-context locking is really just to ensure that things like users double-clicking on a submit button don't cause races. If the user can select the same view in two different windows, and you use the same conversationContextId (or a session-scoped backing bean) then the two windows will interact in unpleasant ways. Having different conversationContextIds ensures that the backing bean instance is *different* for the two windows, so no nasty interactions occur. Note also that if you want multiple windows, you really should select client-side-state-saving. See here for more details: http://myfaces.apache.org/orchestra/myfaces-orchestra-core/multiwindow.html That's the reason there isn't much documentation on the conversation locking feature of Orchestra; apps should use different conversationContextIds for different windows. The locking is just a safety measure for some odd corner cases, not a major user feature. Regards, Simon Jacob Mathew schrieb: It should be noted that the border case where the first request creates a new conversationcontext is not completely sound. In this scenario, no lock is acquired because nothing else can refer to that newly created [conversationcontext] id until the response for this request has been sent back to the client browser. This is not true. The second request can simply guess the conversationcontext id which is a simple alphanumeric increment. Admittedly not a situation likely to happen unless someone was explicitly trying to break the application, but a legitimate hole nonetheless. -Jacob On Thu, Dec 11, 2008 at 4:14 PM, Jacob Mathew jacobgmat...@gmail.com mailto:jacobgmat...@gmail.com wrote: The source code for Orchestra provided the answer I was looking for. It looks like a lock is acquired on the conversationcontext object corresponding to the request before accessing any of the beans inside of a conversation. So the execution of two requests in the same conversationcontext will not happen concurrently, which mean beans in a conversation (access) scope do no, in general, need to be thread safe. Explicit documentation of this will probably be useful. -Jacob On Thu, Dec 11, 2008 at 10:52 AM, Jacob Mathew jacobgmat...@gmail.com mailto:jacobgmat...@gmail.com wrote: I was under the impression that beans that I set up with access scope will need to be thread safe because I could have a user open two tabs (with the same conversation context) and submit to the same page simultaneously (or double submit on the same tab). But I was running some tests and it seems like something in the framework is forcing accesses to my beans to be executed in sequence rather than simultaneously. Specifically I set it up so I had the first request stuck at a breakpoint and submitted a second request (that does not hit the breakpoint), but I found that *both* requests are stuck until I resume the thread stuck at the breakpoint. Any insights? -Jacob Mathew -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
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 -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Action button method binding
McCrady, Paul (ITTD Retail Stores) schrieb: Anyone seen any instances where a method binding from an action button stops getting invoked? e.g. consider the following code snippet script function x() { document.getElementById(y).click(); } /script tr:panelHorizontalLayout halign=end tr:panelButtonBar tr:commandButton id=y action=#{bean.mymethod}/tr:commandButton /tr:panelButtonBar /tr:panelHorizontalLayout We can call function x and have mymethod on bean getting called and working fine but all of a sudden this stops working. The usual cause is a validation or conversion failure. Have you got an h:messages tag in your page so that you can see any error messages that may be generated? Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: MyFaces is inserting JS that's causing JS errors
Are the referenced scripts getting correctly loaded? (a) if you paste that url into a new browser window, do you see the script? (b) if you enable firebug in firefox, can you see the javascript? If not, then you probably have the Tomahawk ExtensionsFilter incorrectly configured. If the script is being loaded, then I can't think what the problem would be. Those are the latest versions of myfaces1.1x and tomahawk, so they should be compatible (we would have had lots of problem reports if not, including problems with the tomahawk example pages that use inputCalendar). Weblogic can be weird sometimes, but I can't see it causing this sort of issue. Are you using other libraries (richfaces, trinidad, etc)? If not, then you'll probably have to debug a little more on your environment... Regards, Simon nanini schrieb: I am facing the same problem. Aren't there any answers yet? laredotornado wrote: Hi, I'm noticing this behavior on PC Firefox. I'm using MyFaces 1.1.6 with Tomahawk 1.1.7 on WebLogic 9.2.2 On a page I have inputCalendar objects, and I notice this is getting added to the top of my page: script type=text/javascript src=/nps_history_gui/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12234745/prototype.PrototypeResourceLoader/prototype.js!-- //--/script script type=text/javascript src=/nps_history_gui/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12234745/calendar.HtmlCalendarRenderer/date.js!-- //--/script script type=text/javascript src=/nps_history_gui/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12234745/calendar.HtmlCalendarRenderer/popcalendar.js!-- //--/script script type=text/javascript src=/nps_history_gui/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12234745/inputTextHelp.HtmlTextHelpRenderer/inputTextHelp.js!-- //--/script but upon loading my page, I get this JS error: invalid array length this.length--; prototype.js (line 464)
Re: how to display line break in h:inputTextarea
tong123123 schrieb: I want to display something like ab def I try the following code h:inputTextarea rows=10 cols=20 readonly=true value=acbr/delt;brgt;// but the output is acbr/delt;brgt;/ so how to let the browser output ab def using h:inputTextarea?? I don't think the HTML textarea component supports embedded html. Can you get this working just with plain HTML? If not, then clearly it is impossible for JSF to do anything about that... Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: confused about selectOneItem and converter and data binding
An html select element looks like this: select name=cars option value=volvoVolvo/option option value=saabSaab/option option value=fiatFiat/option option value=audiAudi/option /select You have: h:selectOneMenu value=#{...} f:selectItems value=#{anotherDataBean.selectItems}/ where the getSelectItems() method returns a list of SelectItem objects whose string is the text you want to display, and the value is a ComplexProp object, right? So the renderer for the f:selectItems writes out one option tag for each item in the list. The body text for the option tag is taken from the SelectItem.label property. The SelectItem.value is a ComplexProp object, and so the converter.getAsString method is called to generate the string to write out as the value attribute. Obviously this occurs once for each item in the list. When the form is posted back, the browser will include in the posted form data the *string value* of whatever option was selected by the user. JSF calls the converter once, to map this string back to a ComplexProp object, then (in update-model phase) stores the resulting object using the value EL-expression of the h:selectOneMenu component. So on render, getAsString is called N times, and on postback getAsObject is called once. Regards, Simon Anton Gavazuk schrieb: Hi dushyant, thanks for response - which value I should return in getAsString method? - actual Key element or Value element? - because the selectOneItem is populated by SelectItem's elements. and why in debug I see that getAsString method is being called for N times (over all elements in binded array)? 2008/11/7 dushyant agarwal [EMAIL PROTECTED]: In case of selection, the getAsObject would convert the selected value as specified and send it to BB. In getAsString() method you again have to specify some code to change the BB value into one of the values in the selectItem list, bound to the selectOneMenu component. --- On Fri, 7/11/08, Anton Gavazuk [EMAIL PROTECTED] wrote: From: Anton Gavazuk [EMAIL PROTECTED] Subject: Re: confused about selectOneItem and converter and data binding To: MyFaces Discussion users@myfaces.apache.org Date: Friday, 7 November, 2008, 3:41 PM Guys, does anyone have any idea? 2008/11/6 Anton Gavazuk [EMAIL PROTECTED]: Hi all, have a problem I have the JSF Bean dataBean with property complexprop - the type of field is ComplexType I want to set an certain property to the bean via selectItems, which is being collected from the anotherDataBean.selectItems - it returns array of SelectItems. so it looks like !--page-- h:selectOneMenu id=in_property value=#{dataBean.complexprop} f:selectItems value=#{anotherDataBean.selectItems}/ f:converter converterId=geoConverter/ /h:selectOneMenu Of course it wouldnt not work because JSF would try convert the String value from UI to internal dataBean.complexprop type and vice versa so I added the converter But I cannot understand how to work properly with it - during the call the method is being called for count = selectItems.size() Converter.getAsString(FacesContext facesContext, UIComponent uiComponent, Object o) What could be wrong? How to link together all such things? Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Export datatable to excel problem with pagination
The exporter class is here in trunk http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/exporter/ It did exist at the time that sandbox 1.1.7 was released: http://svn.apache.org/repos/asf/myfaces/tomahawk/tags/1_1_7/sandbox/core/src/main/java/org/apache/myfaces/custom/exporter/ Where did you download sandbox 1.1.7 from? Looks like you've got a bad jarfile from somewhere. Note that sandbox code is never released by the ASF as a pre-built jarfile; by *definition*, sandbox code is something that has not yet been approved for release. Anyone wanting to use sandbox code should build it themselves [1]. Regards, Simon [1] Note that tomahawk-sandbox-1.1.6 was accidentally deployed to the main maven repositories. This was an accident, and should not have happened. mrfarhankhan schrieb: I'v downloaded the latest Tomahawk and sandbox 1.1.7 libs. But i did not find any exportActionListener component in the sandbox. So ??? Farhan ! Hazem Saleh-2 wrote: Use the exporterActionListener for PDFs and XLSs export: http://wiki.apache.org/myfaces/ExporterActionListener On Tue, Nov 4, 2008 at 11:33 AM, mrfarhankhan [EMAIL PROTECTED]wrote: Hi ! I am following the following link to export my datatable to excel http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel The problem is that I am using pagination with the table but the excel file only contains the rows that are currently being displayed in the datatable. I want all the rows to be exported. Looking for a solution Thanks in advance Farhan ! -- View this message in context: http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20318897.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- Hazem Ahmed Saleh Ahmed Author of (The Definitive Guide to Apache MyFaces and Facelets): http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/1590597370 Web blog: http://www.jroller.com/page/HazemBlog [Web 2.0] Google Maps Integration with JSF: http://code.google.com/p/gmaps4jsf/ http://www.theserverside.com/news/thread.tss?thread_id=51250
Re: Export datatable to excel problem with pagination
There's your problem. What you called sandbox 1.1.7 is actually a sandbox 1.1.7 SNAPSHOT from january 2008. Myfaces does not currently provide any nightly builds of sandbox. You need to check out the sandbox source code (see link on the sandbox site), then use maven 2.x to build the jar. Regards, Simon mrfarhankhan schrieb: I downloaded the jars from the following link http://people.apache.org/builds/myfaces/nightly/ Where can I get the jars ? Thanks Farhan ! Simon Kitching wrote: The exporter class is here in trunk http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/exporter/ It did exist at the time that sandbox 1.1.7 was released: http://svn.apache.org/repos/asf/myfaces/tomahawk/tags/1_1_7/sandbox/core/src/main/java/org/apache/myfaces/custom/exporter/ Where did you download sandbox 1.1.7 from? Looks like you've got a bad jarfile from somewhere. Note that sandbox code is never released by the ASF as a pre-built jarfile; by *definition*, sandbox code is something that has not yet been approved for release. Anyone wanting to use sandbox code should build it themselves [1]. Regards, Simon [1] Note that tomahawk-sandbox-1.1.6 was accidentally deployed to the main maven repositories. This was an accident, and should not have happened. mrfarhankhan schrieb: I'v downloaded the latest Tomahawk and sandbox 1.1.7 libs. But i did not find any exportActionListener component in the sandbox. So ??? Farhan ! Hazem Saleh-2 wrote: Use the exporterActionListener for PDFs and XLSs export: http://wiki.apache.org/myfaces/ExporterActionListener On Tue, Nov 4, 2008 at 11:33 AM, mrfarhankhan [EMAIL PROTECTED]wrote: Hi ! I am following the following link to export my datatable to excel http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel The problem is that I am using pagination with the table but the excel file only contains the rows that are currently being displayed in the datatable. I want all the rows to be exported. Looking for a solution Thanks in advance Farhan ! -- View this message in context: http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20318897.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- Hazem Ahmed Saleh Ahmed Author of (The Definitive Guide to Apache MyFaces and Facelets): http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/1590597370 Web blog: http://www.jroller.com/page/HazemBlog [Web 2.0] Google Maps Integration with JSF: http://code.google.com/p/gmaps4jsf/ http://www.theserverside.com/news/thread.tss?thread_id=51250 -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: MyFaces Tomahawk 1.1.7 Examples cannot be run using myfaces-core-1.2.5 lib
tong123123 schrieb: Caused by: java.lang.NoSuchMethodError: org.apache.myfaces.taglib.html.HtmlPanelGridTag.setColumns(Ljava/lang/String;)V at org.apache.jsp.helloWorld_jsp._jspx_meth_h_005fpanelGrid_005f0(helloWorld_jsp.java:176) at org.apache.jsp.helloWorld_jsp._jspx_meth_h_005fform_005f0(helloWorld_jsp.java:152) at org.apache.jsp.helloWorld_jsp._jspx_meth_f_005fview_005f0(helloWorld_jsp.java:118) at org.apache.jsp.helloWorld_jsp._jspService(helloWorld_jsp.java:83) ... 33 more I just download MyFaces Tomahawk 1.1.7 Examples http://www.apache.org/dyn/closer.cgi/myfaces/binaries/tomahawk-examples-1.1.7-bin.zip then downlaod MyFaces-core 1.2.5 http://www.apache.org/dyn/closer.cgi/myfaces/source/myfaces-core-1.2.5-src.zip then download MyFaces Tomahawk 1.1.7 for JSF 1.2 http://www.apache.org/dyn/closer.cgi/myfaces/binaries/tomahawk12-1.1.7-bin.zip then unzip myfaces-example-blank-1.1.7, unzip MyFaces-core 1.2.5 and place the .jar file in myfaces-example-blank-1.1.7 lib folder, then unzip tomahawk12-1.1.7-bin.zip and place the .jar file in myfaces-example-blank-1.1.7 lib folder, then placed the file in tomcat 6.0.18 and deploy, the exception as stated above is shown!! I really want to use jsf 1.2!! Please don't send email in html form. Your email is almost unreadable for me... Have you cleaned out your servlet-engine's working directory? Servlet engines cache compiled JSPs; if you then change libraries then the old cached files can cause problems like this.. Cheers, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Tomahawk Spring Webflow : enctype=multipart/form-data doesnt work
Yes, something on the wiki would be nice. The point is that the ExtensionsFilter needs to be mapped to *whatever servlet handles the faces request*. In almost every case this is the Faces Servlet (duh). But occasionally it is not, like here with WebFlow. And as it happens, the in-house webapp I work on for my employer also has an architecture where a custom servlet handles requests, then forwards internally to the Faces Servlet. So the Spring WebFlow setup isn't entirely unique. Cheers, Simon Matthias Wessendorf schrieb: thanks! do you mind to document this in the wiki ? I heard that the spring wf does some wild stuff, and since you figured, it would be great to create a wiki page for that! thanks! Matthias On Wed, Nov 5, 2008 at 9:57 PM, djohnjimmy [EMAIL PROTECTED] wrote: I got it working now. The problem was that... When Spring Web Flow comes into picture, the faces Servlet is not the big guy delivering the views - its Spring's MVC Dispatcher Servlet that serves the requests Although, everyone advises Tomahawk Extensions Filter to be mapped to Faces Servlet. That doesnt serve well when we have SWF in between. So, instead of the following fliter-mapping in web.xml. filter-mapping filter-nameExtensions Filter/filter-name servlet-nameFaces Servlet/servlet-name /filter-mapping Try this : filter-mapping filter-nameExtensions Filter/filter-name servlet-nameSpring MVC Dispatcher Servlet/servlet-name /filter-mapping !-- Map all /spring requests to the Dispatcher Servlet for handling -- servlet-mapping servlet-nameSpring MVC Dispatcher Servlet/servlet-name url-pattern/spring/*/url-pattern /servlet-mapping filter filter-nameExtensions Filter/filter-name filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class init-param description Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadMaxFileSize/param-name param-value100m/param-value /init-param init-param description Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadThresholdSize/param-name param-value100k/param-value /init-param init-param description Set the path where the intermediary files will be stored. /description param-nameuploadRepositoryPath/param-name param-value/temp/param-value /init-param /filter djohnjimmy wrote: Can someone please take a look at this. I am stuck BIG time. Thanks! djohnjimmy wrote: My uploadedFile is null. If I put the h:form enctype=multipart/form-data then the page never goes to the next view. If the enctype=plain/text then it navigation works but the uploadedFile is null. Environment : Spring WebFlow : 2.0.3.Release Myfaces : 1.2.4 Tomahawk : 1.1.6 tomahawk-facelets (google project) : 1.1.6.2 Websphere AS : 6.1.0.17 My web.xml http://www.nabble.com/file/p20333785/web.xml web.xml Webflow xml http://www.nabble.com/file/p20333785/upload.xml upload.xml . The upload xhtml (I am using facelets and not jsp) http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml The backend bean : http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java The POJO that I am populating with the CSV values : http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to display the CSV data uploaded in the previous page i.e. csvUpload.xhtml http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml uploadedCSVDetails.xhtml -- View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [tomahawk] single checkboxes are rendered inside label tags
Michael Heinen schrieb: I recently updated tomhawk 1.1.5 to 1.1.7 and noticed that single checkboxes are rendered inside an additional label tag. The html output is now: LABEL INPUT id=... type=checkbox /foo /LABEL Why is this additional label tag rendered in 1.1.7? Is there any benefit? I believe this is equivalent to: label for=id1foo/label input id=id1 type=checkbox but cleaner (a parent/child relation seems more appropriate here than the for approach). If I remember correctly, having the text for the checkbout output as a label (in either form) means that clicking on the label changes the checkbox state too. Writing the checkbox text (foo in this case) as just plain text does not have that effect. I don't know of any other reason. Is there a problem? Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: [TOBAGO] Usging jstl tags inside a tobago sheet-tag
GroovieMan schrieb: [] Anyway, do you think that JSTL is a nogo for tools like tobago, or can you imagine some usecases ? The JSF lifecycle should be thought of as: viewing a new page: * build component tree (aka a view tree) * render component tree * save state of component tree Handling a postback without navigation: * restore component tree (from saved state) * process submitted data * render component tree * save state of component tree Handling a postback with navigation: * restore component tree (from saved state) * process submitted data * build new component tree * render new component tree * save state of component tree JSTL tags that do not change what components are in the component-tree are generally safe. That includes using c:if to wrap something that is NOT a JSF component. But using JSTL tags to change what components are in the tree (eg wrapping JSF components in a c:if, or c:foreach) is dangerous, and usually leads to strange results. By using the JSF rendered property instead of c:if, the component-tree doesn't change; the same objects are in the tree, they just choose to render HTML or not. This applies to all JSF libraries, including Tobago. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
[Orchestra] Core 1.3 Released
The Apache MyFaces Orchestra team is pleased to announce the release of Apache MyFaces Orchestra Core 1.3. Get a full overview at Orchestra's homepage [1]. The distribution is available at * http://myfaces.apache.org/orchestra/download.html Apache MyFaces Orchestra is available in the central Maven repository under Group ID org.apache.myfaces.orchestra. The release notes are available at * http://svn.apache.org/repos/asf/myfaces/orchestra/tags/core-1_3/RELEASE-NOTES.txt Have fun! Regards, Simon [1] http://myfaces.apache.org/orchestra
Re: Tree and TabbedPane Problem in Websphere 6.1
jhomuth schrieb: Hi again, I fixed that problem after a 3 days searching the whole internet. I only wanna submit the solution if somebody has the same problem. I thought it was not the css and js stuff, because i copied it directly into my page, because it could not be found on the server, but I guess I did something wrong. Of course it was the css and js stuff. In MyFaces this stuff will be loaded through an Ressourceloader which is called through the Extensionfilter. But in Websphere (WAS 6.1) this filter is not invoked. To fix that you will have to set a property for your server. In the german version (which I use) you have to go to Server - Anwendungsserver - yourServerName (eg. server1) - Webcontainer-Einstellungen - Webcontainer - Benutzerdefinierte Merkmale - Neu and than set com.ibm.ws.webcontainer.invokefilterscompatibility to true. http://localhost:9061/ibm/console/propertyCollection.do?EditAction=truerefId=Property_1225443461159contextId=cells%3AavengerNode02Cell%3Anodes%3AavengerNode02%3Aservers%3Aserver1resourceUri=server.xmlperspective=tab.configuration in the english version it might be something like that Server - Applicationserver - yourServerName (eg. server1) - Webcontainer-Preferences - Webcontainer - Userdefined Setting - NEW and than set com.ibm.ws.webcontainer.invokefilterscompatibility to true. http://localhost:9061/ibm/console/propertyCollection.do?EditAction=truerefId=Property_1225443461159contextId=cells%3AavengerNode02Cell%3Anodes%3AavengerNode02%3Aservers%3Aserver1resourceUri=server.xmlperspective=tab.configuration After that please restart the server and then it will work. I mean it work in my case and I hope it will work for you in the same way. I found the solution here if you need some additional information http://www.mail-archive.com/[EMAIL PROTECTED]/msg32571.html I was curious about what this property did, and had a quick search. I couldn't find any definite specification, but it looks to me like the following occurs. I'm adding this info here just for future reference.. Most servlet containers do this: * if request url matches a servlet * compute filters, run filters, run servlet * else * set servlet to the file-serving servlet * compute filters, run filters, run servlet But websphere seems to do this by default: * if request url matches a servlet * compute filters, run filters, run servlet * else if url points to file on disk * compute filters, run filters, return file * else send 404 immediately Therefore applications that use filters to service a request (ie never invoke the underlying servlet) don't work. And this is exactly what the tomahawk ExtensionsFilter does; it checks the url and for certain urls it serves the response itself. And the urls don't point to files on disk; once decoded they do reference a file in a jarfile but websphere can't know that. And because ExtensionsFilter is not used to fetch *pages*, but instead (optional) files like .css and .js, the user doesn't get an obvious 404 error on their screen; the .css or .js is just missing when the page is rendered. Setting the magic property appears to make websphere act like every other servlet engine on the planet. Sigh. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Trouble upgrading MyFaces
laredotornado schrieb: Hi, I'm trying to upgrade my MyFaces implementation from 1.1.6 to 1.2.4. I took out the old api and impl jars and replaced them with myfaces-impl-1.2.4.jar and myfaces-api-1.2.4.jar. I kept tomahawk-1.1.7.jar the same. Unfortunately, I'm now getting compilation errors. Below is a sample. What can I do to heal the pain? - Dave search.jsp:33:28: No match was found for method setShowSummary(java.lang.String) in type org.apache.myfaces.taglib.html.HtmlMessagesTag. lt;h:messages showSummary=true showDetail=truelt;/h:messages Are these messages being generated by your IDE? I haven't seen anything like these messages when running apps myself. If yes, then your IDE has got confused and we can't help you with advice on that. If these messages are coming from your servlet engine when you start the app, then maybe it has cached jsps compiled against the old code. For tomcat, when a lib containing jsps is updated you need to clear the tomcat work directory (defaults to $TOMCAT_HOME/work). Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)
Re: Trouble upgrading from MyFaces 1.1.5 to 1.1.6
Note that Tomahawk 1.1.7 now includes facelets support natively. So if you upgrade tomahawk, make sure you remove the tomahawk entry from the facelets.LIBRARIES setting, etc. Both facelets and Myfaces also generate quite a lot of logging output. If you are still having problems, you should enable the logging and check the output. Facelets uses java.util.logging while myfaces and tomahawk use commons-logging. I don't know what trinidad uses. Regards, Simon Luhtala Santeri schrieb: We are using Trinidad 1.0.8. I just updated to Facelets 1.1.14. Lets see what happens next with the MyFaces upgrade… S *From:* Gerhard Petracek [mailto:[EMAIL PROTECTED] *Sent:* 31. lokakuuta 2008 12:28 *To:* MyFaces Discussion *Subject:* Re: Trouble upgrading from MyFaces 1.1.5 to 1.1.6 hello, you can try to upgrade facelets to version 1.1.14 which trinidad version are you using? regards, gerhard 2008/10/31 Luhtala Santeri [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Hi I tried to upgrade from MyFaces 1.1.5 to 1.1.6. http://1.1.6. We have also Facelets 1.1.11 and Trinidad and Tomahawk. When I upgraded, everything seems fine first. The first page renders just fine, but nothing on the page is working…. Commandlinks, buttons are not working. There are no error messages in console that would help.. We have experienced some similar problems earlier when some combination of Tomahawk and Trinidad components have not been a 'perfect match'. But now I tried to strip out all the Tomahawk components from that first page and that just didn't have any effect… FacesTrace didn't help either. Would it help if we upgraded the Facelets version? Would we get any better console output in these situations? Any pointers would be great. S -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Urgent help Need :- Error while serving resource: calendar.HtmlCalendarRenderer/DB/drop1.gif, message : null
You have posted this request several times already; repeating it will achieve nothing except annoying people. It seems that no-one knows the answer to this, or has sufficient interest to investigate. Therefore, you need to either (a) download the tomahawk source and start debugging it, or (b) pay someone else to do that for you. If you are willing to pay for support, I would suggest contacting irian.co.at who do commercial work related to JSF, and are active in the myfaces project. Of course this is open-source, so there may be other people who are also experienced in this area and available for hire but I don't know of anyone else specifically. Regards, Simon Mali123 schrieb: Hi Any help on this issue,please help... Mali123 wrote: Hi Omar, First i want to thank you for helping me,but I'm using Tomahawk-1.1.3 calendar component not the Trinidad one, following is the code segment i used to displace the calender please advice me to how to fix this issue, %@ taglib uri=http://myfaces.apache.org/tomahawk; prefix=t%... t:div styleClass=stepComp t:inputDate value=#{akAppActivityTile.startTime} popupCalendar=true type=date ampm=true timeZone=#{akAppActivityTile.timeZoneId} styleClass=appAcctivitytest / /t:div Is there any patch for this, please help me,hope to get reply asap, Thank you, Mali general.equal.700 wrote: Hi Mali, I am facing the same problem. here is my attempt to apply the patch: open the trinidad-impl package. and locate a file called PopupDialog.js under /src/main/javascript/META-INF/adf/jsLibs add the following in line 7 iframe.src = javascript:false; after line 6 iframe.className = page.getStyleClass(af!dialog::content); in the package it will like that function TrPopupDialog() { var a0=TrPage.getInstance(); var a1=document.createElement(div); a1.style.cssText=visibility:hidden; position: absolute;; a1.className=a0.getStyleClass(af|dialog::container); a1.iframe.src = javascript:false; var a2=document.createElement(div); Thanks, --Omar On Oct 29, 2008, at 12:25 AM, Mali123 wrote: Hi thz for da reply,i can't go for the second option because we have to inform every user to change there browser setting,so i have left only one option using the patch,it will be more helpful to me if you can tell how to apply this patch,i'm using the my-faces-tomahawk-1.3,please help, thx mali Richard Yee-3 wrote: See the Trinidad-1091 issue in Jira. -Richard On Tue, Oct 28, 2008 at 10:53 AM, Richard Yee [EMAIL PROTECTED] wrote: There is a Jira issue filed for the secure/insecure problem you describe. I think there is also a patch available. Another workaround is to have the user change the browser settings to allow mixed content. -R Sent from my iPhone On Oct 28, 2008, at 3:40 AM, Mali123 [EMAIL PROTECTED] wrote: Hi thz for the quick reply, im using IE, when i click the calender button i'm getting this stack trace and security information alert Page Contains Secure / Non-Secure Items,i can ignore the stack trace as u mention way but how can get rid of that alert,is there any possble way to stop that alert when clicking the claender button, my client using the IE so he need to disable this alert, pls help Mali Simon Kitching wrote: Are you using Internet Explorer as the client? I found that IE has the very ugly habit when dealing with a page that references the same resource multiple times. When a page has: foo.gif foo.gif then ie sends two requests to the server concurrently (stupid, stupid). Worse, when one of the requests completes, then it just closes the other socket immediately. This is completely wrong behaviour; with http, only the server should close the socket. So the server is writing the response out the socket, and suddenly finds that the socket has been closed by the other end. It rightly complains because the other end should not be doing that. The real solution is to use a sane browser. Otherwise, just configure your logging to ignore ERROR messages from category org.apache.myfaces.renderkit.html.util.DefaultAddResource. It doesn't actually cause any serious problems on the server. Regards, Simon Mali123 schrieb: hi, i'm using the my-faces-tomahawk-1.3,I've got this stack trace repeatedly in my jsf aplication logs. I use the tomahawk calendar component. I couldn't find the solution anywhere. Could you please help me to solve it? Here is the stack trace: 008-10-28 14:06:52,730 ERROR [org.apache.myfaces.renderkit.html.util.DefaultAddResource] Error while serving resource: calendar.HtmlCalendarRenderer/DB/drop1.gif, message : null ClientAbortException: javax.net.ssl.SSLException: Connection has been shutdown
Re: retrieving property from managed bean
Ayub Khan schrieb: Hi, I am having a small issue, I am getting Error testing property 'commenttext' in bean of type null error message. I googled and did lot of troubleshooting, however unable to resolve it. I have a managed bean AppointmentBean which has a Map of comments Appointment{ private Map commentitemMap=new HashMap(); * public * Map getCommentItemMap() { *return* *this*.commentItemMap; } *public* *void* setCommentItemMap(Map commentItemMap) { *this*.commentItemMap = commentItemMap; } } in my jsp I have bound the text area to appointment.commentItemMap['Cancellation Reason'].commenttext CommentItem { *private* String commenttext=;* public * String getCommenttext() { *return* *this*.commenttext; } *public* *void* setCommenttext(String commenttext) { *this*.commenttext = commenttext; } } In my action method I am setting the commentItem value as below: CommentItem item= *new* CommentItem(); comentMap.put( Cancellation Reason,item); appointment.setCommentItemMap(comentMap); when the form is submitted, I read Error testing property 'commenttext' in bean of type null error message. In the facesConfig.xml I have declared both appointments bean and CommentItem as managed beans in session scope. If I use appointment.commentItemMap['Cancellation Reason'] without the .commenttext , the full classpath of CommentItem is being displayed in the text area (I assume its the object.toString value here ). Please let me know where I am doing wrong. When the form is submitted, the posted form-content will include a value for the commenttext html field (this value will be an empty string if you typed nothing in that field in the html page). During the update model phase, JSF will therefore try to store that value using the EL expression #{appointment.commentItemMap['Cancellation Reason'].commenttext} so it (a) fetches the appointment bean (ok) (b) calls getCommentItemMap -- returns an *empty* map (c) calls map.get('Cancellation Reason') -- returns null (d) tries to call getCommenttext on the null pointer -- error Only *after* the model-update phase will it try to run the action method associated with whatever button was pressed. So it is too late at that point to try to add an object to your commentItemMap with key 'Cancellation Reason'; processing has already tried to access the nonexistent object earlier. Regards, Simon -- -- Emails in mixed posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)