public class User { //姓名 private String name; //年龄 private Integer age; //性别 private Integer sex; //地址 private String address; //赏金 private BigDecimal money;public User(String name, Integer age, Integer sex, String address,BigDecimal money) { this.name = name; this.age = age;...
public void testHandleStreamAfterClosed() { List<String> ids = Arrays.asList("205", "10",...
//1.接收文件名参数String filename=request.getParameter("filename");String mime=this.getServletContext().getMimeType(filename);response.setContentType(mime);response.setHeader("Content-Disposition","attachment;filename="+filename);//2.获取文件的绝对路径String path=this.getServletContext().getRealPat...
public class EnumTest { public static void main(String[] args) { WeekDay day = WeekDay.FRI; System.out.println(day); //结果:FRI System.out.println(day.name()); //结果:FRI System.out.println(day.ordinal()); //结果:5 System.out.println(WeekDay. valueOf("SUN")); //结果:SUN ...
string wildcardname = “%smi%”; list<name> names = mapper.selectlike(wildcardname); select * from foo where bar like #{value} 1. 2. 3. 4. 5. 6. 7. 第2种:在sql语句中拼接通配符,会引起sql注入 string wildcardname = “smi”; list<name> names =mapper.selectlike(wildcardname)...
age; } public static void main(String[] args) { Name[] names = new Name[]...
Context.removeAttribute(String name); 只要是一个域对象上,基本上里面都有这几个方法 response response响应过程 在去发送一个请求时, 会找到tomcat引擎 引擎会找到对应的web应用 并且会创建request对象和response对象 找到应用后, 会执行应用的web.xml再去根据url-patten的内容创建Servlet对象 ...
2.11.3. String与StringBuilder的相互转换 String object = Object.toString()方法//StringBuilder转换为String StringBuilder Object = new StringBuilder(object)//String转换为StringBuilder 1. 2. 3. 2.12.集合 结构 集合={Collection(单列)[List(可重复)—ArrayList、LinkedList;set(不可重复)—HashSet、TreeSet];...
生成拼接字符串 将一个List或者数组中的值拼接到一个字符串里并以逗号分隔开,这个场景相信大家都不陌生...