Explain about validator-rules.xml and validation.xml files ?

Validator framework is used to validate the form data and you no need to write any code in your form bean for validations and storing the error messages.Your Form Bean, extending one of the Validator’s Action Form subclasses, does the required validations.If you do not use Validator, you need to handle the data validations in [...]

What is difference between ActionForm and DynaActionForm

If the ActionForm is used, then user himself has to write the setters and getters when ever he adds a control. The same process is repeated again and again when user creates a view. DynaActionForm eliminates this burden and creates the form bean itself. This way user dont have to write setters and getters. No [...]

Describe validate() and reset() methods ?

validate() : ActionForm class provides a validate() method hook that can be overridden by subclasses to perform validations on incoming form data.The validate() method hook gets called after a Form Bean has been populated with incoming form data. Following is the method signature for the validate() method
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
validate() method has return type [...]

Explain deployment descriptor(web.xml) configuration for struts application ?

Action Servlet and strtus-config.xml files and configured as below
<servlet>      <servlet-name>action</servlet-name>      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>      <init-param>         <param-name>config</param-name>         <param-value>/WEB-INF/struts-config.xml</param-value>       </init-param></servlet>
This config parameter tells the Strut’s Action Servlet where to find its central configuration file struts-config.xml
<servlet-mapping>             <servlet-name>action</servlet-name>             <url-pattern>*.do</url-pattern><servlet-mapping>
In servlet mapping <url-pattern> tag is sayinng that ActionServlet should process any requests for pages thats end in .do
Tag Library descriptors will be configured as [...]

Is Struts Thread Safe ?

Struts is not only thread-safe but thread-depenedent. The response to a requeast is handled by light weight Action object, rather than an individual servlet.Struts instanciate each Action class once and allows other request to threaded through the orginal object. This core strategy conserves resources and provides the best posible throughput. A properyly-designed application will exploit [...]

95. Hibernate Drill One

1. What is Hibernate2. What are ORM tools3. What is Object/relation paradigm mismatch4. What role does the session interface play in Hibernate5. What is sessionFactory interface6. What is Configuration interface7. What is the naming convention of Hibernate XML mapping file extensions8. What are the most common methods of configurating hibernate9. How can the mapping files [...]

94. AJAX Drill – One

1. What is the difference between JavaScript and AJAX ?
JavaScript is most commonly used as a client side scripting language. This means that JavaScript code is written into an HTML page. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it’s up to the browser [...]

93. EJB Drill 3

Can you control when passivation occurs?
The developer, according to the specification, cannot directly control when passivation occurs. Although for Stateful Session Beans, the container cannot passivate an instance that is inside a transaction. So using transactions can be a a strategy to control passivation. The ejbPassivate() method is called during passivation, so the developer [...]

92. EJB Drill Two

What is the differnece between EJB and Java BeansExplain Local InterfacesWhat is EJB ContainerWhat is in-memory replicationWhat is ripple effectWhat’s new in the EJB 2.0 SpecificationWhat is the difference between a Coarse Grained Entiry bean and Fine Grained Entity Bean.What are transaction isolation levels in EJBWhat is the software architectury of EJBs.Waht is the need [...]

91. EJB Short Drill – One

What are the differnt kids of EJBs
Stateless session bean- An instance of these non-persistent EJBs provides a service without storing an interaction or conversation state between methods. Any instance can be used for any client.Stateful session bean- An instance of these non-persistent EJBs maintains state across methods and transactions. Each instance is associated with a [...]

90. What is JNDI

The Java Naming and Directory Interface (JNDI) is an application programming interface (API) for accessing different kinds of naming and directory services. JNDI is not specific to a particular naming or directory service, it can be used to access many different kinds of systems including file systems; distributed objects systems like CORBA, Java RMI, and [...]

89. What’s the difference between servlet/JSP session and EJB Session

A session in a Servlet, is maintained by the Servlet Container through the HttpSession object, that is acquired through the request object. You cannot really instantiate a new HttpSession object, and it doesn’t contains any business logic, but is more of a place where to store objects.
A session in EJB is maintained using the SessionBeans. [...]

88. Compare stateless and statefull session bean

Stateless Session Beans

Stateful Sessions Beans

Are pooled in memory, to save the overhead of creating a bean every time one is needed. WebLogic Server uses a bean instance when needed and puts it back in the pool when the work is complete.
Stateless sessions beans provide faster performance than stateful beans.

Each client creates a new instance [...]

87. How to choose between stateless and statefull beans

Stateless session beans are a good choice if your application does not need to maintain state for a particular client between business method calls. WebLogic Server is multi-threaded, servicing multiple clients simultaneously. With stateless session beans, the EJB container is free to use any available, pooled bean instance to service a client request, rather than [...]

What is the difference between CMP and BMP

Short answer: with bean-managed persistence, you can optimize your queries and improve performance over the generalized container-managed heuristics. But container-managed persistence is very convenient, and vendors will be working to improve its performance as time goes on.]
There is of course a difference as many CMPs use O-R mapping using metadata, which is slower than hardcoded [...]