Found 177 Articles for JSP

What is the purpose of taglib directive in JSP?

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

503 Views

The taglib directive declares that your JSP page uses a set of custom tags, identifies the location of the library, and provides means for identifying the custom tags in your JSP page.The taglib directive follows the syntax given below −Where the uri attribute value resolves to a location the container understands and the prefix attribute informs a container what bits of markup are custom actions.You can write the XML equivalent of the above syntax as follows −When you use a custom tag, it is typically of the form . The prefix is the same as the prefix you specify in ... Read More

How to use Action in JSP?

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

592 Views

The plugin action is used to insert Java components into a JSP page. It determines the type of browser and inserts the or tags as needed.If the needed plugin is not present, it downloads the plugin and then executes the Java component. The Java component can be either an Applet or a JavaBean.The plugin action has several attributes that correspond to common HTML tags used to format Java components. The element can also be used to send parameters to the Applet or Bean.Following is the typical syntax of using the plugin action −         ... Read More

How to use Action in JSP?

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

802 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

237 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

86 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

180 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

105 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

716 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

Advertisements