التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف Advance JAVA

AJAX in Spring MVC

AJAX in Spring MVC:- ..............................................................................................  <%@ page language="java" contentType="text/html; charset=ISO-8859-1"     pageEncoding="ISO-8859-1"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> <script> function searchdata(param) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if(param!='') { document.getElementById("res").innerHTML = xmlhttp.responseText; } else { document.getElementById("res").innerHTML = ''; } } xmlhttp.open("post","ajaxcode.do?q="+param,true); xmlhttp.send(); } </script> </head> <body> <input type="text" placeholder="enter character" onkeyup="searchdata(this.value)" /> <div id=...

What is Servlet or Web Servlet?

                                                                                                                                             Next Chapter It is a predefined Java Interface that provide   HttpServlet class that exists under javax.http.servlet package. This class will be compiled by Java Compiler and executed by JVM under  Servlet container by Web Server. A Servlet container is used to manage the servlet code that is written on the java programming language of an application, Webserver is only used to manage static files (HTML, JS, CSS, Jquery) and JSP Web page but dynamic content will be managed by Servle...

Servlet Example in Java

Servlet is the special class in java which provide a set of web method to write server-side java program. Servlet class is used to implement dynamic functionality under the JAVA Web application. Servlet is also called Server Side Java Class. Java provides a HttpServlet class to implement Servlet Functionality. Servlet class will run under a web server or application server. means we should install Apache Web Server or Glassfish Web Server to execute Servlet Class class Classname extends HtttpServlet {      public void doPost(HttpServletRequest request,HttpServletResponse response)      {       }       public void doGet(HttpServletRequest request,HttpServletResponse response)      {       } } How to create Servlet Class Practically:- In Eclipse:- File   ---->   New Project---> Dynamic Web Project  ---->  Web Application-->Right-click on  Sourc...

Create Design in Servlet using HTML and Css,How to write HTML and CSS Code in Servlet

It means Hypertext markup language that is used to design the user interface of a Web application for all web technology. HTML has predefined elements and attributes to design a web page:- <html> <head> </head> <body> </body> </html> CSS:-   it means a cascading style sheet, it is used to provide properties to design an attractive HTML web page,, for example, if we want to color, font, size, margin, padding, position, shape then we use CSS. Addition Program for Servlet:- package scs; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/Addition") public class Addition extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ...

Create Servlet Program using post method with HTML Form

Create Servlet Program using post method using HTML Form:- mostly we design HTML form on the JSP Web page but it is an example to design HTML form elements under servlet. Example for addition:- Create servlet and first design User-interface on doGet() and Write code on doPost():- package scs; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/DesignExample") public class DesignExample extends HttpServlet { private static final long serialVersionUID = 1L;            /**      * @see HttpServlet#HttpServlet()      */     public DesignExample() {         super();         // TODO Auto-generated constructor stub     } /** * @see HttpServl...

RequestDispatchar in Java,What is RequestDispatchar ?

It is used to navigate application content from the web server without using a web browser. RequestDisptchar Interface Provides better performance as compared to redirect() but we can not manage browser state using session and cookies.URL will not change in Requestdispatcher Interface. It contain navigation from J SP to Servle t or Servlet to Servlet or Servlet to JSP . redirect() is also used to navigate from JSP to Servlet and Servlet to Servlet but it completes roundtrip from server to client then the client to another page hence it will manage browser state using session and cookies and URL will change. Requestdispatcher has two different methods for Page Redirection:- 1) Forward:-  It is used to forward a request from one servlet to another without changing the URL because it will directly forward application content from Server to Server.    Syntax         RequestDispatcher req=  request.getRequestDispatcher("Servlet2");    ...

JSP Introduction,JSP Tutorials

JSP Introduction :- JSP means Java Server Page , It is used to create a dynamic web page under Java web application. We can easily write HTML Code on the JSP web page hence JSP is mostly used to create the d esign layer of an application. Designers can also design a complete web page using JSP because the JSP view is similar to HTML View. For Standard Java Web Application, We will create JSP for designing and Servlet for Programming.  .............................................................................................................................................  What is the difference between JSP and Servlet? 1) JSP is used to create a design layer and the Servlet is used to contain the code layer of an application. 2)  We can write static text and dynamic text both under the JSP web page with separate code structure but  Servlet is a Pure Java class that means we will write HTML Code content under the Servlet predefine method. 3)  JSP web page on...

JSP Page design using Internal CSS

  JSP is used to design the user interface of an application, CSS is used to provide set of properties. Jsp provide proper page template to create user interface of dynamic web application. We can write CSS using three different ways 1)  inline CSS:-   we will write CSS tag under HTML elements <div style="width:200px; height:100px; background-color:green;"></div> 2)  Internal CSS:-  we will write CSS under <style> block. <style type="text/css"> #abc { width:200px;  height:100px;  background-color:green; } </style> <div id="abc"></div> 3) External CSS:-  we will write CSS to create a separate file and link it into HTML Web pages. create a separate file and named it style.css #abc { width:200px;  height:100px;  background-color:green; } go into Jsp page and link style.css <link href="style.css"  type="text/css" rel="stylesheet"   /> <div id="abc"> </div> Exam...

Create Addition Program using JSP and Servlet

Create Addition Program using JSP and Servlet This is the standard approach of Java web application that we should always create a design layer under JSP and code layer under servlet. It is also called the 2-tier architecture of java means we work on two different layers then it will be 2-tier. Step by Step Implementation of Java Web Development:- Step1st:-    Create a JSP web page and design form using HTML Form Content.                       <form action="ServletName" method="post">                                 </form> Step2nd:-   Create Servlet and Write Code under doPost() in eclipse otherwise in Netbeans processRequest() which is used define method which will be called under doGet() and doPost()               ...

What is Database? Database definition

What is Database? The database is used to store information permanently under database software using DBMS, RDBMS , and ORDBMS . DBMS means Database management System:-     It is used to store data using file patterns, we can not establish a relationship between records.  means we can not create primary key and foreign key concepts .for example .xls,.xlsx, Foxpro, and the XML file is the example of DBMS. RDBMS  Relational Database Management System:-   Using this we can store records using rows and tuples, which means using RDBMS we can establish a relationship between tables using primary key and foreign key. MYSQL,ORACLE, MS-SQL,Sybase,IBM DB2. SQL Language is used in the RDBMS pattern, SQL means Structured query language which provides a set of commands to perform the operation. ORDBMS  Object-Relational Database Management System:- Using this we can store records using Object Pattern similar to Object-oriented programming language. ORACLE ...

JDBC Introduction,CRUD in JSP,Servlet,Insert,Update,Delete,Select record using JDBC,JDBC CRUD

It is intermediate technology of Java that is used to perform database operations using drivers and providers, JDBC contains a set of classes and methods to perform database operations for the different database servers. JDBC means Java Database connectivity, It is used to create dynamic applications of Java because JDBC has database-related classes and methods to perform database operations. It will work as a bridge between the java application and the database server. It works using four different types:- 1)  type1:-      JDBC-ODBC Driver:-   It is used for desktop applications because ODBC provides local connection using DSN (Data source name) 2) type2:- JDBC-Network Specific Driver -  It is used to connect the database from a different network, It uses C and C++ Programming approach to connect the server machine. 3) type3:-    JDBC-Vendor Specific Driver, It uses a third-party library to communicate application data to the database server, ...