You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Campbell <ca...@kontiki.com> on 2002/03/18 20:11:14 UTC

RE: Overriding properties defined in TR.props

Use the tools supplied - ant in this case

If you put an entry in your deploy target like this

<filter filtersfile="${env.DEPLOY_FILTER}"/>
        
<copy todir="${dest}/conf" overwrite="on" filtering="true">
<fileset dir="${dir}/conf">
	<exclude name="CVS"/>
</fileset>
</copy>


( you will have to monkey around with your own targets in build.xml,
there is alot of different ways to do this, this is just a simple
example )

where DEPLOY_FILTER is an environment variable indicating a path to a
java style properties file
that has entries like this:

PROP1=val1
PROP2=val2

then in your TR.props you can do this

database.default.driver=@PROP1@
database.default.url=@PROP2@ 

Just change the DEPLOY_FILTER environment variable when you build the
war file and voila!

Works great for me, I deploy to 4 different environments on many
different OS no problem. I have the filter files checked in to cvs so i
can deploy to any environment i have on demand with zero effort.

chris c

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au] 
Sent: Sunday, March 17, 2002 2:54 AM
To: turbine-user
Subject: Overriding properties defined in TR.props


As my webapp moves from development to staging and production I have to
edit
TR.props to alter the values to meet the requirements of the particular
environment.  In particular I have to adjust the database settings and
the
various parameters that tune a site for production.

At the bottom of the default tdk 2.1 TR.props there is a line that
includes
another properties file, flux.properties.  This looks like a good way
for me
to make the necessary customisations to TR.props for each environment -
I
define myapp.properties to include just the properties that need to be
customised for each environment and include this in a standard TR.props.

The comment above the line where flux.properties is included cautions me
to
be careful as duplicate property name values will be replaced.  The
actual
behaviour that I experience however is that duplicate names are not
tolerated and I must comment the properties out in TR.props in order to
get
my webapp to execute without dieing a horrible death at startup.

This is no big problem, but I was wondering if anyone else had
experienced
the problem and if there is a fix.  <cardinal-sin-confession>I haven't
checked the mail archive or cvs.</cardinal-sin-confession>

I am curious as to how others deal with this issue - have you got a
better
solution that you would like to share?

Cheers,

Scott


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: changing default URL

Posted by Jean-Michel FRANCOIS <jm...@datasystem.fr>.
Hi there,
to avoid this problem in my app I didn't change my web.xml but simply 
add an index.jsp in top of my webapp with this content:
<% response.sendRedirect("servlet/mypapp"); %>

I'm not sure it's best way, but it's working.....


Patrice Le Cozler wrote:

