Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

who can help me--use SmartUpload problem

2 views
Skip to first unread message

chenjinshao

unread,
Oct 22, 2002, 3:43:45 AM10/22/02
to

This jsp file in tomcat can load *.jpg and *.gif and *.doc and *.txt and *.htm,and
*.jsp
and other type files from database table.
but in weblogic6.1sp1 this jsp file can't useing and error.


the code begin

<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Vector"%>
<%@ page import="com.jspsmart.upload.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
<%@ page import="javax.servlet.jsp.JspWriter"%>
<%@ page import="javax.servlet.jsp.PageContext"%>
<%@ page import="horn.Dbconn"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.HornUpload"
/>
<%
Dbconn Dbconn=new Dbconn();
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
String id="";
String contentType="application/octet-stream";
String destFileName="";
id=request.getParameter("id");
ResultSet rs=null;
mySmartUpload.initialize(pageContext);
rs = Dbconn.executeSql("SELECT * FROM aaa where id="+id);
if (rs.next())
{
destFileName=rs.getString("filename");
byte b[] = rs.getBytes("docconn");
rs.close();
Dbconn.close();
response.setContentType(contentType);
response.setContentLength(b.length);//here error in weblogic
if(destFileName == null)
response.setHeader("Content-Disposition", "attachment;");
else
if(destFileName.length() == 0)
response.setHeader("Content-Disposition", "attachment;");
else
response.setHeader("Content-Disposition","filename=".concat(String.valueOf(destFileName)));
ServletOutputStream sout = response.getOutputStream();
sout.write(b, 0, b.length);
sout.flush();
sout.close();
}
%>
the code end

in weblogic error message

<Error> <HTTP> <Connection failure
java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '986' byte
s instead of stated: '4036' bytes.
at weblogic.servlet.internal.ServletOutputStreamImpl.commit(ServletOutpu
tStreamImpl.java:422)
at weblogic.servlet.internal.ServletOutputStreamImpl.finish(ServletOutpu
tStreamImpl.java:483)
at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImp
l.java:985)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2044)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>

chenjinshao

unread,
Oct 22, 2002, 3:49:19 AM10/22/02
to

Charlie Sadler

unread,
Oct 23, 2002, 3:56:10 PM10/23/02
to
chenjinshao,
You might try configuring weblogic.xml for keepgenerated and take a look at
the corresponding .java file for the .jsp file.
White space between jsp tags might be polluting the generated output.
See http://e-docs.bea.com/wls/docs61/webapp/weblogic_xml.html#1012195

"chenjinshao" <put...@163.net> wrote in message
news:3db5...@newsgroups.bea.com...

sunnf

unread,
Jun 4, 2004, 11:24:48 PM6/4/04
to

your problem is ok?

"chenjinshao" <put...@163.net> wrote:
>
>This jsp file in tomcat can load *.jpg and *.gif and *.doc and *.txt

>and *.htm,and

0 new messages