<title>buy 登录</title>
</head>
<body>
<h1>welcome</h1><br/>
<% String useName=""; String password="";
Genenal.GetCookieUsePassword(request,useName,password);%>
<form action="toLogin?login" method="post">
你的账号名:<input type="text" name="useName" value=<%=useName %>/><br/>
你的密码:<input type="password" name="password" value=<%=password %>/><br/>
<input type="submit" value="登录"/>
</form>
</body>
</html>
public static void GetCookieUsePassword(HttpServletRequest request,String useName,String password){
Cookie[] cookie=request.getCookies();
for(int i=0;i<cookie.length;++i){
if(cookie[i].getName().equals("useName"))
useName=cookie[i].getValue();
if(cookie[i].getName().equals("password"))
password=cookie[i].getValue();
}
}第一次登录时候
</head>
<body>
<h1>welcome</h1><br/>
<% String useName=""; String password="";
Genenal.GetCookieUsePassword(request,useName,password);%>
<form action="toLogin?login" method="post">
你的账号名:<input type="text" name="useName" value=<%=useName %>/><br/>
你的密码:<input type="password" name="password" value=<%=password %>/><br/>
<input type="submit" value="登录"/>
</form>
</body>
</html>
public static void GetCookieUsePassword(HttpServletRequest request,String useName,String password){
Cookie[] cookie=request.getCookies();
for(int i=0;i<cookie.length;++i){
if(cookie[i].getName().equals("useName"))
useName=cookie[i].getValue();
if(cookie[i].getName().equals("password"))
password=cookie[i].getValue();
}
}第一次登录时候
解决方案 »
- MyEclipse中无法自动创建Hibernate XML Mapping file
- 我用账户admin和密码adminadmin登陆不进去glassfish server 3.1的管理控制台
- 编译struts2标签或者jstl标签错误,,,急
- 求助啊!servlet返回的xml文件的编码问题,我实在搞不懂!!
- 查询数据据库返回到LinkedList 怎么只返回最后一条呢?
- 请教关于定时触发的问题
- 关于复选框的问题
- 我这样写为什么不能显示两个jsp页面,只能显示html页面,谢谢
- java编程高手请进!小弟请教一个问题!!!
- 请教一下各位:Web页面的报表导出到Excel大家都使用什么方式?(假定:使用 Struts、JExcelAPI)
- js循环输出set里的对象
- 参数的理解
改成
:<input type="text" name="useName" value=<%=useName %>
后面多东西了 大哥!!!
你的账号名:<input type="text" name="useName"/><br/>
你的密码:<input type="password" name="password"/><br/>
<input type="submit" value="登录"/>
</form>你的value给了值了,肯定会有东西啊,这样写就ok的
你的密码:<input type="password" name="password" value=<%=password %>/><br/>
>/>这应很容易看出来吧。
程序将红色的全部当成value的值了
你的密码:<input type="password" name="password" value="<%=password %>" /><br/>