上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
  2012年4月2日
摘要: px = density * dip + 0.5 阅读全文
posted @ 2012-04-02 15:14 leaving 阅读(130) 评论(0) 推荐(0)
摘要: 1. 实现UncaughtExceptionHandler接口:uncaughtException方法2. 继承Application,在OnCreate方法中使用Thread.setDefaultUncaughtExceptionHandler注册异常处理类 阅读全文
posted @ 2012-04-02 15:12 leaving 阅读(293) 评论(0) 推荐(0)
摘要: 1. 为了避免出现异常: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification..... 更新数据之前getListView().setVisibility(View.GONE),然后mAllAdapter.notifyDataSetChanged(),更新之后getListView().setVisibility(View.GONE),可以避免 阅读全文
posted @ 2012-04-02 14:10 leaving 阅读(192) 评论(0) 推荐(0)
  2012年3月29日
摘要: 1、抽象工厂模式(Abstract Factory):提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。2、适配器模式(Adapter):将一个类的接口转换成客户希望的另外一个接口。适配器模式使得原本由于接口不兼容而不能一起工作的类可以一起工作。3、桥梁模式(Bridge):将抽象部分与它的实现部分分离,使它们都可以独立地变化。4、建造模式(Builder):将一个复杂对象的构建与它的表示分离,使同样的构建过程可以创建不同的表示。5、责任链模式(Chain of Responsibility):为解除请求的发送者和接收者之间耦合,而使多个对象都有机会处理这个请求。将这些对象连 阅读全文
posted @ 2012-03-29 15:27 leaving 阅读(295) 评论(0) 推荐(0)
摘要: // for 4.0 pad, height calculation of extremely large screen // todo: fixed 3.0 3.1 3.2 support. Class clazz = null; try { clazz = Class.forName("android.view.Display"); Method method = clazz.getMethod("getRawHeight"); if (method != null) { ... 阅读全文
posted @ 2012-03-29 14:10 leaving 阅读(325) 评论(0) 推荐(0)
  2012年3月26日
摘要: 1.@Controller level Annotate a separate method in your @Controller as a @ExceptionHandler simply catch the Exception yourself in your handler method2. DispatcherServlet level Rely on the DefaultHandlerExceptionResolver:Maps common exceptions to appropriate status codes Supplement with your own c... 阅读全文
posted @ 2012-03-26 23:45 leaving 阅读(255) 评论(0) 推荐(0)
摘要: Get a new form Export a JavaBean to the view as the “form bean” or “form backing object” Can pre-populate form using initial bean property values or client queryparameters Convenient form tags/macros exist to simplify rendering form fields1.Invoked on every request@ModelAttribute public void a... 阅读全文
posted @ 2012-03-26 23:42 leaving 阅读(795) 评论(0) 推荐(0)
摘要: Trigger validation by marking a JavaBean parameter as @Valid The JavaBean will be passed to a Validator for validation The JavaBean will be passed to a Validator for validationBinding and validation errors can be trapped and introspected bydeclaring a BindingResult parameter Must follow the JavaB... 阅读全文
posted @ 2012-03-26 23:34 leaving 阅读(923) 评论(0) 推荐(0)
摘要: Type conversion happens automaticallyA common “ConversionService” underpins the places where typeconversion is required Always used with @RequestParam, JavaBean, @PathVariable, and@RequestHeader, and @CookieValue HttpMessageConverter may use when reading and writing objects:for @RequestBody, @Resp.. 阅读全文
posted @ 2012-03-26 23:30 leaving 阅读(1007) 评论(0) 推荐(0)
摘要: 1.Two different systems exist for rendering responses ViewResolver + View HttpMessageConverter2.Triggered in different ways Render a view by returning a String Write a message by returning a @ResponseBody Object or ResponseEntity3.Which one do I use? Use views to generate documents for display ... 阅读全文
posted @ 2012-03-26 23:17 leaving 阅读(236) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页