Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

howto invoke servlet

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have configure to host my web application under c:\test
now, i want to invoke servlet which i put it under c:\test\web-inf\classes\servlet\myservlet , and the servlet name is HelloWWW2 ,
my problem is i couldn't invoke it by this command in browser ,
http://localhost/test/servlet/myservlet.HelloWWW2
am i using the right command ?
or anyone can guide me by very beginning explanation, i'm really dummy here
note: i have modify port number to 80 , so i didn't use localhost:8080

thks in advance for answering !
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the code sample
 
Niti Auekittiroj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way you invoke servlet with
http://localhost/test/servlet/myservlet.HelloWWW2
is correct
But your servlet must place under folder "classes"
and folder's name WEB-INF must be uppercase
The result is this path
c:\test\WEB-INF\classes\myservlet
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, save yourself trouble and grief (down the road) by reading up on the Invoker.

http://test.javaranch.com/wiki/view?InvokerServlet
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you , i manage to get it ....thks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic