在我的应用程序中有这样的菜单栏,
所以当我点击运动按钮时,我想调用“getlink”servlet 并提交值“sport”。我尝试了几种方法,但没有一个是正确的。
这是我的 servlet
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String vdo_type = request.getParameter("Science");
int page = 1;
int recordsPerPage = 10;
if(request.getParameter("page") != null)
page = Integer.parseInt(request.getParameter("page"));
// EmployeeDAO dao = new EmployeeDAO();
Getlink_Dao be=new Getlink_Dao();
List<Utube_to> list = be.getRecentAdd((page-1)*recordsPerPage,
recordsPerPage,vdo_type);
int noOfRecords = be.getNoOfRecords();
int noOfPages = (int) Math.ceil(noOfRecords * 1.0 / recordsPerPage);
request.setAttribute("allvdos", list);
request.setAttribute("noOfPages", noOfPages);
request.setAttribute("currentPage", page);
RequestDispatcher view = request.getRequestDispatcher("Home.jsp");
view.forward(request, response);
}