Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error using Tag

 
Shalu Ban
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am using Tomcat 4.0, i created a custom tag to be used in a JSP page I created a tld file and kept in the WEB-INF folder. When i run the JSP page it gives me the following exception:
org.apache.jasper.JasperException: No such tag in the tag library imported with prefix shalu
I searched a bit on net and found that the likely problem is because i am using Tomcat 4.0. Upgrading to Tomcat 5 might solve my problem. In one article i found that modifying the web.xml file of Tomcat's conf directory to look like this would solve my problem:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>WARNING</param-value>
</init-param>
<init-param>
<param-name>enablePooling</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
I modified the web.xml file and saved it. Restarted Tomcat. But when i accessed the JSP page it gave me the same error.
Is upgrading my Tomcat the only solution? Does Tomcat 4.0 not support a simple customt tag??
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make sure that you have used the correct directive that states that you can use the tag in your JSP file.

Without knowing what the error is that you are receiving, or the JSP page that have created, this is only a guess.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP 1.2 custom actions work just fine in Tomcat 4. No need to upgrade just to use them. The only reason you'd need to upgrade to Tomcat 5 is to use JSP 2.0 custom actions.
The fragment of web.xml you showed us contains nothing to do with custom actions.
What would be more relevant is to show us the tld and the taglib directive from your JSP.
 
Shalu Ban
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah! you guys are right. it was a mistake in the JSP page. I corrected it and its working fine now. thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic