This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Trying to deploy simple helloworld.jsp on tomcat  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the reason for Tomcat 9 to respond with error 404 and message "/WEB-INF/views//WEB-INF/views/helloworld.jsp.jsp"? I dont understand why I have 2 WEB-INFs and .jsp.jsp in the path when my files are named correctly. I am using Intellij Idea 2017. It worked fine before I changed suffix in dispatcher servlet from .jsp to html. Now this error happens even with old .jsp suffix.

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>

 
Sheriff
Posts: 21453
96
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

My guess is that you're forwarding to model "/WEB-INF/views/hellworld.jsp". However, you defined a prefix and suffix which get prepended and appended respectively. The resulting file is "/WEB-INF/views//WEB-INF/views/helloworld.jsp.jsp" (italic is the model, bold is the prefix and suffix).

Try using only "helloworld" as model name. That should result in file "/WEB-INF/views/helloworld.jsp".
 
Andrei Compsci
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right! I had a wrong name returning on my model. It was "/WEB-INF/views/helloworld.jsp" but had to be "helloworld". I dont know how it got changed on its own but changing it back resolved the issue. Thank you.
 
Rob Spoor
Sheriff
Posts: 21453
96
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!