File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classic Tag Handler

 
Nabila Mohammad
Ranch Hand
Posts: 661
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cant run this program .

My jsp file



my tld file



My java file



The error I am getting is:

org.apache.jasper.JasperException: Exception in JSP: /MyJsp.jsp:10

7:
8: ><table border=1">
9:
10: <mine:iterateMovies>
11:
12: <tr><td>${movie}</td></tr>
13:


In the log file it says :

SEVERE: Parse Fatal Error at line 1 column 1: The markup declarations contained or pointed to by the document type declaration must be well-formed.


I have checked all the tags but couldnt come with any mistake....


 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Nabila.

There is a typo in jsp. Use
 
Nabila Mohammad
Ranch Hand
Posts: 661
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for pointing that out...
But I am still getting the error
 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Nabila.


'PageContext' object is not available during ClassicHandler Object creation. Container sets the PageContext Object after object creation. Please see the LifeCycle steps. At this stage 'pageContext' object points to 'null', calling getOut() on it throws 'NullPointerException'.

Declare like this,
and get 'JspWriter' object in doStartTag() method like,
Since PageContext object is available in doStartTag().
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SEVERE: Parse Fatal Error at line 1 column 1: The markup declarations contained or pointed to by the document type declaration must be well-formed.


The error seems to be in the TLD to me (in addition to what chinmaya pointed out). Make sure that there's nothing before the <?xml declaration in your tld file...
 
Nabila Mohammad
Ranch Hand
Posts: 661
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chinamaya,

Thanks , your explanation made sense...and now the code is working.

Thanks Ankit!

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic