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
What is the dispatcher servlet?
Explain the methods of request dispatcher in servlet?
Why do we have servlet listeners?
Can filter be used as request or response?
How many servlet objects are created?
What is setattribute in servlet?
Explain Action Servlet?
What are session variable in servlets?
What is the difference between using getSession(true) and getSession(false) methods?
What are the uses of servlets?
How do we translate jsp?
What is the use of send redirect () method?
How we can create war file in servlet?
What does the term localization refer to?
Which java application server is the best?