Is JSF 1.2 buffering the response, or streaming it back to the browser?

Hi,
I recently implemented a simple custom component which "streams" back a file to the browser (doing some processing on it).
Using myfaces i get out of memory errors when processing large files, I later learned that the myfaces implementation actually buffers the response data before sending it back to the browser, which causes problems for me.
I would be grateful for some insight in how this works in JSF 1.2 RI.
Regards,
Mikael

Basically content interweaving is handling of JSF and non-JSF output in a way so that it appears in the rendered response the way it appears in the page.
Does in mean that the response is processed further to check if there are any expressions which needs evaluating?No we don't handle the expressions, just the insertion of content before and after the view, and the writing of state information.

Similar Messages

  • Tomcat and refreshing jsf component attributes in the browser

    I'm using Eclipse and Tomcat 5.0.25. I start Tomcat in debug mode with a shortcut: "C:\Tomcat-5.0\bin\catalina.bat jpda start". I have an entry in the Tomcat server.xml file that points to my web application:
    <Context debug="0" docBase="C:\MyProjects\eclipse\cdstore\WebContent" path="/cdstore" reloadable="true"/>
    I have a jsp page with a jsf dataTable tag. If I change the html markup (i.e. by typing "hello" in the jsp page) and press the refresh button in my IE 6.0 browser, the "hello" message is displayed.
    If, however, I change the content of a dataTable attribute (i.e. I change styleClass="aClass" to styleClass="anotherClass") or add a new dataTable attribute, the attribute changes are not sent to the browser when I press the browser refresh button. I do a "view html source" and they are not there.
    I have to close the browser down and relaunch the browser to see the new dataTable attributes.
    Does anybody know if there is any easier way of doing this?
    thanks, jeff

    Hi pushpa latha
    Yes it is possible to update the data at the header level using below approach
    create the component interface for your cusotm component
    use the component interface  in the header overview standard component as resuable component.
    Implement the event handler method for the button , in the event handler method get the refreshed value
    create the navigation and call the navigation (fire_outbond_plug) to cutom component by passing the plug name and refreshed data..
    set the refreshed data to your value node in your custom component.
    Thanks & Regards
    Raj

  • I am getting this response when I am trying to open a file: Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."  What do I do?

    I am getting this response when I am trying to open a file: Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser.”  What do I do?  I have opened this up in the past without a problem. 

    Back up all data.
    If Adobe Reader or Acrobat is installed, there should be a setting in its preferences such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected. Otherwise do as follows.
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present. The same goes for a plugin called "iGetter," and perhaps others.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • How to Open PDF in the browser...JSF

    String strUrl = http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf
    FacesContext faces = FacesContext.getCurrentInstance();
    ExternalContext context = faces.getExternalContext();
    HttpServletResponse response = (HttpServletResponse)context.getResponse();
    response.sendRedirect(strURl);          Hello,
    I have to open PDF in the browser, I am trying to redirect using the above code, but it is throwing exception as below. Could some one help me in this issue?
    Thanks In advance
    Error Message:
    java.lang.IllegalStateException: Cannot forward after response has been committed
    Error details:
    java.lang.IllegalStateException: Cannot forward after response has been committed
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         at com.esri.adf.web.faces.application.ADFViewHandler.renderView(Unknown Source)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at com.esri.adf.web.util.ADFSessionTimeoutFilter.doFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)

    You cannot send two responses per request. The solution is to let the client create two requests. Common approach is to add an onclick to the commandbutton/commandlink which opens the PDF in a new browser window and let the actual command action invoke a redirect on the current browser window.
    E.g.<h:commandLink value="Download PDF" action="#{myBean.action}" onclick="window.open('http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf');" />where the #{myBean.action} invokes a redirect and the http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf opens the PDF in the new window.
    Edit
    I've read your question/problem once more and now I am a bit confused. All you want to do is to open the PDF file in a new window and you don't need to do something in the backing bean? Just use a link with target="_blank".
    <h:outputLink value="http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf" target="_blank">Download PDF</h:outputLink>No need for a redirect here.
    Edited by: BalusC on Nov 21, 2007 7:21 AM

  • How do I set iPlanet Web Server 4.1 HTTP Response Header to use expires so that the browser will cache content longer

    I want to add in all html files returned the "expires" value.
    Based in HTTP 1.1, I think it is possible by adding the META tag between the <HEAD> and </HEAD>:
    <META> HTTP_EQUIV:"expires" CONTENT="Sun, 21 Jun 2002 15:05:00 GMT" </META>
    I include this in my html file (but "expires" doesn�t work :(( ). Which options are necessary to modify in the WS?
    How does the internet options of the browser influence?
    PD:(This is a question posted last 5/28, but is has no response yet.)

    The above reply does not take into account that I am trying to use GROUP POLICY EDITOR to make it the default browser.

  • When i watch videos on my iphone 5 my wifi buffers the video and then halfway through it just stops and all wifi stops working on my device. i need to switch back off and on the wifi then it works but the same thing happens every time for videos.

    when i watch videos on my iphone 5 my wifi buffers the video and then halfway through it just stops and all wifi stops working on my device. i need to switch back off and on the wifi then it works but the same thing happens every time for videos. NOT A ROUTER PROBLEM. all my other apple devices dont have this problem

    iOS: Importing personal photos and videos from iOS devices to your computer
    iOS: Unable to import photos or device not recognized as a camera

  • In jsf how to request  the id: a href="1.jsf?id=1" SEGA /a

    in jsf how to request the id: SEGA
    in struts we can create a fromClass but in jsf i do't know howto
    sorry ,i'am beginner

    You can get PortletRequest from (PortletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(). It has all the helper methods of HttpServletRequest. I am not sure about HttpServletRequest...since it is being protected in PortletRequestImpl.

  • Ann: JSF 1.2. The future is already here. It is just not evenly distributed

    Actually, the subject is a name for the headline section on the http://jsfTutorials.net. It contains the links to the useful resources about future JSF version. Also, the project skeleton that includes the latest facelets and working under Tomcat 5.5 is available. There is no official release yet, but the version looks pretty stable. It is a good time for people who want to test-drive the future features.
    If you know the helpful links to resources about the future JSF, let me know and I will include them to the list.
    Sergey : http://jsfTutorials.net

    I would suspect as it contains a jsf-12.jar - below are the jar files shipped with Resin 3.1.8:
    The MANIFEST.MF for jsf-1.2.jar is:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)
    Extension-Name: javax.faces
    Specification-Vendor: Sun Microsystems, Inc
    Specification-Version: 1.2
    Implementation-Vendor-Id: com.caucho
    Implementation-Vendor: Caucho Technology, Inc
    Implementation-Version: 3.1.0
    activation.jar
    ejb-15.jar
    hessian.jar
    j2ee-management-10.jar
    javamail-141.jar
    jaxrpc-15.jar
    jaxws-api.jar
    jca-15.jar
    jms-11.jar
    jpa-15.jar
    jsdk-15.jar
    jsf-12.jar
    jsr88.jar
    jstl-11.jar
    jta-101.jar
    jws-15.jar
    license.jar
    portlet-10.jar
    pro.jar
    quercus.jar
    resin-deploy.jar
    resin-util.jar
    resin.jar
    saaj.jar
    script-10.jar
    webbeans-16.jar
    webutil.jar

  • Responsive Mobile Menus: Open and close on browser, but not in mobile?

    I have two responsive jquery menus I am working with. In the desktop browser they both look and operate fine (full screen and mobile size), but when that same responsive page with menu is viewed on an actual phone (Android and iphone), the menus both: SHOW FULLY OPENED WITH ALL PARENT AND CHILDREN?
    I believe I installed everyting properly (especially since it resizes and works perfect in a normal desk browser) -Dropsdown and Contracts back.
    Does anyone have any experience with this issue (Responsive menus works fine in a desktop browser, but shows completely opened, and will not drop or contract when viewed on an actual mobile phone, like Android or iphone?), and if so any guidance?
    Thanks very much

    Wow, you save me alot of time and headaches. You really know alot and are very helpful and taught me alot. Thank you for helping me, this is my first site I am still trying to build/get up, after years of on-off trying / learning/ abandoning (for other pursuits). This site is really important for me, and would mean alot for me to finally follow through on building.
    Do you know if this forums allows (or do you ever) add friends/contacts so you can message each other? I am somewhat a 'newbie', so I understand if problem, I would not bug/bother you, just curious and fully understand if not. (or do you ever contact via email, website, or other)?
    Also re: Vanilla Testing: I always test all my stuff on a blank HTML page with only the Boilerplate and JS that Dreamweaver provides. I don't know if I have the capability to fully do in something like notepad? Will this method (Boiler, JS, and blank HTML) suffice--No other Scripts--Not even my stylesheet?
    What do you think about this menu. Features seem good, has the most sales, good developer and support?
    http://themes.pixelworkshop.fr/?theme=MegaMenuCompleteSet

  • How to display a RTF file in the browser?

    Hi there,
    sorry 'bout my bad English.
    My jsp page have to get a rtf file and show it. Just setting the ContentPage to text/rtf, is it a solution?
    If not just that, what code I have to write? Let me know!
    Thanks

    I'm not sure if this can be done through JSP. You may need to write a servlet and set the mime type of the response to application/rtf. Then output the rtf text to the browser. Please let me know if you get this to work - I'm having a similar problem. Thanks.

  • Closing the Second instance of the browser.

    Hello,
    I am working on a project written in Java. When applet is running in Browser, we can open the new instance of the browser using File->window->new (or pressing CTR-N). Since the second window runns in the context of first window, It is causing some problem.
    Is there any way for me to close the second instance of the browser from my Java applet?? If not is there any way for me to disable both the File->new->Window and CTR-N options.
    I am new to java and java script. If it is not possible in Java Applet, is it possible in java Script. Please Provide me with full information.
    Thanks and Regards,
    Ratna.

    Hi,
    There is no way you can close the browser window that the user opens. Even if there is a way through some hack, it will not completely give u a solution, independant of browsers and all. And moreover it is not advisable to restrict the user like that.
    A more elegant way would be to handle it in the server side. I can give u one ligical way. U can make the page expire as soon as it gets loaded. U can do that by using the code below. And you have to have a server side function to check for a request from the same client machine for the same page.
    <%
        if (request.getProtocol().compareTo("HTTP/1.0") == 0)
            response.setHeader("Pragma", "no-cache");
        else if (request.getProtocol().compareTo("HTTP/1.1") == 0)
            response.setHeader("Cache-Control", "no-cache");
        response.setHeader("Expires", "-1");
    %>So when the user opens a new browser window, he will be shown page expired message, or the page will be requested again from the server. U can have a map storing the remote address and the session of the user.

  • When I don't have the BROWSER menu option turned on, the WINDOW menu options are un-accessable by mouse

    First of all, I would like to clarify which "menu" is un-accessable.
    I'm referring to the menu that regardless of which program, a user can access by either clicking ALT + SPACE or by clicking the top left corner of the window. I'm NOT referring to the FIREFOX menu options, those I am fine with.
    Normally, I can just move my mouse to the top left corner and double click to close a program. I used to be able to do that too with firefox 3.6. However, due to the new design, when I click the top left corner, I get the orange Firefox drop down menu. This is because firefox, due to the new update, no longer has an independent window bar that is the norm across most programs. The only way I can get this independent menu bar is to enable the browser menu bar. This however, adds two entire layers of bars, which defeats one of the purposes of the update, to give more viewing space
    The Chrome browser also has the tab row on top, however, it doesn't have the issue I brought up. When I click the top left corner of the window, the regular WINDOW menu options pop up.
    The reason why this is important to me is due to the fact that I use two monitors. Normally, I can just move my cursor to the top right and close the window without looking for my right hand side monitor, and then double click the top left hand side of my left hand side monitor to close the window. This is because with a 2 monitor set up, the "X" close button is located inconvinently in the middle of my two screens, forcing me to aim for the tiny small red rectangle, which is why I prefere to double click the top left corner; I don't have to aim.
    I have long been a loyal user of firefox. Browsers like Chrome and others have been out ranking firefox for a long time, mozilla is only playing catch up here...
    While I am glad for the update - better speed due to JaegerMonkey, the added hardware acceleration, the tab groups, and more, if the window menu problem is not resolved soon, this update is going to force me to switch browsers.
    I look forward to a fix, or response on how to resolve this issue.
    Many thanks,
    Still a firefox user... for now

    it's possible but there is likely no need to do this. what exactly is wrong with your computer? a simple reinstall of snow leopard on top of your current system will cure many ills and will preserve your data and applications. and many problems can be solved without reinstalling at all.
    but if you insist on doing a wipe and install boot from the SL install DVD and start disk utility from utilities menu at the top. erase your hard drive using the erase tab in disk utility. then quit disk utility and proceed with the install. and if you do reinstall I suggest you back up your data first. otherwise it will be completely wiped when you erase your hard drive. and you should always back up anyway.
    Message was edited by: V.K.

  • How can I get my SVG to show up in the browser? Using Adobe Muse.

    I created an SVG in Adobe Illustrator CC with all the recommended settings (yes, I unchecked "Responsive"), and then placed it in my website in Muse CC, and it does not appear on my website.  It just shows a broken photo link icon where the image is supposed to be.  I thought that at the very least, it would show the PNG image since it is supposed to automatically create the PNG. 
    It appears perfectly in Muse's Preview mode.
    Any advice?  Attached are images of the SVG settings I use, and how it is appearing in the browser.
    Here's a link to the live site in case you want to take a look: design.mattgrajcar.com (I may have reverted back to just putting a PNG in for the time being).
    Thanks!

    This may be caused by your hosting provider not having the proper MIME file to display .svg files.
    See link.
    http://css-tricks.com/snippets/htaccess/serve-svg-correct-content-type/

  • Error in sending a binary outputstream to the browser

    I am looking for information on sending a binary outputstream to a browser.I am not getting any error and am able to write out the entire buffer.Even though the browser recognizes the mime type,it only sends junk to the client.Please look at the code sample below that I am using to send the outputstream.
    response.setContentType(MimeType);
    String str_encoding = response.getCharacterEncoding();
    System.out.println("================= The Character Encoding is --------------" + str_encoding);
    int len = buf.length;
    System.out.println("Data length ===========" + len);
    response.setHeader("Content-Disposition", "inline;filename=" + "\"" + fileName + "\"");
    OutputStream o = response.getOutputStream();
    int buffer_length = 10 * 1034;
    int offset = 0;
    //read a thousand bytes from the buffer at a time
    while ((offset <= buf.length) && (loop==true))
    if ((buf.length - offset) < buffer_length)
    buffer_length = buf.length - offset;
    loop = false;
    System.out.println("---------Now Inside the Loop, Writing Output Buffer ------" + offset + " bytes");
    o.write(buf,offset,buffer_length);
    o.flush();
    offset = offset + buffer_length;
    If anyone could tell me what needs to be done to successfully send a binary input stream from a Java application to a JSP page calling it and then successfully sending the outputstream for the client to be read,that would be fantastic.

    yes,I did.That sends the data out as junk.The outputstream gets some sort of junk characters with the response.getOutputStream() method.So it errors out when I set the content length.
    I tried sending the data as a whole,but does not seem to make a difference.I was grasping at straws when I tried to break it into chunks.

  • I'm trying to invoke EXCEL or POWERPOINT file into the browser IE 6.0.  The

    I'm running TOMCAT locally on my PC (running Windows NT).
    I'm trying to invoke EXCEL or POWERPOINT file into the browser IE 6.0.
    The output is coming out all scrambled (almost like ASCII code or something),
    where it seems like the applications are not firing up.
    However, an MSWord file shows up fine. So I go to the WEB.XML file in the TOMCAT\CONF
    folder and notice that a MIME type has been set up for MSWord and not the other two.
    I set one up for EXCEL and POWERPOINT but the XLS or PPT files still don't work.
    So, just for kicks, I comment out the MSWord MIME definition but the MSWord file still worked!!!
    I can't figure out what's going on here.
    I'm stopping and starting the TOMCAT service each time I make changes to the WEB.XML file,
    but it seems like none of the changes are taking affect.
    I install all the viewers for MS-Word, ppt, and excell.
    But in Netscape it works fine.

    To support various file formats in IE browser while using window.open like .doc, .docx, .ppt, .pptx, .xls, xlsx etc.,
    The following code can also be used to force any format to get launch outside IE
    For these first configure a filter in web.xml and then include the filter class in given path
    <filter>
    <filter-name>MimeFilter</filter-name>
    <filter-class>com.srk.MimeFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.xls</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.xlsx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.ppt</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.doc</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.docx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.pptx</url-pattern>
    </filter-mapping>
    and then include the filter class in the declared path
    import java.io.*;
    import java.util.logging.*;
    import javax.servlet.*;
    import javax.servlet.Filter;
    import javax.servlet.http.*;
    public class MimeFilter implements Filter {
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    HttpServletResponse httpResp = (HttpServletResponse) response;
    HttpServletRequest httpReq = (HttpServletRequest) request;
    String fileUrl = httpReq.getRequestURI();
    if(fileUrl.lastIndexOf(".xls")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/vnd.ms-excel");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    if(fileUrl.lastIndexOf(".ppt")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/powerpoint");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    if(fileUrl.lastIndexOf(".doc")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/msword");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    chain.doFilter(request, response);
    public boolean isLoggable(LogRecord record) {
    return false;
    public void destroy() {
    public void init(FilterConfig arg0) throws ServletException {
    Please let me know your feedback.

Maybe you are looking for