Keyur Ardeshana
Keyur Ardeshana

Reputation: 204

in which phase of JSP JSTL is evaluated?

I know the life cycle of JSP page but i wondered when i started to use JSTL. My question is that in which phase of JSP life cycle this JSTL tags evaluates? for example in jsp translation phase or in service phase.

Upvotes: 5

Views: 284

Answers (2)

Aurasphere
Aurasphere

Reputation: 4011

JSTL is evaluated during JSP compilation (or translation) phase. You can check that by the stacktrace if an exception is thrown:

org.apache.jasper.JasperException: /index.jsp (line: 8, column: 23) No tag "urfafl" defined in tag library imported with prefix "c"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:199)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1215)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1452)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)

Upvotes: 2

Suresh Atta
Suresh Atta

Reputation: 122008

At translation phase

Custom tags are converted into calls to the tag handler that implements the custom tag.

When you execute that JSP (which happens after successful compilation(translation)), they actually run and render the output to response.

Upvotes: 8

Related Questions