request.setCharacterEncoding 和常用内置对象 跳转

时间:2022-01-06 19:40:00

1、直接转码

new String(name.getBytes("ISO8859_1"),"GBK")

2、

request.setCharactorEncoding("GBK")

3、jsp常用内置对象

request

response

page

pageContext

session

appliaction

exception

out

config   web.xml 配置

4、常用方法

5、跳转

<jsp:forward page="/servlet/test.jsp">   jsp to servlet

getServletConfig().getServletContext()..getRequestDispcher("/servlet/test.jsp").forward(request,response) servlet to jsp

response.sendRedirect("/servlet/test.jsp");