Content-length in JSP

Hi,
I need to set the HTTP header 'Content-Length'
from a JSP page, but cannot figure out how.
// Lars Krog-Jensen

response.setContentLength(theLength)

Similar Messages

  • Exception about content-length of JSP

    My jsp runs with such exception:
              and I can't find out where is wrong in the jsp.The attachment is the
              jsp-generated java source file.
              Environment:
              JDK1.3
              Weblogic 5.1 with SP6
              Windows2000 Server
              Thanks for your help!
              13:47:17 GMT+08:00 2000:<E> <ServletContext-General> Servlet failed with
              Exception
              java.net.ProtocolException: Exceeded stated content-length of: 408 bytes
              at
              weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutput
              StreamImpl.java:163)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(WLOutputSt
              reamWriter.java:139)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWr
              iter.java:104)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWr
              iter.java:111)
              at java.io.Writer.write(Writer.java:129)
              at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:138)
              at
              jsp_servlet._icmcout0._browserpagemainicmcout0._jspService(_browserpa
              gemainicmcout0.java:174)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:123)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:761)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:708)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:252)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:346)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
              [_browserpagemainicmcout0.java]
              

    My jsp runs with such exception:
              and I can't find out where is wrong in the jsp.The attachment is the
              jsp-generated java source file.
              Environment:
              JDK1.3
              Weblogic 5.1 with SP6
              Windows2000 Server
              Thanks for your help!
              13:47:17 GMT+08:00 2000:<E> <ServletContext-General> Servlet failed with
              Exception
              java.net.ProtocolException: Exceeded stated content-length of: 408 bytes
              at
              weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutput
              StreamImpl.java:163)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(WLOutputSt
              reamWriter.java:139)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWr
              iter.java:104)
              at
              weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWr
              iter.java:111)
              at java.io.Writer.write(Writer.java:129)
              at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:138)
              at
              jsp_servlet._icmcout0._browserpagemainicmcout0._jspService(_browserpa
              gemainicmcout0.java:174)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:123)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:761)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:708)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:252)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:346)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
              [_browserpagemainicmcout0.java]
              

  • Content-length error in jsp

              hi all,
              i am running a jsp on weblogic that just displays an index page.
              there is no problem in displaying the page but,on the console i get this error.
              how to solve this error.
              Thanks in advance.
              Parag B.Bhagwat
              java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '4096' bytes instead of stated: '12063' bytes.
                   at weblogic.servlet.internal.ServletOutputStreamImpl.finish(ServletOutputStreamImpl.java:372)
                   at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:249)
                   at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
                   at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              Wed Jan 19 22:55:10 GMT+05:30 2000:<E> <ServletContext-General> Servlet failed with Exception
              java.net.SocketException: socket write error (code=10053)
                   at java.net.SocketOutputStream.socketWrite(Native Method)
                   at java.net.SocketOutputStream.write(SocketOutputStream.java, Compiled Code)
                   at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java, Compiled Code)
                   at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java, Compiled Code)
                   at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java, Compiled Code)
                   at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
                   at weblogic.servlet.FileServlet.service(FileServlet.java:56)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
                   at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
                   at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
                   at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              

    Hello,
              I am facing the same problem of content length... Did you find a solution for it?
              Thanks
              Parag Bhagwat wrote:
              > hi all,
              >
              > i am running a jsp on weblogic that just displays an index page.
              > there is no problem in displaying the page but,on the console i get this error.
              > how to solve this error.
              > Thanks in advance.
              > Parag B.Bhagwat
              > ---------------------------------------------------------------
              > java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '4096' bytes instead of stated: '12063' bytes.
              > at weblogic.servlet.internal.ServletOutputStreamImpl.finish(ServletOutputStreamImpl.java:372)
              > at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:249)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              >
              > Wed Jan 19 22:55:10 GMT+05:30 2000:<E> <ServletContext-General> Servlet failed with Exception
              > java.net.SocketException: socket write error (code=10053)
              > at java.net.SocketOutputStream.socketWrite(Native Method)
              > at java.net.SocketOutputStream.write(SocketOutputStream.java, Compiled Code)
              > at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java, Compiled Code)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java, Compiled Code)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java, Compiled Code)
              > at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
              > at weblogic.servlet.FileServlet.service(FileServlet.java:56)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
              > at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              Walid El Daccache
              Net SNA Team
              SoftSolutions, Lebanon
              

  • SunOne Web Server 6.1 and JSP response content-length

    Hi,
    I am looking for help for a problem in my previous post
    http://swforum.sun.com/jive/thread.jspa?threadID=58612.
    It seems to me the only significant difference of the response to the same jsp file from 6.0 and 6.1 server is the content-length header.
    6.0 response has the content-length header;
    6.1 response does not have the content-length header.
    HttpUrlConnection::getContentLength() returns the actual content length of the 6.0 response;
    HttpUrlConnection::getContentLength() returns -1 for the 6.1 response.
    Here is the dump,
    SunOne WebServer 6.0
    allowUserInteraction? false
    content? sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1eed786
    contentEncoding? null
    contentLength? 999
    contentType? application/x-java-jnlp-file
    Date? 1131378080000
    DefaultAllowUserInteraction? false
    DefaultUseCaches? true
    DoInput? true
    DoOutput? false
    Expiration? Wed Dec 31 19:00:00 EST 1969
    FileNameMap? java.net.URLConnection$1@1a1c887
    lastModified? Wed Dec 31 19:00:00 EST 1969
    requestMethod? GET
    responseCode? 200
    responseMessage? OK
    HEADER::Set-cookie=[JSESSIONID=pkand013-1%253A436f75a0%253A5b909ee2e5bbe3bc;path=/]
    HEADER::Date=[Mon, 07 Nov 2005 15:41:20 GMT]
    HEADER::Server=[Netscape-Enterprise/6.0]
    HEADER::null=[HTTP/1.1 200 OK]
    HEADER::Content-length=[999]
    HEADER::Content-type=[application/x-java-jnlp-file]
    SunOne WebServer 6.1
    allowUserInteraction? false
    content? sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1fee6fc
    contentEncoding? null
    contentLength? -1
    contentType? application/x-java-jnlp-file
    Date? Mon Nov 07 10:49:07 EST 2005
    DefaultAllowUserInteraction? false
    DefaultUseCaches? true
    DoInput? true
    DoOutput? false
    Expiration? Wed Dec 31 14:00:00 EST 1969
    FileNameMap? java.net.URLConnection$1@1503a3
    lastModified? Wed Dec 31 19:00:00 EST 1969
    requestMethod? GET
    responseCode? 200
    responseMessage? OK
    HEADER::null=[HTTP/1.1 200 OK]
    HEADER::Expires=[Wed, 31 Dec 1969 19:00:00 EST]
    HEADER::Set-cookie=[JSESSIONID=44A318F4BC0802A4C70C27FD4AB1C115;Path=/]
    HEADER::Transfer-encoding=[chunked]
    HEADER::Date=[Mon, 07 Nov 2005 15:49:07 GMT]
    HEADER::Pragma=[No-cache]
    HEADER::Server=[Sun-ONE-Web-Server/6.1]
    HEADER::Content-type=[application/x-java-jnlp-file]
    HEADER::Cache-control=[no-cache]
    In my test env, 6.0 and 6.1 are installed on the same machine (Win2K), using the same directory as web root, same http port. Browser runs on a different machine.
    Thanks
    Harry

    Hi, elving
    This is good information. Thanks very much.
    Actually, I am not using SSL, just plain http connection with basic auth. It might be the cache-control header that causes the head ache. 6.0 response does not have the cache-control header, but 6.1 has.
    The interesting thing is that adding a servlet mapping on 6.1 solves the problem.
    I will take a further look tomorrow.
    Cheers,
    Harry
    I doubt the problem has to do with the Content-Length
    header.
    I'd guess that you're using SSL. Are you? If so,
    you're almost certainly bumping into a known bug (or,
    as Microsoft describes it, a "feature") in Internet
    Explorer. Microsoft article KB316431 at
    http://support.microsoft.com/default.aspx?scid=316431h
    as some information on the problem. As the article
    points out, the problem occurs when Internet Explorer
    needs to invoke an external application to handle a
    file that was served over SSL with Cache-Control:
    no-cache and/or Pragma: no-cache headers.
    A work around would be force Web Server to send
    Cache-Control and Pragma headers that don't include
    the no-cache directive. For example, the following
    lines could be added to the obj.conf configuration
    file:<Object ppath="*.jnlp">
    Output fn="set-variable" set-srvhdrs="Cache-Control:
    private"
    Output fn="set-variable" set-srvhdrs="Pragma:
    private"
    </Object>Fortunately, it sounds like you've already
    found another viable work around.

  • HTTP Compression causes HTTP2228: Response content length mismatch

    Dear All,
    My application use iPlanet 6.1, recently we have enabled HTTP compression for the webserver.
    Which inturn does not picking up style sheet and results with bad look and feel on front end.
    On the back iPlanet logs we see some errors like
    warning (23569): for host xxx.xxx.xxx.xxtrying to GET /zbank2/css/zbank.css, finish-response reports: HTTP2228: Response content length mismatch (315 bytes with a content length of 945)
    Could you please help to resolve this problem
    Thanks,
    Jude

    Can you send your css file? I tried it on Web Server 7.0 update 3 seems to be working fine.
    I made a css file from [http://www.w3.org/Style/Examples/011/firstcss|http://www.w3.org/Style/Examples/011/firstcss]
    $cat mystyle.css
    body {
      padding-left: 11em;
      font-family: Georgia, "Times New Roman",
            Times, serif;
      color: purple;
      background-color: #d8da3d }
    ul.navbar {
      list-style-type: none;
      padding: 0;
      margin: 0;
      position: absolute;
      top: 2em;
      left: 1em;
      width: 9em }
    h1 {
      font-family: Helvetica, Geneva, Arial,
            SunSans-Regular, sans-serif }
    ul.navbar li {
      background: white;
      margin: 0.5em 0;
      padding: 0.3em;
      border-right: 1em solid black }
    ul.navbar a {
      text-decoration: none }
    a:link {
      color: blue }
    a:visited {
      color: purple }
    address {
      margin-top: 1em;
      padding-top: 1em;
      border-top: thin dotted }
    $cat myhtml.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html>
    <head>
      <title>My first styled page</title>
      <link rel="stylesheet" href="mystyle.css">
    </head>
    <body>
    This is style.html
    </body>
    </html>$cat obj.conf
    <Object name="default">
    AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
    NameTrans fn="ntrans-j2ee" name="j2ee"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/export1/wsNov4/iplanet/ias/server/work/B1/SunOS5.8_DBG.OBJ/lib/icons" name="es-internal"
    PathCheck fn="uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index-j2ee"
    PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"
    ObjectType fn="type-j2ee"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
    Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
    Service method="TRACE" fn="service-trace"
    Output fn="insert-filter" filter="http-compression" type="text/*" vary="on" fragment-size="8096" compression-level="6"
    Error fn="error-j2ee"
    AddLog fn="flex-log"
    </Object>
    <Object name="j2ee">
    Service fn="service-j2ee" method="*"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>
    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi"
    </Object>
    <Object name="send-precompressed">
    PathCheck fn="find-compressed"
    </Object>
    <Object name="compress-on-demand">
    Output fn="insert-filter" filter="http-compression"
    </Object>Sent a request, but I didn't see any errors
    [07/Nov/2008:12:58:53] finest (22021):  GET /mystyle.css, func_exec reports: executing method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file" Directive="Service"
    [07/Nov/2008:12:58:53] finest (22021):  GET /mystyle.css, func_exec reports: executing fn="insert-filter" filter="http-compression" type="text/*" vary="on" fragment-size="8096" compression-level="6" Directive="Output" magnus-internal=""
    [07/Nov/2008:12:58:53] fine (22021): inserted filter http-compression
    [07/Nov/2008:12:58:53] finest (22021):  GET /mystyle.css, func_exec reports: fn="insert-filter" filter="http-compression" type="text/*" vary="on" fragment-size="8096" compression-level="6" Directive="Output" magnus-internal="" returned 0 (REQ_PROCEED)
    [07/Nov/2008:12:58:53] finest (22021):  GET /mystyle.css, func_exec reports: method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file" Directive="Service" returned 0 (REQ_PROCEED)...ssltap shows the response was encoded :
    --> [
    GET /mystyle.css HTTP/1.1^M
    Host: ....
    User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.2) Gecko/20070225
    Firefox/2.0.0.2^M
    Accept: text/css,*/*;q=0.1^M
    Accept-Language: en-us,en;q=0.5^M
    Accept-Encoding: gzip,deflate^M
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7^M
    Keep-Alive: 300^M
    Connection: keep-alive^M
    Referer: http://.../myhtml.html^M
    Cookie: SUN_ID=129.147.37.51:287861225347735; s_vi=[CS]v1|48F6E7BF00000316-A02082200000556[CE]; nfTimeStamps=19700101000000%7C19700101000000%7C19700101000000; nfSettings=112101110%7C%7Cen_US%7C%7C0%7C60%7C-1%7C%7Cweek%7C-1%7C; location=US;
    s_cc=true; s_sq=%5B%5BB%5D%5D; AMAuthCookie=AQIC5wM2LY4SfczkxcjsoIVQbGnnqbFrqk8lWxYT1xzFVlE%3D%40AAJTSQACMDI%3D%23^M
    ^M
    <-- [
    HTTP/1.1 200 OK^M
    Server: Sun-Java-System-Web-Server/7.0^M
    Date: Fri, 07 Nov 2008 07:28:53 GMT^M
    Content-type: text/css^M
    Last-modified: Fri, 07 Nov 2008 07:20:29 GMT^M
    Etag: W/"277-4913ec3d"^M
    Content-encoding: gzip^M
    Vary: accept-encoding^M
    Transfer-encoding: chunked^M
    ^M
    165^M
    ^_\213^H^CU\222\301N\3030^L\206\357{
    ^K\256\313\2641!A8q^Z'^N^[/\3406nk-M\252$\355\250\320\336\2354)l\315\245\262^?\307\376?\247\205U#\374\254:T\212M-4UA\302nG\355[\314V\326^DQa\313z\224p \353j\3065<|qK^^>\351^BG\333\242yX\307\322|\222\262^FO\216\253\251Ai\265u^R\272\336u\232\246D\201\345\271v\2667J\314\332\243zQ\270Wp]\365zcp(\320%G\232}^P>\214\232D^X;\222`\254I-f\253^R\266S\324b4e\346\240\263\236^C\333^Xb\341\255\356C\272^Pl'\341)^S\315|9\270\260
    \215\204Wj\343\364f\227\306.\220?H^O^T\270\214\320^G24\304\357\273c\3247\340SoNh\2748R\335kt^Q}\212^R\377\202Hs\352~\303\227pi8\373\373G\330<G'\333%\343f\237\275^V\326)r\302q\335d\210\200\254\240\320\261\345b^T\246I\201\276\203PTZ\207y#\323\372b^]J\315\346\234J\346^G(t\237\205\201\343\366H\335k\371\341&U)G\336'-\373^Ui\255\363&\377~\237\373\334\3548\245B\303^F\224^MS\373\353j\365^K O\2450w^B^M
    0^M
    ^M
    ]

  • Content-Length Header Missing in Http Response

    Hi folks,
    Our application uses JSPs and Servlets. To solve a TCP level probelm, we would like to ensure that each response sent from the WebLogic Server includes a content-length header. All the pages are dynamic and therefore we cannot explicitly set the content-length.
    To ensure that WebLogic has the opportunity to set this header, we have increased the response buffer size by adding a <%@ page buffer="nK" %> header to our JSPs and a response.setBufferSize call to our Servlets. The responses still do not contain a content-length header.
    Is there anything else we can do to get WebLogic to set this header?
    Thanks in advance,
    Santosh

    Anybody?

  • How to display a document content in a JSP page

    Hi friends,
    I am trying to display a document's content in a JSP page after user authentication.For that I mapped a jsp file with extension ".sens" in Content Management SDK manager,and put the file in the directory '/ifs/jsp-bin' of webstarterapp,but it is not working.Please help me to solve the probleb as earliest.
    Regards
    Prasenjit

    under view put a new tag
    <f:view>
    <ui:script url="page.js"/>
    and thats it

  • Missing Content-Length in HTTP response

    Hi All,
    I am experimenting with developing websevices using Sun Java Application Server. I have a working webservice using BEA Weblogic and I would like to have it ported to SUN. The application works like this: A client (Tuxedo application program) sends an XML document to the webservice, in response the websevice parse this document and based on certain fields it send back another document.
    The problem is that the SUN application does not return the content-length in its response and hence the requesting client rejects the message. Can anyone help?? Below is the response from both SUN and Weblogic:
    Weblogic
    HTTP/1.1 200 OK
    Date: Sat, 22 Oct 2005 11:42:53 GMT
    Pragma: no-cache
    Server: WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 with CR174524
    Content-Length: 2025
    Content-Type: text/xml; charset=UTF-8
    Expires: Thur, 01 Jan 1970 00:00:00 GMT
    Cache-Control: no-cache
    Connection: Close
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope
    SUN
    HTTP /1.1 200 OK
    X-Powered-By: Servlet/2.4
    SOAPAction: ""
    Content-Type: text/xml;charset=utf-8
    Date: Sat, 22 Oct 2005 11:42:53 GMT
    Server: Sun-Java-System/Application-Server
    Connection: close
    <?xml version="1.0" encoding="UTF-8"?>
    env:Envalope xmls:env="http://schemas.xmlsoap.org/soap/envelope/"
    As can be seen the Content-Length is missing.
    Thanks for your help.
    Ransford

    Is there an option in Sun Java Application Server to include Content-Length in response to a client request? If not is it possible to generate this information from the service code?
    Thanks.

  • ImageLoader,no  Content-Length not loading in ie, chrome

    Im currently working with the PosterFrameElement, the url to the jpeg is like this http://mydomain.dk/image/1234/
    serialElement.addChild(new PosterFrameElement(new URLResource(url)));
    to get pass the ImageLoader canHandleResource I tryed inserting .jpg which then return true..(also override the canHandleResourceto true)
    However my problem seems to have something with the browser and  images content header, the images im trying to load has no Content-Length and is chunked..file size around 46 k (and I have no chance to change this).
    In firefox all work fine,
    BUT  when I view in chrome, ie or safari the picture is not loading. I trace LoadEvent bytes to 0
    It seems like a BUG in the Loader!! is their a workaround or suggestions on how to move on?
    Thanks in advance

    Hi Peter,
    Have you tried loading the images directly in the problem browsers (Chrome, IE, Safari) and see if the loading works any better? If something loads differently based on the browser, that's unusual with Flash Player. I'd see if the browsers themselves are having trouble with the chunked files before tackling anything inside OSMF. I know that certain browsers send different HTTP statuses than others. It is possible that a chunked file is sending a status before the entire file is loaded, tricking the Loader into thinking the file is complete. Adobe notes that the following browsers don't send statuses to the Flash Player: Netscape, Mozilla, Safari, Opera, and Internet Explorer for the Macintosh. That doesn't line up exactly with your list, so that may be a red herring.
    Also, on the matter of getting around the image loader, you could use your own media factory to pick the loader and element type through a custom MediaFactoryItem. If you specify an ID other than the standard OSMF ID for MediaFactoryItems (org.osmf), it will get used before the standard MediaFactoryItem for that media element type. Check out the MediaFactory's resolveItems() method for how that works.
    Nils

  • I am getting a "java.lang.RuntimeException: Error loading file:....NULL content-length." message when attempting to load a jnlp file

    I am the applications administrator for an instance of Galaxy server. In Galaxy there is an option / plugin to opne a BAM file via the Integrative Genomics Viewer (IGV) created at the Broad Institute. When invoked it downloads a jnlp file and launches IGV and then is supposed to open the BAM file in the viewer. However, when it attempts to open the BAM file I get the following error:
    "An Error occurred while loading: http://galaxy/display_application/52cef830ad5766ca/igv_bam/web/29212308ff643a94/data/galaxy_52cef830ad5766ca.bam
    java.lang.RuntimeException: Error loading file: http://galaxy/display_application/52cef830ad5766ca/igv_bam/web/29212308ff643a94/data/galaxy_52cef830ad5766ca.bam NULL content-length."

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all,
    I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file.If calling a servlet for the same is d best way to do that, plz can ne1 tell me :
    1> whether to override the doPost method in the servlet in which to read d file using FileInputStream
    2> Putting the contents in an array and then how to pass this array to the JSP page.
    Thanks,
    deepthy.

    I'm using a properties file to let my web application know what the name of the database is. I'm using an abstract class GeneralDao which will be extended by all the DAO's (Data Access Objects or java classes containing SQL statements).
    Here's the code :
    protected Connection getDatabaseConnection()
              throws Melding
         Connection dbconn = null;     
         ResourceBundle resBundle;
         try
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         resBundle = ResourceBundle.getBundle("gcoConfig");
         String dbConnectie = resBundle.getString("databaseconnection");
         gcoLogger.debug("lezen databaseconnection in resourceBundle " );
         dbconn = DriverManager.getConnection(dbConnectie);
         } catch (InstantiationException exc)The ResourceBundle is used to read the properties file, named gcoConfig.properties.
    With the getString() command I read the content of the string named databaseconnection.
    The gcoConfig.properties file is placed inside the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes
    The GeneralDao is placed in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes\org\gertcuppens\cluifDao.
    So this class is placed some folder below the WEB-INF\classes folder of gcoConfig.properties.
    And the content of the properties file is just one line :
    databaseconnection=jdbc:mysql://localhost/cluif
    If you want to let the JSP know what's inside the properties file, wrap the content in a Javabean, put it in the request or even the session and pass the control to the JSP.

  • Maximum size for an HttpRequest? Set Content-Length?

    Hi, I'm managing to get small strings sent from my applet to my servlet, but when I try anything bigger, I get problems. Oddly enough, the larger object can get sent to my applet from my servlet without any issues.
    Can anyone tell me if there is a maximum size for sending responses?
    Or, if I have to set the content-length property in my applet before I send my data, how do I get the size of my object so I can set it?
    thanks for any advice any of you might have

    Thanks for the pointers.
    BalusC, at first I was trying to write my object without sending it through a byteStream first (hence the q) :), tried it that way too and wouldn't work.
    I finally figured out that it wasn't the code that was the problem, but it was an upload issue (server specific). Have changed the code to sending one line of data at a time since I was converting my object to an output file in the servlet anyway. Not the best solution but it works :)
    Thanks again

  • Content-Length Header being stripped out of Gatewayed pages

    I am working to integrate the GPL'ed Moodle e-learning web application with Plumtree.  However, I'm hitting a snag.  For certain POST events, Moodle expects to receive a content-length header.
    When I use the application outside the portal, it works fine, and the Content-Length header is sent.  However, when I have the application gatewayed through the portal, the Content-Length header seems to get stripped out of the HTTP request and I get HTTP error 411 (Content Length Required).
    Is there a way I can convince the portal to not strip out the Content Length HTTP header?

    I'm working with .NET portal.
    For the particular file that caused the error as reported in the tcptrace log, I opened IIS manager, found the virtual directory, right clicked to open the properties dialog and checked directory security.
    Select edit anonymous access to check the account used for anonymous access, supply the user account needed and allow IIS to manage password. If in doubt check the settings on pages containing http post that are functioning properly.
    Check Integrated Widows Authentication
    I found this virutal directory had no user in the anonymous account, not sure how this happened. This resulted in pages that contained post/postbacks giving the "length required" error when I hit a button to perform the post/postback. Pages that did not contain Posts/Postback work correctly.

  • How to solve "Bad Content-Length value" Error that show in ADF Mobile

    I was develop application that using web service from mine original ADF project and I can't fetch via AMX Page as pop-up error "Bad Content-Length value" How to solve this problem ?
    My Web-service configuration
    - "Find" is only basic operation that in view instance
    - None of View criteria
    As only find is basic operation, that seems required "findCriteria" and "findControl" parameter(as seen in "Panel From layout" generated in AMX Page)
    After drag generate form view in AMX Page and after to deploy to simulator, I was found pop-up error was said Bad Content-Length value as shown below.
    I am also using HTTP Analyzer and didn't found any request from ADF Mobile Application
    http://img844.imageshack.us/img844/7720/screenshot20130305at163.png

    Hi,
    I'm also got a problem with this tutorial too, after touch at "Salary Upgrade" button and got same error too
    http://docs.oracle.com/cd/E18941_01/tutorials/BuildingMobileApps/ADFMobileTutorial_2.html
    I have some conclusion with develop ADF Mobile in OSX will related with this problem as tutorial are properly working and nobody was said about this problem.
    My current development machine is OSX 10.8.2 with jDeveloper 11.1.2.3.0
    Edited by: meddlesome on Mar 7, 2013 2:49 AM

  • Exporting Content of a JSP page into Excel Spread Sheet

    I am trying to export the content of a JSP page into an excel spread sheet. I know this issue had been posted before, but if you any one has the source code of a sample that's working please send it to me at [email protected]
    Your help is appreciated.
    Jamais.

    http://forum.java.sun.com/thread.jspa?threadID=664249

Maybe you are looking for

  • Background Execution Problem-Docking Container with 2 ALV Grids in one scre

    Hi Friends, I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER. The objects are 'g_dock_cont' and 'g_dock_cont1'. I am getting the foreground output as expected with 2 ALV Grids. While executing in background (F9), I

  • Lumia 920 stuck with spinning gears (bricked) afte...

    My phone has been in the spinning gears mode for almost 48 hours. Tried all the steps to reset the phone but to no avail. Anyone has solution to this?

  • Parameter changes in RAC

    Hi, We have two node RAC and presently up and running. We are going to set single node standby database for the two node RAC. We need to modify some initialization parameter in RAC. Is this possible to shutdown one instance and restart following this

  • IDOC value with Mapping

    Hi,    i have a segment that will hold n number of occurences. Ex: E1BPE1MARAEXTRT. Field name called field1.         i need to pass the occurence value to target field and the same value should not repeat in target . Ex: field1 value 1000------targe

  • Computer not automatically transfering music to ipod.

    I had a sad face thing on my ipod, so i followed the instructions and now i have removed my old itunes, and i had to reinstall a new itunes thing and now it recongnizes my ipod, but it will not automatically transfer music to it..what can i do?