Re: Problem when report generation and JSF navigation
Works like a charm!Thanks Murat (and Martin)ThomasOn 4/4/06, Murat Hazer [EMAIL PROTECTED] wrote:Hi,You should add this line just above facesContext.responseComplete() line;facesContext.getApplication().getStateManager().saveSerializedView( facesContext);PS: Martin's solution... On 4/4/06, Sébastien Marin [EMAIL PROTECTED] wrote: Hello, i have the same problem. The first action is Ok but the second just do arefresh or made error. It is the same process when we click on the back icon ofthe web browser.I would like to understand. Thanks Selon Thomas Gaudin [EMAIL PROTECTED]:- Hi,-- I am using JasperReport to generate PDF files on the fly. - It is working fine the first time I click on the link to the report but it - fails alternatively every 2 clicks exactly...- I guess I am somehow messing up the navigation mecanism but I don't know- where to start my investigation.- Any hint is warmly welcome. - Thanks, -- Thomas-- Here is the code :- - JSF Bean :- public class Reports extends BasePage implements Serializable {- public String users() { - List results = userManager.getUsers(null);- Map parameters = new HashMap();- parameters.put(format, pdf);- parameters.put(WEBDIR, getServletContext().getRealPath(/)); - try{- InputStream is =- getServletContext().getResourceAsStream(/WEB-INF/reports/userList.jrxml);- JRBeanCollectionDataSource ds = new- JRBeanCollectionDataSource(results); -- getResponse().setContentType(application/pdf);- getResponse().addHeader(Content-Disposition, attachment;- filename=userList.pdf); -- JasperDesign jasperDesign = JRXmlLoader.load(is);- JasperReport jasperReport = JasperCompileManager.compileReport- (jasperDesign);- JasperPrint jasperPrint = - JasperFillManager.fillReport(jasperReport,- parameters, ds);- JasperExportManager.exportReportToPdfStream(jasperPrint,- getResponse().getOutputStream());-- getFacesContext().responseComplete(); - }- catch(Exception e){- log.error(e);- }- return null;- }- - The link to generate report : - h:commandLink value=report action="">- - faces-config.xml :-managed-bean- managed-bean-namereports/managed-bean-name - managed-bean-classorg.appfuse.webapp.action.Reports- /managed-bean-class- managed-bean-scoperequest/managed-bean-scope- managed-property - property-nameuserManager/property-name- value#{userManager}/value- /managed-property- /managed-bean -- Murat HAZERElektrik-Elektronik Mühendisi - Electrical-Electronics EngineerTel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63Blog URL: http://www.projedunyasi.orgYahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/
Problem when report generation and JSF navigation
Hi,I am using JasperReport to generate PDF files on the fly. It is working fine the first time I click on the link to the report but it fails alternatively every 2 clicks exactly...I guess I am somehow messing up the navigation mecanism but I don't know where to start my investigation. Any hint is warmly welcome.Thanks,ThomasHere is the code :JSF Bean : public class Reports extends BasePage implements Serializable { public String users() { List results = userManager.getUsers(null); Map parameters = new HashMap(); parameters.put(format, pdf); parameters.put(WEBDIR, getServletContext().getRealPath(/)); try{ InputStream is = getServletContext().getResourceAsStream(/WEB-INF/reports/userList.jrxml); JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(results); getResponse().setContentType(application/pdf); getResponse().addHeader(Content-Disposition, attachment; filename=userList.pdf); JasperDesign jasperDesign = JRXmlLoader.load(is); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); JasperPrint jasperPrint = JasperFillManager.fillReport (jasperReport, parameters, ds); JasperExportManager.exportReportToPdfStream(jasperPrint, getResponse().getOutputStream()); getFacesContext().responseComplete(); } catch(Exception e){ log.error(e); } return null; }The link to generate report :h:commandLink value=report action="" reports.users}/ faces-config.xml : managed-bean managed-bean-namereports/managed-bean-name managed-bean-classorg.appfuse.webapp.action.Reports/managed-bean-class managed-bean-scoperequest/managed-bean-scope managed-property property-nameuserManager/property-name value#{userManager}/value /managed-property /managed-bean
Re: Using Tobago with facelet?
Hi, Arvid, I am trying to reach the same point than you but I am having problems. I built and deployed the example demo and it works great but when I try to insert a sample in my facelet web application (even the simplest hello world example) I keep getting : [benevole.info] ERROR [http-80-Processor24] ResourceManagerImpl.getPaths(323) | Path not found, and no fallback. Using empty string. mainDirs = '[org/apache/myfaces/tobago/renderkit]' contentType = 'html' theme = 'speyside' browser = 'mozilla_5_0' subDir = 'tag' name = 'org.apache.myfaces.StylesheetRenderer' suffix = '' key = 'null' [benevole.info] ERROR [http-80-Processor24] ResourceManagerImpl.getRenderer(429) | name = 'org.apache.myfaces.StylesheetRenderer' clientProperties = 'html/speyside/mozilla_5_0' java.lang.NullPointerException at org.apache.myfaces.tobago.context.ResourceManagerImpl.getRenderer(ResourceManagerImpl.java:424) at org.apache.myfaces.tobago.renderkit.TobagoRenderKit.getRenderer(TobagoRenderKit.java:63) at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:744) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:509) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109) . 9 fvr. 2006 16:55:04 com.sun.facelets.FaceletViewHandler handleRenderException GRAVE: Error Rendering View java.lang.RuntimeException: org.apache.myfaces.StylesheetRenderer at org.apache.myfaces.tobago.context.ResourceManagerImpl.getRenderer(ResourceManagerImpl.java:433) at org.apache.myfaces.tobago.renderkit.TobagoRenderKit.getRenderer(TobagoRenderKit.java:63) at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:744) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:509) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109) ... Caused by: java.lang.NullPointerException at org.apache.myfaces.tobago.context.ResourceManagerImpl.getRenderer(ResourceManagerImpl.java:424) ... 71 more 9 fvr. 2006 16:55:04 com.sun.facelets.FaceletViewHandler handleRenderException Has anybody some clue about the reason of this problem? Thanks, Thomas Arvid Hlsebus a crit: Yes, thanks a lot! I just came home from work and updated the example. Now the gridLayout works: But I still get this warning: 08.02.2006 23:33:16 com.sun.facelets.tag.jsf.ComponentRule warnAttr WARNUNG: /helloWorld.xml @10,43 columns="fixed;*" Property 'columns' is not on type: org.apache.myfaces.tobago.component.UIGridLayout Unfortunately I'm pretty tired and have to go to bed... I will look into the other problems tomorrow night -- like the missing SPAN tag around the label content: span class="tobago-out-default"Hello World/span Regards, Arvid
Using Tobago with facelet?
Hi, I am wondering wether it is possible to use some tobago components with facelet like : http://tobago.atanion.net/tobago-example-demo/faces/overview/layout.jsp or http://tobago.atanion.net/tobago-example-demo/faces/overview/sheetControl.jsp Did anybody integrate them already? Any hints are warmly welcome. Is there a tobago mailing list by the way? Thanks. Thomas
behaviour change upgrading to nightly build
Hi, I have just upgraded a maven build from about 10 days ago to the nightly build available on myfaces website. I am using a custom authentication method in a request scope bean. The code for the logout() method is performing the following : getRequest().getSession().invalidate(); Cookie terminate = new Cookie( TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, null); terminate.setMaxAge(0); getResponse().addCookie(terminate); return "welcome"; The "welcome" refers to a navigation rule in my faces-config.xml : navigation-rule from-view-id/*/from-view-id navigation-case from-outcomewelcome/from-outcome to-view-id/home.xhtml/to-view-id redirect / /navigation-case /navigation-rule Before upgrading it was working fine but now I get this exception (I translated in english the message): java.lang.IllegalStateException: Not possible to create a session after the response has been sent at org.apache.catalina.connector.Request.doGetSession(Request.java:2206) at org.apache.catalina.connector.Request.getSession(Request.java:2024) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:842) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:223) at org.apache.myfaces.component.html.util.ExtensionsFilter.getFacesContext(ExtensionsFilter.java:185) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:142) ... If I add a "getRequest().getSession(true);" before returning this solves the problem but I am worried about this change. Would anybody have some hint about what is the matter please? Thanks, Thomas
Re: JSCookMenu and Facelets issue
I had the same problem and I think it was related to the extension filter mapping. If you really can't fix it you could have a look at this sample app : http://www.thogau.net/appfuse-facelets it uses a JSCookmenu with facelets so you can check the difference between the 2 configurations. hope it helps, Thomas Matt Fury a écrit : Hi All, I've searched through the archives of the mailing list and could only find a few questions and few answers about jscookmenu with facelets. I've appeared to have gotten it at least rendering now but for some reason it renders a Submit Query button? I've seen a couple of posts about that but did not seem to get a solid resolution. Anyone know why it might do that? I've set up the pages with the Tomahawk Taglibary files. Thanks. -Matt --- Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
Re: PermGen Space problem???
I have the same with tomcat only and it is a known issue. It does happen when you reload applications several times (the less memory on the box, the more often it occurs). Usually you don't reload webapps that often on production, if you do, best is to restart tomcat. Thomas Julien Martin a écrit : Hello Mads, I am running Tomcat and not Jboss. (+ windows) How can I make sure this does not happen in the production environment? Thanks in advance, Julien. --- Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
Re: apache myfaces mailing list
If you don't find, I'll give you a ring to get your phone number and will explain by phone ;) Seriously, the best way is actually to send an email to the list to start a new thread and to reply to emails to continue a thread. Reiche,Werner [CIS] a écrit : Hi, I have subscribed to the mailing list, but I cannot post new threads. What do I have to do to post? Werner Reiche --- Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
Re: Full path to webapp?
Maybe you can try src=#{facesContext.externalContext.requestContextPath}/images/mytarget.png Hope it helps, Thomas Hendrik Neumann a écrit : Hi List, I'm currently developing a JSF-components which renders SVG-images: svg:rasterizer src=mySrc.svg target=mytarget.png type=PNG styleClass=myCssClass style=background-color:gray; width=50 height=100 alt=alt text allowZoom=true allowVerticalResize=true allowHorizontalResize=true / But of course I want to use relative paths for src and target. So I need to add the full path to the webapplication to src and target. But how can I obtain this information? -- Mit freundlichen Grüßen / Greetings, Hendrik Neumann; Ruhr-University of Bochum --- Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
Myfaces and javascript
Hi, I must be missing something obvious but I am stuck with this... Is there a myFaces tag equivalent to afh:script in ADF faces? I don't understand how to include a javascript file without hardcoding the context path : I have a js script file in /scripts/myscript.js, how to include it so as it works if the application is deployed in the root context (/) or in another context (/mycontext/) ? Also, anybody knows how to localize a message displayed in a alert() javascript popup? Thanks, Thomas
Re: Myfaces and javascript
Thanks Hansjörg, performing the alert stuff as you advise should do the trick. Unfortunatly I am using facelets instead of JSP so the %=request.getContextPath()% method is not possible for me. For style sheets I am using the tomahawk t:stylesheet tag but there do not seem to have t:script tag... Aby ideas? Thanks, Thomas Hansjörg Meuschel a écrit : Hi, I have something like f:verbatim script language='text/javascript' src='%=request.getContextPath()%/path/to/your/script.js'/ /f:verbatim or link rel=stylesheet type=text/css href=%=request.getContextPath()%/myfaces.css / For localized javascript popup messages I have for example t:commandButton value=Message onclick=alert('#{bundle.theMessage}');/ Hope this helps you, I've no idea about other solutions... Regards Hans Thomas Gaudin wrote: Hi, I must be missing something obvious but I am stuck with this... Is there a myFaces tag equivalent to afh:script in ADF faces? I don't understand how to include a javascript file without hardcoding the context path : I have a js script file in /scripts/myscript.js, how to include it so as it works if the application is deployed in the root context (/) or in another context (/mycontext/) ? Also, anybody knows how to localize a message displayed in a alert() javascript popup? Thanks, Thomas --- Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
Re: JSF Components For Acegi Security Framework
Hi, I would like to use your component with facelets. I tried first to use it with JSP but I could not have it working. Would you have a working sample application to show how to integrate it? I also have question : what is the reason why the JSP tag library can not be used with JSF? I am new to JSF and I would appreciate some more info. Thanks, Thomas PS : I post this both in Myfaces list and in your blog so that you can answer where you think it is more suitable. Cagatay Civici a écrit : Hi, I've implemented custom jsf components that can be used to integrate Acegi into JSF. Acegi has built-in JSP tags for securing components but no support for JSF, my aim is to do the same thing for the JSF environment. Related information can be found at my blog; http://www.jroller.com/page/cagataycivici?entry=acegi_jsf_components_hit_the I've released the component in sourceforge jsf-comp. The component is under Apache License. http://sourceforge.net/projects/jsf-comp/ If you are planning to use JSF-Spring-Acegi together in your applications, this component could be a possible solution. Regards, Cagatay Civici No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.20/234 - Release Date: 18/01/2006
Re: Problem building Maven XSLT plugin
Hi, I had similar problem and to have the plugin installed I had to modify the pom.xml : project modelVersion4.0.0/modelVersion parent artifactIdmojo-sandbox/artifactId groupIdorg.codehaus.mojo/groupId version1/version /parent and run mvn install from the root directory but not from src Hope it helps, Thomas Peter Henderson a écrit : Hi list. Im trying to build MyFaces using Maven, by following the instructions at http://wiki.apache.org/myfaces/Building_With_Maven. The trouble is I cant even get the XSLT plugin to build. (Step 0) I check out the src. svn co https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/xslt-maven-plugin Axslt-maven-plugin/src Axslt-maven-plugin/src/main Axslt-maven-plugin/src/main/java Axslt-maven-plugin/src/main/java/org Axslt-maven-plugin/src/main/java/org/codehaus Axslt-maven-plugin/src/main/java/org/codehaus/mojo Axslt-maven-plugin/src/main/java/org/codehaus/mojo/xslt Axslt-maven-plugin/src/main/java/org/codehaus/mojo/xslt/XsltMojo.java Axslt-maven-plugin/pom.xml Checked out revision 1356. OK no problem so far. Then I run mvn install -e + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [install] [INFO] [INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.1/maven-resources-plugin-2.1.pom 888b downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin-parent/2.0/maven-plugin-parent-2.0.pom 6K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.1/maven-resources-plugin-2.1.jar 10K downloaded [INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.0/maven-compiler-plugin-2.0.pom 1K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.0/maven-compiler-plugin-2.0.jar 13K downloaded [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.1.2/maven-surefire-plugin-2.1.2.pom 2K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.1.2/maven-surefire-plugin-2.1.2.jar 9K downloaded [INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.0/maven-jar-plugin-2.0.pom 737b downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.0/maven-jar-plugin-2.0.jar 7K downloaded [INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.1/maven-install-plugin-2.1.pom 981b downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.1/maven-install-plugin-2.1.jar 8K downloaded [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one. [INFO] [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at