以jhtml结尾的文件

用一个实例来说明,直接上代码。

LogonAction.java(一个servlet)

package com.lz.web.action;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class LogonAction extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
   
    public LogonAction() {
        super();
        
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		System.out.println("#####################get######################");
		request.getRequestDispatcher("/result.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		doGet(request, response);
	}

}

  web.xml文件配置


  	login
  	com.lz.web.action.LogonAction
  
  
  
  	login
  	/login.jhtml
  

  index.jsp

  result.jsp




Insert title here


   

结果页面

  可以实现。

转载于:https://www.cnblogs.com/lzeffort/p/4816649.html

你可能感兴趣的:(以jhtml结尾的文件)