当前位置: 技术问答>java相关
大家看看,很简单的,就是初学者无知的表现
来源: 互联网 发布时间:2015-10-19
本文导语: 我编译下面的java程序,出现很多错误 import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class SpeakBean { String allSpeaking= new String(""); String CookieName = new String(""); ...
我编译下面的java程序,出现很多错误
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SpeakBean {
String allSpeaking= new String("");
String CookieName = new String("");
public SpeakBean() {
}
public void setChat(String name,String speaking,
HttpServletResponse response) {
if (!name.equals("") && !speaking.equals(""))
allSpeaking=allSpeaking+name+"说:"+speaking+";
Cookie cookie = new Cookie("name",name);
response.addCookie(cookie);
}
public String getCookieName(HttpServletRequest request) {
Cookie[] cookies = request.getCookies();
if (cookies.length > 0)
{for (int i = 0; i
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SpeakBean {
String allSpeaking= new String("");
String CookieName = new String("");
public SpeakBean() {
}
public void setChat(String name,String speaking,
HttpServletResponse response) {
if (!name.equals("") && !speaking.equals(""))
allSpeaking=allSpeaking+name+"说:"+speaking+";
Cookie cookie = new Cookie("name",name);
response.addCookie(cookie);
}
public String getCookieName(HttpServletRequest request) {
Cookie[] cookies = request.getCookies();
if (cookies.length > 0)
{for (int i = 0; i