Found 177 Articles for JSP

How to remove a java variable from current scope in JSP?

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

336 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:

How to set result of a java expression in a property in JSP?

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

108 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

How to print result of a java expression in JSP?

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

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 − , &

What the different types of JSTL tags are ?

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

485 Views

The JSTL tags can be classified, according to their functions, into the following JSTL tag library groups that can be used when creating a JSP page −Core TagsFormatting tagsSQL tagsXML tagsJSTL Functions

What is JSTL?

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

898 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

How to send a email with attachment using a JSP page?

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

321 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");

How to send a html based email using a JSP page?

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

441 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

How to send a simple text based email using a JSP page?

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

211 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

How do you implement the auto refresh in JSP?

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

300 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

What is auto refresh feature in JSP?

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

120 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

Previous 1 ... 4 5 6 7 8 ... 18 Next
Advertisements