Found 9326 Articles for Object Oriented Programming

How to write a JSP Expression?

Samual Sam
Updated on 30-Jul-2019 22:30:25

381 Views

A JSP expression element contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file.Because the value of an expression is converted to a String, you can use an expression within a line of text, whether or not it is tagged with HTML, in a JSP file.The expression element can contain any expression that is valid according to the Java Language Specification but you cannot use a semicolon to end an expression.Following is the syntax of JSP Expression −You can write the XML equivalent of the above syntax as ... Read More

What is the difference between include action and include directive in JSP?

Chandu yadav
Updated on 30-Jul-2019 22:30:25

1K+ Views

include action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.

How to declare an object of a class using JSP declarations?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

952 Views

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.Following is the syntax for JSP Declarations −You can write the XML equivalent of the above syntax as follows − code fragment Following is an example of Object declaration in JSP Declarations −

What are JSP declarations? In how many ways we can write JSP declarations?

Samual Sam
Updated on 30-Jul-2019 22:30:25

155 Views

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.Following is the syntax for JSP Declarations −You can write the XML equivalent of the above syntax as follows − code fragment Following is an example for JSP Declarations −

What is the function of action in JSP?

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

284 Views

This action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.Following table lists out the attributes associated with the include action −S.No.Attribute & Description1pageThe relative URL of the page to be included.2flushThe boolean attribute determines whether the included resource has its buffer flushed before it is included.ExampleLet us define the following two files (a)date.jsp and (b) main.jsp as follows −Following is the content of ... Read More

What is a scriptlet in JSP and what is its syntax?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

1K+ Views

A scriptlet can contain any number of JAVA language statements, variable or method declarations, or expressions that are valid in the page scripting language.Following is the syntax of Scriptlet −You can write the XML equivalent of the above syntax as follows − code fragment Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first example for JSP −           Hello World               Hello World!      

What do the id and scope attribute mean in the action elements in JSP?

Ankith Reddy
Updated on 30-Jul-2019 22:30:25

334 Views

These are two attributes that are common to all Action elements: the id attribute and the scope attribute.Id attributeThe id attribute uniquely identifies the Action element and allows the action to be referenced inside the JSP page. If the Action creates an instance of an object, the id value can be used to reference it through the implicit object PageContext.Scope attributeThis attribute identifies the lifecycle of the Action element. The id attribute and the scope attribute are directly related, as the scope attribute determines the lifespan of the object associated with the id. The scope attribute has four possible values:(a) ... Read More

Please explain lifecycle of a JSP

Samual Sam
Updated on 30-Jul-2019 22:30:25

162 Views

A JSP life cycle is defined as the process from its creation till the destruction. This is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.Paths Followed By JSPThe following are the paths followed by a JSP −CompilationInitializationExecutionCleanupThe four major phases of a JSP life cycle are very similar to the Servlet Life Cycle. The four phases have been described below −JSP CompilationWhen a browser asks for a JSP, the JSP engine first checks to see whether it needs to compile the page. If the page has never been compiled, ... Read More

How a JSP page works. Can somebody explains the JSP architecture in simpler terms

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

620 Views

The web server needs a JSP engine, i.e, a container to process JSP pages. The JSP container is responsible for intercepting requests for JSP pages. This tutorial makes use of Apache which has built-in JSP container to support JSP pages development.A JSP container works with the Web server to provide the runtime environment and other services a JSP needs. It knows how to understand the special elements that are part of JSPs.Following diagram shows the position of JSP container and JSP files in a Web application.JSP ProcessingThe following steps explain how the web server creates the Webpage using JSP −As ... Read More

How to setup a Web server like Tomcat to test JSP pages?

Samual Sam
Updated on 30-Jul-2019 22:30:25

784 Views

Apache Tomcat is an open source software implementation of the JavaServer Pages and Servlet technologies and can act as a standalone server for testing JSP and Servlets, and can be integrated with the Apache Web Server. Here are the steps to set up Tomcat on your machine −Download the latest version of Tomcat from https://tomcat.apache.org/.Once you downloaded the installation, unpack the binary distribution into a convenient location. For example, in C:\apache-tomcat-5.5.29 on windows, or /usr/local/apache-tomcat-5.5.29 on Linux/Unix and create CATALINA_HOME environment variable pointing to these locations.Tomcat can be started by executing the following commands on the Windows machine −%CATALINA_HOME%\bin\startup.bat ... Read More

Advertisements