Struts2之helloword实例
1.helloworld.jsp [code="jsp"]<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> helloworld页面 helloworld,struts2! [/code] 2.web.xml [code="xml"] struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /* [/code] 3.lib下的jar包 commons-fileupload-1.2.1.jar commons-logging.jar freemarker-2.3.15.jar ognl-2.7.3.jar struts2-core-2.1.8.1.jar xwork-core-2.1.6.jar 4.Action类 [code="java"]package com.hitsoft.action; public class HelloWorld{ public String execute() throws Exception { return "success"; } }[/code] 5.struts.xml [code="xml"] /hellworld.jsp [/code] 6.访问地址:http://localhost:8080/struts2/helloworld.action