T
T
Timofey Lanevich2018-10-20 23:55:54
Java
Timofey Lanevich, 2018-10-20 23:55:54

Not transmitting data via post?

I can't transfer data via Post, Get requests all work. The project worked, but for some reason it stopped...

Method:

@Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String charsetName = "UTF-8";
        String charsetNameIso = "ISO-8859-1";

        String title = req.getParameter("title");
        String preview = req.getParameter("preview");
        String textBody = req.getParameter("textbody");

        System.out.println(title);
        System.out.println(preview);
        System.out.println(textBody);

        doGet(req, resp);
    }


Request:
<form method="post">
        <label>Title: <input type="text" name="title"><br></label>
        <label>Preview: <input name="preview"><br></label>
        <label>Text body: <input name="textbody"><br></label>

        <button type="submit" name="submit_text">Submit</button><br>
    </form>


Link to the project
Thank you for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
roswell, 2018-10-21
@Timak31

protected void doPost
form method="get"
"You, holy father, either take off your cross or put on your pants..."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question