Found 9326 Articles for Object Oriented Programming

How many types of directive tags JSP supports?

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

94 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

What are JSP Directives?

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

194 Views

A JSP directive affects the overall structure of the servlet class. It usually has the following form −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

I want to use %> literal in JSP page. But it is throwing error. How to escape this syntax in JSP?

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

114 Views

You can escape it using backslash character. Replace %> with %/>. Following example showcases the same. A Comment Test Syntax: Today's date:

How to use action in JSP?

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

827 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

What are JSP comments?

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

6K+ 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

How to use action in JSP?

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

919 Views

The setProperty action sets the properties of a Bean. The Bean must have been previously defined before this action. There are two basic ways to use the setProperty action −You can use jsp:setProperty after, but outside of a jsp:useBean element, as given below − ... In this case, the jsp:setProperty is executed regardless of whether a new bean was instantiated or an existing bean was found.A second context in which jsp:setProperty can appear is inside the body of a jsp:useBean element, as given below − ... Here, the jsp:setProperty is executed only if ... Read More

How to write a comment in a JSP page?

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

10K+ Views

JSP comment marks to 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 CommentsThere ... Read More

How to use action in JSP?

George John
Updated on 30-Jul-2019 22:30:25

3K+ 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 −Sr.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

How to print a date using JSP Expression?

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

277 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

Advertisements