<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">JSTL URL tag is used to format and save url in a variable to use it at later stage. The<i><b> <;c:url>;</b></i> 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.</p>
<p> The JSTL url tag is just an alternative method of writing the call to the <b><i>response.encodeURL()</i></b> method. The only real advantage the url tag provides is proper URL encoding, including any parameters specified by children param tag.<br />
<b><br />
</b> <b>JSTL <i><;C:URL>;</i> Tag Example:</b></p>
<pre class="highlight" name="code"><;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>;
<;html>;
<;head>;
<;title>;JSTL URL Tag Example<;/title>;
<;/head>;
<;body>;
 <;c:url value="https://dineshonjava.com" var="tutorialLink">;
 <;c:param name="author" value="Dinesh">;<;/c:param>;
 <;/c:url>;
 <;c:import url="${tutorialLink}">;<;/c:import>;
<;/body>;
<;/html>;
</pre>
<p>
As you can see above, <i><b><;c:url>;</b></i> tag is being used to store the value of url in a variable <b><i>tutorialLink</i></b>. </p>
<p>In <;c:import>; tag, the url attribute will have following value.<br />
<i><b><br />
https://dineshonjava.com?author=Dinesh</b></i><br />
<b>Attributes of <i><;c:url>;</i> tag are:</b></p>
<p> ; ; ; ; ;<b> 1. value</b>:This attribute provides URL to be processed.</p>
<p> ; ; ; ;<b> ; ; 2. var:</b> This attribute provides name of the exported scoped variable for the processed url. The type of the scoped variable is String.</p>
<p> ; ; ; ; ; ;<b> 3. context:</b> This attribute provides name of the context when specifying a relative URL resource that belongs to a foreign context.</p>
<p> ; ; ; ; ; ;<b> 4. scope: </b>This attribute provides the scope for var.</div>
<p></p>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/10/jstl-param-tag.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/10/jsp-standard-tag-library-jstl-tutorial.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/10/jstl-redirect-tag.html">Next</a> >;>;</b></div>
<p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/jstl-param-tag/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/jstl-redirect-tag/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '309'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…