Meaningless Drivel is fun!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Classic Tag Handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Classic Tag Handler" Watch "Classic Tag Handler" New topic
Author

Classic Tag Handler

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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....



The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Nabila.

There is a typo in jsp. Use
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Thanks for pointing that out...
But I am still getting the error
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
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

Joined: Aug 03, 2008
Posts: 9303
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Hi Chinamaya,

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

Thanks Ankit!

 
GeeCON Prague 2014
 
subject: Classic Tag Handler