Wyswietlanie na stronie randomowe dane Java z uzyciem JSP/Servlety i TomCata

0

Mam mojego Servlet'a

@WebServlet(name = "FetchServlet")
public class FetchServlet extends HttpServlet {
 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setAttribute("id","asddas");
        request.setAttribute("data","asddas");
        request.setAttribute("primes","asddas");
    }

mam moja klase JSP

<%@ page language="java" contentType="text/html; ISO-8859-1" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>Hello servlet</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form method="post">
    Id: ${id}
    Data: ${data}
    Primes: ${primes}
    <input type="submit" value="Fetch">
</form>
</body>
</html>

a to jest mój web.xml

    <servlet>
        <servlet-name>fetch</servlet-name>
        <servlet-class>FetchServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>fetch</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

bardzo proszę o pomoc- jak ja mam ustawić w servletcie by na te 3 pola wstawial jakies 3 dane ?

0

probowalem doGet/doPost; rozne znaczniki w html

<input> i pare innych; jedyne co mi teraz wchodzi do glowy to ze web.xml nie laczy poprawnie tych dwóch plikow

1 użytkowników online, w tym zalogowanych: 0, gości: 1