tailieunhanh - peer-topeer Networks phần 3

Nó rất hữu ích và thuận tiện hơn trong quá trình học tập và thử nghiệm. Tôi recommendyou để cho phép servlet Invoker nếu bạn không quen thuộc với Tomcat. Bạn có thể kích hoạt chức năng này bằng cách thay đổi theo con đường conf. Các bước để cho phép các servlet Invoker như sau: 1. | Better Development Environment 45 It is useful and more convenient in the learning and testing process. I recom-mendyou to enable the invoker servlet if you are not familiar with Tomcat. You can enable this function by modifying the under the conf path. Steps to enable the invoker servlet are as follows 1. Locate the following two blocks in the file in the conf directory. -- servlet servlet-name invoker servlet-name servlet-class servlet-class init-param param-name debug param-name param-value 0 param-value init-param load-on-startup 2 load-on-startup servlet - servlet-mapping servlet-name invoker servlet-name url-pattern servlet url-pattern servlet-mapping 2. Remove the first line and last line of the above two blocks . --and -- . 3. Save the file. You can turn off this function by adding back the first and last line to the blocks. 4. Create classes path under the C Tomcat webapps ROOT WEB-INF. 5. Copy the of this book to the following path C Tomcat webapps ROOT WEB-INF classes 6. Start a web browser. 7. Type http localhost 8080 servlet simple as the URL. The browser will display the screen as illustrated in Fig. . Address jgi http localhost 0OBŨ servlet simple Simple Figure . Screen of the simple servlet 46 5. Web Server and Related Technologies Deployment of Servlets It will be better to put the source files and compiled files . the class files in different directories when you have a lot of programs in your application. If you are using an IDE tool such as Jbuilder then the IDE will take care of compilation and put the class file in the right directory. However if you do not have an IDE on your computer you can use the following command javac -d For example the following command will compile a program and store the file in the c Tomcat webapps ROOT WEB-INF classes. -d c Tomcat .

TỪ KHÓA LIÊN QUAN