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
Why we Avoiding Short Circuits ? If you need all of your boolean expressions evaluated regardless of the truth value of each, then you can use & and | instead of && and ||. The

In this assignment, you will implement the game of Boggle, a word game in which players connect adjacent letters on a 4x4 board to create as many words as possible. This is based o

An aspect is the cross-cutting functionality that you are executing. It is the aspect of your application you are modularizing. An example of an aspect is logging. Logging is somet

Question: (a) Explain the event handling mechanism using a 'JComboBox' as example. Your answer must clearly indicate the event source, event object and event listener. Also

How can we define a Pixel? It is the smallest number of element of image that is spread along with regular array on display and each constituent consist of particular color.

You are to write a program name arrayScaling.java that will randomly generate 5000 integer number raging from 1 - 49 and place them in an array. 1.  The program will scale thi

Classes are attached into the JVM as they are referenced by name in a class that is already running in the JVM. So, how is the staring class loaded? The very first class is espec

What are the different types of messages available in the JMS API? Ans) Message, TextMessage, BytesMessage, StreamMessage, ObjectMessage, MapMessage are the dissimilar messages

Explain the Remainder or Modulus Operator in Java? Java has one significant arithmetical operator you might not be familiar with, %, also called as the modulus or remainder ope

Defiine the term Object ? Object is a named collection of properties (data, state) & techniques (instructions, behavior). Mainly Objects are key to understanding object-oriente