Found 34484 Articles for Programming

What is session attribute in JSP?

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

2K+ Views

The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin session object and a value of false means that the JSP page cannot access the builtin session object.Following directive allows the JSP page to use any of the builtin object session methods such as session.getCreationTime() or session.getLastAccessTime() −

What is language attribute in JSP?

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

351 Views

The language attribute indicates the programming language used in scripting the JSP page.For example, because you usually use Java as the scripting language, your language option looks like this −

What is isThreadSafe attribute in JSP?

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

1K+ Views

The isThreadSafe option marks a page as being thread-safe. By default, all JSPs are considered thread-safe. If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.The following page directive sets the isThreadSafe option to false −

What is info attribute in JSP?

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

255 Views

The info attribute lets you provide a description of the JSP. The following is a coding example −

What is import attribute in JSP?

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

1K+ Views

The import attribute serves the same function as and behaves like, the Java import statement. The value for the import option is the name of the package you want to import.To import java.sql.*, use the following page directive −To import multiple packages, you can specify them separated by comma as follows −By default, a container automatically imports java.lang.*, javax.servlet.*, javax.servlet.jsp.*, and javax.servlet.http.*.

What is extends attribute in JSP?

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

591 Views

The extends attribute specifies a superclass that the generated servlet must extend.For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass −

How to send an error code using JSP to browser?

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

285 Views

Following example shows how a 407 error code is sent to the client browser. After this, the browser would show you "Need authentication!!!" message.           Setting HTTP Status Code     You will receive the following output −HTTP Status 407 - Need authentication!!! type Status report message Need authentication!!! description The client must first authenticate itself with the proxy (Need authentication!!!). Apache Tomcat/5.5.29

How to refresh a JSP page at regular interval?

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

260 Views

Following example would use setIntHeader() method to set Refresh header to simulate a digital clock −           Auto Refresh Header Example                        Auto Refresh Header Example                 Now put the above code in main.jsp and try to access it. This will display the current system time after every 5 seconds as follows. Run the JSP. You will receive the following output: −Auto Refresh Header ExampleCurrent Time is: 9:44:50 PM

What is isErrorPage attribute in JSP?

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

1K+ Views

The errorPage attribute tells the JSP engine which page to display if there is an error while the current page runs. The value of the errorPage attribute is a relative URL.The following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown −The isErrorPage attribute indicates that the current JSP can be used as the error page for another JSP.The value of isErrorPage is either true or false. The default value of the isErrorPage attribute is false.For example, the handleError.jsp sets the isErrorPage option to true because it is supposed to handle errors −

What are important server response headers that are useful in web programming?

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

122 Views

Following is a summary of the most useful HTTP 1.1 response headers which go back to the browser from the web server. These headers are frequently used in web programming −Sr.No.Header & Description1AllowThis header specifies the request methods (GET, POST, etc.) that the server supports.2Cache-ControlThis header specifies the circumstances in which the response document can safely be cached. It can have values public, private or no-cache etc. Public means document is cacheable, Private means document is for a single user and can only be stored in private (nonshared) caches and no-cache means document should never be cached.3ConnectionThis header instructs the ... Read More

Advertisements