"Unable to compile class for JSP" when using "class" as a custom tag attribute.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Adamson
Posted On:   Friday, May 10, 2002 08:33 AM

Hi, Have created a custom tag and have had it working successfully up to a point. All attribute names I use work 100% except when: ... I need the tag to emulate html tag's class attribute but this error occurs at runtime: Error: 500 Location: /index.jsp Internal Servlet Error: org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:476) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) ..... Root cause: java.lang.NullPointerException at org.apache.jasper.compiler.TagBeginGenerator.generateSetters(TagBeginGenera   More>>

Hi,


Have created a custom tag and have had it working successfully up to a point. All attribute names I use work 100% except when:

			
...



I need the tag to emulate html tag's class attribute but this error occurs at runtime:
			
Error: 500
Location: /index.jsp
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:476)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
.....

Root cause:
java.lang.NullPointerException
at org.apache.jasper.compiler.TagBeginGenerator.generateSetters(TagBeginGenerator.java:196)
at org.apache.jasper.compiler.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:291)

...



I definitely have
			
class
false


in taglib.tld and

			
public void setClass(String class) { ... }

In tagclass.java (could the method setClass() be interfering with the super class?)



I'm hoping there's something I can do to my code to rectify this as the problem seems to be internal?

The page is running on Tomcat3.2.1 and taglib version 1.0. Could upgrading these pose a solution?


Thanks,

Paul Adamson    <<Less

Re: "Unable to compile class for JSP" when using "class" as a custom tag attribute.

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, May 10, 2002 08:40 AM

Paul,

Probably because "class" is a reserved word, and it confuses the server...

Have you tried changing from class to clas (only one 's')?
About | Sitemap | Contact