Found 177 Articles for JSP

How to format number in JSP?

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

2K+ Views

The tag is used to format numbers, percentages, and currencies.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueNumeric value to displayYesNonetypeNUMBER, CURRENCY, or PERCENTNoNumberpatternSpecify a custom formatting pattern for the output.NoNonecurrencyCodeCurrency code (for type = "currency")NoFrom the default localecurrencySymbolCurrency symbol (for type = "currency")NoFrom the default localegroupingUsedWhether to group numbers (TRUE or FALSE)NotruemaxIntegerDigitsMaximum number of integer digits to printNoNoneminIntegerDigitsMinimum number of integer digits to printNoNonemaxFractionDigitsMaximum number of fractional digits to printNoNoneminFractionDigitsMinimum number of fractional digits to printNoNonevarName of the variable to store the formatted numberNoPrint to pagescopeScope of the variable to store the formatted numberNopageExample       ... Read More

What are JSTL formatting tags in JSP?

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

349 Views

The JSTL formatting tags are used to format and display text, the date, the time, and numbers for internationalized Websites. Following is the syntax to include Formatting library in your JSP −Following table lists out the Formatting JSTL Tags −S.No.Tag & Description1: To render numerical value with specific precision or format.2: Parses the string representation of a number, currency, or percentage.3: Formats a date and/or time using the supplied styles and pattern.4: Parses the string representation of a date and/or time5: Loads a resource bundle to be used by its tag body.6: Stores the given locale in the locale configuration variable.7: Loads a resource bundle and ... Read More

What is the use of tag in JSP?

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

311 Views

The tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary. The var attribute specifies the variable that will contain the formatted URL.The JSTL url tag is just an alternative method of writing the call to the response.encodeURL() method. The only real advantage the url tag provides is proper URL encoding, including any parameters specified by children param tag.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueBase URLYesNonecontext/ followed by the name of a local web applicationNoCurrent applicationvarName of the variable to expose the processed URLNoPrint to pagescopeScope of ... Read More

What is the use of tag in JSP?

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

299 Views

The tag redirects the browser to an alternate URL by facilitating automatic URL rewriting, it supports context-relative URLs, and it also supports the tag.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaulturlURL to redirect the user's browser toYesNonecontext/ followed by the name of a local web applicationNoCurrent applicationExampleIf you need to pass parameters to a tag, use the tag to create the URL first as shown below − Tag Example The above code will redirect the request to http://www.photofuntoos.com - Try it yourself.

What is the use of tag in JSP?

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

277 Views

The tag allows proper URL request parameter to be specified with URL and also does the necessary URL encoding required.Within a tag, the name attribute indicates the parameter name, and the value attribute indicates the parameter value −AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultnameName of the request parameter to set in the URLYesNonevalueValue of the request parameter to set in the URLNoBodyExampleIf you need to pass parameters to a tag, use the tag to create the URL first as shown below − The above request will ... Read More

How to apply forTokens tag in JSP?

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

152 Views

The tag has similar attributes as that of the tag except for one additional attribute delims which specifies characters to use as delimiters.AttributeDescriptionRequiredDefaultdelimsCharacters to use as delimitersYesNoneExample for           Tag Example                               The above code will generate the following result −Zara nuha roshy

How to apply forEach tag in JSP?

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

552 Views

The tag is a commonly used tag because it iterates over a collection of objects. The tag is used to break a string into tokens and iterate through each of the tokens.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultitemsInformation to loop overNoNonebeginElement to start with (0 = first item, 1 = second item, ...)No0endElement to end with (0 = first item, 1 = second item, ...)NoLast elementstepProcess every step itemsNo1varName of the variable to expose the current itemNoNonevarStatusName of the variable to expose the loop statusNoNoneExample for Tag Example Item The above code will generate the following result −Item 1 Item 2 Item 3 Item 4 Item 5

How to apply choose tag in JSP?

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

208 Views

The works like a Java switch statement in that it lets you choose between a number of alternatives. Where the switch statement has case statements, the tag has tags. Just as a switch statement has the default clause to specify a default action, has as the default clause.AttributeThe tag does not have any attribute.The tag has one attributes which is listed below.The tag does not have any attribute.The tag has the following attributes −AttributeDescriptionRequiredDefaulttestCondition to evaluateYesNoneExample           Tag Example             ... Read More

How to apply if tag in JSP?

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

174 Views

The tag evaluates an expression and displays its body content only if the expression evaluates to true.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaulttestCondition to evaluateYesNonevarName of the variable to store the condition's resultNoNonescopeScope of the variable to store the condition's resultNopageExample Tag Example My salary is: The above code will generate the following result −My salary is: 4000

How to handle an exception in JSP?

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

143 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

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