• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404 - /JSPServlerProject/ error

 
Satyajeet Sen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created html file under web inf folder



and added LoginServlet in src folder



and UserDAO class along with the Bean class and ConnectionManager where i tried to fetch data from database


The program is that it consist of username and password and on enter details with that mentioned in database it would redirect me to next jsp page with correct login message and otherwise with incorrect message


but i am getting this error.
 
Sachin Kukale
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your web.xml file.
You can not execute the Servlet programs without an web.xml file.
Second advise for you is that you can put the html/jsp files directly under 'Web Content' folder; which is default folder and it is looked by tomcat container by default to locate the JSP/HTML files.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin Kukale wrote:
Second advise for you is that you can put the html/jsp files directly under 'Web Content' folder; which is default folder and it is looked by tomcat container by default to locate the JSP/HTML files.

That is not correct. "Web Content" is an IDE artifact -- it has nothing to do with Tomcat.
 
Sachin Kukale
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Sachin Kukale wrote:
Second advise for you is that you can put the html/jsp files directly under 'Web Content' folder; which is default folder and it is looked by tomcat container by default to locate the JSP/HTML files.

That is not correct. "Web Content" is an IDE artifact -- it has nothing to do with Tomcat.


Yes that may be correct!!!
But in web.xml file when we specify the welcome file list and if we have our JSPs in Web Content folder then we can specify it as:
---
<welcome-file>login.jsp</welcome-file>
---
But if we are specifying the JSPs in other folders then we have to give the absolute path name with reference to the 'src' folder. If tomcat is not looking for JSPs in 'Web Content' by default then why we need to specify the complete path name while putting our JSPs in other folders except 'Web Content'.
There may be another concept; which I don't know; hoping clarification from you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat looks for files and folders relative to the context root, which is the folder that contains WEB-INF.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!