我的测试程序如下。
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;import cn.com.froad.epos.system.*;
/**
* 说明:当一位用户进行登录时认证其浏览器是不是符合条件,Cookie,版本
*/
public class AuthVisitor extends HttpServlet {
public void init(ServletConfig sc) throws ServletException{
super.init(sc);
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
String LogName = request.getParameter("LogName");
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=GBK");
out.println("<%@ page language=java pageEncoding=GBK contentType=\"text/html;charset=GBK\" %>"); out.println("<html>");
out.println("<meta Http-equiv=Content-Type content=\"text/html;charset=GBK\">");
out.println("<head>");
out.println(FLATE.JS_HEAD);
out.println("alert(\"我的朋友vvvvvvvfghdfghvvvvvvv\")");
out.println(FLATE.JS_END);
out.println("</body>");
out.println("</html>");
}
}
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;import cn.com.froad.epos.system.*;
/**
* 说明:当一位用户进行登录时认证其浏览器是不是符合条件,Cookie,版本
*/
public class AuthVisitor extends HttpServlet {
public void init(ServletConfig sc) throws ServletException{
super.init(sc);
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
String LogName = request.getParameter("LogName");
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=GBK");
out.println("<%@ page language=java pageEncoding=GBK contentType=\"text/html;charset=GBK\" %>"); out.println("<html>");
out.println("<meta Http-equiv=Content-Type content=\"text/html;charset=GBK\">");
out.println("<head>");
out.println(FLATE.JS_HEAD);
out.println("alert(\"我的朋友vvvvvvvfghdfghvvvvvvv\")");
out.println(FLATE.JS_END);
out.println("</body>");
out.println("</html>");
}
}
解决方案 »
- ssh整合了JBPM4.4,出现了这个错误,不知道怎么解决来大神解决
- jsp中的数组如何传到action
- 求一个聊天室,最好有详细的介绍。要流程介绍,谢谢了
- mysql问题.100分求助..谢谢
- 日期型可不可以转化为Calendar型,比如:Fri Sep 16 00:00:00 CST 2005 可不可以转化Calendar型,
- 如何判断一个链接,是从页面里直接鼠标双击弹出的窗口;还是直接复制文字的链接放到IE浏览器地址栏里
- 怎样在JSP中使用Bean?
- 求救
- 哪位大侠知道---如何得到一个网页是由哪个网页提交或是跳转过来的?在线等!
- java异常信息代表什么意义, 哪有说明?
- window.location跳转到另外的htm,为什么在个别pc上不好用呢?
- 如何学习struts
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=GB2312");
String LogName = request.getParameter("LogName");
out.println("<%@ page language=java contentType=\"text/html;charset=GB2312\" %>");
throws ServletException, IOException {
// String LogName = request.getParameter("LogName");
response.setContentType("text/html;charset=GBK");
PrintWriter out = response.getWriter();
out.println("<%@ page language=java pageEncoding=GBK contentType=\"text/html;charset=GBK\" %>"); out.println("<html>");
out.println("<meta Http-equiv=Content-Type content=\"text/html;charset=GBK\">");
out.println("<head>");
out.println("</body>");
out.println("alert(\"我的朋友vvvvvvvfghdfghvvvvvvv\")");
out.println("</body>");
out.println("</html>");
out.flush();
out.close();
}这是好的,我测试了,
城市劣人 http://www.5ai7.net/
JDK1.4.2_12
Eclipse3.0.2
Tomecat5.0.28
有其它地方的问题没有啊,各位请看一下。