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 can you push data from an Applet to a Servlet?
What do you mean by deployment descriptor?
How to read request headers from servlets?
What are important features of Servlet 3?
What is the advantage of Servlets when compared with other server side technologies?
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
What do you mean by annotations in servlet?
What is java servlet session?
Why jsp is better than servlet?
How do you design microservices?
what is multiple server?
What is a java servlet?
What are the advantages of cookies?
What do you mean by web applications? Explain web application directory arrangement?
Can we refresh servlet in client and server side automatically?