图片上传的问题 高手请进

kaxi 2003-09-15 12:45:44
我的图片上传程序 在RESIN里边是正常的 但我放在TOMCAT下就出错了 怎么搞的
错误如下
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /admins/upload/sample1.jsp(1,0) Page directive: can't have multiple occurrences of language
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(Unknown Source)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(Unknown Source)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(Unknown Source)
at org.apache.jasper.compiler.Validator$PageDirectiveVisitor.visit(Unknown Source)
at org.apache.jasper.compiler.Node$PageDirective.accept(Unknown Source)
at org.apache.jasper.compiler.Node$Nodes.visit(Unknown Source)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Unknown Source)
at org.apache.jasper.compiler.Node$Visitor.visit(Unknown Source)
at org.apache.jasper.compiler.Node$Root.accept(Unknown Source)
at org.apache.jasper.compiler.Node$Nodes.visit(Unknown Source)
at org.apache.jasper.compiler.Validator.validate(Unknown Source)
at org.apache.jasper.compiler.Compiler.generateJava(Unknown Source)
at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
at org.apache.jasper.JspCompilationContext.compile(Unknown Source)
at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Unknown Source)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:256)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:361)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:563)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:535)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:638)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)



--------------------------------------------------------------------------------

Apache Tomcat/4.1
...全文
2 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kaxi 2003-09-15
这是上传的程序
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<%@ page language="java" import="com.jspsmart.upload.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.io.File"%>
<%@ include file="/common/config.jsp" %>
<jsp:useBean id="DoDateBean" scope="page" class="com.kaxi.info.common.DoDate" />
<jsp:useBean id="DoTextBean" scope="page" class="com.kaxi.info.common.DoText" />
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<jsp:useBean id="ReOutputBean" scope="page" class="com.kaxi.info.common.ReOutput" />

<HTML>
<BODY BGCOLOR="white">


<%
String DateFilename= "";
String Datedir= "";
String FilePath=path+"upimages/";

//取得时间
Date dCurr = new Date();
//按时间取得文件名
DateFilename=DoDateBean.fotmatDate3(dCurr);
DateFilename=DoTextBean.DateFileEncode(DateFilename);

//按时间取得目录名
Datedir=DoDateBean.fotmatDate4(dCurr);
Datedir=DoTextBean.DateFileEncode(Datedir);

//目录路径
FilePath=FilePath+Datedir;

try {
//初始化
mySmartUpload.initialize(pageContext);
//设置文件大小
mySmartUpload.setTotalMaxFileSize(1000000);
//文件上传
mySmartUpload.upload();

//取得上传文件
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
//取得文件名
DateFilename=DateFilename+"."+myFile.getFileExt();

//创建目录
File myFilePath=new File(FilePath);

if(!myFilePath.exists())
{
myFilePath.mkdir();
}

//判断文件是否上传成功
if(!myFile.isMissing()){
//判断文件大小
if (myFile.getSize()<102400) {
//判断文件类型
if (myFile.getFileExt().equals("jpg") || myFile.getFileExt().equals("gif") || myFile.getFileExt().equals("swf")) {
//保存文件
myFile.saveAs("/upimages/"+Datedir+"/"+DateFilename);
//out.println("您上传的文件大小是: " + myFile.getSize() + "<BR>");
//out.println("文件名是: " + DateFilename + "<BR>");

out.print("<script language=javascript>");
out.print("alert('图片上传成功!!');");
out.print("parent.window.location.reload();");
out.print("window.location= (sample1.htm);");
out.print("</script>");

//out.println("<img src=/upload/"+Datedir+"/"+DateFilename+" >");
}
else{
out.print(ReOutputBean.ReOutput(false,"只能上传JPG GIF SWF的文件!!","javascript:history.go(-1);"));
}

}
else{
out.print(ReOutputBean.ReOutput(false,"文件大不能超过100K","javascript:history.go(-1);"));
}


}
else{
out.print(ReOutputBean.ReOutput(false,"文件上传失败","javascript:history.go(-1);"));
}

} catch (Exception e) {
out.println(e.toString());
}

%>

</BODY>
</HTML>
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告