Saturday, 25 April 2015

HTML PDF Upload and preview option

<!----  
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
@author: ananddw
-->
<!DOCTYPE html>
  <html lang="en">
    <head>
<body BGCOLOR=#66CCFF>
        <title>Java by Anand</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript">
            function PreviewImage() {
                pdffile=document.getElementById("uploadPDF").files[0];
                pdffile_url=URL.createObjectURL(pdffile);
                $('#viewer').attr('src',pdffile_url);
            }
        </script>
<body>
    </head>
    <body>
        <input id="uploadPDF" type="file" name="myPDF"/>&nbsp;
        <input type="button" value="Preview" onclick="PreviewImage();" />

        <div style="clear:both">
           <iframe id="viewer" frameborder="0" scrolling="no" width="400" height="600"></iframe>
        </div>
    </body> 
</html>






Thursday, 23 April 2015

DropDown value Comes on Text Field Using HTML and JS

<html>
<head>
<body bgcolor="#3399FF">
<center>
<h2>DropDown value on Text Field</h2>
<b>Select Value:</b><select id="DP" onchange="run()">
      <!--Call run() function-->
     <option>-select-</option>
     <option value=
    "value of 1 value of 1 value of 1 value of 1
     value of 1 value of 1 value of 1 value of 1
     value of 1 value of 1 value of 1 value of 1
     value of 1 value of 1 value of 1 value of 1
     value of 1 value of 1 value of 1 value of 1" title="value of 1" ">1</option>
     <option value="value of 2" title="value of 2">2</option>
     <option value="value of 3" title="value of 3">3</option>
     <option value="value of 4" title="value of 4">4</option>
     <option value="value of 5" title="value of 5">5</option>
             </select><br><br>

    <!---  Get the Selected value from Dropdown -->

<b>Dropdown text:</b>
<textarea rows="5" cols="66" id="tx" placeholder="get value
on option select" class="resizedTextbox" disabled="true">
</textarea>

<br>

</center>
</body>
</head>
</html>
<!------Java Script Starts here  --->
<script>
function run() {
    document.getElementById("tx").value = document.getElementById("DP").value;
    alert(DP.value);
}

function up() {

    //if (document.getElementById("srt").value != "") {
        var dop = document.getElementById("tx").value;
    //}
    pop(dop);

}

</script>

<style>
body
    {
        width:80%;
        margin-left:auto;
        margin-right:auto;
    }
   
    resizedTextbox {width: 100px; height: 20px}
</style>

Wednesday, 22 April 2015

Why mapping Used in Java

Basically Mapping will configure on xml because of following reason.

> When we use multiple file on different package then that time server doesn't decide which file we execute.

> on XML we define full controlling path . like if i click on ___ Control will forward to ___- page 

> On html form tag we define form action = --- so that is called xml and find where class has been define if find then perform operation else get error 


Hope this will help 
Thanks  

Use Of PageContext() Method in Servlet Java

basically it is used to find attribute and set Attribute value on servlet :-
please find example built on your platform but please put all the file under WEB-Pages .else you will get Error :- Request resource not available
============ index.html===================
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title> User Login Page – Enter details</title>
</head>
<body>
<form action="validation.jsp">
Enter User-Id: <input type="text" name="uid"><br>
Enter Password: <input type="text" name="upass"><br>
<input type="submit" value="Login">
</form>
</body>
</html>
=========== validation.jsp=================
<%--
    Document   : validation
    Created on : Apr 22, 2015, 4:21:40 PM
    Author     : ananddw
--%>

<html>
<head> <title> Validation JSP Page</title>
</head>
<body>
<%
String id=request.getParameter("uid");
String pass=request.getParameter("upass");
out.println("hello "+id);
pageContext.setAttribute("UName", id, PageContext.SESSION_SCOPE);
pageContext.setAttribute("UPassword", pass, PageContext.SESSION_SCOPE);
%>
<a href="display.jsp">Click here to see what you have entered </a>
</body>
</html>

==========display.jsp==============
<%--
    Document   : display
    Created on : Apr 22, 2015, 4:22:46 PM
    Author     : ananddw
--%>

<html>
<head>
<title>Displaying User Details</title>
</head>
<body>
<%
String username= (String) pageContext.getAttribute("UName", PageContext.SESSION_SCOPE);
String userpassword= (String) pageContext.getAttribute("UPassword", PageContext.SESSION_SCOPE);
out.println("Hi "+username);
out.println("Your Password is: "+userpassword);
%>
</body>
</html>
=====================================

No mapping needed on this method since it should call from web pages
.

Tuesday, 21 April 2015

How to work Equals() and EqualsIgnoreCase() method in java

Equals():-To compare two strings for equality.
EqualsIgnoreCase():-The comparison is case-sensitive String if both are same return boolean value= true
=========Equals.java===============

/**
 *
 * @author Ananddw
 */
public class Equals {

    public static void main(String[] args) {

        String str1 = "Anand";
        String str2 = "anand";
        String str3 = "Ajeet";
        String str4 = "Antrish";

        // Calling equals method
        System.out.println("Compare str1 and str2 with equals method===>" + str1.equals(str2));
        System.out.println("Compare str1 and str3 with equals method===>" + str1.equals(str3));
        System.out.println("Compare str3 and str4 with equals method===>" + str3.equals(str4));
        //calling equals ignore method
       System.out.println("Compare str1 and str2 with equalsIgnore method===>" + str1.equalsIgnoreCase(str2));
        System.out.println("Compare str1 and str3 with equalsIgnore method===>" + str1.equalsIgnoreCase(str3));
        System.out.println("Compare str3 and str4 with equalsIgnore method===>" + str3.equalsIgnoreCase(str4));

    }

}

Registration form Using HTMl and CSS

<!DOCTYPE html>
<!--
 * @author ananddw

-->
<html>
    <body>
        <form autocomplete="off" action="Test.html">
            <h3> Registration form by Anand</h3> </br> </br>
            <!----  For FullName ---->

            FullName:<input type="text" name="FullName" placeholder=" Your Full Name" required /> </br> </br>
            <!----  For Email: ---->
            Email:<input type="email" name="Email" placeholder="Type Email @gmail.com"  required/> </br> </br>
            <!----  For Date of birth ---->
            Date of birth: <select id="form_dob_month" name="dob_month">
                <option value="-">-</option>
                <option value="1" >January</option>
                <option value="2">Febuary</option>
                <option value="3">March</option>
                <option value="4">April</option>
                <option value="5">May</option>
                <option value="6">June</option>
                <option value="7">July</option>
                <option value="8">August</option>
                <option value="9">September</option>
                <option value="10">October</option>
                <option value="11">November</option>
                <option value="12">December</option>
            </select>
            <select id="form_dob_day" name="dob_day">
                <option value="-">-</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10">10</option>
                <option value="11">11</option>
                <option value="12">12</option>
                <option value="13">13</option>
                <option value="14">14</option>
                <option value="15">15</option>
                <option value="16">16</option>
                <option value="17">17</option>
                <option value="18">18</option>
                <option value="19">19</option>
                <option value="20">20</option>
                <option value="21">21</option>
                <option value="22">22</option>
                <option value="23">23</option>
                <option value="24">24</option>
                <option value="25">25</option>
                <option value="26">26</option>
                <option value="27">27</option>
                <option value="28">28</option>
                <option value="29">29</option>
                <option value="30">30</option>
                <option value="31">31</option>
            </select>
            <select id="form_dob_year" name="dob_year">
                <option value="-">-</option>
                <option value="2011">2011</option>
                <option value="2010">2010</option>
                <option value="2009">2009</option>
                <option value="2008">2008</option>
                <option value="2007">2007</option>
                <option value="2006">2006</option>
                <option value="2005">2005</option>
                <option value="2004">2004</option>
                <option value="2003">2003</option>
                <option value="2002">2002</option>
                <option value="2001">2001</option>
                <option value="2000">2000</option>
                <option value="1999">1999</option>
                <option value="1998">1998</option>
                <option value="1997">1997</option>
                <option value="1996">1996</option>
                <option value="1995">1995</option>
                <option value="1994">1994</option>
                <option value="1993">1993</option>
                <option value="1992">1992</option>
                <option value="1991">1991</option>
                <option value="1990">1990</option>
                <option value="1989">1989</option>
                <option value="1988">1988</option>
                <option value="1987">1987</option>
                <option value="1986">1986</option>
                <option value="1985">1985</option>
                <option value="1984">1984</option>
                <option value="1983">1983</option>
                <option value="1982">1982</option>
                <option value="1981">1981</option>
                <option value="1980">1980</option>
                <option value="1979">1979</option>
                <option value="1978">1978</option>
                <option value="1977">1977</option>
                <option value="1976">1976</option>
                <option value="1975">1975</option>
                <option value="1974">1974</option>
                <option value="1973">1973</option>
                <option value="1972">1972</option>
                <option value="1971">1971</option>
                <option value="1970">1970</option>
                <option value="1969">1969</option>
                <option value="1968">1968</option>
                <option value="1967">1967</option>
                <option value="1966">1966</option>
                <option value="1965">1965</option>
                <option value="1964">1964</option>
                <option value="1963">1963</option>
                <option value="1962">1962</option>
                <option value="1961">1961</option>
                <option value="1960">1960</option>
                <option value="1959">1959</option>
            </select>
            </br> </br>
            <!----  For Radio Button ---->

            Male:<input type="radio" name="Male"   /></br>
            Female:<input type="radio" name="Female"  />
            </br> </br>
            <!----  For Upload Resume ---->
            Upload Resume:<input type="file" name="upload Resume" /> </br> </br>

            <!---- For contact number --->
            Contact No:<input type="text" name="Contact No" placeholder="10 digit number" maxlength="10" required=""/></br> </br>
            <!--- Drodown Code--->
            Degree:<select name="select" >
                <option value="BE">BE</option>
                <option value="BE">BCA</option>
                <option value="BE">MCA</option>
                <option value="BE">MTECH</option>
            </select>
            </br> </br>



            <input type="submit" name="Register" value="Register"/>

        </form>

    </body>
</html>
<style>
    body{
        background-color: chocolate;
        alignment-adjust: central;
        width: auto;
    }
    form{
        font-family: inherit;
        text-align: center;
        width: auto;
        inline-box-align: calc;
        color: darkblue;
    }
    h3{
        color: deepskyblue;
        width: auto;
    }


</style>

Sunday, 19 April 2015

Get The longText Dropdown value using hover and alert function

<!DOCTYPE html>
<!--
 Author     : ananddw
-->
<html><body bgcolor="gray"><center>
        <h1>welcome</h1>
        <h2>Add Enquiry Form</h2>

        <table>


            <tr><td></td>
                <td><select id="short_code" onchange="getSelected(this)">
                        <option value="Select">-Select-</option>
                        <option value="Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 " title="Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 ">1 </option>
                        <option value="Value of DropDown 2" title="Value of DropDown 2">2</option>
                        <option value="Value of DropDown 3" title="Value of DropDown 3">3</option>
                        <option value="Value of DropDown 4 " title="Value of DropDown 4">4 </option>
                        <option value="Value of DropDown 5" title="Value of DropDown 5">5</option>
                        <option value="Value of DropDown 6" title="Value of DropDown 6">6</option>
                        <option value="Value of DropDown 7 " title="Value of DropDown 7">7 </option>
                        <option value="Value of DropDown 8" title="Value of DropDown 8">8</option>
                        <option value="Value of DropDown 9" title="Value of DropDown 9">9</option>
                    </select>
                </td>
            </tr>
           
           
           
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="Get Value"/></td>
            </tr>
        </table>
    </center>
</body>
</html>

<script type="text/javascript">
    function getSelected(select) {
        alert(select.options[select.selectedIndex].value);
    }
</script>

Friday, 17 April 2015

How to Call Hover() form HTML page to getting the value of Dropdown onmousehover...

Inside a option value if you write tittle="Value of Dropdown1" and the name of Dropdown is "1" . So when you mousehover on 1 it should display "value of dropdown 1"..
Please find updated code


=====================register.html======================
<html><body bgcolor="gray"><center>
<h1>welcome</h1>
<h2>Add Enquiry Form</h2>

<table>

</tr>
<tr><td></td>
<td><select name="timings">
<option value="Select">-Select-</option>
<option value="DROPDOWN 1 " title="Value of DropDown 1">1 </option>
<option value="DROPDOWN 2" title="Value of DropDown 2">2</option>
<option value="DROPDOWN 3" title="Value of DropDown 3">3</option>
<option value="DROPDOWN 1 " title="Value of DropDown 4">4 </option>
<option value="DROPDOWN 2" title="Value of DropDown 5">5</option>
<option value="DROPDOWN 3" title="Value of DropDown 6">6</option>
<option value="DROPDOWN 1 " title="Value of DropDown 7">7 </option>
<option value="DROPDOWN 2" title="Value of DropDown 8">8</option>
<option value="DROPDOWN 3" title="Value of DropDown 9">9</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Get Value " /></td>
</tr>
</table>
</form>
</center>
</body>
</html>









=============================================================
Thanks 

Wednesday, 15 April 2015

How to populate Drop Down From Database Table in Java

Before create project you have to understand from a JSP file you have to create JDBC Connection with default port 3306  and call HTML Code inside JSP page :--

==========================index.jsp====================================




<%@ page import="java.sql.*" %>
<%ResultSet resultset =null;%>

<HTML>
<HEAD>
    <TITLE>Welcome in Java by Anand,Bangalore</TITLE>
</HEAD>

<BODY BGCOLOR=#66CCFF>

<%
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/Anand";
con = DriverManager.getConnection(url, "root", "pass@123");
    Statement statement = con.createStatement() ;
    resultset =statement.executeQuery("select * from blore") ;
%>

      <center>
    <h1> Welcome in Java by Anand,Bangalore</h1>
        <select>
        <%  while(resultset.next()){ %>
            <option><%= resultset.getString(2)%></option>
        <% } %>
        </select>
     </center>

<%

        }
        catch(Exception e)
        {
             out.println("wrong entry"+e);
        }
%>

</BODY>
</HTML>

======================Create Table Form DB=========================

> Create Database Anand;
> use Anand;
> Create table blore(id int(4), city varchar(30));;
>  insert into blore values('1',"Rewa");
insert into blore values('2',"Pune");
insert into blore values('3',"Bangalore");
insert into blore values('4',"Satna");


Monday, 13 April 2015

Simple Login Form With Servlet Forwarding

For Creating a login form with Servlet we have require some files
For fornt End:-index.html
For Forwarding control: Demo.java (Create as a servlet not a normal java file)
-----
index.html
---
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
@author ananddw
-->
<html><body>

        <form action="welcome" method="get" align="center">
           
                    Enter your name<input type="text" name="name"> <br>
               
           
                    Enter you password<input type="password" name="password"> <br>
 

            <input type="submit" value="login">
        </form>
</html>


============= Demo.java================




import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ananddw
 */

public class Demo extends HttpServlet{
   
public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
{
   
res.setContentType("text/html");

PrintWriter pw=res.getWriter();

String name=req.getParameter("name");
    System.out.println("Name is "+name);

String password=req.getParameter("password");
    System.out.println("Password is "+password);


pw.println("Welcome :-"+name +",with password:-"+password);

}
}
===============web.xml=======================

<web-app>

<servlet>
<servlet-name>anand</servlet-name>
<servlet-class>Demo</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>anand</servlet-name>
<url-pattern>/welcome</url-pattern>
</servlet-mapping>

</web-app>

============================================
Run this programme on server make sure that while creating a project you create dynamic web project else you will get Error .

Wednesday, 8 April 2015

Basic HTML Tag Used

<!---- 
Author: Anand
-->



<html>
      <head>
            <title> Welcome in the World of HTML </title>
            
      <form align="center">
            
      <body bgcolor="##33CCFF">
    
      <select name="DropDown">
            
          <option  id="1"  value="Anand" > Anand </option>
          
           <option  id="2" value="Antrish" >Antrish </option>
           
          <option  id="3" value="Ajeet" >Ajeet </option>
         
      </select>
      
      <br></br>
      
    DatePicker:  <input type="date" value="date"/>
    
       <br></br>
       
    Name:<input type="text" name="Username" />
    
     <br></br>
     
     Password:<input type="password" name="password" />
     
      <br></br>
      
      Male:<input type="radio" name="Male" value="male" checked="checked" />
      
       Female:<input type="radio" name="Male" value="male" checked="checked" />
       
          <br></br>
          
          ON:<input type="checkbox" name="ON" value="ON" checked="checked" />
          
          OFF:<input type="checkbox" name="OFF" value="OFF" checked="checked" />
          
            <br></br>
            
            <ol>
                  
                  <li>Ajeet</li>
                  
                  <li>Antrish</li>
                  
                  <li>Anand</li>
                  
            </ol>

            
             <br></br>
 <input type="file" name="Browse File" value="" width="50" />
             
              <br></br>
              
              <a href="http://learnjavabyanand.blogspot.in/">Click here</a>
              
            <br></br>
            
            <input type="submit" value="Submit" name="Submit" />

     
      </bdoy>
      
      </form>
      
</head>
  
</html>

             

            

Tuesday, 7 April 2015

How to get client IP address in a servlet

package com.anand;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ClientIP extends HttpServlet {

protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

     response.setContentType("text/html");
     PrintWriter out = response.getWriter();
            String name = request.getParameter("name");
           System.out.println("Eneter Name : " + name);
           System.out.println("IP Address of request : </font></b>" +
            request.getRemoteAddr()+"<h3>");

 }
}  

How to Get Client IP Address Using Java Code

/*
 * @author :Anand
 */

package com.anand;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class IP{

public static void main(String[] args) {
 
 InetAddress ip;
 try {
 
ip = InetAddress.getLocalHost();
System.out.println("Your IP is====>" + ip.getHostAddress());
 
 } catch (UnknownHostException e) {
 System.out.println("catch the exception if Error Come ===>"+e);
 
e.printStackTrace();
 
 }
 
}
 
}

Saturday, 4 April 2015

