mybook.jsp
对于原始session.currentPage可以再jsp种实现 也可以在 事件消息 HttpSessionListener中实现
you.js
});
});
我使用自定义标签实现的,
标签
for(int i=0;i<number&&resultSet.next();++i){
str+="<div class=/"red/">"+resultSet.getString("name")+"<br/>"+resultSet.getDouble("price")+"</div><br/>";
follow+=resultSet.getString("name")+resultSet.getDouble("price");
}
for(int i=1;i<=totalPage;++i){
if(i==page){
str+="<span style="/" mce_style="/""color:red/">"+i+"</span>";
continue;
}
str+="<span class=/"click/">"+i+"</span>";
}
return str;
}
public void setTable(String table){
this.table=table;
}
public void setPage(int page){
this.page=page;
}
public void setNumber(int number){
this.number=number;
}
}
why.tld
<tlib-version>1.0</tlib-version>
<short-name>why</short-name><!--my.Example 声明name example-->
<tag>
<name>to</name>
<tag-class>my.Example</tag-class>
<body-content>empty</body-content>
<attribute>
<name>here</name>
</attribute>
</tag>
<tag>
<name>query</name>
<tag-class>my.Query</tag-class>
<body-content>empty</body-content>
<attribute>
<name>table</name>
<required>true</required>
</attribute>
<attribute>
<name>page</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>number</name>
</attribute>
</tag>
</taglib>