Hi,
The best way to do this is build time filtering via Maven. It is very simple to
add. Create a build.properties file (or call it whatever you want), then add
properties to it like:
serverUrl=localhost
someotherproperty=something
In your web.xml, add the placeholders:
> <init-param>
> <param-name>casServerLoginUrl</param-name>
> <param-value>${serverUrl}/auth/login</param-value>
> </init-param>
Then in the pom, set it to filter the web.xml file using that properties file.
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
We are doing this for things like the database properties in CAS. IMO this
should be a core part of CAS to allow building of the same source tree on
multiple environments easier. It's just been added to uPortal.
cheers,
Steve
On 02/02/2011, at 10:31 PM, Kristian Rink wrote:
> Folks;
>
> so far stumbling into running CAS in our environment, I am stuck with a
> scenario like this: I do have a Java web application (war package)
> including a web.xml having all the CAS related filters declared and
> configured so things work fine. However, right now I end up with
> configuration like this...
>
> [...]
> <filter>
> <filter-name>CAS_Authentication_Filter</filter-name>
>
> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
> <init-param>
> <param-name>casServerLoginUrl</param-name>
>
> <param-value>http://localhost:8080/auth/login</param-value>
> </init-param>
> <init-param>
> <param-name>serverName</param-name>
> <param-value>http://localhost:8080/</param-value>
> </init-param>
> </filter>
> [...]
>
> ... which is not that nice. The CAS application, generally, is a .war
> file built using the maven overlay approach and supposed to run in the
> same servlet container the business application (so far) is running in,
> and, for testing purposes, I would like to have the CAS and business
> app run on my local machine (thus "localhost") and, for production
> environment, I want to be able to deploy the whole configuration
> (without changing web.xml) to the server. Trying something like
>
> [...]
> <filter>
> <filter-name>CAS_Authentication_Filter</filter-name>
>
> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
> <init-param>
> <param-name>casServerLoginUrl</param-name>
> <param-value>/auth/login</param-value>
> </init-param>
> <init-param>
> <param-name>serverName</param-name>
> <param-value>/</param-value>
> </init-param>
> </filter>
> [...]
>
> however failed, and, looking at what happened, it didn't take me twice
> seeing why. However: Is there a good way of achieving what I would like
> to do (i.o.w. not hard-coding the serverName in web.xml), or should I
> use some kind of maven magic and profiles in order to deploy my
> application right? Comments?
>
> TIA and all the best,
> Kristian
>
> --
> You are currently subscribed to [email protected] as:
> [email protected]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/cas-user
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user