In MVC 2 architecture, which component contains process of form validation logic?
Controller
View
Model
No answer is correct correct answers Controller
What is the correct URI of the Core Tag Library?
http://java.sun.com/jsp/jstl/core
http://java.sun.com/jsp/jstl/xml
http://java.sun.com/jsp/jstl/fmt
http://java.sun.com/jsp/jstl/sql
http://java.sun.com/jsp/jstl/functions correct answers http://java.sun.com/jsp/jstl/core
Which of the following is true about action tag in struts.xml?
We define action tags corresponds to every URL we want to access.
Configured interceptors are applied to do any post-processing if required.
Both of the above.
None of the above. None of the above. None of the above. correct answers Both of the
above.
The web.xml file for a webapp contains the following XML fragment for configuring session
timeout.
300
What would be the session timeout interval for the sessions created in this web application?
300 minutes
300 seconds
300 milli seconds
300 hours correct answers 300 minutes
Your servlet may receive a request, which the servlet cannot handle. In such cases, you want
to redirect the request to another resource which may or may not be a part of the same web
application. Which of the following options can be used to achieve this objective?
response.sendRedirect("some url");
RequestDispatcherrd = this.getServletContext().getRequestDispatcher("some url");
rd.forward(request, response);
RequestDispatcherrd = request.getRequestDispatcher("some url"); rd.forward(request,
response);
request.sendRedirect("some url"); correct answers response.sendRedirect("some url");
Java web application contains
Dynamic web pages
Static web pages
Media resources
All answers are correct correct answers All answers are correct
What are some common tasks that we can do with servlet filters?
, Logging request parameters to log files
Authentication and authorization of request for resources.
Formatting of request body or header before sending it to servlet.
Compressing the response data sent to the client.
Alter response by adding some cookies, header information etc.
All answers are correct. correct answers All answers are correct.
The method getWriter returns an object of type PrintWriter. This class has println methods to
generate output. Which of these classes define the getWriter method? Select one correct
answer.
HttpServletRequest
HttpServletResponse
ServletConfig
ServletContext correct answers HttpServletResponse
How can you execute a stored procedure in the database?
Call method execute() on a CallableStatement object
Call method executeProcedure() on a Statement object
Call method execute() on a StoredProcedure object
Call method run() on a ProcedureCommand object correct answers Call method execute() on
a CallableStatement object
Which of the following is correct about the Model Objects?
There are various temporary objects which are created during execution of a page.
The current model object is placed before the action on the value stack.
These objects include #application, #session, #request, #attr and #parameters and refer to the
corresponding servlet scopes.
None of the above. correct answers The current model object is placed before the action on
the value stack.
https://www.tutorialspoint.com/struts_2/struts_value_stack_ognl.htm
In MVC 1, controller and model, both are JSP. Is this true?
True
False correct answers True
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
java.jdbc and java.jdbc.sql
java.sql and javax.sql
java.rdb and javax.rdb correct answers java.sql and javax.sql
See the extract from web.xml of web application "mywebapp" on server named myserver,
runs on port 8080:
ServletA
/