configuration

Pulling values from a Java Properties file in order?

I have a properties file where the order of the values is important. I want to be able to iterate through the properties file and output the values based on the order of the original file. However, since the Properties file is backed by, correct me if I'm wrong, a Map that does not maintain insertion order, the iterator returns the val...

Redirect ALL requests under a domain to static page - .htaccess or 301 or RedirectMatch?

Hey everyone, I am trying to redirect ALL requests for mydomain.com whether they are something like: http://www.mydomain.com http://mydomain.com http://mydomain.com/photos http://mydomain.com/index.php?id=672 to be redirected to http://mydomain.com/index.html As long as it has mydomain.com in it, they should see this page - its...

Which design patterns can be applied to the configuration settings problem?

In large and complex software products managing configurable settings becomes a major pain. Two approaches I've seen to the problem are: have each component in the system load its own configuration from config files or registry settings. have a settings loader class that loads all the configurable system settings and have each compon...

How can I run my Rails application in a non-root context?

I'm working in a non-privileged environment, and my Rails application's root url is http://foo.com/bar. What is the simplest way to tell Rails that, for example, my stylesheets are in /bar/stylesheets, not /stylesheets, and make model_url point to /bar/model/baz instead of /model/baz? ...

How in ASP.NET MVC to change Url.Encode character replacement strategy?

I'm using Url.Encode within a view and it's replacing spaces with + so instead of: /production/cats-the-musical I'm getting .../cats+the+musical. I'm sure this is an easy one, but where do you go to configuring which characters are used for this? I'll be doing this: public static string EncodeForSEO(this UrlHelper helper, string unen...

Access App.Config Settings from Class Library Called through Unit Test Project

I have the following setup: ASP.net 3.5 Web Site Project C# Class Library with business logic C# Class Library for unit testing The business logic library does all of the db access. It gets connection strings from the web.config file of the web site by accessing System.Configuration.ConfigurationManager.ConnectionStrings. When the li...

Add Interceptors through the web.config? NHibernate

I can't seem to find an example where someone added an interceptor via web.config - is this possible? And yes I know about event listeners and will be using them on another project - but I wanted to see if I could get around having to inject the interceptor in code - thank you ...

again about log4net and Unity IOC config

Hello, I've bumped through a few of these questions laying around various sites and the answers seem to be spun by l4n officianados toward the value of the lightweight wrapper that log4net 'is' (don't you get it?) and similar points of mind-boggling fact. However it seems that what users are asking for (and this is my question) is how ...

How to use ConfigurationManager for DEBUG dn RELEASE versions in VS 2008 projects

Hi, i would like to use the "ConfigurationManager" settings, that i can create in VS 2008 ( see image ), to create different behaviors in my web.config or app.config files... for example i want to use different connection strings, if the "debug"-configuration is active, like: <configuration> <connectionStrings configSource="connecti...

Two .NET projects, one DB connection string?

I have a .NET solution containing two projects: An ASP.NET MVC project, 'Website' A class library, 'Models' The 'Models' project contains a Linq-to-SQL data-context along with a few partial classes that extend the database objects. The connection string is defined in the web.config of the 'Website' project. However the 'Models' pro...

Editing a custom configuration section in an installer class

I am trying to update a custom configuration section of a web.config file during the installation of my product in a custom action. I wanted to use the actual configration classes to do this however when the installer runs it loads my installer class but then the Configuration.GetSection throw a File Not Found exception as it is trying ...

How do I set the timezone in Tomcat for a single web app?

What is the best way to set the time zone in Tomcat for a single web app? I've seen options for changing the command-line parameters or environment variables for Tomcat, but is there a way to set it that is self-contained in the WAR file and not dependent on any Tomcat configuration? Edit: to reemphasize, I'm looking for a solution that...

Storring data in web.config(custom section/appSettings element) vs storing it in a class

Hi. Why is it better to store data inside an appSettings element (or inside a custom section) of a web.config file than to store it in a class? One argument would be that by using custom sections we don’t have to recompile code when we change data, but that’s a weak argument, especially if we’re using Web Sites, which get recompiled...

Making a custom binding configurable over App.config

I've created a custom binding and want to make it configurable over App.config. The binding has no special options at the moment, so it would be sufficient to support just <endpoint address="http://myAddress" binding="myBinding" contract="myContract"> After checking some sites, I found out that I have to enable c...

How do I force a rebuild when the project configuration changes?

I have several project configurations and I switch between them constantly. However, every time I switch, I have to manually do a rebuild before running. How do I force it to rebuild automatically? ...

How do I configure nginx to "fall-through" various directories to find a file?

I'm setting up nginx as an asset server for our website, but I have a requirement that nginx needs to check in two directories for the file: \assets\dir1\pic.jpg \assets\dir2\pic.jpg I need nginx to check in the \assets\dir1 first and if it can't find the file, check in \assets\dir2. The problem is that nginx only allows for t...

Configure unity with one config file for multiple applications

I have two closely related applications that are both using the Unity IoC container. They have some custom types in common, but not all of them. At the moment I have two config files that have a lot of duplication. I'd like to have just one Unity config file to rule them all. However, as not all types exist in both applications Unity i...

Castle ActiveRecord error "Session is closed"

Hello, I'm trying to get started with Castle ActiveRecord but I'm stuck trying to make it work in an ASP.NET (MVC, if it matters) application. In fact I'm getting an ObjectDisposedException during a query with the following message: Session is closed! Object name: 'ISession'. I'm initializing ActiveRecord from an XML file (as shown i...

Automatically set a Java EE Module dependencies in Eclipse using Maven2

I have two projects, one called my-lib, the other one is my-webapp. As I use Maven2, I set my-lib as a dependency of my-webapp. In Eclipse, I need to have my-lib set as a "Java EE Module dependencies" for my-webapp. Is there a way to make this dependency set when I run the mvn eclipse:clean eclipse:eclipse command? For the moment, ever...

Connection interrupted when using WebHttpBinding in Transport SecurityMode

I want to expose an implementation of a contract over a WebHttpBinding with SecurityMode: transport (SSL). However, when I try to access the site via Firefox, I only get The connection to localhost was interrupted while the page was loading. The config file is as follows: <configuration> <system.serviceModel> <services> ...