Announcement Announcement Module
No announcement yet.
Strange side effects... Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange side effects...

    Hi all,

    I'm working with a AbstractWizardFormController.
    Calling the processFinish and according to user answer I display a pdfView or an ExcelView...

    No problem with the former but the latter play me a trick...

    First, without adding any header, a popup ask me whether I want to display export.htm in my browser or record it on my filesystem, as export.htm is the url mapped on my controller.

    So I add
    response.setHeader("Content-Disposition", "inline; filename=export.xls");
    and here come the side effect, nothing is displayed nor a popup and I'm back to the first page of my wizard.

    Thank you in advance for any help...


  • #2

    In fact, it seem's it does'nt work much with the pdf view too.

    Under Mozilla FF, all work good, but under IE, it try to open the file as export.htm without using accrobat pdf plugging. (So i've got a lot of symbol in a web page)

    And if I add
    response.setHeader("Content-Disposition", "attachment;filename=letter.pdf");
    An exception append :

    ClientAbortException: Broken pipe
    at org.apache.coyote.tomcat5.OutputBuffer.realWriteBy tes(
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh
    at org.apache.coyote.tomcat5.OutputBuffer.writeBytes(
    at org.apache.coyote.tomcat5.OutputBuffer.write(Outpu
    at org.apache.coyote.tomcat5.CoyoteOutputStream.write (
    at org.springframework.web.servlet.view.document.Abst ractPdfView.renderMergedOutputModel(AbstractPdfVie
    at org.springframework.web.servlet.view.AbstractView. render(
    at org.springframework.web.servlet.DispatcherServlet. render(
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(
    at org.springframework.web.servlet.DispatcherServlet. doService(
    at org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(
    at org.springframework.web.servlet.FrameworkServlet.d oPost(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    at sun.reflect.GeneratedMethodAccessor1406.invoke(Unk nown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at Method)
    at .java:499)
    at ilege(
    at ternalDoFilter(
    at cess$000(
    at org.apache.catalina.core.ApplicationFilterChain$1. run(
    at Method)
    at Filter(
    at org.apache.catalina.core.StandardWrapperValve.invo ke(
    at org.apache.catalina.core.StandardValveContext.invo keNext(
    at org.apache.catalina.core.StandardPipeline.invoke(S
    at org.apache.catalina.core.StandardContextValve.invo keInternal(
    at org.apache.catalina.core.StandardContextValve.invo ke(
    at org.apache.catalina.core.StandardValveContext.invo keNext(
    at org.apache.catalina.core.StandardPipeline.invoke(S
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.core.StandardValveContext.invo keNext(
    at org.apache.catalina.valves.ErrorReportValve.invoke (
    at org.apache.catalina.core.StandardValveContext.invo keNext(
    at org.apache.catalina.core.StandardPipeline.invoke(S
    at org.apache.catalina.core.StandardEngineValve.invok e(
    at org.apache.catalina.core.StandardValveContext.invo keNext(
    at org.apache.catalina.core.StandardPipeline.invoke(S
    at org.apache.catalina.core.ContainerBase.invoke(Cont
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo
    at org.apache.jk.common.HandlerRequest.invoke(Handler
    at org.apache.jk.common.ChannelSocket.invoke(ChannelS
    at org.apache.jk.common.ChannelSocket.processConnecti on(
    at org.apache.jk.common.SocketConnection.runIt(Channe
    at org.apache.tomcat.util.threads.ThreadPool$ControlR
    Am I doing something wrong ?




    • #3
      This is a well known problem with IE.

      It ignores the mime type and only uses the file extension to determine what client side application to open.

      You'll need to open the export file as export.pdf and not export.htm.

      This goes for any file you want to open in IE, not just PDFs.

      IE will also request the PDF twice (WTF?) for some reason best known to Microsoft so be aware of that if your PDF is expensive to produce.


      • #4

        This is well fix...

        Just an open question :

        The Content-Disposition should set the filename for browser purpose... Why doesn't it work by this way ?
        Server problem ? (Jonas 4.1.2)
        Browser problem ?

        and what about this exception ?

        ClientAbortException: Broken pipe