日期:2014-05-18 浏览次数:20747 次
<s:url var="url_pre" value="show!show.action">
<s:param name="pageNow" value="pageNow-1"></s:param>
</s:url>
<s:a href="%{url_pre}">上一页</s:a>
st = conn.createStatement();
String sql1 = "select * from userinfo where userName='"+ userName +"'";
rs1 = st.executeQuery(sql1);
if(!rs1.next()){
System.out.println("不存在该用户名");
return "Error";
}else{
String sql2 = "select * from userinfo where passWord='"+ passWord +"'";
rs2 = st.executeQuery(sql2);
if(!rs2.next()){
System.out.println("密码错误");
return "Error";
}
<script type="text/javascript">
var page = 0;//当前页数
function changePage(num){
var p = page+num;
if (p>0) {
location.href = "show!show.action?pageNow="+p;
} else {
alert("没有上一页了!");
}
}
</script>
<a href="#" onclick="changePage(-1)"></a>
HttpServletResponse resp;//取HttpServletResponse的代码
st = conn.createStatement();
String sql1 = "select * from userinfo where userName='"+ userName +"'";
rs1 = st.executeQuery(sql1);
if(!rs1.next()){
System.out.println("不存在该用户名");
String msg = "不存在该用户名"