Answer Posted / dara
<form action="/servlet/full.class.name">
</form>
This method uses the invoker servlet, provided by many
servlet containers. The much better way of invoking a
servlet is by providing an explicit mapping for it. This is
accomplished by using a pair of tags in your web
application's web.xml file. This is not the same file as
mentioned above. That file was located in Tomcat's conf/
directory. This web.xml file (which you will probably need
to create) will reside in your web-application's WEB-INF/
directory. For each servlet you want to call, provide a
pair of tags like the following:
...
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>your.package.name.HelloWorld</servlet-
class>
</servlet>
...
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
...
Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
How a servlet is unloaded?
Whether we can get deadlock situation in servlets?
What do you mean by request dispatcher in servlet? Also explain its methods.
Tell us something about servletcontext interface.
Explain how to improve Servlet Performance?
What is the difference between the http servlet and generic servlet?
Why is servlet used?
Which are the different ways you can communicate between servlets?
What is the main purpose of java servlets?
How can you run a servlet program?
What is difference between PrintWriter and ServletOutputStream?
Which interface must be implemented by all servlets?
What is the difference between context parameter and context attribute?
What is a deployment descriptor?
how to link html file to sevlet file.one name is textbox,c&c++ is cheakbox,bc&mca is radio button and one submit buttonis ok why in this programme use in servelt file