Filter servlet example

Filter servlet example explained here in only 2 minutes.Filter object is generally used for filtering both request or responce made to your web application. Where we use filter in servlet? Case 1: In day to day life when we make calls the call is intercepted and checked whether you are having sufficient balance. If balance==0 then      Filter says “You don’t…

Read More Read More

Jsp implicit object request

Jsp implicit object Request is used for getting the value from the UI controls in the JSP. Request object stores value in the form of HashMap. Step1:Create the jsp Create new jsp under folder webcontent with name survey.jsp Step2:Create the form with button Open survey.jsp. Create form with attribute action=”JEE/process.jsp” it means after we click on submit the data is…

Read More Read More

Jsp implicit object Config

jsp implicit Object config This is ServletConfig object associated with the page.It means the object and its value will be accessible within the same jsp page where it is defined. Web.xml(located in WebContent/Web-INF)

configdemo.jsp (located in WebContent folder)

Output Config Demo pageLevelValue If you have come this far it means you have enjoyed reading this article. Please comment…

Read More Read More

Jsp implicit Object response

jsp implicit object response object is the instance of the class HttpServletResponse class.The HttpServletResponse class implements interface javax.servlet.ServletResponse. Jsp implicit object response Methods: response.getWriter().println(“print something n jsp page”); this getWriter() method gives you writer which has print() to print the stuff on jsp page.the text which you want to print is passed as a parameter.

response.sendRedirect(“url”); this method is…

Read More Read More

Jsp Implicit Object pageContext

pagecontext is mainly used for get/set/remove the value from the pageConext instance of class PageContext. We do not need to create this instance as it is created by the container it self for us. The pageContext comes with flexibility where you can specify scope explicitly for each stored entity. Scopes for the entity which is saved in pageContext are page…

Read More Read More

Spring with hibernate jpa integration

Spring with hibernate jpa integration Folder Structure Download required Jars Jars Spring1.xml Folder Location:SpringCore/src/spring1.xml

Writing the Dao Layer with entitymanager and hibernate Folder Location:SpringCore/src/com/dao/

Service for invoking the dao layer Folder Location:SpringCore/src/com/service/

Entity class Folder Location:SpringCore/src/com/model/

Writing the Main funtion to test spring hibernate jpa integration Folder Location:SpringCore/src/com/main/

POM requred for this project

StringBuffer vs StringBuilder example

StringBuffer and StringBuilder are widely used to manipulate the strings in java. StringBuffer StringBuffer basically used for modifying String If we have String then why we should again learn this new class? Because String is immutable each modification on String creates new Object while in StringBuffer it is mutable when you modify contents of StringBuffer it does not create new…

Read More Read More

Java Mutithreading

Why we need multithreading in java I am going to explain in most simple easy way. Imagine google is giving you data in seconds literally 1000’s of links are fetched in less than a second.How this damn thing is possible.Let us take one example if you and your cousin is at home you are told to make the lunch at…

Read More Read More

Jdbc tutorial for beginners

Database is required for saving the record so that I can use saved data further.This is simple jdbc program to teach you jdbc in very simple easy step by step approach. In this tutorial you will learn how to use jdbc to save or get the records. 1.First step is to Load the driver. Class.forName(“oracle.jdbc.driver.OracleDriver”); How to load the driver and…

Read More Read More