0
ファイルをアップロードするjspファイルがあり、年と月を選択する2つのドロップダウンとチェックボックスがあります。私は送信した後、これらの値をコントローラーに入力します。私は、Javaの春のMVCフレームワークを使用しています。私はファイルタイプがpostメソッドを使って送信されるべきであることを知っていますが、他の値はどうすれば使用できますか?jspで年月を含むファイルをアップロードします。年、月、チェックボックスの値とコントローラ内のファイルを取得する
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="sp" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Upload File</title>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet" type="text/css"></link>
<link href="<c:url value="/resources/bootstrap.min.css" />" rel="stylesheet" type="text/css"></link>
<link href="<c:url value="/resources/payslip-style.css" />" rel="stylesheet" type="text/css"></link>
</head>
<body>
<form action ="verifyFile" id="myform" enctype="multipart/form-data">
\t \t \t \t <div class="dropdown dropdown-inline">
\t \t \t \t \t <select class="form-control" id="dd1" name="selectYear" >
\t \t \t \t \t \t <option value="" label="Select Year"/>
\t \t \t \t \t \t \t <c:forEach var="year" items="${years}">
\t \t \t \t \t \t \t \t <option value="${year}"><c:out value="${year}"></c:out>
\t \t \t \t \t \t \t \t </option>
\t \t \t \t \t \t \t </c:forEach>
\t \t </select>
\t </div>
\t \t \t \t <div class="dropdown dropdown-inline">
\t \t \t \t \t <select class="form-control" id="dd2" name="dd2">
\t \t \t \t \t \t <option value="" label="select Month"/>
\t \t \t \t \t \t \t <c:forEach items="${monthsList}" var="months">
\t \t \t \t \t \t \t \t <option value="${months}"><c:out value="${months}"></c:out>
\t \t \t \t \t \t \t \t </option>
\t \t \t \t \t \t \t </c:forEach>
\t </select>
</div><br/><br/>
\t \t \t \t <div class="upload-file">
\t \t \t \t \t <b>Header :</b><input type="checkbox" name="header"></input><br/><br/>
\t \t \t \t \t <label class="btn btn-default btn-file">
\t \t \t \t Browse File <input type="file" name="file" style="display: none;" accept=".csv" id="f1" ></input>
\t \t \t \t \t </label>
\t \t \t \t \t <label><span class='label label-info' id="upload-file-info"></span></label><br/><br/>
\t \t \t \t \t <input class="btn btn-primary" type="submit" id="Upload" value="Upload" onclick="validate();"></input>
\t \t \t \t \t <input class="btn btn-primary" type="reset" name="Reset"></input><br/><br/>
\t \t \t \t </div>
\t \t \t </form>
</body>
</html>
必須の文字列パラメータ 『DD1がエラー』存在しない "与えています。 –
同じエラーが発生しました。必要な文字列パラメータ 'selectYear'が存在しません。 –