• 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

Mapped JSP Page not showing up on giving the URL pattern

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JSP is not showing by giving the URL pattern to which it is mapped in DD.

I have made a very simple application ( It is for testing. )
The directory structure is
JspDemo <- project directory
-- First.jsp (This is in JspDemo.)
-- WEB-INF (This is in JspDemo.)
-- web.xml ( This is in WEB-INF.)


web.xml contains


and First,jsp is a simple JSP which counts number of times it is opened i.e. hits.

Now when i am giving the URL http://localhost:8080/JspDemo/first.jsp
It is giving me the error
HTTP Status 500 with "javax.servlet.ServletException: No servlet class has been specified for servlet First".


And if i am manually calling the JSP by URL http://localhost:8080/JspDemo/First.jsp or loading it on startup by using
load-on-startup tag in DD then it is giving me the error.
Http 404 error with message "Servlet First is not available".

please anyone help me out.
 
Bartender
Posts: 1845
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue is being caused by the metadata-complete="true" attribute on your web.xml.

If you remove that attribute from the web-app element of your web.xml file, it works.

I'm not 100% sure why this works like this. I have never seen this attribute before. According to the documentation:


The metadata-complete attribute defines whether this deployment descriptor and other related deployment
descriptors for this module (e.g., web service descriptors) are complete, or whether the class files available to this
module and packaged with this application should be examined for annotations that specify deployment
information. If metadata-complete is set to "true", the deployment tool must ignore any annotations that specify
deployment information, which might be present in the class files of the application. If metadata-complete is not
specified or is set to "false", the deployment tool must examine the class files of the application for annotations,
as specified by the specifications.



I guess it has something to do with whether or not Tomcat will invoke the translate/compile step for the JSP file.
ie if you are metadata-complete then you shouldn't have to compile anything - right?
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic