Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » POST Request ignoring submitted data
POST Request ignoring submitted data [message #1770633] Tue, 15 August 2017 10:12
Roparzh Hemon is currently offline Roparzh HemonFriend
Messages: 18
Registered: July 2017
Junior Member
I have a very basic Java EE project, consisting of one servlet and one
associated jsp file (their contents are below).

The problem I'm encountering is that, when in debugging mode I fill the fields in the form and
press the "Submit" button, I can see that the request.getParameterNames is empty, when it
should contain "left", "right", etc.

Any help appreciated.

Contents of file :

package com.miniCalculatrice.servlets;

import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

 * Servlet implementation class Main
public class Main extends HttpServlet {
	private static final long serialVersionUID = 1L;
     * @see HttpServlet#HttpServlet()
    public Main() {
        // TODO Auto-generated constructor stub

	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		forward(request, response);

	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Enumeration<String> enu=request.getParameterNames();
		boolean see=enu.hasMoreElements();
		for (; enu.hasMoreElements();) {
			   String elt=enu.nextElement();
		doGet(request, response);


Contents of main.jsp file :

<%@ page language="java" contentType="text/html; charset=UTF-8"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<form method="post" action="main" enctype="multipart/form-data">
            <input type="text" name="left" id="left" />
              <select multiple>
  								<option value="plus">+</option>
  								<option value="minus">-</option>
  								<option value="times">x</option>
  								<option value="divided">/</option>
            <input type="text" name="right" id="right" />
        <input type="submit" value="Calculer"/>

Also, the web.xml file of my project is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:jsp="" xsi:schemaLocation="" version="3.0">

Previous Topic:Wysiwyg editor for NEON
Next Topic:Neon JS Autocompletion
Goto Forum:

Current Time: Mon Sep 21 10:39:31 GMT 2020

Powered by FUDForum. Page generated in 0.02005 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top