As a new hand of Tomcat, I was confused for this question for a long time, and I was too simple to write, I didn't involve; I was posted on 9cbs, but I didn't want the answer. I was inspired yesterday, and I was completely solved in my heart. It's really simple, exiting, for the SERVELT / JSP's student, discusses less and walk less.
I always thought that the latest version is the most perfect function, so I use Tomcat5.0.19, but according to the book, I have to compose each servlet, and the web-INF / Web.xml in the project directory is similar to the following. Code:
servlet>
servlet-maping>
servlet>
servlet-maping>
Later, I learned from multiple parties, I know that Tomcat has an invoker servlet, as long as the following code is added to Web.xml:
servlet-maping>
Use the http: // localhost: 8080 / project directory name / servlet / servlet name, if the project is ROOT, where the project catalog can save the http: // localhost: 8080 / servelt / servlet name. But I used the above method in Tomcat5 in Tomcat5, which is always unsuccessful (other configuration is correct), and the Tomcat's DOS window appears multi-line "serious" words, prompts in Web.xml, even the basic Tomcat default page error, Remove the above servlet-mapping, there is no problem. Later, I took a closer look at the post on the Internet. I found that the people who talk about the reactor are Tomcat4, and I also heard that Tomcat5 is a little change in Tomcat4, so it has been Tomcat4.1.30 from the official website, and then press the above method, Actually. Naturally, my machine is completely used in Tomcat4. Since I have a Win2K WinXP dual system, in order to understand the new features of Tomcat5, Tomcat5 is also installed on another system, but the debugging or use Tomcat4, this question is also put down.
servlet-maping>
Use the http: // localhost: 8080 / project directory name / servlet / servlet name, if the project is ROOT, where the project catalog can save the http: // localhost: 8080 / servelt / servlet name. But I used the above method in Tomcat5 in Tomcat5, which is always unsuccessful (other configuration is correct), and the Tomcat's DOS window appears multi-line "serious" words, prompts in Web.xml, even the basic Tomcat default page error, Remove the above servlet-mapping, there is no problem. Later, I took a closer look at the post on the Internet. I found that the people who talk about the reactor are Tomcat4, and I also heard that Tomcat5 is a little change in Tomcat4, so it has been Tomcat4.1.30 from the official website, and then press the above method, Actually. Naturally, my machine is completely used in Tomcat4. Since I have a Win2K WinXP dual system, in order to understand the new features of Tomcat5, Tomcat5 is also installed on another system, but the debugging or use Tomcat4, this question is also put down.
I learned Tomcat 4.1.12, which is enabled by default. Due to the disclosure of a security defect, this subsequent version, the caller is disabled by default. If you want to enable, you need to cancel the servlet-mapping element item below the conf / web.xml file. Open the corresponding web.xml, found that there is really
servlet-maping>
->
->
However, add an comment, disabled. To be lifted, don't add again, just use the comment to get out of it (I didn't pay attention, huh, huh. I think of the corresponding web.xml of Tomcat5, it also has these items, which is added There must be this function! So switching the system, run, or the error above. Oh, yes, in web.xml configuration, pay attention,
Corresponding relationship, view Tomcat4 and Tomcat5 respectively
I really discovered
Org.apache.catalina.servlets.invokerseervlet
servlet-class>
init-param>
servlet>
The difference is that in Tomcat5, the above code has been added to be disabled, and Tomcat4 is not, this explains why Tomcat5 is always wrong. So immediately remove the comment, try Tomcat5, initialization did not appear "serious" words, running no problem, another question solved.
In summary, in Tomcat4, the servlet caller is enabled, and only goes to the name
Instructions can be; in Tomcat5, in addition to this, you have to remove the same name
The comment.
Another attached: Tomcat4 highest version 4.1.30, Tomcat5 latest version 5.0.27 can be downloaded in Tomcat official address
Http://jakarta.apache.org/site/binindex.cgi download