example of page directive in jsp
index.jsp
<html>
<head>
<title>EX-35</title>
</head>
<body>
<%@ page language="java" %>
<%@ page info="A code from www.BipinRupadiya.com" %>
<ul>
<li><a href="import.jsp">Example of page directive import </a></li>
<li><a href="isThreadsafe.jsp">Example of page directive isThreadsafe </a></li>
<li><a href="jsp-forward.jsp">Example of page directive jsp-forward </a></li>
<li><a href="contentType.jsp">Example of page directive contentType </a></li>
<li><a href="errorPage.jsp">Example of page directive isErrorPage and errorPage </a></li>
</ul>
<body>
</html>
<head>
<title>EX-35</title>
</head>
<body>
<%@ page language="java" %>
<%@ page info="A code from www.BipinRupadiya.com" %>
<ul>
<li><a href="import.jsp">Example of page directive import </a></li>
<li><a href="isThreadsafe.jsp">Example of page directive isThreadsafe </a></li>
<li><a href="jsp-forward.jsp">Example of page directive jsp-forward </a></li>
<li><a href="contentType.jsp">Example of page directive contentType </a></li>
<li><a href="errorPage.jsp">Example of page directive isErrorPage and errorPage </a></li>
</ul>
<body>
</html>
import.jsp
<%@ page import="java.util.*"%>
<UL>
<%Date d= new Date();%>
<LI>Current time: <%=d %>
<LI>Server: <%= application.getServerInfo() %>
<LI>Session ID: <%= session.getId() %>
<LI>The testParam form parameter:
<%= request.getParameter("testParam") %>
</UL>
<UL>
<%Date d= new Date();%>
<LI>Current time: <%=d %>
<LI>Server: <%= application.getServerInfo() %>
<LI>Session ID: <%= session.getId() %>
<LI>The testParam form parameter:
<%= request.getParameter("testParam") %>
</UL>
isThreadsafe.jsp
<%@ page isThreadSafe="true"%>
<%! private int idNum = 0; %>
<%
//synchronized(this)
{
String userID = "userID : " + idNum;
out.println("Your " + userID + ".");
idNum = idNum + 1;
}
%>
<%! private int idNum = 0; %>
<%
//synchronized(this)
{
String userID = "userID : " + idNum;
out.println("Your " + userID + ".");
idNum = idNum + 1;
}
%>
jsp-forward.jsp
<% String destination;
if (Math.random() > 0.5)
{ destination = "/p1.jsp"; }
else
{ destination = "/p2.jsp"; }
%>
<jsp:forward page="<%= destination %>" />
if (Math.random() > 0.5)
{ destination = "/p1.jsp"; }
else
{ destination = "/p2.jsp"; }
%>
<jsp:forward page="<%= destination %>" />
<!-- make p1.jsp and p2.jsp as dummy file -->
contentType.jsp
<!-- produce out in an excel file -->
<%@page contentType="application/vnd.ms-excel" %>
<%
out.print("wwww"+"\t"+"Bipin"+"\t"+"Rupadiya.com");
%>
<%@page contentType="application/vnd.ms-excel" %>
<%
out.print("wwww"+"\t"+"Bipin"+"\t"+"Rupadiya.com");
%>
errorPage.jsp
<%@ page errorPage="ediv.jsp" %>
<%=10/0%>
<%=10/0%>
ediv.jsp
<%@ page isErrorPage="true" %>
we can not divide any number with ZERO
we can not divide any number with ZERO
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
-
▼
2013
(64)
-
▼
June
(25)
- Example of command line argument in C on Linux
- Example of command line argument in Java
- AES with CBC mode example in Java
- AES with CFM mode example in Java
- AES with ECB mode example in Java
- 3DES with CFM mode example in Java
- 3DES with CBC mode example in Java
- 3DES with ECB mode example in Java
- RSA Encryption Example in Java
- JSP JDBC Example
- example of preparedstatement in java
- example of page directive in jsp
- example of jsp scripting elements
- Example of requestdispatcher
- JSTL standard tag library Example
- DES with CBC mode example in Java
- DES with CFM mode example in Java
- DES with ECB mode example in Java
- One Time Pad Encryption Example using Java code
- S-Box Example using Java
- P-Box Example using Java
- Transposition cipher example using Java
- Mono-alphabetic Substitution Cipher example using ...
- Generalized Caesar Cipher example using java
- java socket programming example
-
▼
June
(25)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
0 comments:
Post a Comment