可按Ctrl+D收藏 蚂蚁资源网

蚂蚁资源网

jsp网站源码(jsp免费源码cms)

  • 全部评论(3)
  • nij
  • <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%><%@ page import="java.util.*" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>登录页面</title></head><body> <form name="loginForm" method="post" action="judgeUser.jsp"> <table> <tr> <td>用户名:<input type="text" name="userName" id="userName"></td> </tr> <tr> <td>密码:<input type="password" name="password" id="password"></td> </tr> <tr> <td><input type="submit" value="登录" style="background-color:pink"> <input type="reset" value="重置" style="background-color:red"></td> </tr> </table> </form></body></html><%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%><%@ page import="java.util.*" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>身份验证</title></head><body> <% request.setCharacterEncoding("GB18030"); String name = request.getParameter("userName"); String password = request.getParameter("password"); if(name.equals("abc")&& password.equals("123")) { %> <jsp:forward page="afterLogin.jsp"> <jsp:param name="userName" value="<%=name%>"/> </jsp:forward> <% } else { %> <jsp:forward page="login.jsp"/> <% } %></body></html> <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>登录成功</title></head><body> <% request.setCharacterEncoding("GB18030"); String name = request.getParameter("userName"); out.println("欢迎你:" + name); %></body></html> 总共3个jsp文件,第一个是login.jsp,第2个是judge.jsp,第3个是afterLogin.jsp
  • 2021-02-15 18:00:07
  • 000000
  • 看懂这个,就OK了,实现会员管理界面(会员查询,删除)<br>呵呵,注意下面两点,我标志的<br><br>&lt;%@pagecontentType=&quot;text/html;charset=UTF-8&quot;language=&quot;java&quot;%&gt;<br>&lt;%@pageimport=&quot;java.sql.*&quot;%&gt;<br>&lt;%@pageimport=&quot;Bean.QueryBean&quot;%&gt;<br>&lt;jsp:useBeanid=&quot;query&quot;scope=&quot;page&quot;class=&quot;Bean.QueryBean&quot;/&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;metahttp-equiv=&quot;Content-Type&quot;content=&quot;text/html;charset=UTF-8&quot;&gt;<br>&lt;title&gt;<br>admincontrol<br>&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;%!<br>ResultSetrs=null;<br>Stringsql,login;<br>intcode;<br>intpagesize=3;<br>introwcount=0;<br>intpagecount=1,n;<br>intshowpage=1;<br>%&gt;<br>&lt;scriptlanguage=&quot;javascript&quot;&gt;<br>functioncheck_delete()<br>{if(confirm(&quot;你确定它删除吗?&quot;))<br>returntrue;<br>else<br>returnfalse;}<br>&lt;/script&gt;<br><br>&lt;bodybgcolor=&quot;#ffffff&quot;&gt;<br>&lt;ahref=&quot;index.jsp&quot;&gt;返回首页&lt;a&gt;<br>&lt;tableborder=&quot;1&quot;width=&quot;786&quot;align=&quot;center&quot;bordercolor=&quot;#FFFFFF&quot;cellpadding=&quot;0&quot;cellspacing=&quot;0&quot;bordercolordark=&quot;#333333&quot;bordercolorlight=&quot;#FFFFFF&quot;&gt;<br>&lt;tr&gt;<br>&lt;tdwidth=&quot;786&quot;align=&quot;center&quot;colspan=&quot;6&quot;height=&quot;32&quot;&gt;用户管理&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;formname=&quot;form1&quot;method=&quot;post&quot;action=&quot;&quot;&gt;<br>&lt;tr&gt;<br>&lt;tdwidth=&quot;18%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;用户ID&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;用户名&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;用户身份&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;注册时间&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;管理&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;%<br>sql=&quot;select*fromuserinfoorderbyaddtimedesc&quot;;//会员查询<br>try<br>{<br>rs=query.executeQuery(sql);<br>if(!rs.next())<br>{<br>%&gt;<br>&lt;scriptlanguage=&quot;javascript&quot;&gt;<br>alert(&quot;没有用户信息&quot;);<br>&lt;/script&gt;<br>&lt;%<br>}else<br>{<br>rs.last();<br>rowcount=rs.getRow();<br>pagecount=((rowcount%pagesize)==0?(rowcount/pagesize):(rowcount/pagesize)+1);<br>Stringtopage=request.getParameter(&quot;topage&quot;);<br>if(topage!=null)<br>{<br>showpage=Integer.parseInt(topage);<br>if(showpage&gt;pagecount){<br>showpage=pagecount;<br>}elseif(showpage&lt;=0){<br>showpage=1;<br>}<br>}<br>rs.absolute((showpage-1)*pagesize+1);<br>for(inti=1;i&lt;=pagesize;i++)<br>{<br>code=rs.getInt(&quot;id&quot;);<br>%&gt;<br>&lt;tr&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;&lt;%=code%&gt;&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;&lt;%=rs.getString(&quot;username&quot;)%&gt;&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;&lt;%=rs.getString(&quot;logrole&quot;)%&gt;&lt;/td&gt;<br>&lt;tdwidth=&quot;18%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;&lt;%=rs.getString(&quot;addtime&quot;)%&gt;&lt;/td&gt;<br>&lt;tdwidth=&quot;17%&quot;align=&quot;center&quot;height=&quot;27&quot;&gt;&lt;ahref=&quot;Userdel?id=&lt;%=code%&gt;&quot;onclick=&quot;returncheck_delete();&quot;&gt;删除&lt;/a&gt;&lt;/td&gt;<br>&lt;/tr&gt;//删除功能<br>&lt;%<br>if(!rs.next())<br>break;<br>}}<br>}catch(Exceptione)<br>{out.println(&quot;查询异常!!!&quot;);}<br>%&gt;<br>&lt;tr&gt;<br>&lt;tdwidth=&quot;786&quot;height=&quot;30&quot;colspan=&quot;9&quot;align=&quot;right&quot;&gt;<br>&lt;tablewidth=&quot;786&quot;align=&quot;center&quot;cellpadding=&quot;0&quot;cellspacing=&quot;0&quot;&gt;<br>&lt;tr&gt;<br>&lt;tdwidth=&quot;786&quot;height=&quot;30&quot;colspan=&quot;6&quot;align=&quot;right&quot;&gt;<br>&lt;divalign=&quot;center&quot;&gt;共&lt;%=pagecount%&gt;页<br>&lt;ahref=&quot;admincontrol.jsp?topage=&lt;%=1%&gt;&quot;&gt;第一页&lt;/a&gt;<br>&lt;ahref=&quot;admincontrol.jsp?topage=&lt;%=showpage-1%&gt;&quot;&gt;上一页&lt;/a&gt;<br>&lt;ahref=&quot;admincontrol.jsp?topage=&lt;%=showpage+1%&gt;&quot;&gt;下一页&lt;/a&gt;<br>&lt;ahref=&quot;admincontrol.jsp?topage=&lt;%=pagecount%&gt;&quot;&gt;最后一页&lt;/a&gt;<br>&lt;/div&gt;<br>&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/table&gt;<br>&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/form&gt;<br>&lt;/table&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;
  • 2021-02-11 13:55:09
  • 至深科技
  • 急JSP 的源代码,哪有用JSP就能完成注册和登录的,这需要和数据库连接的,也就需要用到java语言了。如果说页面<%@page contentType="text/html;charset=GBK"%><html><head> <title> login student html </title></head><body><p align="center" style="color:red;font-size:19pt">登陆界面</p><hr><form action="/QQStudent/action/login" method="post"><table border="1"><tr><td>userName:</td><td><input type="text" name="userName"></input></td></tr><tr><td>Password:</td><td><input type="password" name="password"></input></td></tr></table><span><input type="submit" name="submit" value="登录"></input><input type="reset" name="reset" value="取消"></input></span></form> </body></html>这个就可以了!!
  • 2021-02-11 13:55:09
  • 商品推荐