• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can any body tell how to call servlet withot using web.xml

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


i am using eclipse.i have Login servlet in default package i have called servlet from login form

<form name="frmlogin" method="get" action="http://localhost:8080/servlet/Login">
my project name is OnlineCourseRegistration

it show error httpresource is not available
i called like this this also not working

<form name="frmlogin" method="get" action="http://localhost:8080/OnlineCourseRegistration/Login">

it show error http resource is not available


thanks in advance


 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need a web.xml file to declare the servlet names and classes. Any decent servlet tutorial explains how to do that.
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You cannot execute a servlet without web.xml, configuration for servlet must be there so that the container is able to execute it.

 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have web.xml in my application suppose if i didn,t mention servlet name and classes in web.xml can I able to call servlet?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No.
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But why you want to do this ?
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks friends just i want to know
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:No.



It's considered a security risk. If you like security risks, call Bill Gates. Java was expressly defined to minimize security issues.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably don't want to include the host/port information in the form's "action" attribute, by the way.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back in the beginning of servlets somebody created the Invoker servlet. With the invoker active you had the appearance of servlet classes in the default package being called without a web.xml entry. This was an illusion because the invoker was really getting the request first - as configured in web.xml.

This was supposed to make it easier for newcomers to experiment with servlets without getting into web.xml but it has proved to be a disaster and caused much more confusion than web.xml ever did.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic