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
Type casting defines treating a variable of one type as though it is another type. When up casting primitives as given below from left to right, automatic conversion happens. Bu

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

According to XMPP Standards Foundation "XMPP is the Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice

SMTP (Simple Mail Transfer Protocol) permits two mail servers to communicate using a easy language, and gives a step-by-step protocol for exchanging information. SMTP delivers m

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Prepare a Java Look and Feel Theme from HTML Template Project Description: For this project you would be needed to create a Java LAF (Look and Feel) Theme from this HTML Y



To simplify complex class diagrams you may group classes into packages.

Create an application for Koch’s Cottages, a weekend getaway resort that rents cottages and boats to use on the local lakenimum 100 words accepted#