小编Kar*_*k.m的帖子

java中的非法转发引用

 import java.io.*;
 import jxl.*;
 class Xlparsing
 {
   Workbook wb =wb.getWorkbook(new File(
    "C:\\Documents and Settings\\kmoorthi\\Desktop\\ak\\new.xls"));
   // Illegal forward reference What it means
   Sheet st = wb.getSheet(0);
   Cell cell1 = st.getCell(0,0);
   String a1 = cell1.getContents();
   public static void main(String s[])
   {
     System.out.println(new Xlparsing().a1);
   }
 }
Run Code Online (Sandbox Code Playgroud)

嗨当我尝试从Excel工作表中提取数据时,非法前向引用错误会出现在文件对象创建中.

怎么解决这个?

java

24
推荐指数
1
解决办法
4万
查看次数

文件上传"multipart/form"异常org.apache.commons.fileupload.FileUploadBase $ InvalidContentTypeException

我尝试使用Apache Commons上传文件,但抛出了以下异常

org.apache.commons.fileupload.FileUploadBase $ InvalidContentTypeException:请求不包含multipart/form-data或multipart/mixed流,内容类型标头为null

我的HTML代码是

<form  name="inp" action="upload.jsp"  method="get" onsubmit="return valid();" enctype="multipart/form-data">
<table align="center" cellspacing="2">

  <tr><td><font size="5" color="#E41B17">Select File</font> </td>
<td><input type="file" name="infile"></td>
</tr>
<tr><td><font size="5" color="#E41B17">Target File Name</font></td>
<td><input type="text" size="20" name="filename"></input></td>
</tr>
<tr></tr>
<tr><td colspan="2" align="center"><input type=submit value="Upload"  ></td></tr>
</table>
<br></br>
<center>
<a href="index.html"><font color="#E41B17">HOME</font></a>
</center>
</form>
Run Code Online (Sandbox Code Playgroud)

我的JSP代码是

   <% 
   String user = (String)session.getAttribute("uname");
   String f = request.getParameter("filename");

   DiskFileUpload upload = new DiskFileUpload();         
   boolean isMultipart=upload.isMultipartContent(request);


   upload.setSizeMax(1048576);     
   List items = upload.parseRequest(request);  
   FileItem  file = (FileItem) items.get(0); 

   String source = …
Run Code Online (Sandbox Code Playgroud)

java jsp file-upload apache-commons

7
推荐指数
1
解决办法
3万
查看次数

如何在MySQL中存储图片?

我想将图像存储在MySQL数据库中.我创建了一个具有BLOB数据类型的表,但现在如何将图像存储在此表中?

java mysql database blob

6
推荐指数
2
解决办法
1万
查看次数

在java中无限循环

我是Java新手.我试图从文本文件中提取员工数据并将其存储在集合中.我使用Stringtokenizer从文件中获取字符串,但在第二次迭代中,while循环变为无限; 它不会出现在while循环中.我的代码是:

public class Reader1 {
    String a;
    int i = 0;
    int count = 0;
    int x = 0;
    int y = 0;
    File f = new File(
            "C:\\Documents and Settings\\kmoorthi\\Desktop\\ak\\sample.txt");

    ArrayList<Employee> al = new ArrayList<Employee>();

    public void notePad() throws IOException {

        try {
            FileReader fis = new FileReader(f);
            BufferedReader br = new BufferedReader(fis);

            do {
                a = br.readLine();
                i++;
                if (i > 1) {
                    if (a != null) {
                        StringTokenizer st = new StringTokenizer(a, "    ");
                        Employee e …
Run Code Online (Sandbox Code Playgroud)

java

3
推荐指数
1
解决办法
1921
查看次数

是否值得研究applet?

我是网络开发的新手,我是否学习applets?

java applet

2
推荐指数
1
解决办法
688
查看次数

Java中的Biff异常

当我尝试用Java读取Excel文件时,它会抛出"biff exception".

这是什么意思?我试图谷歌它,但无法找到正确的解释.

jxl.read.biff.BiffException: Unable to recognize OLE stream

                             at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)

                             at jxl.read.biff.File.<init>(File.java:127)

                             at jxl.Workbook.getWorkbook(Workbook.java:221)

                             at jxl.Workbook.getWorkbook(Workbook.java:198)

                             at Com.Parsing.ExcelFile.excel(Extract.java:20)

                             at Com.Parsing.Extract.main(Extract.java:55)
Run Code Online (Sandbox Code Playgroud)

java excel exception

2
推荐指数
1
解决办法
3万
查看次数

Servlet异常 - 已为此响应调用了getOutputStream()

在我的servlet中

一个被抛出的例外

org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has already been called for this response
Run Code Online (Sandbox Code Playgroud)

帮我解决这个问题

提前致谢

servlets

1
推荐指数
1
解决办法
3万
查看次数

为什么在html中使用post方法时不使用request.getParameter()检索数据

在我的jsp代码中,我使用request.getParameter()来检索在html中输入的数据.使用get方法时检索数据,但是当我使用post方法时它不是为什么会发生这种情况

我的HTML表单是

<code>
<form  name="inp" action="upload.jsp"  method="post" onsubmit="return valid();" enctype="multipart/form-data">
<table align="center" cellspacing="2">

<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td><font size="5" color="#E41B17">Select File</font> </td>
<td><input type="file" name="infile"></td>
</tr>
<tr><td><font size="5" color="#E41B17">Target File Name</font></td>
<td><input type="text" size="20" name="filename"></input></td>
</tr>
<tr></tr>
<tr><td colspan="2" align="center"><input type=submit value="Upload"  ></td></tr>
</table>
<br></br>
<center>
<a href="index.html"><font color="#E41B17">HOME</font></a>
</center>
</form>
</code>
Run Code Online (Sandbox Code Playgroud)

我的jsp scriptlet是

<% String f = request.getParameter("filename");
  System.out.println(f); %>
Run Code Online (Sandbox Code Playgroud)

提前致谢

html jsp

1
推荐指数
1
解决办法
2845
查看次数

使用java在excel中只读的单个单元格

如何使用 Java 在 Excel 中制作只读单元格?

java excel

1
推荐指数
1
解决办法
4558
查看次数

标签 统计

java ×7

excel ×2

jsp ×2

apache-commons ×1

applet ×1

blob ×1

database ×1

exception ×1

file-upload ×1

html ×1

mysql ×1

servlets ×1