11.struts

1.先添加一个struts2-core依赖和servlet-api依赖

2.web.xml




  Archetype Created Web Application
  
struts2
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

 
 
 struts2
 /*
 
3.struts.xml文件放在src文件下



	
	
	
	/hello.jsp
	
	
	

4.Action中含有execute方法注意格式

public class HelloAction {
	 public String execute(){
		 System.out.println("hello");
		 return "hello";
	 }
}

5.hello.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>




struts hello


世界 你好


6.test: localhost:8080/struts-web/hello



你可能感兴趣的:(struts,struts)