Found 34484 Articles for Programming

How to use action in JSP?

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

845 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

938 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

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

285 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

How to write a JSP Expression?

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

389 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

966 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 −

Advertisements