Head First Servlets and JSP phần 3

Không có một phần của nó có thể được sao chép, truyền đi dưới bất kỳ hình thức nào bởi bất kỳ phương tiện mà không cần sự cho phép trước bằng văn bản cho in lại và trích dẫn từ nhà xuất bản. Tái phân phối hoặc sử dụng khác vi phạm quyền sử dụng hợp lý theo luật bản quyền Hoa Kỳ (xem 17 USC107 | Chapter 5. Being a Web App attributes and steners Since the Container reads the servlet init parameters only once you still can t change your email address -I during the life of the servlet. So this is a dumb -X solution. So um where s that redeploy button on Tomcat With Tomcat there isn t a one-button reallysimpleadmin tool fordeploymentand redeployment although there is an admin tool that ships with Tomcat . But think about it what s the worst you have to do to Sure it s easytotell Tomcat to shutdown and startup but what about the web apps that are running Theyall have to go down Technically change the servlet s init parameters You make a quick change to the web. xml file shut down Tomcat bin then restart Tomcat bin . On restart Tomcat looks in its wehappsdirectory and deploys everything it finds there. web apps down so that you can redeploy one servlet is a little harsh especially ifyou have a lot of traffic Tomcat. In a production environment that s what you d use. But for testing it s easier tojust restart Tomcat. Info on the management tool is at http tomcat But in the real world even a hot redeploy is a Big Deal and taking even a single app down just because the init parameter value changed can be a bad idea. If the values of on your web site. But that s why mostofthe production-quality Web Containers letyou do a hotredeploy which means that you don t have to restart your server or take any other web apps down. In fact Tomcat does includea manager tool that will let you deploy undeploy and redeploy entire web apps without restarting your init parameters are going to change frequently you re better off having your servlet methods get the valuesfrom afileor database but this approach will mean a lot more overhead each time your servlet code runs instead ofonly once during initialization. you are here 153 Chapter 5. Being a Web App Head First Servlets and JSP By Bert Bates

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
78    3    1    03-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.