What is the purpose of the error-code element in the <error-page> configuration of the web.xml file in a Java web application?
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "To map a specific HTTP error code to a designated error page.". Trong mô tả triển khai, một khai báo trang lỗi nhận diện tình huống theo một trong hai lối: theo mã trạng thái hoặc theo kiểu ngoại lệ; phần tử được hỏi chính là lối thứ nhất, nó ghi một mã cụ thể rồi gắn mã đó với đường dẫn trang mà container sẽ chuyển tới khi phản hồi mang mã ấy. Mô tả "To define the structure of a web page." thuộc việc của HTML và trang hiển thị, không phải của cấu hình triển khai. Mô tả "To handle HTTP requests and responses." là việc của servlet; cấu hình chỉ nói cho container biết phải làm gì khi có lỗi, bản thân nó không xử lý lượt gọi nào. Mô tả "To specify the default error page for the entire web application." lại bỏ mất chính vai của mã lỗi: khai bao trùm cho cả ứng dụng thì phải nhận diện theo kiểu ngoại lệ chung, còn khai theo mã thì chỉ áp cho đúng mã đã ghi.
Cùng phần 2
Which annotation is used to declare Servlet Mapping without web.xml?Có lời giảiCâu hỏiConsider the following code:
protected void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException {
String user = req.getParameter("username");
res.getWriter().println("User: " + user);
}
Which of the following statements is the most incorrect?Có lời giảiCâu hỏiWhat does the <error-page> tag in the deployment descriptor signify?Có lời giảiCâu hỏiCả 48 câu của chủ đề48 câu
Xuất hiện trong 3 bộ đề
Đi tiếp từ đây