2019-08-13 java学习 笔记

1、从跳转页面返回又不想用servlet,并且保留之前搜索的记录~可以用这个方法
<a href="#" onclick="history.back(-1)">返回</a>
里面的 onclick="history.back(-1)"

2、从session域 获取值 ${sessionScope.user.username}

3、JDBC操作数据库的基本步骤:
1)加载(注册)数据库驱动(到JVM)。
2)建立(获取)数据库连接。
3)创建(获取)数据库操作对象。
4)定义操作的SQL语句。
5)执行数据库操作。
6)获取并操作结果集。
7)关闭对象,回收数据库资源(关闭结果集-->关闭数据库操作对象-->关闭连接)。

4.ajax 使用方法

BillResponseResult billResponseResult = new BillResponseResult();
billResponseResult.setMessage("true");
String result_json_string = JSON.toJSONString(billResponseResult);
response.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter pw = response.getWriter();
pw.print(result_json_string);
pw.flush();
pw.close();

5.BigDecimal
商城计算价格的一个类

6.实体类要实现序列化接口
implements Serializable

7.性能测试软件
apache jmeter

8.spring xml 配置头内容

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

 <!-- 在配置文件中,登记注册我们写的bean -->
 <bean id="userServiceIfac" class="com.neude.spring88.service.UserServiceImpl"></bean>
 <bean id="userServlet" class="com.neude.spring88.controller.UserServlet"
 
    lazy-init = "false"
    init-method = "init"
    destroy-method = "destroy"
    scope = "prototype"
 >
      <property name="userService" ref="userServiceIfac"></property>

</bean>

</beans>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容