Hi everyone,
i'm working on a web project. now i want to load my login.jsp into main.jsp while clicking a button in status.jsp, which is included by main.jsp:
main.jsp:<body>
<div id="container">
<div id="banner" align="center" style="margin:auto; height:141px">
<img alt="XXXX" src="images/banner.jpg"></img>
</div>
<div id="navigation" style="width:420px; height:50px;float:left">
<jsp:include page="frame/navigation.jsp"></jsp:include>
</div>
<div id="status" style="width:444px;height:50px;float:left">
<jsp:include page="frame/status.jsp"></jsp:include>
</div>
<hr />
<div id="menu" style="width:164px; height:400px;float:left">
<jsp:include page="frame/menu.jsp"></jsp:include>
</div>
<div id="content" style="width:700px; height:400px; float:left">
<jsp:include page="frame/content.jsp"></jsp:include>
</div>
<hr />
<div id="footer" style="text-align:center">
<jsp:include page="frame/footer.jsp"></jsp:include>
</div>
</div>
</body>
status.jsp:
<body onload="showTime()">
<%
User user = (User)session.getAttribute("currentUser");
if (user != null) {
String name = user.getUsers_realname();
%>
<div>Welcome,<%=name %>! <input type="button" name="logout" value="Exit" onclick=""></div>
<%
} else {
%>
<div style="color:red">You haven't loggod on, please<a id="login" href="#">login</a></div>
<%
}
%>
<label id="curTime"></label>
</body>
HERE, while clicking "login" link in satus.jsp, which has been included in main.jsp,
my login.jsp will be loaded into content.jsp, which is also part of main.jsp ,
so how can i do this? Thanks in advance!
i'm working on a web project. now i want to load my login.jsp into main.jsp while clicking a button in status.jsp, which is included by main.jsp:
main.jsp:<body>
<div id="container">
<div id="banner" align="center" style="margin:auto; height:141px">
<img alt="XXXX" src="images/banner.jpg"></img>
</div>
<div id="navigation" style="width:420px; height:50px;float:left">
<jsp:include page="frame/navigation.jsp"></jsp:include>
</div>
<div id="status" style="width:444px;height:50px;float:left">
<jsp:include page="frame/status.jsp"></jsp:include>
</div>
<hr />
<div id="menu" style="width:164px; height:400px;float:left">
<jsp:include page="frame/menu.jsp"></jsp:include>
</div>
<div id="content" style="width:700px; height:400px; float:left">
<jsp:include page="frame/content.jsp"></jsp:include>
</div>
<hr />
<div id="footer" style="text-align:center">
<jsp:include page="frame/footer.jsp"></jsp:include>
</div>
</div>
</body>
status.jsp:
<body onload="showTime()">
<%
User user = (User)session.getAttribute("currentUser");
if (user != null) {
String name = user.getUsers_realname();
%>
<div>Welcome,<%=name %>! <input type="button" name="logout" value="Exit" onclick=""></div>
<%
} else {
%>
<div style="color:red">You haven't loggod on, please<a id="login" href="#">login</a></div>
<%
}
%>
<label id="curTime"></label>
</body>
HERE, while clicking "login" link in satus.jsp, which has been included in main.jsp,
my login.jsp will be loaded into content.jsp, which is also part of main.jsp ,
so how can i do this? Thanks in advance!