• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Classic Tag Handler

 
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....


 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Nabila.

There is a typo in jsp. Use
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for pointing that out...
But I am still getting the error
 
Chinmaya Chowdary
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chinamaya,

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

Thanks Ankit!

 
reply
    Bookmark Topic Watch Topic
  • New Topic