Custom tags in servlets?
Is it possible to use custom tags in servlets?
I would like to write a custom tag to the response output from a servlet with the same effect as it would have in a JSP file. A JSP file has to define the tag library descriptor of the custom tag with a taglib directive. Is it possible to somehow define custom tags within a servlet?
Thanks
# 2
Thanks for your answer Rahul, but it doesn't solve the problem I am facing. I may not have formulated my question well.
What I would like to know is if I could define custom tags in a servlet, how I'd do it. And if it is not possible to define custom tags in a servlet, how I'd emulate as if there was a custom tag.
I would want a servlet to read JSP code and process it so that the results are the same as if the webserver would load the JSP file directly.
I have to write my own servlet to process the JSP, because the JSP code is accessible remotely and the server only processes local JSPs. I know that it is a security risk to allow to run JSP code from a remote location and that the JAVA webserver may not be designed to allow this. Though I do not need to process JSP scriptlets, all I would need is custom tags (for which the TagHandler classes are installed on the server) and JSP actions. If it is not possible to load JSP files remotely and interpret them (ignoring the scriptlets), I will have to find a work around.
Thanks