>I had the same problem with one of my app (no more images)
>it seems that when you use url mapping, the portion of the url you type after  http://localhost:8080/myapp/ is ignored
>( if you type http://localhost:8080/myapp/images/the-image-you-want-to-display.gif , you always come back to your app
>home page )
>I didn't find the way to avoid that. If you find where the problem comes from, I'm interested.
>
>Patrice
>
>Java Mails wrote:
>
>> thanks for the quick response
>>I tried ur advice... it did worked.
>>however, it can no longer see the images/picture files i use in the app. and so does the CSS ive set.
>>
>>  Patrice Le Cozler <pl...@dexem.com> wrote: You just add the following lines in your myapp/WEB-INF/web.xml file
>>(after the section) :
>>
>>myapp
>>/*
>>
>>see
>>http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/funcspecs/fs-default.html
>>
>>or the Java Servlet specification for more informations
>>
>>Patrice
>>
>>Java Mails wrote:
>>
>>>hi all!
>>>conventionally, I invoke turbine application using the following URL
>>>http://localhost:8080/myapp/servlet/myapp
>>>This can sometimes be long and somehow not very friendly.
>>>How can I make do it in such a way that I can invoke it using only
>>>http://localhost:8080/myapp
>>>
>>>tia
>>>
>>>
>>>---------------------------------
>>>Do You Yahoo!?
>>>Yahoo! Games - play chess, backgammon, pool and more
>>>
>>--
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
>>
>>---------------------------------
>>Do You Yahoo!?
>>Yahoo! Games - play chess, backgammon, pool and more
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>


Re: changing default URL

Posted by Patrice Le Cozler <pl...@dexem.com>.
I had the same problem with one of my app (no more images)
it seems that when you use url mapping, the portion of the url you type after  http://localhost:8080/myapp/ is ignored
( if you type http://localhost:8080/myapp/images/the-image-you-want-to-display.gif , you always come back to your app
home page )
I didn't find the way to avoid that. If you find where the problem comes from, I'm interested.

Patrice

Java Mails wrote:

>  thanks for the quick response
> I tried ur advice... it did worked.
> however, it can no longer see the images/picture files i use in the app. and so does the CSS ive set.
>
>   Patrice Le Cozler <pl...@dexem.com> wrote: You just add the following lines in your myapp/WEB-INF/web.xml file
> (after the section) :
>
> myapp
> /*
>
> see
> http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/funcspecs/fs-default.html
>
> or the Java Servlet specification for more informations
>
> Patrice
>
> Java Mails wrote:
>
> > hi all!
> > conventionally, I invoke turbine application using the following URL
> > http://localhost:8080/myapp/servlet/myapp
> > This can sometimes be long and somehow not very friendly.
> > How can I make do it in such a way that I can invoke it using only
> > http://localhost:8080/myapp
> >
> > tia
> >
> >
> > ---------------------------------
> > Do You Yahoo!?
> > Yahoo! Games - play chess, backgammon, pool and more
>
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: changing default URL

Posted by Java Mails <av...@yahoo.com>.
 thanks for the quick response
I tried ur advice... it did worked.
however, it can no longer see the images/picture files i use in the app. and so does the CSS ive set.
 
  Patrice Le Cozler <pl...@dexem.com> wrote: You just add the following lines in your myapp/WEB-INF/web.xml file
(after the section) :


myapp
/*


see
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/funcspecs/fs-default.html

or the Java Servlet specification for more informations

Patrice

Java Mails wrote:

> hi all!
> conventionally, I invoke turbine application using the following URL
> http://localhost:8080/myapp/servlet/myapp
> This can sometimes be long and somehow not very friendly.
> How can I make do it in such a way that I can invoke it using only
> http://localhost:8080/myapp
>
> tia
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

Re: changing default URL

Posted by Patrice Le Cozler <pl...@dexem.com>.
You just add the following lines in your myapp/WEB-INF/web.xml file
(after the <servlet> section) :

  <servlet-mapping>
    <servlet-name>myapp</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

see
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/funcspecs/fs-default.html

or the Java Servlet specification for more informations

Patrice

Java Mails wrote:

>  hi all!
> conventionally, I invoke turbine application using the following URL
> http://localhost:8080/myapp/servlet/myapp
> This can sometimes be long and somehow not very friendly.
> How can I make do it in such a way that I can invoke it using only
> http://localhost:8080/myapp
>
> tia
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


changing default URL

Posted by Java Mails <av...@yahoo.com>.
 hi all!
conventionally, I invoke turbine application using the following URL
http://localhost:8080/myapp/servlet/myapp
This can sometimes be long and somehow not very friendly. 
How can I make do it in such a way that I can invoke it using only
http://localhost:8080/myapp
 
tia 
 



---------------------------------
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

Re: Overriding properties defined in TR.props

Posted by Scott Eade <se...@backstagetech.com.au>.
Chris,

I finally got around to switching to the method you provided below.  This is
way better than what I was doing.

Thanks for pointing me in the right direction.

Scott

> From: "Chris Campbell" <ca...@kontiki.com>
> Reply-To: "Turbine Users List" <tu...@jakarta.apache.org>
> Date: Mon, 18 Mar 2002 11:11:14 -0800
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> Subject: RE: Overriding properties defined in TR.props
> 
> Use the tools supplied - ant in this case
> 
> If you put an entry in your deploy target like this
> 
> <filter filtersfile="${env.DEPLOY_FILTER}"/>
>       
> <copy todir="${dest}/conf" overwrite="on" filtering="true">
> <fileset dir="${dir}/conf">
> <exclude name="CVS"/>
> </fileset>
> </copy>
> 
> 
> ( you will have to monkey around with your own targets in build.xml,
> there is alot of different ways to do this, this is just a simple
> example )
> 
> where DEPLOY_FILTER is an environment variable indicating a path to a
> java style properties file
> that has entries like this:
> 
> PROP1=val1
> PROP2=val2
> 
> then in your TR.props you can do this
> 
> database.default.driver=@PROP1@
> database.default.url=@PROP2@
> 
> Just change the DEPLOY_FILTER environment variable when you build the
> war file and voila!
> 
> Works great for me, I deploy to 4 different environments on many
> different OS no problem. I have the filter files checked in to cvs so i
> can deploy to any environment i have on demand with zero effort.
> 
> chris c
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>