Win a copy of Microservices in Action this week in the Web Services 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Servlet not found from JSP  RSS feed

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I'm having trouble with identifying issue with below code snippet. When I click the link "mypage", it throws servlet not found exception. File not found: /servlet/com.df.csImaging.DisplayImageServlet.
I've attached the project structure. The jsp page where below code resides is under WebContent. I'm not a web developer, but the servlet path seems little odd. The puzzle is, it was working all good since 2014 and all of a sudden it broke. I believe there is something wrong with the path specified in the showImage() function, but not sure how to point to the servlet under com.df.csImaging location. Can you please advise?




image.jpg
[Thumbnail for image.jpg]
Project Structure
 
Marshal
Posts: 67165
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The path should be server-relative, rather than page-relative.

See the JspFaq from more info: https://coderanch.com/wiki/659912/Resource-Url-Problems

 
Sheriff
Posts: 21466
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you map the servlet in web.xml or with an @WebServlet annotation? Because without either of these, the servlet is just a class. It will definitely not be available under servlet/<class name> (unless if you map it like that).
 
santosh batta
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my web.xml...


 
santosh batta
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was working fine without any issues before. The only difference I notice is websphere server patch upgrade. Earlier I used to deploy it on WAS 7.0.0.1 and now it is WAS 7.0.0.41. There was a fix pack upgrade happened and now current version of WAS is 7.0.0.41. Not sure, if this really matters, but this is the only difference I could see between both work-spaces.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!