`
文章列表
运用部门与员工之间的关系 部门(Department)中有三属性,设置get和set方法         private int did; private String dname; private Set<Employee> emps; 员工(Employee)也有三个属性,分别生成get和set方法 private int eid; private String ename; private Department depart; 部门类的xml文件映射(Department.hbm.xml) <class name="com.cao ...
jsp页面(dynaform.jsp) <h1>测试动态actionform</h1><hr> <form action="dyna.do" method="post"> <input type="text" name="name" /><br/> <input type="text" name="age" /><br/> <in ...
一、beanwrite标签 action中在request范围中设置了以下属性 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // TODO Auto-generated method stub request.setAttribute("name& ...
jsp表单页面(upload.jsp) <!-- form表单必须是post提交,且要配置enctype="multipart/form-data" --> <form action="upload.do" method="post" enctype="multipart/form-data"> 文件路径:<input type="file" name= ...
import java.lang.reflect.Array; public class TestArray { public static void main(String[] args) { String [] strs = new String[]{"c","p","x"}; //如果此类是数组,则返回表示此类组件类型的 Class Class<?> st = strs.getClass().getComponentType(); //打印数组的定义类型 System.out.p ...
演示所需要的简单类 class AA{ public AA(String name){ System.out.println(name); } public AA(int id,String name){ System.out.println(id+" "+name); } public int id; public String name; public int getId() { return id; } public void setId(int id) { this.i ...
jsp请求表单页面: <%@taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %> <form action="i18nlogin.do" method="post"> <bean:message key="user.name" /><input type="text" name="username"/><br/ ...

JAVA国际化

    博客分类:
  • java
需要的配置文件(配置文件的basename是message): message.properties message_en_US.properties message_zh_CN.properties java实现类: import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; public class JavaI18n { public static void main(String[] args) { Locale defaultL ...
Global site tag (gtag.js) - Google Analytics