我的JAVA学习笔记(记下一些容易忘记的知识点)持续更新

来源:互联网 发布:淘宝手机排名 编辑:程序博客网 时间:2024/04/19 05:24

1.spring单元测试用到的方法

//创建Spring容器对象

ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");

 //查找到它创建的Bean

HelloSpring hs = (HelloSpring)ac.getBean("helloSpring");

 

2.Struts2 result的url传多个值

<result name="success" >test.jsp?id=100&amp;msg=${msg}</result>

 

3.jdbc连接oracle数据库

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","admin");

 

4.&lt和&gt可以在网页内替换<和>标签 ,以避免javascript效果

 

 

曾经,彻夜不眠,敲代码,写程序,为了什么?兴趣爱好?头脑发热?为梦想而战?