明天晚上我在CSDN上问了一个问题,网友给我解答了,可是我研究了一夜也没研究出来到底该怎么做,于是我感觉我的智商太低了,我真的好郁闷
问题及解答如下:
以下是一个简单的网页记数器,用Struts框架该把这些代码写在哪里呢,怎么写呢,以前用Struts就处理表单了,现在让我用这些代码写在Struts框架里,我就不知道往哪写了
<body>
<%
if(application.getAttribute("count")==null){
application.setAttribute("count","1");
out.println("first user");
out.print(application.getAttribute("count"));
}
else{
int a=Integer.valueOf((String)application.getAttribute("count"));
application.setAttribute("count",Integer.toString(a+1));
out.print(application.getAttribute("count"));
}
%>
</body>
以下是解答:
zhanglinkai1984() ( ) 信誉:100 Blog 2007-2-10 22:41:22 得分: 0
写在处理用户第一次发送请求的Action中
我就没明白这个Action该怎么写,往哪写,就算写完了,怎么才能程序一运行就运行这个Action呢,我是男人,我不能因为这点小事就把我压倒了,大家帮帮忙,我没分了,先给大家拜个早年。
问题及解答如下:
以下是一个简单的网页记数器,用Struts框架该把这些代码写在哪里呢,怎么写呢,以前用Struts就处理表单了,现在让我用这些代码写在Struts框架里,我就不知道往哪写了
<body>
<%
if(application.getAttribute("count")==null){
application.setAttribute("count","1");
out.println("first user");
out.print(application.getAttribute("count"));
}
else{
int a=Integer.valueOf((String)application.getAttribute("count"));
application.setAttribute("count",Integer.toString(a+1));
out.print(application.getAttribute("count"));
}
%>
</body>
以下是解答:
zhanglinkai1984() ( ) 信誉:100 Blog 2007-2-10 22:41:22 得分: 0
写在处理用户第一次发送请求的Action中
我就没明白这个Action该怎么写,往哪写,就算写完了,怎么才能程序一运行就运行这个Action呢,我是男人,我不能因为这点小事就把我压倒了,大家帮帮忙,我没分了,先给大家拜个早年。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货