- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34484 Articles for Programming
170 Views
The tag catches any Throwable that occurs in its body and optionally exposes it. It is used for error handling and to deal more gracefully with the problem.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultvarThe name of the variable to hold the java.lang.Throwable if thrown by elements in the body.NoNoneExample Tag Example The exception is : ${catchException} There is an exception: ${catchException.message} The above code will generate the following result −The exception is : java.lang.ArithmaticException: / by zero There is an exception: / by zero
368 Views
The tag removes a variable from either a specified scope or the first scope where the variable is found (if no scope is specified). This action is not particularly helpful, but it can aid in ensuring that a JSP cleans up any scoped resources it is responsible for.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultvarName of the variable to removeYesNonescopeScope of the variable to removeNoAll scopesExample Tag Example Before Remove Value: After Remove Value: The above code will generate the following result −Before Remove Value: 4000 After Remove Value:
117 Views
The tag is JSTL-friendly version of the setProperty action. The tag is helpful because it evaluates an expression and uses the results to set a value of a JavaBean or a java.util.Map object.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueInformation to saveNobodytargetName of the variable whose property should be modifiedNoNonepropertyProperty to modifyNoNonevarName of the variable to store informationNoNonescopeScope of variable to store informationNoPageIf target is specified, property must also be specified.Example Tag Example The above code will generate the following result −4000
2K+ Views
The tag displays the result of an expression. This is almost similar to the way works. The difference here is that tag lets you use the simpler "." notation to access properties. For example, to access customer.address.street, use the tag .The tag can automatically escape XML tags so they aren't evaluated as actual tags.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueInformation to outputYesNonedefaultFallback information to outputNobodyescapeXmlTrue if the tag should escape special XML charactersNotrueExample Tag Example The above code will generate the following result − , &
967 Views
The JavaServer Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which encapsulates the core functionality common to many JSP applications.JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating the existing custom tags with the JSTL tags.Install JSTL LibraryTo begin working with JSP pages you need to first install the JSTL library. If you are using the Apache Tomcat container, then follow these two steps −Step 1 − Download the binary distribution from Apache Standard Taglib and ... Read More
345 Views
Following is an example to send an email with attachment from your machine −Example Send Attachment Email using JSP Send Attachment Email using JSP Let us now run the above JSP to send a file as an attachment along with a message on a given email ID.User Authentication PartIf it is required to provide user ID and Password to the email server for authentication purpose, then you can set these properties as follows −Outputprops.setProperty("mail.user", "myuser"); props.setProperty("mail.password", "mypwd");
492 Views
Here is an example to send an HTML email from your machine. It is assumed that your localhost is connected to the Internet and that it is capable enough to send an email. Make sure all the jar files from the Java Email API package and the JAF package are available in CLASSPATH.This example is very similar to the previous one, except that here we are using the setContent() method to set content whose second argument is "text/html" to specify that the HTML content is included in the message.Using this example, you can send as big an HTML content as ... Read More
229 Views
To send an email using a JSP, you should have the JavaMail API and the Java Activation Framework (JAF) installed on your machine.You can download the latest version of JavaMail (Version 1.2) from the Java's standard website.You can download the latest version of JavaBeans Activation Framework JAF (Version 1.0.2) from the Java's standard website.Download and unzip these files, in the newly-created top-level directories. You will find a number of jar files for both the applications. You need to add the mail.jar and the activation.jar files in your CLASSPATH.Send a Simple EmailHere is an example to send a simple email from ... Read More
330 Views
JSP makes this job easy by providing you a mechanism where you can make a webpage in such a way that it would refresh automatically after a given interval.The simplest way of refreshing a Webpage is by using the setIntHeader() method of the response object. Following is the signature of this method −public void setIntHeader(String header, int headerValue)This method sends back the header "Refresh" to the browser along with an integer value which indicates time interval in seconds.Auto Page Refresh ExampleIn the following example, we will use the setIntHeader() method to set Refresh header. This will help simulate a digital ... Read More