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 do you define a servlet?
What is a servlet context?
Which application server is best for java?
Explain mvc pattern.
How is an application exception handling is done using a servlet?
What is webservlet?
What are the phases of servlet life cycle?
How to read request headers from servlets?
How can a servlet be used to generate plain text instead of html?
What are advantages of servlets over cgi?
What is the difference between the servlets and cgi programs?
What’s the difference between sendredirect and forward methods
What is servlet in web technology?
Which is better jsp or servlet?
Explain the different ways for servlet authentication?