1. 通过范型反射,取得子类中定义的entityClass.
this.entityClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];  2016-03-12 10:59:14

2. 得到URL的一种方式

String location = "classpath:cache/ehcache.xml";
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
Resource resource = resolver.getResource(location);
URL url = resource.getURL();

3. 流变字符串

import common.io.Streams;
String json = Streams.asString(request.getInputStream(), "UTF-8");

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
  • 2021-04-16
  • 2022-01-20
  • 2021-11-21
  • 2022-12-23
猜你喜欢
  • 2021-07-21
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
相关资源
相似解决方案