Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在JSP的标题部分隐藏登录凭据_Java_Jquery_Jsp_Servlets - Fatal编程技术网

Java 在JSP的标题部分隐藏登录凭据

Java 在JSP的标题部分隐藏登录凭据,java,jquery,jsp,servlets,Java,Jquery,Jsp,Servlets,我在标题部分有登录凭证(即电子邮件和密码)。它包含在所有页面中。登录后如何隐藏该登录凭据。我在JSP页面中使用了servlet代码。我只有JSP页面,任何人请帮助我 login.jsp ___________********_______ <!DOCTYPE html> <html> <head> <script src="jquery.min.js"></script> <script> $(document).read

我在标题部分有登录凭证(即电子邮件和密码)。它包含在所有页面中。登录后如何隐藏该登录凭据。我在JSP页面中使用了servlet代码。我只有JSP页面,任何人请帮助我

login.jsp
___________********_______

<!DOCTYPE html>
<html>
<head>
<script src="jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".btn1").click(function(){
$("input").hide();
});
});
</script>
</head>
<body  style="background-color: wheat;">
<div>Email<input class="span2" id="logInEmail" type="text">&nbsp; &nbsp;
   Password<input class="span2" id="logInPass" type="password"><br></div>
<a class="btn1" href="welcome.jsp">Sign in</a>
</body>
</html>
________************_____________

index.jsp
_________************____________
<!DOCTYPE html>
<html>
<head>
<%@include file="login.jsp" %>
</head>
<body>
<p>This is index page</p>
<p>This is for paragraph</p>
</body>
</html>
____________************_________

welcome.jsp
_____________*************________
<!DOCTYPE html>
<html>
<head>
<%@include file="login.jsp" %>
</head>
<body>
<h4>Welcome success</h4>
<p>Hello world</p>
</body>
</html>

 *******************
login.jsp
___________********_______
$(文档).ready(函数(){
$(“.btn1”)。单击(函数(){
$(“输入”).hide();
});
});
电子邮件
密码
________************_____________ index.jsp _________************____________ 这是索引页

这是一段

____________************_________ welcome.jsp _____________*************________ 欢迎成功 你好,世界

*******************
在会话中使用method=“post”并将电子邮件存储在验证成功块中

 if valid user
 HttpSession session=request.getSession();
 session.setAttribute("email", emailid);
在任何页面中获取emailid

String email=(String)session.getAttribute("email");

没有任何代码,我们很难帮助您;-)您使用的是post请求吗?使用post请求而不是getIt如果您的表单页中确实有表单,则会有所帮助。