zholinho
zholinho

Reputation: 520

Redirection to html in dynamic web project in Java

I have created a dynamic web project in Java. When I run the project with Tomcat server, it always hits index.html. I want to hit index.html in home folder, and then I write redirection to it on this way:

<meta HTTP-EQUIV="REFRESH" content="0; url=../home/">

and a lot of other combination, but it always returns 404 not found. Does anyone have ideas how I could start page /home/index.html?
web.xml always hits the page in WebContent Folder

Here is how it looks.

enter image description here

Upvotes: 0

Views: 1199

Answers (2)

Julien
Julien

Reputation: 2584

It looks like your src folder does not contain sources but just static resources. You should avoid putting your css/html/images/js in this folder. Put all these in WebContent/css, WebContent/home, WebContent/images and WebContent/js and everything should work the right way.

Upvotes: 0

Rahul Sahu
Rahul Sahu

Reputation: 284

Write below code in your web.xml under tag.

<welcome-file-list>
   <welcome-file>/home/index.html</welcome-file>
</welcome-file-list>

Upvotes: 1

Related Questions