26.Develop an application to write a "page-composite" JSP that includes other pages or passes control to another page. (Hint: Use <jsp:include> or <jsp:forward>).
index.jsp
<html>
<head>
<title>EX-26</title>
<style>
div
{
background:#ababff;
position:absolute;
width:1000px;
left:110px;
}
.abcH
{
top:0.5cm;
width:1000px;
border-style:solid;
}
.abcL
{
top:200px;
width:1000px;
}
.abcF
{
top:500px;
width:1000px;
border-style:solid;
}
</style>
</head>
<body bgcolor="#ababff">
<%@ include file="/header.jsp" %>
<jsp:include page="/login.jsp" />
<jsp:include page="/footer.jsp" />
<br>
</div>
</body>
</html>
header.jsp
<div class="abcH" id="f1">
<br>
<table align="center">
<tr>
<td><h1>www.BipinRupadiya.blogspot.in<h1></td>
</tr>
</table>
</div>
login.jsp
<div class="abcL" id="f1">
<br>
<form method="POST" action="result.jsp">
<table align="center">
<tr>
<td colspan=2 align=center> <h3>Login</h3><hr></td>
</tr>
<tr>
<td>User Name : </td>
<td><input type="text" name="txtUsr"></td>
</tr>
<tr>
<td>Password :</td>
<td><input type="password" name="txtPwd"></td>
</tr>
<tr>
<td colspan=2 align=center><hr>
<input type="submit" value="Login">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</div>
footer.jsp
<div class="abcF" id="f2">
<br>
<table align="center">
<tr>
<td><h3>© Mr. Bipin S Rupadiya<h3></td>
</tr>
</table>
</div>
result.jsp
<%
String d;
if(request.getParameter("txtUsr").equals("bipin") &&
request.getParameter("txtPwd").equals("rupadiya"))
d="welcome.jsp";
else
d="index.jsp";
%>
<jsp:forward page="<%= d%>" />
welcome.jsp
<html>
<head>
<title>EX-26</title>
<style>
div
{
background:#ababff;
position:absolute;
width:1000px;
left:110px;
}
.abcH
{
top:0.5cm;
width:1000px;
border-style:solid;
}
.abcL
{
top:200px;
width:1000px;
}
.abcF
{
top:500px;
width:1000px;
border-style:solid;
}
</style>
</head>
<body bgcolor="#ababff">
<%@ include file="/header.jsp" %>
<div class="abcL">
<center><h1>Welcome</h1><br>
<br>
<a href="index.jsp">Home</a>
</div>
<jsp:include page="/footer.jsp" />
<br>
</div>
</body>
</html>
Subscribe to:
Post Comments (Atom)
Subjects
- WordPress
- Mobile Computing-4649303 Practical Solution
- Android Programming New Syllabus Theory
- PHP LAMP Question Bank
- PHP LAMP Theory
- Step by Step Android Example
- Android Practical
- Android Theory
- Android Question Bank
- Networking FON Practical
- Networking FON Theory
- OS Practical
- OS Theory
- HTML
- JavaScript
- J2EE WTAD Theory
- J2EE WTAD Question Bank
- J2EE WTAD Quick Guide
- J2EE WTAD GTU Papers
- J2EE WTAD Practical
- Python
- JAVA Theory
- JAVA Practical
- MIS
Categories
- Android (55)
- c (11)
- Configure Tomcat7 (2)
- CSS (3)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- install Tomcat (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- linux (8)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- shell script (33)
- unix (22)
- WTAD (34)
Blog Archive
-
▼
2012
(79)
-
▼
March
(7)
- 26.Develop an application to write a "page-composi...
- 27. You want to reduce the amount of Java coding i...
- 23. Develop a interest calculation application in ...
- 20. Write a JSP page, which uses the include direc...
- 19. Write a simple JSP page to display a simple me...
- 18. Develop a Servlet to authenticate a user, wher...
- 17. Develop a Servlet which looks for cookies for ...
-
▼
March
(7)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
0 comments:
Post a Comment