• Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 21289
87
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: 21289
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!