• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tag files vs <jsp:include>

 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:include> and Tagfiles can be used for the same purpose.
which approach is the better way? why?

Have one more Question.

If you create any custom tag, you should include .TLD file for the same and should be kept in WEB-INF folder.
Why this is not the case for JSTL tags like <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> etc.

I'm not clear with these concepts.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future please use only one topic per question.

1) I prefer tag files because passing parameters by name via tag attributes is explicit and more clear than implicitly passing them as scoped variables. You can also perform type checking.

2) The TLD file for the JSTL is inside the JSTL jar file itself. This is the proper way to package up a tag library.

By the way, your URI for the JSTL is out of date. That URL is for JSTL 1.0 not modern JSTL 1.1 and 1.2.
 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:In the future please use only one topic per question.

1) I prefer tag files because passing parameters by name via tag attributes is explicit and more clear than implicitly passing them as scoped variables. You can also perform type checking.

2) The TLD file for the JSTL is inside the JSTL jar file itself. This is the proper way to package up a tag library.

By the way, your URI for the JSTL is out of date. That URL is for JSTL 1.0 not modern JSTL 1.1 and 1.2.



Thanks for your reply.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!