JSP Articles

Page 3 of 8

What is an application Object in JSP?

George John
George John
Updated on 30-Jul-2019 497 Views

The application object is direct wrapper around the ServletContext object for the generated Servlet and in reality an instance of a javax.servlet.ServletContext object.This object is a representation of the JSP page through its entire lifecycle. This object is created when the JSP page is initialized and will be removed when the JSP page is removed by the jspDestroy() method.By adding an attribute to application, you can ensure that all JSP files that make up your web application have access to it.

Read More

What is extends attribute in JSP?

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

The extends attribute specifies a superclass that the generated servlet must extend.For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass −

Read More

What is info attribute in JSP?

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

The info attribute lets you provide a description of the JSP. The following is a coding example −

Read More

What is isThreadSafe attribute in JSP?

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

The isThreadSafe option marks a page as being thread-safe. By default, all JSPs are considered thread-safe. If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.The following page directive sets the isThreadSafe option to false −

Read More

How to use action in JSP?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.The getProperty action has only two attributes, both of which are required. The syntax of the getProperty action is as follows − ... Following table lists out the required attributes associated with the getProperty action −Sr.No.Attribute & Description1nameThe name of the Bean that has a property to be retrieved. The Bean must have been previously defined.2propertyThe property attribute is the name of the Bean property to be retrieved.ExampleLet us define a test bean that will ...

Read More

How many types of directive tags JSP supports?

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

A JSP directive affects the overall structure of the servlet class. It usually has the following form −Directives can have a number of attributes which you can list down as key-value pairs and separated by commas.The blanks between the @ symbol and the directive name, and between the last attribute and the closing %>, are optional.There are three types of directive tag −S.No.Directive & Description1Defines page-dependent attributes, such as scripting language, error page, and buffering requirements.2Includes a file during the translation phase.3Declares a tag library, containing custom actions, used in the page

Read More

What is the use of jsp text action element?

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

The action can be used to write the template text in JSP pages and documents. Following is the simple syntax for this action −Template dataThe body of the template cannot contain other elements; it can only contain text and EL expressions (Note − EL expressions are explained in a subsequent chapter). Note that in XML files, you cannot use expressions such as ${whatever > 0}, because the greater than signs are illegal. Instead, use the gt form, such as ${whatever gt 0} or an alternative is to embed the value in a CDATA section.]]>If you need to include a ...

Read More

What is language attribute in JSP?

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

The language attribute indicates the programming language used in scripting the JSP page.For example, because you usually use Java as the scripting language, your language option looks like this −

Read More

What is session attribute in JSP?

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

The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin session object and a value of false means that the JSP page cannot access the builtin session object.Following directive allows the JSP page to use any of the builtin object session methods such as session.getCreationTime() or session.getLastAccessTime() −

Read More

I need to understand how to use a bean and update its properties in JSP page. Please share an example.

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

The useBean action is quite versatile. It first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object.The simplest way to load a bean is as follows −Once a bean class is loaded, you can use jsp:setProperty and jsp:getProperty actions to modify and retrieve the bean properties.Following table lists out the attributes associated with the useBean action −S.No.Attribute & Description1classDesignates the full package name of the bean.2typeSpecifies the type of the variable that will refer to the object.3beanNameGives the name of the bean as specified ...

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