Note that there are some explanatory texts on larger screens.

plurals
  1. PONullPointerException in File Upload by tomahawk
    primarykey
    data
    text
    <p>I want to upload an Excel file to a JBoss Server with JSF, so I used Tomahawk.</p> <p>Here is the view:</p> <pre><code>&lt;%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%&gt; &lt;h:form id="MF" enctype="multipart/form-data" &gt; &lt;x:inputFileUpload id="fileupload" value="#{dataentryctl.minvoice}" storage="file" required="false" /&gt; &lt;h:commandButton id="Submit" type="button" action="#{invoiceentryctl.PersistData}" value="save" onclick="revalidateF12();submitForm()" onkeydown="keyDownEvents(this)" /&gt; &lt;/h:form&gt; </code></pre> <p>Here is the controller/model:</p> <pre><code>package panaceaFACweb.FACCtlbean; import org.apache.myfaces.custom.fileupload.UploadedFile; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class dataentryctl { private UploadedFile minvoice; public UploadedFile getMinvoice() { return minvoice; } public void setMinvoice(UploadedFile minvoice) { this.minvoice = minvoice; } public String PersistData() { load(); return null; } public void load() { ParseXLS parseXls = new ParseXLS(); try { InputStream input = minvoice.getInputStream(); // ... } catch (IOException e) { e.printStackTrace(); }catch (Exception e) { e.printStackTrace(); } } } </code></pre> <p>I have the following JARs:</p> <ul> <li>tomahawk-1.1.9.jar</li> <li>commons-el-1.0.jar</li> <li>commons-logging-1.1.1.jar</li> <li>commons-fileupload-1.2.2-javadoc.jar</li> <li>commons-io-1.4.jar</li> </ul> <p>Other JARs related to JSF are already there. Other JSP pages work fine.</p> <p>I am getting a <code>NullPointerException</code> on the line <code>InputStream input = minvoice.getInputStream();</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload