/webapps/hello/servlets/WelcomeServlet.html opened normally but now:
The requested resource (/hello/servlets/WelcomeServlet.html) is not available.
And if it even worked after clicking for invoking servlet if showing:
The requested resource (/hello/welcome1) is not available.
<web-app version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemalocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
Anybody have ideas? Thanks.
What it can be?
I wrote hello/servlets/WelcomeServlet.html and got - is not available.
downloaded SimpleGreet.war example works.
Maybe something with server settings? (But today morning html loads fine)
RatiKante pal, thanks it was mistake from tests before. I tried debugging, changing defferent parts. But it seems that mistake not in this place.
Check the picture.If not present redeploy it.
1 - Invoke a simple webpage
2 - Get that webpage to call a servlet.
1 - Try moving WelcomeServlet.html to the same directory that holds your WEB-INF folder. Start whatever webserver youre running and navigate to that page again, that should work.
2 - In your WelcomeServlet.html, i presume you are calling welcome1. You need to change your web.xml entry to be <servlet-class>hello.WelcomeServlet</servlet-class> to match the package name defined in the WelcomeServlet.java code
Mike, I tried to do it with *.html file, but it isn't open anyway. And about web.xml - I reply to RatiKanta pal, that's my fault, but it isn't solve the problem.
Bear Bibeault, I can't find there an answer.
Volodymyr Shulyk wrote: in the Deitel book says - create *.class file in WEB-INF/classes
Yes that is the location where the servlet container looks for the .class files.
Volodymyr Shulyk wrote: but I often see *.java file in this folder. It changes something?
Maybe you have put .java files in there. Well this does not affect the servlet container as it is only concerned with .class files.
Volodymyr Shulyk wrote: (Can I create *.class file or I need to create *.java and compile from command line?
Exactly, compile your .java to .class and put them in WEB-INF/classes.
Volodymyr Shulyk wrote: It seems like a stupid question
At JR we believe no question is stupid or simple
So feel free to ask anything without hesitation.