Found 9326 Articles for Object Oriented Programming

What implicit objects are supported by JSP?

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

116 Views

Following table lists out the nine Implicit Objects that JSP supports −Sr.No.Object & Description1requestThis is the HttpServletRequest object associated with the request.2responseThis is the HttpServletResponse object associated with the response to the client.3outThis is the PrintWriter object used to send output to the client.4sessionThis is the HttpSession object associated with the request.5applicationThis is the ServletContext object associated with the application context.6configThis is the ServletConfig object associated with the page.7pageContextThis encapsulates use of server-specific features like higher performance JspWriters.8pageThis is simply a synonym for this, and is used to call the methods defined by the translated servlet class.9ExceptionThe Exception object allows ... Read More

What is the use of jsp text action element?

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

98 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 the use of jsp plugin action element?

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

138 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

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

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

539 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

What are the different scope values for the JSP action in JSP?

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

537 Views

scope attribute identifies the lifecycle of the Action element. The id attribute and the scope attribute are directly related, as the scope attribute determines the lifespan of the object associated with the id. The scope attribute has four possible values: (a) page,  (b)request,  (c)session, and (d) application.

What is the use of Action in JSP?

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

542 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 the purpose of taglib directive in JSP?

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

520 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

711 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

833 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

258 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

Advertisements