Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Tag doubt

 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,
I am learning how to create a custom tag. I found an example and trying to implement . Iam getting an error: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/Heading.tld: (line 3, col 6).

My Heading.tld is as follows:


I am using struts1.3.8,Tomcat6. Is anything wrong with DOCTYPE?? Please help me in solving this error. I tried removing the DOCTYPE, now I am getting error: /pages/HeadingExample.jsp(11,0) Unable to load tag handler class "actions.HeadingTag" for tag "head:heading"


Thankyou,

Sudha.
SCJP1.5
 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am getting the error: /pages/HeadingExample.jsp(11,0) Unable to load tag handler class "actions.HeadingTag" for tag "head:heading" .

I am trying all the possible ways to solve this error. I noticed that there is no .class file for this HeadingTag.java. So I compiled this file separetly to check whether this file works correctly. But I got 13 errors. I really couldn't get why Iam getting all these errors. What's wrong with this java file.

HeadingTag.java


Please guide me what I am doing wrong.

Sudha.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


But I got 13 errors. I really couldn't get why Iam getting all these errors. What's wrong with this java file.


where is your Java file located and how do you compile and what are the 13 errors


import javax.servlet.*; // I am getting error as all these packages does not exist


What container are you using ? seems that your classpath not set correctly.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the JSP 1.2 format. With Tomcat 6 you should be using JSP 2.0. See the JSP 2.0 Spec for details.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: With Tomcat 6 you should be using JSP 2.0. See the JSP 2.0 Spec for details.


in tomcat6 ,jsp version is 2.1 for more details click here

 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Thank you for all your replies. I am using Tomcat6.0. I thought JSP 2 will support JSP1.2. So JSP2.0 wont support classic tags(TagSupport)? I have to use SimpleTag handler?? Tell me the necessary changes I have to do for my code to work. Please send me a link or an example to learn.

Thankyou
Sudha.
SCJP5.0
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

JSP 2.1 supports full bacward compatability. Hope this link helps you. ProJSP
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it does, the point is that there is no need to be using a JSP 1.2 format in a more modern container. It also helps eliminate any possibility of error with mixing old with new.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic