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
Need Professional Framework Coder with Video Coding Experience? Project Description: Professional Framework Coder with Video Coding experience. You must know API, Java, C++,

Need Toward Privacy Preserving and Collusion Resistance in a Location Proof Updating System Project Description: Today's location-sensitive service relies on user's mobile de

The roster lets you keep track of the availability ("presence") of other users. A roster also allows you to organize users into groups such as "Friends" and "Co-workers". Other IM

J2EE (Java 2 Enterprise Edition) is an environment for deploying and developing enterprise applications on various operating system. The J2EE platform consists of J2EE components,

1. The spring container searches the bean's definition from the XML file and instantiates the bean. 2. Using the dependency injection, spring populates all of the properties as

What is Arithmetic promotion assignment and casting? In an assignment statement, i.e. if there's an equals sign, Java compares the type of the left hand side to the at last typ

The Applet's life cycle functions are as follows: public void init() : Initialization function called only once by the browser. public void start() : Method called after

can you explain me the er diagram for the online doctor system

What is an Exceptions ? • What is an exception? • try-catch • finally • The different kinds of exceptions • Multiple catch clauses • The throws clause • Throwing excepti

I want cyclos mobile banking USSD and IVR module Project Description: We already have a Cyclos mobile banking project deployed on our server with SMS banking module. The s