Struts入门的helloworld
1.导包:将Struts2的sturts-blank.war进行解压。在lib包中把jar找到
2.创建一个普通的Java类helloworldAction,写一个返回值为string的方法,方法名字自定义
public class HelloWorldAction{
public Sring hehe(){
System.out.println(11111);
return " success";
}
}
3.在src根目录下创建一个名字为struts.xml的文件
4.在webcontent目录下创建一个名为hehe的Jsp文件
5.web.xml中配置Struts的核心过滤器
6.浏览器中访问时输入http://localhost:8080/struts2Test/hehe/heheAction