Você está na página 1de 10

1. ______ validator messages are bound to the related fields.

a.
b.
c.
d.

Common
Non-field
Field
Custom

2. What is the term for determining whether a user has access to particular resource.
a.
b.
c.
d.

Authentication
Secrecy
Confidentiality
Authorization

3. The J2ee platform uses a multi-tiered distributed application model which of the following is not considered a tier in this architecture.?
a.
b.
c.
d.

Client tier
Security tier
Web tier
EIS tier

4. Which validator is defined below:


</p>
<validator type=req>
<param name=fieldname>country </param>
<message>(some message was here) </message>
</validator>
a.
b.
c.
d.

Non-field
Custom
Common
Field

5. Arrange the following order of execution


1. User sends request to server
2. FilterDispatcher looks at the request and then determines the appropriate action
3. Interceptors configured for application
4. action executed

6. Which of the following statement is correct with respect to Actions?


a.
b.
c.
d.

The action class usually acts as a controller and executes a particular business logic depending on request object and input parameter.
The action class usually acts as a model and executes a particular business logic depending on the request object and input parameter.
The action class usually acts as a view and executes a particular business logic depending on request object and input parameter.
The action class usually acts as a controller and executes a particular business logic depending on request object and input parameter.

7. What is not a type of visibility between objects.


a. Global
b. Method
c. Local
d. Attribute
8. What are the benefits of using business delegate pattern? Select all that apply.
a. It shields the client from changes in the implementation of business.
b. it implements the business service functionality locally to improve performance
c. It shields the clients from the details of access mechanism such as corba or rmi of business services.
d. it provides the clients with a uniform interface to the business services.
9. Which is incorrect with respect to struts 2.0

a. If there is no execute method and no other method is specified in the configuration then also action is executed successfully.
b. Implementing action interface is optional
c. If action is not implemented the framework will use reflection to look for an execute method.
d. the method invoked in the processing of an action Is the execute method.
10. You are automating a computer parts ordering business. For this purpose, your web application requires a controller component that would
receive the requests and dispatch them to appropriate JSP pages. It would also coordinate the request processing among the JSP pages, thereby
managing the workflow. Finally, the behavior of the controller component is to be loaded at runtime as needed.Which design pattern would be
appropriate in this situation? (Select one)
a Front Controller
b Session Facade
c Transfer Object
d Model-View-Controller
e Data Access Object
11. Which of the following are "best practices" for large distributed systems?
A.

Avoid business logic implementation in the display code; display inconsistencies can result because the logic can be copied and modified

in one object and not another.


B.
Coding data manipulation logic, format and display code, and user event handling together can make application maintenance
simple.
C.
Facilitate reuse of user interfaces by segregating application logic from the code for an existing interface.
D.
Utilizing the MVC design pattern results in a separation of the application data from the ways that the data can be accessed or viewed as
well as from the mapping between system events (such as user interface events) and application behaviors.
12. which of the following implicit objects can be used to store attributes that need to be accessed from all sessions of web application. Select all
that apply..
a. PageContext
b. Request
c.Session
d. Application
13. ______ Validators only add action level messages
a. Field
b. Non-Field
c. Custom
d.Common
14. J2ee uses core patterns to enable flexible association of EJB classes with other components. Which is not used by J2ee?
a. Designer
b. Factory
c. Proxy
d. Decorator
15. The ____Atrribute provides URL information to execute action as /new.action. The extension .action is configured in the ___config file?
a. map,struts.properties
b. name, struts.properties
c. value, struts.properties
d. action, struts.properties
16. which of the following are benefits of MVC architecture?(Choose 3)
a. close coupling of views and controller
b. having multiple views using same model.
c. Development of various components can progress in the parallel once the interface between components is clearly defined.
d. Easier user interface change.
17. Identify authentication mechanism that are built into HTTP specification. Select all that apply.
a. Digest
b. Basic
c. Form
d. Client-Cert

18. Which of the following defines data integrity


a. It guarantees that information is accessible only to certain users.
b. It guarantees that unintended parties cannot read information during transmission between client and server.
C. it guarantees information is not altered during transmission between client and server.
d. It guarantees information is kept in encrypted form on server.
19. Which of the following actions would you use to prevent your website from being attacked. Select all that apply.
a. Block network traffic at all ports except HTTP
b. Audit usage pattern of our server.
c. Use HTTPS instead of HTTP
d. Use design patterns.
20. Which is used to retrieve values from collection?
a. Iterator
b. Append
c. Generator
d. Merge.
21. which of the following option are correct. select all that are applicable
a. it is wise to make the transfer object immutable if the transfer objects represents read only data
b. applying the transfer object data on ejbs help to reduce load on java beans
c.A transfer objects exist only on server side
d.the transfer object ensures that data is not stale at the time of use
22. which design pattern allows you to decouple the business logic,data representation and data representation?
a. bimodal data access
b business delegate
c.transfer object
d.model-view-controller
23. which of the following statements are correct? Select all that apply
a.Struts 2 uses OGNL for type conversion and converters to convert Basic and common object types and primitives as well.
b.In Struts 2 different lifecycles are created on a per Action basis via Interceptor Stacks
c.Commons-Beanutils are used by used by Struts 1 for type conversion
d.Each module in Struts 1 has a separate Request Processors
24. which of the following are the benefits of transfer object design pattern? Select all that apply
a.it reduces coupling between data access module and the database
b.it reduces network traffic
c.it improves response time for data access
d.it improves efficiency of object operations
25. which of the following are features of interceptors? Choose two
a.interceptor act as a controller
b.extremely flexible
c.actioninvocation knows in which sequence the interceptors should be involked
d.complex testing process
26.ONGL stands for?
a.object-graphical navigation language
b. object-graph notation language
c. object-graph navigational language
d. object-graph navigation language
27. what is the use of push tag?
a.you can push a value into the value stack using push tag
b. push tag is used to assign a property value to another name
c.the push tag is used to retrieve data from value stack
d. you can push a value into the action context using push tag

28.you are building the server side of an application and you are finalizing the interfaces that you will provide to the presentation layer.however
you have not yet finalized the access details of the business services.which design pattern should you use to mitigate this concern?
a.model-view-controller
b.business delegate
c.data access object
d.facade
29.which of the following provide life cycle of action?
a. servletdispatch instantiates a new action proxy and calls execute()
once the execution of action is complete the request is sent to a result to render the results
interceptors intercepts the request being sent to and returning from action
b. servletdispatch instantiates a new action proxy and calls execute()
interceptors intercepts the request being sent to and returning from action
once the execution of action is complete the request is sent to a result to render the results
c. interceptors intercepts the request being sent to and returning from action
servletdispatch instantiates a new action proxy and calls execute()
once the execution of action is complete the request is sent to a result to render the results
d. interceptors intercepts the request being sent to and returning from action
once the execution of action is complete the request is sent to a result to render the results
servletdispatch instantiates a new action proxy and calls execute()
30. In class diagram what does a line with an arrow from one class to other denote?
a.method visibility
b.attribute visibility
c.class visibility
d.global visibility
31. Which of the following are not benefits of using the MVC best practice?
A.
B.
C.
D.

Clarifies application design through separation of data modeling issues from data display and user interaction
Enhances reusability by separating application functionality from presentation
Facilitates maintenance by encapsulating application functions behind trusted APIs
Simplifies database design because only the View components access the database

32. You have been contacted by a company to help them improve the performance of their e-commerce application. You have
suggested that the hardware on which the application is currently deployed (two web servers and a database server) be migrated to
three web servers, an application server, and a database server (all on different machines). You assure them that all the required
software rewrites will be worth it in the long run. What are the characteristics of your suggested architecture?
A.
B.
C.
D.

Fat clients
Thin clients
Good separation of business logic
Good scalability

33. the validation .xml is either________ or __________


a.struts-validation.xml, <actionclassname>-<actionaliasname>-validation.xml
b. struts-validation.xml, <interceptor>-validation.xml
c. struts-validation.xml, <actionclassname>-interceptor-validation.xml
d. <actionclassname> -validation.xml, <actionclassname>-<actionaliasname>-validation.xml
34.ONGL expression language helps in accesing the values stored on the ________ and in the __________
a. arraylist,map
b.valuestack,servletcontext
c.list,hashmap
d.valuestack,actioncontext
35.dependancy injection can be implemented by __________injection,________injection and __________injection

a. constructor,class,getter
b. setter,class,getter
c. construction,interface,setter
d. construction,interface,getter
36. which item is not one of the three kinds of relationship a class diagram can have?
a.assosciation
b.specialisation
c.generalisation
d.aggregation
38. which of the following is not true of using the mvc best practice?
A.

The Model in an MVC-based application can be divided into two parts: the internal state of the system and the actions that can be taken

to alter that state.


