File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Want Suggestion on Connection. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Want Suggestion on Connection." Watch "Want Suggestion on Connection." New topic

Want Suggestion on Connection.

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hello Ranchers / Bear ,

Today i have come up with one more query. We have an website in which we have like 65 - 70 pages. One of the pages is the CinemaScope which has details of the latest cinemas and latest interviews with the celebrities and all that is the related to the glamour world.

Now , The previous architecture which was made by previous developers was such that whenever the page is loaded i.e JSP Page, it goes to a file called "" which has a hashtable with details like DBURL , driverClassName, SMTP HOST etc...and then serves the JSP Page.

Now , It has come to me and according to me , this is not a good architecture. What i have done is , In the <context-param> element of the <web-app> , I have defined these details and it too is working.

Now , Can anyone tell me if i have taken a write step to make it more efficient ? Also , The application is following MVC1 architecture which actually is BAD , but is there... The DB connection is done in the JSP itself where actually only presentation logic should be there. However , I will try to make it MVC2 but before that i want suggestions from our fellow developers here at the ranch. Is making changes in the web.xml a good step ?

P.S : We are using JRUN4 as our Servlet / JSP container.

Please let me know of your suggestions.

Thanks in advance.
Yogendra Joshi.

Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

There is no "MVC1". There is Model1 and Model2. Model 2 uses MVC, Model1 does not.

Your change sounds fine.
Either way, there was a central place to hold configuration settings.
You've moved that place from the code to a configuration file (where configuration settings belong).

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Ben ,

I am sorry.. I meant Model 1 and thanks for the suggestion. I know the changes which i have done are same as earlier , however as the configurations are now saved in deployment descriptor it would be utilized by the "Already in Memory" settings.

Hope the company understands my logic... :-)

Thanks again for the reply.
I agree. Here's the link:
subject: Want Suggestion on Connection.
jQuery in Action, 3rd edition