I have a
servlet which receives input from a form, processes the data and sends response to a
JSP.
public class A extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException
{
String name =req.getParameter("name");
String city = req.getParameter("city");
String country = req.getParameter("country");
welcome.jsp? inname= name& incity=city & incountry=country;
}
}
I want to pass the 3 strings to a JSP welcome.jsp.
<%
String jspName = request.getParameter("inname");
String jspCity = request.getParameter("incity");
out.println("Welcome "+ jspName);
out.println("You live in "+ jspCity);
%>
Is the abpve correct in the servlet and jsp?