The JSTL Core Tag is used to format or encode a url into a string variable. This variable can be used anywhere in the jsp instead of using url directly.
Syntax:
c:url tag attributes:
Attribute | Description | Required |
value | It specify the base URL. | Yes |
context | / followed by the name of a local web application. | No |
var | Name of the variable to expose the processed URL. | No |
scope | Scope of the variable to expose the processed URL. | No |
Example:
test.jsp
hello.jsp
web.xml
Output:
Click on the link.
No comments:
Post a Comment