Have you practiced Java enough that you are ready to learn advanced Java? Take this advanced Java quiz, and see how much you have learned. This will examine your understanding of JSP, Servlet, and Design patterns. You will get an idea about your understanding while taking the quiz and after checking the result. Give it a try and see what more you need to learn, or you know everything. All the best! Do share the quiz with other programming fans.
DoPost(ServletRequest, ServletResponse)
DoPOST(ServletRequest, ServletResponse)
ServicePost(HttpServletRequest, HttpServletResponse)
DoPost(HttpServletRequest, HttpServletResponse)
PrintWriter out = response.getServletOutput();
PrintWriter out = response.getPrintWriter();
PrintWriter out = response.getOuputStream();
OutputStream out = response.getOuputStream();
ServletOutputStream out = response.getServletOutputStream();
GetHeader() of ServletRequest
GetHeaders() of HttpServletRequest
GetHeaderValue() of ServletRequest
GetHeader() of HttpServletRequest
GetHeaders() of ServletRequest
GetHeaders() of HttpServletRequest
Param-description
Description
Info
Param-info
Init-param-info
BankApp.xml
Bankapp.xml
Server.xml
WebApp.xml
Web.xml
Simpletax/WEB-INF/thirdparty
Simpletax/WEB-INF/jars
Simpletax/WEB-INF/lib
Simpletax/WEB-INF/classes
Simpletax/WEB-INF
This class will compile as is.
This class will compile only if the attributeReplaced() method is added to it.
This class will compile only if the attributeUpdated() method is added to it.
This class will compile only if the attributeChanged() method is added to it.
It will throw an InvalidStateException while serving a request.
It will throw a ServletException while serving a request.
It will throw a NullPointerException while serving a request.
It will throw an IllegalStateException while serving a request.
It will not throw an exception.
None of the above.
X = 3, 5
X = 3, 7
X = 5, 3
Compilation error
Application
Session
Exception
config
State =
State =
Request.getAttribute("address");
Request.getParameter("address");
GetServletContext().getRequestAttribute("address");
PageContext.getAttribute("address",PageContext.REQUEST_SCOPE);
PageContext.getRequest().getAttribute("address");
PageContext.getRequestAttribute("address");
PageContext.getRequestParameter("address");
The bean instance will not be available in that.jsp
The bean instance may or may not be available in that.jsp, depending on the threading model implemented by that.jsp.
The bean instance will be available in that.jsp, and the that.jsp page can print the values of the beans properties using .
The bean instance will be available in that.jsp and the that.jsp page can print the values of the bean’s properties using only if that.jsp also contains a declaration identical to the one in this.jsp and before using .
Front Controller
Session Facade
Value Object
Model-View-Controller
Data Access Object
The type of the actual data source can be specified at deployment time.
The data clients are independent of the data source vendor API.
It increases the performance of data-accessing routines.
It allows the clients to access the data source through EJBs.
It allows resource locking in an efficient way.
Model-View-Controller
Value Object
Bimodal Data Access
Business Delegate
It improves the response time for data access.
It improves the efficiency of object operations.
It reduces the network traffic.
It reduces the coupling between the data access module and the database.
The Value Object pattern ensures that the data is not stale at the time of use.
It is wise to make the Value Object immutable if the Value Object represents readonly data.
Applying the Value Object pattern on EJBs helps to reduce the load on enterprise beans.
A Value Object exists only on the server side.
It implements the business service functionality locally to improve performance.
It shields the clients from the details of the access mechanism, such as CORBA or RMI, of the business services.
It shields the clients from changes in the implementation of the business services.
It provides the clients with a uniform interface to the business services.
It reduces the number of remote calls and reduces network overhead.
Wait!
Here's an interesting quiz for you.