javaweb总结:
web前端:
html
基本标签:
div
img
a
ulli
表单标签:
form
属性action method name
input
属性:
代表输入框:text,password
代表选择:radion,checkbox
代表按钮:button,submit,reset,image
特殊的:hidden,file
select:option
textarea
css
选择器:
基本选择器
id选择器:#id
类选择器:.class
元素选择器:html标签名称
属性选择器
基本选择器[属性=‘属性值’]
层级选择器
属性和属性值:
color
font-size
backgroud
display
float
盒子模型
margin
padding
border
js
ECMAscript
基本语法
数据类型 var
语句 if else for while
函数
普通函数 function函数名(参数)函数体{}
匿名函数 function (参数)(函数体)
事件
onclick
onsubmit
onchange
onload
onfocus
onblur
onkeyup
onkeydown
onmouseover
onmouseout
js的内置对象
Date---var date=new Date();
String
BOM
window
弹框的方法
alert
confirm
prompt
定时器
setinterval(funcation,毫秒值)---clearinterval()
setTimeout
全局函数
eval()encoderURl()
location
DOM(dom树)主要功能通过js的api去获得标签元素和操作标签元素
document.getElementById()
getElementsByTagName()
getElementsByName()
getAttribute()
appendChid()
Jqery
选择器:
基本选择器
id
class
元素
层级选择器
父元素 子元素 (后代选择器)
父元素>子元素 (儿子选择器)
属性选择器
基本选择器[属性值=‘属性值’]
表单属性过滤选择器:selected checked
jquery的Dom操作
html()或标签体的内容
val()获得val的值
css()获得css的属性值
attr(),prop()
each()
append()appendTo() before()
ajax
js原声的ajax---通过本地浏览器中的ajax引擎
jquery的ajax
$.post(url,data,function(){},type)
$get()
$.ajax({})
bootstrap
1.导入jquery,bootstrap,js,bootstrap.css
2.使用阑珊系统
3.bootstrap的响应式
web服务端
tomcat服务器
servlet
生命周期
创建;默认第一次访问该servlet --init(ServletConfig) 的时候创建
何时销毁:服务器关闭---destory()
request
获得请求行
getMthod
getContextPath
获得请求头
getHeader(name)
获得请求体
getParameter/getParameterMap
转发和域对象
request.getRequesDispather(url).forward()
setAttribute/getAttribute
response
设置响应式:setstatus
设置相应头:setHeard(name.value)
设置相应头
getWriter().write()
getOutputStream().write()
会话技术
Cookie
怎样向客户端设置cookie
Cookiecook = new Cookie(name,value)
持久话时间:cookie.setMaxAge()
携带路径:默认的路径是当前资源产生下的所有资源都携带,其他不携带
自己设置路径:cookie.setPath(/)
如何得到客户端的cookie
Cookie[]cookies=request.cookies()
cookie.getName()
cookie.getValue()
session
session的生命周期
创建:request.getSession()
销毁:过期(默认30分钟,在Context配置),手动销毁,session.invalidate,服务器关闭
session的域:
一次会话
jsp/el/jstl
jsp
脚本和注释
指令
page(动态包含)
include(静态包含)
taglib
内置对象
request
response
pageContext
session
applicate
page
out
config
exception
jsp标签
<jsp:includepage=""/>动态包含
el
获得域中的数据${}
有11个内置对象
可以进行运算操作
jstl
<c:if>
<c:foreachitems=”“ var="">
数据库:
sql分类:
DDL(数据库的定义):定义数据库
定义数据表----创建表的语句
DML(数据库的操作):
insert
insertinto user values(?,?,?);
delete
deletfrom user where name =?
update
update user set name=? where id=?
DQL(数据库的查询):
单表查询:
select* from user
selectname,age from user
selectsalary+5000 as new salary from user
selectcount(*)/sum(salary)/avg(salary) from user
select* from user where name is null
select* from user order by age desc,salary asc
selectdistinct name from user
selectsum(salary) from user groupName havingsum(salary)>1000
select* from user where name like ___ (一个下划线代表一个)/ %(任意)
select* from user like limit 0,5
select* from user where ,group by having,order by ,limit
多表查询:
表与表的关系设计原则
:一对一
:一对多
:多对多
查询语句
:内连接:select 表,表,表 where 条件
:左外:left join ..on
: 右外:right join...on
子查询的结果单行单列:select * from a where id in(select id from b where)
多行单列的子查询
多行多子查询
DCL(数据库的控制):
事务:
redis:(nosql数据库)(安装与启动)
redis的操作 Jedis jdis = newJedis(host,port)
JedisPool pool = newJedisPool(JedisConfig,host,port)
数据结构的操作5种:
多数据库,广播域订阅、持久话