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
Why the concept of single thread model interface is used?
How can we refresh automatically when new data is entered into the database?
What are the difference between session and cookies in servlet? Explain
How to find whether a parameter exists in the request object?
Can a jsp be called using a servlet?
Can filter be used as request or response?
Why doesn’t a servlet include main()? How does it work?
How we can call a jsp from the servlet?
List out difference between a JavaBean from a Servlet?
What are the drawbacks of cgi?
Describe the phases of servlet lifecycle?
What are the advantages of servlets over traditional cgi?
How a servlet is unloaded?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
Difference between GET and POST?