Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 9691
42
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!

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic