Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applications settings in JSP

 
Joseph jo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Joseph jo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web.xml is not the right place for this.

There is no one set place. Some people put them in properties files for reference.
 
Joseph jo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic