k space

Ranch Hand
+ Follow
since Jun 25, 2002
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by k space

well done Dinesh
14 years ago
No, HttpSessionActivateListener does not need any DD configuration.

Please refer to this thread Is HttpSessionActivationListener configured in DD?
well done Durgesh Tiwari

srivastava ashish wrote:
Problem statment does not require any transaction and security so i am bypassing EJB and proposing a Web Based Solution.



Make sure you fully understand the requirements. In real life projects, it is common to have Web + DB. However, I doubt that in the SCEA exam it will require only these two tiers, i.e. no EJB tier. In JEE architecture, EJB is commonly used to handle the business logic.
congratulations and keep it up Srivastava Ashish
Hi Malatesh,

The web container only knows about the Servlet interface, which defines the init(ServletConfig) method.

The GenericServlet is a helper class that makes writing servlets easier. The init() method of the GenericServlet (as you stated that) is a convenience method so that there's no need to call super.init(config). Please check the API for the details.

Please also note that you can develop your servlet from scratch, i.e. without extending the GenericServlet class or the HttpServlet class.

Malatesh Karabisti wrote:If I write a default constructor do I need call the init() method or container will take care of calling this one ?



Hi Malatesh, I believe you need to understand the Life Cycle of a servlet. Here is one Servlet Life Cycle.

Malatesh Karabisti wrote:why I can't write my own constructor in Servlet ?what are the consequence if I write it?



I guess you are talking about non-default constructors.

You can write a servlet that has the default constructor plus other constructors, but only default constructor will be used by the container to instantiate your servlet. Please remember the container only knows about the javax.servlet.Servlet interface. Once the servlet object has been instantiated or created, the container will invoke the init(ServletConfig) method and let the servlet initialize itself before serving any requests. The init method is the proper place for the initialization, as it is able to access the environment through the ServletConfig.
well done Mika
14 years ago

Luke Murphy wrote:
Personally I favour the separation. A factory / builder or mapper class could be used to map from one to the other.



I agreed that a clean separation is important in terms of maintainability and extendability. In your case, you need POJO + JPA for persistence, and JAXB for Transfer Object or a presentation of your Domain Object. By separating them (as Murphy suggested using a factory/builder to generate the required object), you have the flexibility of supporting different presentations, e.g. JSON.
well done Karl

Karl Wu wrote:
One question about Part 2, do I need to start Part 2 assignment immediately after Part 1 or can do it anytime.



There is no time limit on completing the assignment, so take a break and enjoy yourself until you are ready to start the part II. I believe you find this SCEA FAQ useful.