1.index.jsp
訪問屬性 tags
/tags.jsp
package com.wxh.action; import com.opensymphony.xwork2.ActionSupport; public class TagsAction extends ActionSupport{ private String password; private String username; public TagsAction(){ } public String execute(){ this.addFieldError("fielderror.test","wrong!"); return SUCCESS; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } }
5.Dog.java
package com.wxh.action; public class Dog { public Dog(){ } public Dog(String anme){ super(); this.name=name; } private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public String toString(){ return "dog:"+name; } }
6.S.java
package com.wxh.action; public class S { public static String STR="STATIC STRING"; public static String s(){ return "static method"; } }
package com.wxh.action; public class User { private int age; public User(){ System.out.println("user.constructor!"); } public User(int age){ super(); this.age=age; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String toString(){ return "user"+age; } }
include1.html
中文