Home > front end >  Where is the "jsp" taglib TLD?
Where is the "jsp" taglib TLD?

Time:09-22

In a special case, I need to make the same as "<jsp:useBean" in Java class.

It sounds like using org.apache.commons.beanutils.BeanUtils.cloneBean(Object bean) will do the work.

But what is driving me crazy is that I can't find the TLD associated to "<jsp:" tags, nor the class used by "<jsp:useBean".

Even "jsp" on Google gives me nothing. The JSP specs I found makes me believe that it's not a tag like the others and that the code behind "<jsp:useBean" is in Java's core.

Am I right ? Have I missed something ?

Regards

CodePudding user response:

<jsp:useBean> is an action tag and not part of a tag library, cf. https://en.wikipedia.org/wiki/Jakarta_Server_Pages#Syntax, scroll down to "Additional Tags".

The code probably was part of J2EE back in the day or is in the servlet containers. Today it apparently is an eclipse project: https://projects.eclipse.org/projects/ee4j.jsp.

CodePudding user response:

There's no TLD for <jsp: elements in the JSP page. These elements are part of the JSP language. With this language you can create JSP pages but if you need to use custom TLDs like JSTL then you should use taglib directive.

What is interesting in JSP: it's called now Jakarta Server Pages. You can read more about this in the article What is JSP? Introduction to Jakarta Server Pages.

One of the original Java web technologies, JSP is still widely used with servlets and JSTL. Here's how to use Jakarta Server Pages to build dynamic web pages that connect to the Java back end.

CodePudding user response:

<jsp:useBean> is actually "a JSP server markup tag" "the server knows in a JSP specification server", the "tags" you are thinking of are standard tag library c: f: are resources that use a TLD Tag Library Descriptor (stored in a jar package to be loaded as a resource) and are from the original "custom tag" API system.

Custom tags do not need to be in a .jar, unjared they must be put in /webapplication/WEB-INF/tags/ often associated with non programmatic tags that operate like an include markup file. jar packaged tags are in a folder structure /webapplication*/META-INF/tags/* any tags wherever they reside require to be named to their full path in an XML markup like .tld file in the top directory of the package.

  • Related