"How to Read file Line by line from your system Using java code "

package com.Anand;

/*  
 * Created by : Anand
 * Date: 04-APR-2015       
 *         */



import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Reader {



 
public static void main(String[] args) {
 
try (
BufferedReader br = new BufferedReader(new FileReader("E:\\Anand.txt")))

{
System.out.println("Read file ok ===> "+br);
String LinebyLine;
 
while ((LinebyLine = br.readLine()) != null) {
System.out.println("Read file Line by line===> "+LinebyLine);
}
 
} catch (IOException e) {
e.printStackTrace();

 
}}

Wednesday, 1 April 2015

 ======================================================================
How to See Total Visitors in webpage Using  HTMl front End and Servlet Used for forwarding the Control ?
=======================================================================
For creating this project we need to create Some files like :-
index.jsp :- for front page
logout.jsp:- for log out page
            
________________________________index.jsp________________________________________

<html>
<body bgcolor="#FFCCFF">
<h1 align="center">Welcome to the World of java </h1>
<table align="right">
<tr>
<td>
<h4>
Total Visited :<%=application.getAttribute("TV") %>
</h4></td>
</tr>
<tr>
<td>
<h4>
Total Active :<%=application.getAttribute("TA") %>
</h4></td>
</tr>
</table>
<br />
<br />
<h4 align="center">Home page</h4>
<br />
<br />
<a href="logout.jlc">LOGOUT</a>
</body>
</html>

____________________________________Logout.jsp____________________________________
<%@ page session="false"%>
<html>
<body bgcolor="#FFCCFF">
<h1>Welcome to the World of java </h1>
<table align="right">
<tr>
<td>
<h4>
Total Visited :<%=application.getAttribute("TV") %>
</h4></td>
</tr>
<tr>
<td>
<h1>
Total Active :<%=application.getAttribute("TA") %>
</h1></td>
</tr>
</table>
<br />
<br />
<h4>You have logged out successfully</h4>
<br />
<br />
<a href="index.jsp">Go To Index Page</a>
</body>
</html>

======================================================================
Now for forwarding a Control we have create three servlet classes 
LogoutServlet.java
MyContextListener.java
MySessionListener.java

______________________________LogoutServlet.java ________________________________
package com.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class LogoutServlet extends HttpServlet {
protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    HttpSession sess=req.getSession(false);
    if(sess!=null)
    sess.invalidate();
    RequestDispatcher rd=req.getRequestDispatcher("logout.jsp");
    rd.forward(req, res);
}

}

__________________________MyContextListener.java________________________________
package com.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class MyContextListener implements ServletContextListener {
      public void contextInitialized(ServletContextEvent event) {
    System.out.println("**ContextInitialized***");
    ServletContext ctx=event.getServletContext();
    ctx.setAttribute("TV", 0);  
    ctx.setAttribute("TA", 0);  
    }
    public void contextDestroyed(ServletContextEvent arg0) {
    System.out.println("***contextDestroyed**");
    }
}

__________________________MySessionListener.java______________________________
package com.servlet;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class MySessionListener implements HttpSessionListener {
    public void sessionCreated(HttpSessionEvent event) {
    HttpSession sess=event.getSession();
    ServletContext ctx=sess.getServletContext();
    int tv=(Integer) ctx.getAttribute("TV");
    tv++;
    ctx.setAttribute("TV", tv);
    int ta=(Integer) ctx.getAttribute("TA");
    ta++;
    ctx.setAttribute("TA", ta);
    }
    public void sessionDestroyed(HttpSessionEvent event) {
    HttpSession sess=event.getSession();
    ServletContext ctx=sess.getServletContext();
    int ta=(Integer) ctx.getAttribute("TA");
    ta--;
    ctx.setAttribute("TA",ta);
    
    }
}
====================================================================
For mapping
web.xml 

_______________________________web.xml___________________________________
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>Lab29</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>logoutServ</servlet-name>
    <servlet-class>com.servlet.LogoutServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>logoutServ</servlet-name>
    <url-pattern>/logout.jlc</url-pattern>
  </servlet-mapping>
  <listener>
    <listener-class>com.servlet.MyContextListener</listener-class>
  </listener>
  <listener>
    <listener-class>com.servlet.MySessionListener</listener-class>
  </listener>
</web-app>



==================================================================
Please find attached image   where we put all these files so it can be accessible  and O/P Console as well .


if any Doubt and suggestion  wanted Contact any time 





Thanks & Regards
Anand Dwivedi
Software Developer 
Email: ananddwivedi92@gmail.com

Map class field to map

 import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; public class AutogeneratedClassMapper {     public static M...