Estou iniciando em JSP e criei esta pagina para teste. Mas está apresentando erro na seguinte linha:
Cookie cookieJSP = new Cookie(cookieName, email);
Com a seguinte mensagem:
Multiple annotations found at this line:
- Cookie cannot be resolved to a type
Estou utilizando o eclipse.
<%--
Document : teste
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
String email = request.getParameter("email");
String cookieName = "cookieRicardo";
Cookie cookieJSP = new Cookie(cookieName, email);
cookieJSP.setMaxAge(7 * 24 * 60 * 60);
cookieJSP.setVersion(0);
cookieJSP.setSecure(false);
cookieJSP.setComment("Email");
response.addCookie(cookieJSP);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSP Page</title>
</head>
<body>
<h1>Armazena o Cookie</h1>
<a href='readcookie.jsp'>Link para página que lê o cookie</a>
</body>
</html>