<%@page contentType="text/html;charset=GBK"%>与<meta content="text/html; charset=GBK">区别

<%@page contentType="text/html;charset=gbk"%>与<meta http-equiv="Content-Type" content="text/html; charset=GBK">区别  


<%@page contentType="text/html;charset=gbk"%>

是在服务端(tomcat)起作用,是告诉应用服务器采用何种编码输出JSP文件流;


<meta http-equiv="Content-Type" content="text/html; charset=GBK">

后一个是在客户端(浏览器)起作用,是告诉浏览器是采用何种编码方式显示HTML页面。


前者由jsp引擎对输出内容进行编码, 后者将由IE对页面内容进行编码,他们负责的编码对象不同。
所以,我们有些时候会出现页面上的一些东西是正常的,而out.print...出来的东西是乱码,就是这个原因。
<meta http-equiv="expires" content="0"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="content-type" content="text/html; charset=GBK"> <%@ include file="connect.jsp"%> <%@ page language="java" contentType="text/html" %> <%//@ page import="java.sql.*" %> <%//@ page import="com.sap.mw.jco.*" %> <html> <head> </head> <body> <% String app = "DELIVERY"; String session_id=request.getParameter("sessionId"); String n = new String(); Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); Connection connection = null; PreparedStatement ps = null; ResultSet rs = null; try{ connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://ap12hr1:1433;DatabaseName=SSO", "SSO", "ssobuilder"); ps = connection.prepareStatement("SELECT * FROM SSO.USER_LOGIN WHERE SESSION_ID = ?"); ps.setString(1, session_id); rs = ps.executeQuery(); if(rs.next()){ n = rs.getString("USER_LOGIN_ID"); if(rs.next()){ // multi session id %> <p align=center>Error!, please login again. <a href="http://ap12hr1:7070/sso/control/main">Back</a></p> <% }else{ IFunctionTemplate ftemplate = repository.getFunctionTemplate("Z_LB_GETUSERAU"); JCO.Function function = new JCO.Function(ftemplate); JCO.Client client = JCO.getClient(SID); JCO.ParameterList input = function.getImportParameterList(); input.setValue(n, "I_USERID" ); input.setValue(app, "I_APP"); client.execute(function); JCO.Table userrole = function.getTableParameterList().getTable("EUSERAU"); if (userrole.getNumRows() > 0) { //Angela Zhang 20050324 ----------- String user = n; String role = userrole.getString("ROLE"); String ipaddress=request.getRemoteAddr(); com.connectpackage.LogonBean myLogon = new com.connectpackage.LogonBean(); myLogon.setUserid(user); myLogon.setApp(app); myLogon.setRole(role); myLogon.setIpaddress(ipaddress); if (myLogon.LogonLog().equals("F")) response.sendRedirect("http://"+session.getAttribute("app_server")+"/info_page/logon_error.htm"); // --------------------------------- session.setAttribute("role_delivery",userrole.getString("ROLE")); session.setAttribute("user",n); session.setAttribute("pass","T"); response.sendRedirect("delivery_function_select.jsp"); %> <%} else { %> <p align=center>You have no authorization. <a href="http://ap12hr1:7070/sso/control/main">Back</a></p> <% }//if // Release the client into the pool JCO.releaseClient(client); JCO.removeClientPool(SID); } }else{ //no user_login_id found %> <p align=center>User or password error! Please login again. <a href="http://ap12hr1:7070/sso/control/main">Back</a></p> <% } }catch(Exception e){ System.out.println(e); }finally{ if(rs != null) rs.close(); if(ps != null) ps.close(); if(connection != null) connection.close(); } %> </body> </html> 我要通过工具连接 怎么连 有用户密码吗 sqlservrt
最新发布
08-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值