JSP Servlet Dự án quản lý sinh viên + CSDL - Database SQL Server - MySQL - Lập trình JSP/Servlet Viết chương trình quản lý sinh viên BÀI TRẮC NGHIỆM ĐÁNH GIÁ Trắc Nghiệm Ôn Tập JSP / Servlet Bộ đề kiểm tra: Trắc Nghiệm Ôn Tập JSP / Servlet (80 câu). ⏱️ 20 phút 🎯 Điểm đạt: 80% 📝 80 câu Làm bài toàn màn hình Câu 1: Which of the following is an advantage of Web applications mentioned in the document? Platform independence Higher maintenance costs Restricted visibility Difficult access to information Câu 2: Which protocol offers 'Reduced Lag' and 'Stronger Security' compared to its predecessors? HTTP/1.0 HTTP/1.1 HTTP/2 HTTP/3 Câu 3: What is the primary role of a Web container in a Java Web application? To design visually appealing Web pages To manage servlets and provide a runtime environment To act as a database server To provide client-side scripting support Câu 4: In the Web application workflow, which component processes the request and generates the response? Request Object Servlet Web Server Browser Câu 5: Which file extension is used to package Java Web applications for deployment? .jar .war .exe .zip Câu 6: Which HTTP method is typically used to retrieve data from a server? POST PUT GET DELETE Câu 7: What was the previous name of the Jakarta EE platform? Java SE Java EE Jakarta JS Java ME Câu 8: Which Jakarta EE profile contains Core, Web services, plus Mail and Messaging? Web Profile Platform Profile Core Profile Micro Profile Câu 9: What is a disadvantage of using Jakarta EE for small applications? Lack of scalability Complexity Platform dependence Proprietary solutions Câu 10: Which Apache Tomcat responsibility involves executing and unloading servlet classes? Designing HTML pages Managing database tables Servlet management Writing Java code Câu 11: Which directory in a Web application structure contains the 'web.xml' file? src WEB-INF lib bin Câu 12: Which servlet lifecycle method is called exactly once when the servlet is first loaded? service() destroy() init() doGet() Câu 13: Which HTTP status code indicates 'Resource not found'? 500 401 404 301 Câu 14: Which technique for session tracking involves adding data to the end of a URL? Cookies URL rewriting Hidden form fields HttpSession Câu 15: What is the purpose of the 'invalidate()' method in HttpSession? To create a new session To destroy data in a session for security To refresh the page To store a cookie Câu 16: Which JSP element is used to embed Java code within HTML? Expression Scriptlet Directive Declaration Câu 17: Why do servlets generally run faster than JSP pages during initial execution? JSP is not Java-based JSP takes time to compile into servlets Servlets do not use a container Servlets use only HTTP/3 Câu 18: Which JSP directive is used to insert content of another resource at runtime? page taglib include forward Câu 19: What is a 'filter chain' in Jakarta Servlets? A list of database queries More than one filter existing between client and servlet A series of HTML tags Sequence of JSP lifecycle methods Câu 20: Which technology is an ORM that persists entities in a database? JDBC JPA JSON JSF Câu 21: What is the main advantage of the DAO pattern? Faster page rendering Separates business logic from database access Automatic HTML generation Increases network lag Câu 22: In asynchronous processing, what happens to a servlet thread waiting for a resource? It is terminated immediately It is returned to the thread pool It blocks all other threads It creates a new JSP page Câu 23: Which JSP implicit object represents the output stream sent to the client? request session out config Câu 24: In the MVC architecture, which component typically acts as the controller? JSP Page Servlet Database HTML File Câu 25: Which operator is used in JSP EL to access the value of a variable? Dot operator (.) Plus operator (+) Arrow operator (->) Colon operator (:) Câu 26: What does the 'isThreadSafe' option in a JSP page identify? If the page is encrypted If the page can process multiple threads simultaneously If the database is secure If the JSP is using taglib Câu 27: Which HTTP method is used to update an existing resource? GET PUT DELETE HEAD Câu 28: What is the primary technology used for communication on the Web? HTML and HTTP Java and C++ SQL and Oracle XML and JSON Câu 29: Which component manages mapping URLs to specific servlets? Web Server Web Container Database Server Client Browser Câu 30: The Microservices architecture is characterized as being: A single-block application Modular and lightweight Purely client-side Based only on raw data logs Câu 31: Which Jakarta EE profile is tailored for Web application services? Core Profile Platform Profile Web Profile Persistence Profile Câu 32: Which IDE is frequently used for Java, Ruby, and Python development? Visual Studio Eclipse IDE IntelliJ IDEA NetBeans Câu 33: What is the default port for Apache Tomcat mentioned in the guide? 80 443 8080 3306 Câu 34: What is the primary function of the 'web.xml' file? To store database passwords To describe deployment details of the application To provide CSS styles To compile Java classes Câu 35: Which package contains classes for HTTP-specific servlets? jakarta.servlet jakarta.servlet.http jakarta.enterprise java.sql Câu 36: Which method retrieves a specific initialization parameter for a servlet? getInitParameterNames() getInitParameter(String name) setAttribute() getWriter() Câu 37: What does HTTP status code 500 indicate? Bad Request Unauthorized Internal Server Error Moved Permanently Câu 38: How are 'Hidden Form Fields' implemented in HTML? Using encrypted tags Using <input type="hidden"> Stored only on the server Blocked by firewalls Câu 39: What is a 'Cookie' in web development? A small Java program Information sent by server and stored by browser A database table An error code Câu 40: Which setting prevents cookie access by client-side scripts? setSecure() setHttpOnly(true) invalidate() setMaxInactiveInterval() Câu 41: What does JSON stand for? Java Server Object Notation JavaScript Object Notation Java Simple Output Network Java Standard Object Node Câu 42: Which JSP phase converts the page into a Servlet? Execution Translation Destruction Request Câu 43: A 'scriptlet' in JSP contains: CSS blocks Java code within HTML SQL statements only JavaScript functions Câu 44: Which JSP directive links the page to custom tags? page include taglib action Câu 45: Which component intercepts requests between client and servlet? Servlet Filter Listener Context Câu 46: What is an 'annotation' in Servlet API? Database index Metadata attached to code elements Visual theme Security certificate Câu 47: Which annotation is used for file upload configuration? @WebServlet @MultipartConfig @WebFilter @Entity Câu 48: What does JDBC stand for? Java Database Connection Java Database Connectivity Joint Database Core Java Data Binding Code Câu 49: In JPA, a persistent object (POJO) is called an: Servlet Entity Context Filter Câu 50: Which mechanism uses XMLHttpRequest for asynchronous updates? SQL AJAX JPA JDBC Câu 51: What is a key difference between HTTP 1.0 and 1.1? 1.1 is stateless 1.1 supports persistent connections 1.1 only works with JSPs There is no difference Câu 52: Which JSP implicit object provides access to all others? pageContext application session response Câu 53: In MVC, which component handles presentation? Controller Model View Service Câu 54: JSP Model II is an implementation of which pattern? Singleton MVC DAO Factory Câu 55: Which EL operator represents logical 'AND'? || && ! == Câu 56: What is the purpose of a TLD file? To style the page To map function names to EL To encrypt the database To define project name Câu 57: Which method sets an attribute in application scope? getAttribute() setAttribute() removeAttribute() setInitParameter() Câu 58: What does 'beginRequest()' do in JDBC 4.3? Closes connection Informs driver a request is starting Executes SQL Creates table Câu 59: Which interface supports asynchronous processing in Servlets? AsyncContext AsyncListener ServletContext HttpServlet Câu 60: What information does a Response Header typically contain? User passwords Metadata like file size and type HTML body content Database table list Câu 61: Which corporation managed Java EE after Sun Microsystems? Microsoft Oracle Corporation Google IBM Câu 62: The Jakarta EE Web Profile is intended for: Foundational Services only Web Applications Services Batch Processing Mobile Development Câu 63: Eclipse IDE feature for annual updates and plug-ins is: Perspective Software Update Code Completion Workspace Câu 64: The 'lib' folder in a WAR file is used to store: HTML files Compiled .class files JAR library files Deployment descriptors Câu 65: Which lifecycle method is called when a servlet is taken out of service? init() service() destroy() stop() Câu 66: What does a '302 Found' status code represent? Permanent move Temporary replacement/redirect Success Server down Câu 67: Which session tracking technique is described as 'Lowest priority'? Cookies URL rewriting Hidden form fields JSON Binding Câu 68: What is 'JSON Serialization'? Decoding string to object Converting Java objects to JSON string Deleting a JSON file Formatting HTML Câu 69: Which JSP tag outputs simple values or calculation results? Scriptlet Expression Declaration Directive Câu 70: A listed demerit of using Servlets is: Platform dependence Extensive knowledge required High infrastructure cost Slow execution Câu 71: Which MVC component contains business logic functions? View Controller Model Dispatcher Câu 72: What does the 'taglib' directive specify? CSS location Custom tag library description Page encoding Error logs Câu 73: The Filter API includes which interfaces? ServletConfig Filter, FilterConfig, FilterChain JDBC Driver AsyncContext Câu 74: What is 'Server Push' in Servlet 6.0? Client sending data Server sending resources pre-emptively Deleting database records Error handling Câu 75: Which listener monitors session creation/destruction? ServletContextListener HttpSessionListener ServletRequestListener HttpSessionAttributeListener Câu 76: Which JSP implicit object shares data across the entire application? session application request page Câu 77: In JSP EL, 'Coercion' refers to: Deleting variables Automatic type conversion Encrypting URLs Private method calls Câu 78: Which component manages servlet lifecycle and access rights? Browser Web Container SQL Driver HTML Validator Câu 79: Platform independence in Web apps means: No internet needed Cross-OS access via browser Auto data entry Lower security risks Câu 80: Which JSP element provides page-wide info during translation? Expression Directive Scriptlet Comment 🚀 Nộp Bài & Xem Điểm 🔄 Làm Lại