What are the basic components of jsp?, JAVA Programming

There are two different types of data in a JSP page.

1. Static part which occurs copied directly to the response by the JSP Engine.

2. Dynamic part, which have anything that may be compiled and translated by the JSP Engine.

There are three basic types of dynamic components. (TIP: remember SAD as an abbreviation for Scripting, Directive elements, and Action).

Declaration component: is the embedded Java declaration statement, which gives inserted at the Servlet class level.

<%! Calendar c = Calendar.getInstance(); %>

 Can you define a method within your JSP page?

You can define methods within your JSP pages as declarations, and your methods may be called from within your other methods you define, scriptlets or expression elements. Those declared functions do not have direct access to the JSP implicit objects like response, request, session etc but you may pass them to your functions you declare as parameters.

Expression Element: is the embedded Java expression, which gets solved by the service method.

<%= new Date() %>

Scriptlet Element: are the embedded Java statements, which get performed as part of the service function.

<%

            String username = null;

username = request.getParameter("firstName"); //"request" is a JSP implicit object

%>

Action components: A JSP element that gives information for execution phase.

 

Posted Date: 7/25/2012 4:02:47 AM | Location : United States







Related Discussions:- What are the basic components of jsp?, Assignment Help, Ask Question on What are the basic components of jsp?, Get Answer, Expert's Help, What are the basic components of jsp? Discussions

Write discussion on What are the basic components of jsp?
Your posts are moderated
Related Questions
SudCell and Simple Sudoku Implementation We describe, fully, the SudCell class that will represent each of the 81 cells or boxes in a Sudoku puzzle.  Then we will

Why are JSP pages the preferred API for creating a web-based client program? Because no plug-ins or security policy files are required on the client systems (applet does). Also,

List the Parentheses used in Java language? As usual here's the output: % javac FahrToCelsius.java % java FahrToCelsius 0 -17.7778 20 -6.66667 40 4.44444 60 15.5556 80 26.6667

Why should we, as computing professionals, be interested within studying the social implications of our creations? This is important Because of remaining the track of money wis

The program: 2 classes one called Student, one called Grades Functional Requirements: Ask for how many students u need to enter the program must: prompt the user to enter the

System Program Project Description: I want someone who can study my existing program and from there the updates may be done Skills required: Java, Oracle, MySQL, Softwa

An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm.  ActionForm handles the session state for web application and the ActionForm object is automatically p

1-4 Problem Set: Arithmetic Consider the following statement when responding to questions 1 and 2: Jim develops 5 Java applications a year. Joe develops 10 Java applications a year

What is meant by semantic error? Occur while a statement executes and has an effect not intended through the programmer and Frequently times occur only in unusual & infrequent

Application using Swing API