JSP가 시작됩니다. 다음 HTML 양식이 있습니다.JSP 요청 get 매개 변수가 예외를 throw합니다.
<form method='POST' enctype='multipart/form-data'>
<input type="text" name="sittingPlaces">
<textarea name="invitees"></textarea>
<input type="submit" value="Submit">
</form>
그리고 다음 자바 코드.
if (request != null && request.getContentType() != null) {
int sittingPlaces = Integer.parseInt(request.getParameter("sittingPlaces"));
String invites = request.getParameter("invitees");
}
나는
int sittingPlaces = Integer.parseInt(request.getParameter("sittingPlaces"));
어떤 생각 이유에서 오류가? 고마워요.
무엇이 오류입니까? –
** 예외 : ** org.apache.jasper.JasperException : 41 페이지의 JSP 페이지 /TP2.jsp 처리 중 예외가 발생했습니다. ** 근본 원인 : ** java.lang.NumberFormatException : null – LPB
NumberFormatException : "Throw to 응용 프로그램이 문자열을 숫자 형식 중 하나로 변환하려고 시도했지만 문자열에 적절한 형식이 없다는 것을 나타냅니다. " sittingPlace에 어떤 값을 지정 하시겠습니까? –