2018.1.16很棒!么么么哒!
今天把数据库搞定了eclipse+mysql:
1.数据库创建过程:
添加到数据库:
查询数据库:
查询现在的数据个数: select count(*) from comment;
删除表中的数据; delete from comment where id in (23,24,26,30);
delete from comment where id>8 && id<20;
2.页面间传递参数遇到的问题:
在contact.html页面明明用name标记了input,得到的值一直是null,即使在本页面上直接request.getParameter("nickname)得到的也是null.为什么呢为什么呢?
原因终于找到:根本就没有写form 更没有写type=submit,从始至终都没有提交过数据,从哪来的request呢!因为引用的插件里面酷炫的登录效果并没有submit这个属性,所以这是个坑啊!
解决:自己在contact.jsp页面加上一个<form method="post" action="contact.jsp" >和<input type="submit" value="提交">
<form method="post" action="contact.jsp">
<h2>感谢您的留言</h2>
<p>昵称:</p>
<input type="text" class="input_text" name="nickname"/>
<p>邮箱:</p>
<input type="text" class="input_text" name="email"/>
<p>留言:</p>
<textarea rows="3" cols="20" name="comment">
</textarea>
<input type="submit" value="提交测试">
</form>
d