Found 9297 Articles for Object Oriented Programming

How to use Action in JSP?

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

839 Views

The forward action terminates the action of the current page and forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.Following is the syntax of the forward action −Following table lists out the required attributes associated with the forward action −Sr.No.Attribute & Description1pageShould consist of a relative URL of another resource such as a static page, another JSP page, or a Java Servlet.ExampleLet us reuse the following two files (a) date.jsp and (b) main.jsp as follows −Following is the content of the date.jsp file −Today's date: Following is the content of the ... Read More

I am facing problem in using include directive tag in jsp. Please share a working example.

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

263 Views

The include directive is used to include a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase. You may code include directives anywhere in your JSP page.The general usage form of this directive is as follows −The filename in the include directive is actually a relative URL. If you just specify a filename with no associated path, the JSP compiler assumes that the file is in the same directory as your JSP.You can write the XML equivalent of the above syntax as follows ... Read More

How many types of directive tags JSP supports?

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

99 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

198 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

117 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

846 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

Advertisements