aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Want Suggestion on Connection." Watch "Want Suggestion on Connection." New topic
Author

Want Suggestion on Connection.

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 212
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 "Variables.java" 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
Sheriff

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: 212
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: http://aspose.com/file-tools
 
subject: Want Suggestion on Connection.
 
Similar Threads
Displaying N rows per page
problem while keeping scope as session
session issues with Ctrl-N
about struts
Suggestion On Design Pattern & Technology To Be Used