File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Applications settings in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Applications settings in JSP" Watch "Applications settings in JSP" New topic
Author

Applications settings in JSP

Joseph jo
Greenhorn

Joined: Mar 02, 2009
Posts: 11
Hi All

Im new to java programming and I am developing a JSP web application.

Where can/should i keep my applications configuration setting elements.

for example query strings and other elements...in microsoft .net they are kept in web.config file.

does JSP support any this sort of configuration file....if it does....how can i retrieve those values from that file in application?

Any help would be much appreciated


Thanks

-Joseph



Oscar Costa
Ranch Hand

Joined: Feb 05, 2009
Posts: 31

Hi Joseph,

In Servlet/JSP we use the web.xml to some configurations...

I would suggest to you read some Servlet/JSP book, like the "Head First Servlet and JSP".


"Do or do not... there is no try!" - Jedi Master Yoda
> SCJP 5 : SCWCD 5 : SCBCD 5 <
Joseph jo
Greenhorn

Joined: Mar 02, 2009
Posts: 11
Oscar Costa wrote:Hi Joseph,

In Servlet/JSP we use the web.xml to some configurations...

I would suggest to you read some Servlet/JSP book, like the "Head First Servlet and JSP".



HI Oscar

Thanks for your prompt reply.

I have recently bought this book...but in their i cannot see ...anything about configuration settings for query strings and other reusable variables.
however, it in that book there is an chapter for configuring welcome and error pages.

So, it would be very much helpful...if you could redirect me to particular chapter in that book or if you have any online urls.

and could also please elaborate....you said "some configurations"...what configuration you meant?


Thanks

-Joseph
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

web.xml is not the right place for this.

There is no one set place. Some people put them in properties files for reference.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joseph jo
Greenhorn

Joined: Mar 02, 2009
Posts: 11
Bear Bibeault wrote:web.xml is not the right place for this.

There is no one set place. Some people put them in properties files for reference.



Hi Bibeault

Thanks for your reply.

Then could you please provide some best practices for it?

As i said its a web application. there will be atleast 20-25 key elements for the *.xml file including connection strings and etc.

And could you also please write, how to retrieve those values from that file?


Thanks

-Joseph
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

Best practices include NOT doing SQL access from the UI tier, and certainly not from JSP pages.

Retrieving values from a properties file is a simple Java operation and not a JSP topic.

By the way, when are you planning on replying to my private message?
Joseph jo
Greenhorn

Joined: Mar 02, 2009
Posts: 11
Bear Bibeault wrote:Best practices include NOT doing SQL access from the UI tier, and certainly not from JSP pages.

Retrieving values from a properties file is a simple Java operation and not a JSP topic.

By the way, when are you planning on replying to my private message?



Not accessing the database from UI tier, but how about from code behind file? i mean class files in JSP.
and its Oracle database.

could you please give me a sample example of retrieving values from property files?

Private Message?? i didnt get any message in my private messages inbox.
could you please forward me that message again....and i'll reply to it....thanks

Yes, but i think i owe an apology for my previous wrong use of forums....and i apologize.
I didnt know the usage policy of the java forums *_*


Thanks

-Joseph



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

Joseph jo wrote:Not accessing the database from UI tier, but how about from code behind file? i mean class files in JSP.
and its Oracle database.
Not a JSP topic. If you have specific JDBC or ORM questions, please post in those forums.

could you please give me a sample example of retrieving values from property files?

Again, not a JSP topic. Check out the classes in the java.util classes, and if you have questions, post in an appropriate forum.

Private Message?? i didnt get any message in my private messages inbox.

Please check again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applications settings in JSP