当前位置: 技术问答>java相关
各位大GG.DD!小妹又来问问题了...................UP也可.........
来源: 互联网 发布时间:2015-09-20
本文导语: 下面是一段代码,看看出了什么问题呀!!大家帮我解决一下吧!!! JSP部分! uploadfile JBuilder Generated JSP CLASS部分: package jp.co.ite.application.form; import jp.co.tenartni.xsv.UploadFileData; import jp.co.ite.application.common.*; imp...
下面是一段代码,看看出了什么问题呀!!大家帮我解决一下吧!!!
JSP部分!
uploadfile
JBuilder Generated JSP
CLASS部分:
package jp.co.ite.application.form;
import jp.co.tenartni.xsv.UploadFileData;
import jp.co.ite.application.common.*;
import jp.co.tenartni.data.*;
import jp.co.tenartni.xqa.*;
import jp.co.tenartni.xsv.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.lang.*;
import jp.co.tenartni.xsv.ServletBase;
public class uploadForm extends HtmlForm
{
public uploadForm()
{
// 表示フォーム正当性のチェック
this.setCheckSequence(true);
// 出力タイプ設定
this.setOutputType(HtmlFormType.USE_JSP_CALLPAGE);
// JSPファイルの設定
this.setJavaServerPageFileName("uploadfile.jsp");
}
public void initialize(ParamSet sessionParam) throws Exception
{
// メッセージの消去
this.clearErrorMessage();
this.clearNormalMessage();
}
// リクエストチェック、画面遷移等の実行
protected HtmlForm doExecute(java.util.Vector requestParamNames,
java.util.Hashtable requestParamValues)
throws Exception
{
try
{
String sub = this.getSubmitValue(requestParamValues);
if (sub.equals("UPLOAD"))
{
//System.out.println("111"+requestParamValues.get("uploadFILE")+"1111qrwydgdhdg");
UploadFileData updfile = new UploadFileData();
//UploadFileData updfile = (UploadFileData)requestParamValues.get("uploadFILE");
updfile = (UploadFileData)requestParamValues.get("uploadFILE");
BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(updfile.getContent()),""));
String inStr = null;
while ((inStr = in.readLine()) != null)
{
System.out.println("wo asi ni y !");
}
in.close();
//HtmlForm nextForm = this.getSession().getFormByName("FormNext");
//return nextForm;
}
}
catch(Exception x)
{
x.printStackTrace();
}
return this;
}
}
出现的错误提示:
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /examples )
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( )
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /test )
2002-09-30 10:33:00 - PoolTcpConnector: Starting HttpConnectionHandler on 100
2002-09-30 10:33:00 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccc
java.lang.ClassCastException: [Ljava.lang.String;
at jp.co.ite.application.form.uploadForm.doExecute(uploadForm.java:50)
at jp.co.tenartni.xsv.HtmlForm.execute(HtmlForm.java:395)
at jp.co.tenartni.xsv.BasicSession.doFormExecute(BasicSession.java:194)
at jp.co.tenartni.xsv.BasicSession.execute(BasicSession.java:305)
at jp.co.tenartni.xsv.ServletBase.executeSession(ServletBase.java:450)
at jp.co.tenartni.xsv.ServletBase.service(ServletBase.java:291)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
05)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
at java.lang.Thread.run(Thread.java:484)
JSP部分!
uploadfile
JBuilder Generated JSP
CLASS部分:
package jp.co.ite.application.form;
import jp.co.tenartni.xsv.UploadFileData;
import jp.co.ite.application.common.*;
import jp.co.tenartni.data.*;
import jp.co.tenartni.xqa.*;
import jp.co.tenartni.xsv.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.lang.*;
import jp.co.tenartni.xsv.ServletBase;
public class uploadForm extends HtmlForm
{
public uploadForm()
{
// 表示フォーム正当性のチェック
this.setCheckSequence(true);
// 出力タイプ設定
this.setOutputType(HtmlFormType.USE_JSP_CALLPAGE);
// JSPファイルの設定
this.setJavaServerPageFileName("uploadfile.jsp");
}
public void initialize(ParamSet sessionParam) throws Exception
{
// メッセージの消去
this.clearErrorMessage();
this.clearNormalMessage();
}
// リクエストチェック、画面遷移等の実行
protected HtmlForm doExecute(java.util.Vector requestParamNames,
java.util.Hashtable requestParamValues)
throws Exception
{
try
{
String sub = this.getSubmitValue(requestParamValues);
if (sub.equals("UPLOAD"))
{
//System.out.println("111"+requestParamValues.get("uploadFILE")+"1111qrwydgdhdg");
UploadFileData updfile = new UploadFileData();
//UploadFileData updfile = (UploadFileData)requestParamValues.get("uploadFILE");
updfile = (UploadFileData)requestParamValues.get("uploadFILE");
BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(updfile.getContent()),""));
String inStr = null;
while ((inStr = in.readLine()) != null)
{
System.out.println("wo asi ni y !");
}
in.close();
//HtmlForm nextForm = this.getSession().getFormByName("FormNext");
//return nextForm;
}
}
catch(Exception x)
{
x.printStackTrace();
}
return this;
}
}
出现的错误提示:
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /examples )
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( )
2002-09-30 10:32:58 - ContextManager: Adding context Ctx( /test )
2002-09-30 10:33:00 - PoolTcpConnector: Starting HttpConnectionHandler on 100
2002-09-30 10:33:00 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccc
java.lang.ClassCastException: [Ljava.lang.String;
at jp.co.ite.application.form.uploadForm.doExecute(uploadForm.java:50)
at jp.co.tenartni.xsv.HtmlForm.execute(HtmlForm.java:395)
at jp.co.tenartni.xsv.BasicSession.doFormExecute(BasicSession.java:194)
at jp.co.tenartni.xsv.BasicSession.execute(BasicSession.java:305)
at jp.co.tenartni.xsv.ServletBase.executeSession(ServletBase.java:450)
at jp.co.tenartni.xsv.ServletBase.service(ServletBase.java:291)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
05)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
at java.lang.Thread.run(Thread.java:484)
|
UP+GZ...........