A
A
advirtys2016-04-04 08:10:00
Java
advirtys, 2016-04-04 08:10:00

How to get data from a form?

Hey!!!
I can not pull out the parameters from the form.
request.getParameter("title_ru_RU"); does not work. how to get data out of a form?

<form action="${pageContext.request.contextPath}/do/add-product" method="post" enctype="multipart/form-data">
                <p>Название на русском:</p>
                <input size="50" type="text" name="title_ru_RU" />
                <p>Название на англиском:</p>
                <input size="50" type="text" name="title_en_US" />
                <p>Описание на русском:</p>
                <textarea rows="10" cols="50" name="description_ru_RU"></textarea>
                <p>Описание на англиском:</p>
                <textarea rows="10" cols="50" name="description_en_US"></textarea>
                <p>Тип продукта:</p>
                <select name="type">
                    <option value="PIZZA">${pizza_title}</option>
                    <option value="SUSHI">${sushi_title}</option>
                    <option value="DRINK">${drinks_title}</option>
                </select>
                <p>Цена:</p>
                <input type="number" name="price" min="1" />
                <p>Картинка:</p>
                <input type="file" name="img" />
                <p><br>
                <input class="product_btn" type="submit" value="Добавить"></p>
            </form>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evhen, 2016-04-04
@EugeneP2

  1. To do this, enctype="multipart/form-data"use the Commons FileUpload library . There is documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question