Skip to main content

Posts

Showing posts with the label JSP

Free Java Video tutorials -java EE JSP Servlet Maven Spring Hibernate

First of all “ HAPPY NEWYEAR TO ALLZ… ” . I have been thinking of how can I start this new year; with do something good to people ; and I end up with writing something in this blog which helps to java newbies . I am going to share some open source(free) resource helps you to get started with java web development . Java video tutorials 1.    http://javabrains.koushik.org/p/home.html 2.    http://www.youtube.com/user/patrickwashingtondc 3.    http://www.youtube.com/channel/UCJiNQzZSUO6kYlbb4WUvJQA 4.    http://java9s.com/ 5.    http://www.pvtuts.com/java/java-introduction 6.    http://www.javavids.com/ 7.    http://www.ittrainersonline.com/maven-online-training-videos/ 8.    http://www.youtube.com/user/javascreencasts/about Paid tutorials : 1.http://www.vtc.com/products/Advanced-Java-Programming-Java-SE7-Tutorials.htm 2. http://www.lynda.com/Java...

JSP page directives

A jsp page directive looks like this: <%@ directive attribute="value" %> I am not gonna explain each and every page directives here . I would like to discuss about two page directives  which is import and include. First of all consider the import directive . The following simple program illustrate the use of import page directive: The output would be something looks like this: <%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%>  <%@ page import="java.util.Date" %>   //page directive <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Jsp Basics</title> </head> <body> <%=new Date() %> </body> </html> Tue Nov 12 17:42:34 I...

JSP Basic syntax -Declarations Scriptlets

In this post I would like to explain basic syntax of JSP Lets start with the Scriptlet Following is the syntax of scriptlet: <% code goes here…..%> On other hand code rendered inside <% %> these tags considered as jsp code; and compiled as JSP code We have XML equivalent of the above syntax ;it would be looks something like this: Code goes here…… Now let’s write a simple jsp file: <% int i=2; int k=3; int j=k+i; out.println("sum of i and j is:"+j); %> The output would be something like this: Sum of I and j is:5  Nothing special in it; now consider the xml syntax we can run the above code like this: int i=2; int k=3; int j=k+i; out.println("sum of i and j is:"+j); In jsp there is a shortcut for out.println() method .consider the following example <% int i=2; int k=3; int j=k+i; %> Sum of I an j is:<%=k%> Ie <%= variable %> this way we can print a variable inside a jsp file. When compared to out.p...

Introduction to JSP

  Now lets explore JSP (Java Server Page) Inoder to understand JSP we have very much understanding of what serverlet is. If you don't have the basic understanding what servlet does . i would recommend review the previous post first and start with this one.So what is a Jsp ?. Before we explore JSP i would like to explain one potential problem of using servlets; to be honest we can develop any web application using servlets we have all required technology to do that so you can capture any user request through url and assign a servlet to handle it and any html code written in servlet .But Creating html code inside servlet is very crucial process means using print writer manipulating a dynamic html page is highly Challenging. We can tackle this situation by using Jsp so that we can write java code inside html code.