B.
The Controller portion of the application focuses on receiving requests from the client (most often a user running a web browser),
deciding what business logic function is to be performed, and delegating responsibility for producing the next phase of the user interface to an
appropriate View component.
C.
The Model determines how the results should be displayed.
D.
The View transfers user input to the Controller
39. which of the following jar is used for annotations in struts?
a. struts2-convention-plugin-2.1.6
b. struts2-annotations-2.1.6
c. struts2-annotation-plugin-2.1.6
d. struts2-annotations-plugin-2.1.6
40. which of the following interfaces or classes is used to retrieve the session associated with the user?
a.httpservletrequest
b.genericservlet
c. servletcontext
d .servletconfig
41. which is incorrect in respect to action in struts2?
a. any pojo object with a execute signature can be used as an struts 2 action object.
b.struts 2 action may implement an action interface
c.struts 2 provides an base actionsupport class to implement commonly used interfaces.
d.struts 2 actions are coupled to container.
42. You are designing an application that is required to display the data to users through HTML interfaces. It also has to feed the same data to
other systems through XML as well as WAP interfaces. Which design pattern would be appropriate in this situation? (Select one)
a Interface Factory
b Session Facade
c Transfer Object
d Model-View-Controller
e Factory
43.which of the uml diagrams may be best suited for a business analyst?
a.usecase
b.deployement
c.class
d.activity
44. which of the following deployement descriptors used for specifying the authentication mechanism for a Web application?
a. login-config
b. auth-constraint
c. security-constraint
d. web-resource-collection

45.which of the following element is used to create an interceptor stack?


a.interceptor-ref
b.interceptors
c.interceptor-stack
d.interceptorstack
46.which of the following cases would an application not necessarily benefit from the use of enterprise java bean?
A.
Small Scale deployment
B Large scale deployment
C Transactional in nature
D No Transactional requirements
47. How is tiles integrated in struts 2?
a. In the deployment descriptor first setup the tiles definition file as shown below.
<context-param>
<param-name> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG </param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
Then setup the tiles listener.
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
b. In the struts.xml first setup the tiles definition file as shown below.
<context-param>
<param-name> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG </param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
Then setup the tiles listener.
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
c. In the struts.xml first setup the tiles definition file as shown below.
<context-param>
<param-name> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG </param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
d. In the deployment descriptor first setup the tiles definition file as shown below.
<context-param>
<param-name> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG </param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>

48. which of the following validation types are supported by struts?


a. struts 2 supports the manual validation via the validate method and the webwork validation framework.
b. struts 2 supports the manual validation via the validate method and the xwork validation framework.
c. struts 2 supports the manual validation via the validate method and the struts validation framework.
d. struts 2 supports the manual validation via the dovalidate method and the xwork validation framework.
49. Which item(s) is not part of a class in a UML class diagram?
A.
B.
C.
D.

Name
Attributes
Method
Comments

50. Which statement is not true when discussing best practices?


A.

Data access objects are a useful best practice, as they encapsulate access to data and maintain a clean separation of bean and database

access code.

B.
C.

A session bean facade provides a simple, single point of entry to shared entity beans.
A session bean facade does not shield the client from complex entity bean relationships and manages workflow on a client's

behalf.
D.
A session bean facade avoids the problems associated with access to entity beans from the client layernamely overabundance of
network traffic and latency and awkward security management.
51. which of the following can execute code before and after action is involked?
a. OGNL
b. validator
c. annotations
d. interceptors
52. which of the following statements are true in respect to value stack?
a. it is the place where data associated with processing of the request is stored
b.the name attribute of the ui tag is the one which links the property on the valuestack
c.<s:text filed name=username label=user name value=somename /> here the propertyon the value stack.
d.all the form properties will be stored on the valuestack
53. which of the following statements are true in respect methodfilterinterceptor? Choose 3
a. parameter excludemethods is used to have the method names to be excluded from interceptor processing
b.if the method name are available in both includemethods and excludemethods, it will be considered as excluded methodmethod
c.parameter includemethods is used to have method names to be included in the interceptor processing
d.methodfilterinterceptor is an abstract interceptor used as a base class for interceptors that will filter execution based on method names.

54. select the correct options related to the actioncontext? Check all that apply.
a. the Actioncontext is a global storage area that holds all data associated with
b.the valuestack is the part of actioncontext
c.the actioncontext is thread local that makes the struts 2 action thread safe
d.the actioncontext is the context in which action is executed
55. A standard set of result tokens are defined by the actionsupport base class.Which of the following are predefined result names?
a. success
none
error
input
login
b.pass
none
error
log-off
logo
c.success
none
error
output
log
d. . success
none
error
log-off
login
56. What are the non-functional requirements?
a. performance,reliability,documentation
b. specification,usecase,
c. performance,availability,reliability
d. scalability, extensibility, manageability
57. which statement is not true about state machines and state diagrams?

a. the state diagram shows the sequences of states that an object passes through during its lifetime.
b. state diagrams are used in situations for which all or most of the events represents the completion of internally generated actions(that
is , procedural flow of control).
c. a state machine is a basically a diagram of states and transactions that describe the response of an object of a given class to the receipt of
external stimuli, and is generally attached to a class or method.
d. a state diagram represents a state machine; a state being a condition during the life of an object or an interaction during which it satisfies some
condition , performs some action, or waits for some event.
58. Which one of the following must be done before authorization takes place? (Select one)
a Data validation
b User authentication
c Data encryption
d Data compression
59. Which of the following elements are used for defining a security constraint? Choose only those elements that come directly under the
securityconstraint element. (Select three)
a login-config
b role-name
c role
d transport-guarantee
e user-data-constraint
f auth-constraint
g authorization-constraint
h web-resource-collection
60. Which of the following statements regarding authentication mechanisms are correct?(Select two)
a The HTTP Basic mechanism transmits the username/password in the open.
b The HTTP Basic mechanism uses HTML FORMs to collect usernames/passwords.
c The transmission method in the Basic and FORM mechanisms is the same.
d The method of capturing the usernames/passwords in the Basic and FORM mechanisms
is the same.
61. Which of the following statements are correct for an unauthenticated user?(Select two)
a HttpServletRequest.getUserPrincipal() returns null.
b HttpServletRequest.getUserPrincipal() throws SecurityException.
c HttpServletRequest.isUserInRole() returns false.
-d HttpServletRequest.getRemoteUser() throws a SecurityException.

SOME EXTRA QUESTIONS (NOT SO IMPORTANT, JUST GIVE A GLANCE)


which command is used for executing DDL statements?
A execute()
B executeResult()
C executeUpdate()
D executeQuery()
set of services provided by component or class is called as
A Interface
B Container
C Component

D Object
Statement A:notify(), notifyall() and wait() can be used only within synchronized block
Statement B:notify(), notifyall() and wait() can be called on objects not thread.
a. A is true, B is false
b. A is false, B is true
c. Both A and B are True
d. Both A and B are false
Annotation type can extend another annotation type. True/ False
False/true
Which validator is used for Action Level Error message?
a. Field,
b. NonField
c. Custom
d. Common
Question about what is model,view ,controller in struts 2.0
a action , UGI tags, interceptors
b. action , result,interceptors
c. action ,view,interceptors
d.action,result,filterdispatcher
Which one of the following is true regarding property files in struts?

a.
b.

Web-Content/PropertyFile.xml
WebINF/PropertyFile.xml

What is true about features of Struts 2.0 -- Options(theoretical)


Ans: Implementation of Action is optional my answer

Referring above (tag with html prefix)


Which are the following of choices below allow the creation of a struts aware HTML form?
ANS: <%@taglib uri =/WEB-INF/Struts-html.tld prefix=html%>
The Struts message can be loaded either by?
1. an init parameter in the servlet config in the web.xml.
2. by a <message resource> tag in the strut-config.xml
When option 2 is required.
Ans: option 2 is required when the application supports more than one application resource file.
Question on MVC
Ans: Model
-Action
View
-Jsp,XSTL free markers.
Controller -Interceptor
Life cycle of interceptor?
Ans: 1 object instantiation.
2 Initialization method
3 Interceptor
4 Destroy
Question of context param and listner class declaration
Ans: They both are declared in web.xml was the answer

which of the following are true?


Ans: when a object is serialized the whole object state are saved

Declaring a volatile java variable means...(i donno wot the question is, but this is the truth)
declaring a volatile java variable the value will be saved in main memory not local

Struts 2 life cycle


1>User send request
2>Action dispatcher looks for action
3>interceptor are applied
4>execution of action
5>result rendering o/p
6>redirect request.
7>view o/p to user.

Question on steps in life cycle of struts 2.0 options are like


1. User requests to the server and request send to servlet
2. filter action filters some thing like this
3. action method called
4. interceptor intercepts the action to the .

isolation true- not affects one transaction from another


steps of struts2.0 architecture
a. Servlet dispatcher dispatches calls action proxy and then action is called.
b. Interceptor intercepts the request and execute() method is called
c. the action completes and then result are rendered to the user
Life cycle of action? --very important

REQUEST TO filterdispatcher
Actionmapping is called
Actionproxy is called to execute the method actioninvocation
Interceptors to process the request
Action is executed
Result
Interceptors in reverse order

In what attribute do you specify the redirection file in struts?

NO IDEA

Você também pode gostar