我的代码中没这样的语句啊!源码如下,请指教:
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*,java.util.*" %>
<jsp:useBean id="joyrisingbean" scope="page" class="db.lxtconndb"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
request.getSession(true);//建立session
int month,day,hour,today,total,select;
String time;
String errmsg=request.getParameter("errmsg");
GregorianCalendar calendar;
calendar=new GregorianCalendar();
month=calendar.get(Calendar.MONTH)+1;
day=calendar.get(Calendar.DAY_OF_MONTH);
hour=calendar.get(Calendar.HOUR_OF_DAY);
time="m"+String.valueOf(month)+"d"+String.valueOf(day);//time的值形如time=m8d2,即8月2日
String sql="select * from counter where date='"+time+"'";
ResultSet rs=joyrisingbean.executeQuery(sql);
if(!rs.next())//数据库中无数据,表明使用者为当日的第一位访客
{sql="insert into counter(date,today,first,second,third,forth,,fifth,sixth)values('"+time+"',0,0,0,0,0,0,0)";
rs=joyrisingbean.executeQuery(sql);//在表中建立一笔该日新数据
}
sql="select * from counter where date='"+time+"'";
rs=joyrisingbean.executeQuery(sql);
today=rs.getInt(2);
select=(int)Math.floor(hour/4)+1;//计算使用者上网时段
sql="select * from total";
rs=joyrisingbean.executeQuery(sql);
total=rs.getInt(1);
if(session.isNew())//使用者为首次进入网页,累加人数
{
today++;
switch(select)
{case 1:
sql="update counter set today="+today+",first=first+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 2:
sql="update counter set today="+today+",second=second+1 where date='"+time+"'";
joyrisingbean.executeUpdate(sql);//???
break;
case 3:
sql="update counter set today="+today+",third=third+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 4:
sql="update counter set today="+today+",forth=forth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 5:
sql="update counter set today="+today+",fifth=fiftht+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 6:
sql="update counter set today="+today+",sixth=sixth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
}
total++;
sql="update total set total=total+1";
joyrisingbean.executeQuery(sql);
rs.close();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>人数浏览统计</title>
</head><body>
<%
//System.out.print("您的IP地址:"+request.getRemoteAddr());
String showcount=String.valueOf(total);
System.out.print("您是本站的第 ");
for(int i=0;i<showcount.length();i++)
System.out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
System.out.print("位访客<br>");
showcount=String.valueOf(today);
System.out.print("您是今天的第 ");
for(int i=0;i<showcount.length();i++)
System.out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
out.print("位访客<br>");
%>
<hr><form name="conuter" id="counter" action="search.jsp" method="post">
<table width="100%" border="1" align="center">
<tr>
<td><font color="#3333FF">上网人数统计查询:</font></td>
<td><select size="1" name="month">
<option selected="selected">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option>
<option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select>月</td>
<td><select size="1" name="day">
<option selected="selected">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option>
<option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option>
<option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option>
<option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select>日</td>
<td><input type="submit" name="send" value="查询" /></td>
</tr>
<tr>
<td colspan="4" align="center">
<a href="search.jsp?month=<%=month%>&today=<%=day%>">
<font size="3">查看今天各时段流量统计</font></a></td>
</tr>
</table>
</form>
<font color="#FF3366" size="4">
<%
if(errmsg!=null)
System.out.print(errmsg);
%>
</font>
</body>
</html>
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*,java.util.*" %>
<jsp:useBean id="joyrisingbean" scope="page" class="db.lxtconndb"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
request.getSession(true);//建立session
int month,day,hour,today,total,select;
String time;
String errmsg=request.getParameter("errmsg");
GregorianCalendar calendar;
calendar=new GregorianCalendar();
month=calendar.get(Calendar.MONTH)+1;
day=calendar.get(Calendar.DAY_OF_MONTH);
hour=calendar.get(Calendar.HOUR_OF_DAY);
time="m"+String.valueOf(month)+"d"+String.valueOf(day);//time的值形如time=m8d2,即8月2日
String sql="select * from counter where date='"+time+"'";
ResultSet rs=joyrisingbean.executeQuery(sql);
if(!rs.next())//数据库中无数据,表明使用者为当日的第一位访客
{sql="insert into counter(date,today,first,second,third,forth,,fifth,sixth)values('"+time+"',0,0,0,0,0,0,0)";
rs=joyrisingbean.executeQuery(sql);//在表中建立一笔该日新数据
}
sql="select * from counter where date='"+time+"'";
rs=joyrisingbean.executeQuery(sql);
today=rs.getInt(2);
select=(int)Math.floor(hour/4)+1;//计算使用者上网时段
sql="select * from total";
rs=joyrisingbean.executeQuery(sql);
total=rs.getInt(1);
if(session.isNew())//使用者为首次进入网页,累加人数
{
today++;
switch(select)
{case 1:
sql="update counter set today="+today+",first=first+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 2:
sql="update counter set today="+today+",second=second+1 where date='"+time+"'";
joyrisingbean.executeUpdate(sql);//???
break;
case 3:
sql="update counter set today="+today+",third=third+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 4:
sql="update counter set today="+today+",forth=forth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 5:
sql="update counter set today="+today+",fifth=fiftht+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 6:
sql="update counter set today="+today+",sixth=sixth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
}
total++;
sql="update total set total=total+1";
joyrisingbean.executeQuery(sql);
rs.close();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>人数浏览统计</title>
</head><body>
<%
//System.out.print("您的IP地址:"+request.getRemoteAddr());
String showcount=String.valueOf(total);
System.out.print("您是本站的第 ");
for(int i=0;i<showcount.length();i++)
System.out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
System.out.print("位访客<br>");
showcount=String.valueOf(today);
System.out.print("您是今天的第 ");
for(int i=0;i<showcount.length();i++)
System.out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
out.print("位访客<br>");
%>
<hr><form name="conuter" id="counter" action="search.jsp" method="post">
<table width="100%" border="1" align="center">
<tr>
<td><font color="#3333FF">上网人数统计查询:</font></td>
<td><select size="1" name="month">
<option selected="selected">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option>
<option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select>月</td>
<td><select size="1" name="day">
<option selected="selected">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option>
<option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option>
<option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option>
<option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select>日</td>
<td><input type="submit" name="send" value="查询" /></td>
</tr>
<tr>
<td colspan="4" align="center">
<a href="search.jsp?month=<%=month%>&today=<%=day%>">
<font size="3">查看今天各时段流量统计</font></a></td>
</tr>
</table>
</form>
<font color="#FF3366" size="4">
<%
if(errmsg!=null)
System.out.print(errmsg);
%>
</font>
</body>
</html>
解决方案 »
- 请问Java Web里面文本域怎么写?
- Java , 从一个数据表中拷贝指定图片到另一个数据表中???
- 连接oracle异常:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: Got minus one
- 动态获取数据
- 我想做个考试编排系统,遇到个问题
- 关于文件上传下载的问题
- 框架页的session过期问题--在线等
- 我该如何学习JSP呢?
- 在网页中以表格的形式显示图文...求高手
- jsp服务器之间能共享session对象吗?
- 请教一个hibernate的一对多双向关联,多方是复合主键
- 怎么做一个安全的登陆验证??
楼主【joyrising】截止到2008-08-02 09:19:09的历史汇总数据(不包括此帖):
发帖的总数量:4 发帖的总分数:60 每贴平均分数:15
回帖的总数量:5 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:4 结贴的总分数:60
无满意结贴数:1 无满意结贴分:20
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:25.00 % 无满意结分率:33.33 %
敬礼!
取消马甲机器人,请点这里:http://www.java2000.net/mycsdn/robotStop.jsp?usern=joyrising
tmp2mb1s4y8st__jsp.java:148:非法的表达式开始
private java.util.ArrayList _caucho_depends = new java.util.ArrayList();
_tmp2mb1s4y8st__jsp.java:148:
非法的表达式开始
public java.util.ArrayList _caucho_getDependList()
148:
需要 ';'
public java.util.ArrayList _caucho_getDependList()
可我没写这样的语句啊!该怎么找错误?有没有这样一种编译器把错误码直接定位在源码上的第几行第几列?是什么?在哪可以下载?请指教!谢谢!
tmp2mb1s4y8st__jsp.java这个是它生成的servlet,可以在D:\Tomcat\work\Catalina\localhost\test\org\apache\jsp这种类似的路径下找到
/*
* JSP generated by Resin-3.2.s080615 (built Sun, 15 Jun 2008 07:00:48 PDT)
*/package _jsp._counter2;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;public class _tmp14fa64y6uz__jsp extends com.caucho.jsp.JavaPage
{
private static final java.util.HashMap<String,java.lang.reflect.Method> _jsp_functionMap = new java.util.HashMap<String,java.lang.reflect.Method>();
private boolean _caucho_isDead;
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
javax.servlet.http.HttpSession session = request.getSession(true);
com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication();
com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false); TagState _jsp_state = new TagState(); try {
_jspService(request, response, pageContext, _jsp_application, session, _jsp_state);
} catch (java.lang.Throwable _jsp_e) {
pageContext.handlePageException(_jsp_e);
} finally {
_jsp_state.release();
com.caucho.jsp.QJspFactory.freePageContext(pageContext);
}
}
private void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.caucho.jsp.PageContextImpl pageContext,
javax.servlet.ServletContext application,
javax.servlet.http.HttpSession session,
TagState _jsp_state)
throws Throwable
{
javax.servlet.jsp.JspWriter out = pageContext.getOut();
final javax.el.ELContext _jsp_env = pageContext.getELContext();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
response.setContentType("text/html; charset=gbk");
request.setCharacterEncoding("GBK"); out.write(_jsp_string0, 0, _jsp_string0.length);
db.lxtconndb joyrisingbean;
joyrisingbean = (db.lxtconndb) pageContext.getAttribute("joyrisingbean");
if (joyrisingbean == null) {
joyrisingbean = new db.lxtconndb();
pageContext.setAttribute("joyrisingbean", joyrisingbean);
}
out.write(_jsp_string1, 0, _jsp_string1.length);
request.getSession(true);//\u5efa\u7acbsession
int month,day,hour,today,total,select;
String time;
String errmsg=request.getParameter("errmsg");
GregorianCalendar calendar;
calendar=new GregorianCalendar();
month=calendar.get(Calendar.MONTH)+1;
day=calendar.get(Calendar.DAY_OF_MONTH);
hour=calendar.get(Calendar.HOUR_OF_DAY);
time="m"+String.valueOf(month)+"d"+String.valueOf(day);//time\u7684\u503c\u5f62\u5982time=m8d2,\u53738\u67082\u65e5
String sql="select * from counter where date='"+time+"'";
ResultSet rs=joyrisingbean.executeQuery(sql);
if(!rs.next())//\u6570\u636e\u5e93\u4e2d\u65e0\u6570\u636e\uff0c\u8868\u660e\u4f7f\u7528\u8005\u4e3a\u5f53\u65e5\u7684\u7b2c\u4e00\u4f4d\u8bbf\u5ba2
{sql="insert into counter(date,today,first,second,third,forth,,fifth,sixth)values('"+time+"',0,0,0,0,0,0,0)";
rs=joyrisingbean.executeQuery(sql);//\u5728\u8868\u4e2d\u5efa\u7acb\u4e00\u7b14\u8be5\u65e5\u65b0\u6570\u636e
}
sql="select * from counter where date='"+time+"'";
rs=joyrisingbean.executeQuery(sql);
today=rs.getInt(2);
select=(int)Math.floor(hour/4)+1;//\u8ba1\u7b97\u4f7f\u7528\u8005\u4e0a\u7f51\u65f6\u6bb5
sql="select * from total";
rs=joyrisingbean.executeQuery(sql);
total=rs.getInt(1);
if(session.isNew())//\u4f7f\u7528\u8005\u4e3a\u9996\u6b21\u8fdb\u5165\u7f51\u9875\uff0c\u7d2f\u52a0\u4eba\u6570
{
today++;
switch(select)
{case 1:
sql="update counter set today="+today+",first=first+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 2:
sql="update counter set today="+today+",second=second+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 3:
sql="update counter set today="+today+",third=third+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 4:
sql="update counter set today="+today+",forth=forth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 5:
sql="update counter set today="+today+",fifth=fiftht+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
case 6:
sql="update counter set today="+today+",sixth=sixth+1 where date='"+time+"'";
joyrisingbean.executeQuery(sql);//???
break;
}
代码太长,做两下
sql="update total set total=total+1";
joyrisingbean.executeQuery(sql);
rs.close(); out.write(_jsp_string2, 0, _jsp_string2.length);
out.print("\u60a8\u7684IP\u5730\u5740\uff1a"+request.getRemoteAddr());
String showcount=String.valueOf(total);
out.print("\u60a8\u662f\u672c\u7ad9\u7684\u7b2c ");
for(int i=0;i<showcount.length();i++)
out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
out.print("\u4f4d\u8bbf\u5ba2<br>");
showcount=String.valueOf(today);
out.print("\u60a8\u662f\u4eca\u5929\u7684\u7b2c\u3000");
for(int i=0;i<showcount.length();i++)
out.print("<img src=./image/digital"+showcount.charAt(i)+".jpg>");
out.print("\u4f4d\u8bbf\u5ba2<br>"); out.write(_jsp_string3, 0, _jsp_string3.length);
out.print((month));
out.write(_jsp_string4, 0, _jsp_string4.length);
out.print((day));
out.write(_jsp_string5, 0, _jsp_string5.length);
if(errmsg!=null)
out.print(errmsg); out.write(_jsp_string6, 0, _jsp_string6.length);
} private java.util.ArrayList _caucho_depends = new java.util.ArrayList(); public java.util.ArrayList _caucho_getDependList()
{
return _caucho_depends;
} public void _caucho_addDepend(com.caucho.vfs.PersistentDependency depend)
{
super._caucho_addDepend(depend);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
} public boolean _caucho_isModified()
{
if (_caucho_isDead)
return true;
if (com.caucho.server.util.CauchoSystem.getVersionId() != -5379034613217303949L)
return true;
for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
com.caucho.vfs.Dependency depend;
depend = (com.caucho.vfs.Dependency) _caucho_depends.get(i);
if (depend.isModified())
return true;
}
return false;
} public long _caucho_lastModified()
{
return 0;
} public java.util.HashMap<String,java.lang.reflect.Method> _caucho_getFunctionMap()
{
return _jsp_functionMap;
} public void init(ServletConfig config)
throws ServletException
{
com.caucho.server.webapp.WebApp webApp
= (com.caucho.server.webapp.WebApp) config.getServletContext();
super.init(config);
com.caucho.jsp.TaglibManager manager = webApp.getJspApplicationContext().getTaglibManager();
com.caucho.jsp.PageContextImpl pageContext = new com.caucho.jsp.PageContextImpl(webApp, this);
} public void destroy()
{
_caucho_isDead = true;
super.destroy();
} public void init(com.caucho.vfs.Path appDir)
throws javax.servlet.ServletException
{
com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
mergePath.addMergePath(appDir);
mergePath.addMergePath(resinHome);
com.caucho.loader.DynamicClassLoader loader;
loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
String resourcePath = loader.getResourcePathSpecificFirst();
mergePath.addClassPath(resourcePath);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(appDir.lookup("counter2/TMP14fa64y6uz.jsp"), 8760894204367457099L, false);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
} final static class TagState { void release()
{
}
} private final static char []_jsp_string4;
private final static char []_jsp_string6;
private final static char []_jsp_string5;
private final static char []_jsp_string1;
private final static char []_jsp_string0;
private final static char []_jsp_string2;
private final static char []_jsp_string3;
static {
_jsp_string4 = "&today=".toCharArray();
_jsp_string6 = "\r\n</font>\r\n</body>\r\n</html>\r\n".toCharArray();
_jsp_string5 = "\">\r\n <font size=\"3\">\u67e5\u770b\u4eca\u5929\u5404\u65f6\u6bb5\u6d41\u91cf\u7edf\u8ba1</font></a></td>\r\n </tr>\r\n</table>\r\n</form>\r\n<font color=\"#FF3366\" size=\"4\">\r\n".toCharArray();
_jsp_string1 = "\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n".toCharArray();
_jsp_string0 = "\r\n".toCharArray();
_jsp_string2 = "\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gbk\" />\r\n<title>\u4eba\u6570\u6d4f\u89c8\u7edf\u8ba1</title>\r\n</head>\r\n\r\n<body>\r\n".toCharArray();
_jsp_string3 = "\r\n<hr>\r\n\r\n<form name=\"conuter\" id=\"counter\" action=\"search.jsp\" method=\"post\">\r\n<table width=\"100%\" border=\"1\" align=\"center\">\r\n <tr>\r\n <td><font color=\"#3333FF\">\u4e0a\u7f51\u4eba\u6570\u7edf\u8ba1\u67e5\u8be2\uff1a</font></td>\r\n <td><select size=\"1\" name=\"month\">\r\n <option selected=\"selected\">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option>\r\n <option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select>\u6708</td>\r\n <td><select size=\"1\" name=\"day\">\r\n <option selected=\"selected\">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option>\r\n <option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option>\r\n <option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option>\r\n <option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select>\u65e5</td>\r\n <td><input type=\"submit\" name=\"send\" value=\"\u67e5\u8be2\" /></td>\r\n </tr>\r\n <tr>\r\n \r\n <td colspan=\"4\" align=\"center\">\r\n <a href=\"search.jsp?month=".toCharArray();
}
}