[Lift] Re: Props file example
On Mon, Oct 12, 2009 at 2:55 PM, wrote: > > And how do I switch runtimes? within the boot.scala? If I need to, I change the run mode at start up time: $ MAVEN_OPTS="-Drun.mode=pilot" mvn jetty:run ...if that helps Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Props file example
And how do I switch runtimes? within the boot.scala? On Oct 12, 2009, at 3:52 PM, Timothy Perrett wrote: > > > Note that you can also intermix this with runtimes: > > default.props > default.pilot.props > > Doing something like that can let you automatically load different > properties based on the run mode lift is in (production vs dev etc) > > Your code will still look like: > > Props.get("some.key") //=> Box[String] > > HTH > > Cheers, Tim > > On 12 Oct 2009, at 14:36, Peter Robinett wrote: > >> >> It's a simple java.properties file. You should place it in src/main/ >> resources/props. There is a search order but, off the top of my head, >> the last two options are the username running the app (e.g. >> peter.props) and default.props. >> >> My peter.props looks like this: >> db.driver=com.mysql.jdbc.Driver >> db.url=jdbc:mysql://localhost/myDB >> db.user=myUser >> db.password=myPassword >> isPeter=true >> >> Notice that you can define your own properties. >> >> Peter Robinett >> >> On Oct 12, 2:42 pm, Guillermo Acilu wrote: >>> Hello guys, >>> >>> I am starting to learn Lift and I have a very silly question. >>> >>> I am using postgresql and I have seen that the file boot.scala reads >>> the configuration parameters like connect string, user name and >>> password, from a properties file called Props. I could not find an >>> example of such a file in any document or in google. Is it a XML >>> file >>> or a simple java.properties file? Could you please send me an small >>> example? >>> >>> Thanks in advance, >>> >>> GA >>> >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Props file example
Thanks for the information On Oct 12, 2009, at 3:36 PM, Peter Robinett wrote: > > It's a simple java.properties file. You should place it in src/main/ > resources/props. There is a search order but, off the top of my head, > the last two options are the username running the app (e.g. > peter.props) and default.props. > > My peter.props looks like this: > db.driver=com.mysql.jdbc.Driver > db.url=jdbc:mysql://localhost/myDB > db.user=myUser > db.password=myPassword > isPeter=true > > Notice that you can define your own properties. > > Peter Robinett > > On Oct 12, 2:42 pm, Guillermo Acilu wrote: >> Hello guys, >> >> I am starting to learn Lift and I have a very silly question. >> >> I am using postgresql and I have seen that the file boot.scala reads >> the configuration parameters like connect string, user name and >> password, from a properties file called Props. I could not find an >> example of such a file in any document or in google. Is it a XML file >> or a simple java.properties file? Could you please send me an small >> example? >> >> Thanks in advance, >> >> GA > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Props file example
Note that you can also intermix this with runtimes: default.props default.pilot.props Doing something like that can let you automatically load different properties based on the run mode lift is in (production vs dev etc) Your code will still look like: Props.get("some.key") //=> Box[String] HTH Cheers, Tim On 12 Oct 2009, at 14:36, Peter Robinett wrote: > > It's a simple java.properties file. You should place it in src/main/ > resources/props. There is a search order but, off the top of my head, > the last two options are the username running the app (e.g. > peter.props) and default.props. > > My peter.props looks like this: > db.driver=com.mysql.jdbc.Driver > db.url=jdbc:mysql://localhost/myDB > db.user=myUser > db.password=myPassword > isPeter=true > > Notice that you can define your own properties. > > Peter Robinett > > On Oct 12, 2:42 pm, Guillermo Acilu wrote: >> Hello guys, >> >> I am starting to learn Lift and I have a very silly question. >> >> I am using postgresql and I have seen that the file boot.scala reads >> the configuration parameters like connect string, user name and >> password, from a properties file called Props. I could not find an >> example of such a file in any document or in google. Is it a XML file >> or a simple java.properties file? Could you please send me an small >> example? >> >> Thanks in advance, >> >> GA > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Props file example
It's a simple java.properties file. You should place it in src/main/ resources/props. There is a search order but, off the top of my head, the last two options are the username running the app (e.g. peter.props) and default.props. My peter.props looks like this: db.driver=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost/myDB db.user=myUser db.password=myPassword isPeter=true Notice that you can define your own properties. Peter Robinett On Oct 12, 2:42 pm, Guillermo Acilu wrote: > Hello guys, > > I am starting to learn Lift and I have a very silly question. > > I am using postgresql and I have seen that the file boot.scala reads > the configuration parameters like connect string, user name and > password, from a properties file called Props. I could not find an > example of such a file in any document or in google. Is it a XML file > or a simple java.properties file? Could you please send me an small > example? > > Thanks in advance, > > GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---