JSP Articles

Page 2 of 8

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

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 523 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

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

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ 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.

Read More

How to print a date using JSP Expression?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 422 Views

Following example shows a JSP Expression printing date on the browser −           A Comment Test     Today's date: The above code will generate the following result −Today's date: 11-Sep-2010 21:24:25

Read More

What are JSP literals?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 821 Views

The JSP expression language defines the following literals −Boolean − true and falseInteger − as in JavaFloating point − as in JavaString − with single and double quotes; " is escaped as ", ' is escaped as ', and \ is escaped as \.Null − null

Read More

What is the function of action in JSP?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 537 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 are JSP declarations? In how many ways we can write JSP declarations?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 350 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 −

Read More

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

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 1K+ 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 −

Read More

What are JSP comments?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 8K+ Views

JSP comment marks text or statements that the JSP container should ignore. A JSP comment is useful when you want to hide or "comment out", a part of your JSP page.Following is the syntax of the JSP comments −Following example shows the JSP Comments −           A Comment Test               A Test of Comments           The above code will generate the following result −A Test of Comments

Read More

What is the difference between JspWriter and PrintWriter?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 300 Views

The JspWriter object contains most of the same methods as the java.io.PrintWriter class. However, JspWriter has some additional methods designed to deal with buffering. Unlike the PrintWriter object, JspWriter throws IOExceptions.

Read More
Showing 11–20 of 77 articles
« Prev 1 2 3 4 5 8 Next »
Advertisements