我有一個對jsp頁面的GET請求。 JSP頁面的內容是如下:HTTP GET請求返回空格
<%@page language="java" import="java.sql.*,java.util.*" %>
<%@page import="javax.servlet.*, java.util.*,java.util.Date, java.text.*"%>
<jsp:useBean id="workM" class="test.concept" scope="page" />
<jsp:useBean id="userM" class="test.learning" scope="page" />
<jsp:useBean id="checkM" class="test.check" scope="session" />
<%
if (checkM.checkUser()) //For auto loading user's most used search engine. Note: Only if the difference between top two is very big
{
String user_id = checkM.getUser();
ResultSet RS6=workM.executeQuery("select top 1 searchEngineUsed,count(*) as number from UserSearchEngineSearch where user_id='"+user_id+"' group by searchEngineUsed order by number desc;");
while (RS6.next())
{
String name = RS6.getString("searchEngineUsed");
if (name.equals("google"))
{
out.print("1");
}
else if (name.equals("yahoo"))
{
out.print("2");
}
else if (name.equals("bing"))
{
out.print("3");
}
else if (name.equals("baidu"))
{
out.print("4");
}
else if (name.equals("yandex"))
{
out.print("5");
}
else if (name.equals("askcom"))
{
out.print("6");
}
else //by default just display google
{
out.print("1");
}
}
}
else //user not login
{
out.print("1");
}
%>
然而,GET網頁的內容是包含5行新行,接着進行4(意思是「百度」被選擇)。如何刪除5行新行間距?
啊,這是我出錯的地方..謝謝男人..不知道有6個換行符。 – Ferrino