首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 将一个页面的HTML到JavaBean对象

将一个页面的HTML到JavaBean对象

  • 资源大小:11.28 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签:

资 源 简 介

in many case ,we have to process some infomation based on html pages. In order to hide the verbose regular match and convertion,we can use the component ,and just only pay attation on our business point. simple usage ``` public class ClientTest extends TestCase{ public void testParse() throws IOException{ String resource = "h2j_config.xml"; Reader reader = Resources.getResourceAsReader(resource); Html2JavabeanClient client = Html2JavabeanClientBuilder.buildSqlMapClient(reader); StringWriter sw = new StringWriter(); InputStream is = Resources.getResourceAsStream("oneuser.html"); BufferedReader reader1 = new BufferedReader(new InputStreamReader(is)); String temp = null; while((temp = reader1.readLine()) != null){ sw.write(temp); } reader1.close(); User u = (User)client.parseForObject("user1", sw.getBuffer().toString()); System.out.println(u.getName() + &qu

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP