2016/12/23EL即expressionlanguage(表达式语言)目的:为了使jsp下起来更加简单语法:${xx xxxxx}${myname[my-name]}(只能在jsp里面写)导包:jsp/jstl/core例子:${se ssionScope.user.sex}从session的范围中取得用户的性别,Jspscriptlet里面是:user user=session.getAttribute(“user”)Stringsex=user.GetSex();forEach>Jstl(jspStandardTagLibrary,jsp标准标签库)是不断完 善的开放源代码的jsp标签库,使用jstl必须将jstl.jar文件放到classpath中分页:IntpageSize= n;当前的记录页数乱码处理方式:第一种:<%@pagecontentType=“text/htm;charset=utf-8 ”%>第二种:(响应编码类型)Response。SetCharacterEncoding(“utf-8”)第三种:NewStr ing(request.getParameter(“name”).getBytes(“ISO8859_1”),”utf-8”)第四 种:修改tomcat的server.Xml第五种(过滤器)配置wxb.xmlname>SetCharacterEncodinglass>SetCharacterEncodingFilter< filter-name>SetCharacterEncodingl-pattern>(创建class) |
|