////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

In addition to the simplified tag library mechanism provided by GSP, you can also use JSP tags from GSP.

In order to use JSP support you must ensure you have the `grails-web-jsp` dependency on your classpath by adding it to your `build.gradle` file:

[source,groovy,subs="attributes"]
.build.gradle
----
dependencies {
    //...
    runtimeOnly "org.apache.grails.views:grails-web-jsp"
}
----


Then you will need to declare the JSP taglib to use with the `taglib` directive at the top of your GSP file:

[,xml]
----
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
----

Besides this you have to configure Grails to scan for the JSP tld files.
This is configured with the `grails.gsp.tldScanPattern` setting. It accepts a comma separated String value. Spring's PathMatchingResourcePatternResolver is used to resolve the patterns.

For example, you could scan for all available tld files by adding this to `application.yml`:

[source,yaml]
.grails-app/conf/application.yml
----
grails:
    gsp:
        tldScanPattern: 'classpath*:/META-INF/*.tld,/WEB-INF/tld/*.tld'
----

JSTL standard library is no longer added as a dependency by default. In case you are using JSTL, you should also add these dependencies to `build.gradle`:
[source,groovy]
.build.gradle
----
dependencies {
    //...
    runtimeOnly 'javax.servlet:jstl:1.1.2'
    runtimeOnly 'taglibs:standard:1.1.2'
}
----

Then you can use JSP tags like any other tag:

[source,xml]
----
<fmt:formatNumber value="${10}" pattern=".00"/>
----

With the added bonus that you can invoke JSP tags like methods:

[source,gsp]
----
${fmt.formatNumber(value:10, pattern:".00")}
----
