以下是我的JSP页面:
<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>
我想把这些代码用struts分离开,可是不知道这些代码往哪里写了,麻烦大哥帮我一下,最好有详细的代吗,有的人告诉我说写一个bean,可是这个bean怎么写呀?
<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>
我想把这些代码用struts分离开,可是不知道这些代码往哪里写了,麻烦大哥帮我一下,最好有详细的代吗,有的人告诉我说写一个bean,可是这个bean怎么写呀?
<c:out value="1"></c:out>
</logic:notPresent>
<logic:present name="count">
<bean:write name="count" />
</logic:present>