Presentation is loading. Please wait.

Presentation is loading. Please wait.

In Class Assg 2 - solution

Similar presentations


Presentation on theme: "In Class Assg 2 - solution"— Presentation transcript:

1 In Class Assg 2 - solution
Create a servlet called FuncServlet that is Called by Functions2.html Based on the selected function, redirects to either Cust.html or Sale.html Functions .html FuncServlet User Cust or Sale.html Don’t forget to change Functions2.html to invoke FuncServlet Chapter 8 © copyright Janson Industries 2011

2 © copyright Janson Industries 2011
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class FuncServlet extends HttpServlet { private static final long serialVersionUID = 1L; public FuncServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String FuncDD = request.getParameter("FuncDD"); if (FuncDD.equals("Customer")) { response.sendRedirect("Cust.html"); } else { response.sendRedirect("Sale.html"); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Chapter 8 © copyright Janson Industries 2011


Download ppt "In Class Assg 2 - solution"

Similar presentations


Ads by Google