Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Using <jsp-file> tag in web.xml

 
Greenhorn
Posts: 25
Oracle PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I tried to test usage of servlet init parameters inside jsp pages using the tags explained in K & B Head First JSP & Servlets book (in chapter 7).
I tried different ways but when I try to access the relevant JSP page, it gives me "servlet class not found" error. Please see the below
codes and help me to identify the what is the error I am doing here.
Please note that I have removed all the servlet init parameter related stuffs in these codes mentioned in below [wanted to create a basic working example which uses jsp-file tag].

Web.xml file


Exception I am getting when accessing this jsp using /TestParams,


For the JSP page, I tried with several jsp pages including a one which contains only html tags.
like this,


When I tried to access the JSP page directly (using http://localhost:8080/ch7-1/TestParams.jsp), it shows the JSP page without any error.
It gives me this error when I am using url defined in servlet to access this (using http://localhost:8080/ch7-1/TestParams).

I am using Tomcat 7 for testing my web apps.


Thanks & Regards,
Manjula
 
Manjula Weerasinghe
Greenhorn
Posts: 25
Oracle PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem resolved.
It seems the problem is with the of the web-app tag of the web.xml.
After I removed that it works fine now.
 
Greenhorn
Posts: 15
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manjula,

I really didn't understand, how it solved your problem???

metadata-complete="true" means that the deployment tool only examines the web.xml file and ignores annotations (such as @WebServlet, @WebFilter, and @WebListener present in the class files of the application) and any web-fragment.xml files.

If you remove that attribute from the web-app tag, it will implicitly be set to "false", meaning that the deployment tool will scan all the files for annotations and web-fragment.xml files.

I really don't find any connection bewteen your problem and metadata-complete attribute. Please throw some light on it...

Thanks and Regards,
Ashok
 
Manjula Weerasinghe
Greenhorn
Posts: 25
Oracle PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ashok,

Although I am not able to provide any correct and possible explanation for this issue, I can recreate this issue by adding metadata-complete="true" attribute to my web.xml file and this issue disappears once I remove that attribute.
Later I found this thread https://coderanch.com/t/520556/JSP/java/Mapped-JSP-Page-not-showing and It seems the reason for that issue is also this "metadata-complete="true"" attribute.

Thanks & Regards,
Manjula
 
Ashok Kurakula
Greenhorn
Posts: 15
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks Manjula
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic