How To Upload and Read CSV File On SpringMVC Using OpenCSV

In this function, I use OpenCSV library to help me read csv file. You can read more about OpenCSV on their website.

The form on my jsp:

<form action="${baseURL}/uploadfile" method="POST" enctype="multipart/form-data" >
    <div class="form-group">
        <label>File input</label>
        <input type="file" name="file"/>
    </div>
    <br/><br/>
    <div class="form-group">
        <button type="submit" id="upload">Upload</button>
    </div>
</form>

My controller: Continue reading “How To Upload and Read CSV File On SpringMVC Using OpenCSV”