摘要:
Struts2中Action接收参数的方法主要有以下三种: 1.使用Action的属性接收参数(最原始的方式): a.定义:在Action类中定义属性,创建get和set方法; b.接收:通过属性接收参数,如:userName; c.发送:使用属性名传递参数,如:user1!add?userName=jim; 2.使用DomainModel接收参数: a.定义:定义Model类,在Action中定义Model类的对象(不需要new),创建该对象的get和set方法; b.接收:通过对象的属性接收参数,如:user.getUserName(); c.发送:使用对象的属性传递参数,如:... 阅读全文
摘要:
Java代码 publicclassTryDotRegEx{ publicstaticvoidmain(String[]args){ //TODOAuto-generatedmethodstub Stringstr="111.3.22.11"; str=str.replaceAll("(^|\\.)(\\d)(\\.|$)","$100$2$3"); str=str.replaceAll("(^|\\.)(\\d{2})(\\.|$)","$10$2$3"); str=str.replaceAl 阅读全文