praks5432
praks5432

Reputation: 7792

JSP Cannot find resource

I'm writing something extremely with JSPs and Java Servlets, just to get used to them.

I have a Java servlet called "LoginServlet" inside "Java Resources" and, inside my web content folder I have

<form action="LoginServlet" method="post">

which is inside a html file. However, eclipse tells me that this resource cannot be found. I've tried action="userLoginPackage.LoginServlet",but that does not work. Note, that everything is in the same project, but I don't think that the stuff in WebContent is in the same package as LoginServlet, which could be the problem. However, if it is, I'm not sure where else to put html files(where should I put them?)

I understand this may be difficult to solve without knowing the structure of my project- please let me know if there is any other information I can provide.

Upvotes: 0

Views: 844

Answers (2)

laksys
laksys

Reputation: 3237

Your "LoginServlet" should be placed inside "Java Resources/src" folder. And your html file should be in "WebContent" folder.

Upvotes: 0

Don
Don

Reputation: 555

Have you define your "LoginServlet" in the web.xml? What's the web.xml look like? You need to define a servlet in the web.xml before you can call it.

Upvotes: 1

Related Questions