I'm definitely stretching this a little, but I also believe it to be true...
Resource files are, in my mind, "encapsulated" by the package that they belong to. You should be able to *look* at a package and see a component with all its related resources. You should be able to right click on a component's folder and copy that folder and know that you have the whole package. I feel it's not intuitive for resources to be anywhere other than in the package they belong to. Anyway, putting them in a separate directory hierarchy (even if they wind up in the same Java packaging structure when you build the JAR) breaks this idea of encapsulation. In general, things should always be as private/local as possible. With resources, this is best accomplished by keeping them in the same folder. It seems that everyone who encounters Wicket for the first time goes through a period when they think this is wrongheaded... until they almost invariably change their minds about it. It definitely requires a small mind shift. luther.baker wrote: > > Hi Jonathan, > > Curious for your thoughts - how does separating html files into the > resources directory break encapsulation? > > -Luther > > > > > On Wed, Mar 18, 2009 at 10:19 PM, Jonathan Locke > <[email protected]>wrote: > >> >> >> yes, but wicket takes a different view than maven on resources in >> general. >> they are always closest to the component they belong to. it's a form of >> encapsulation. so maybe it's wrong from maven's point of view, but >> putting >> them in src/main/resources would be wrong from wicket's point of view. >> the >> archetype should remain unchanged. >> >> >> Brill Pappin wrote: >> > >> > With Maven, non compiled files should be in src/main/resources >> > >> > The quickstart archetype actually does the *wrong* thing and puts them >> > in with the java files. >> > >> > - Brill Pappin >> > >> > On 18-Mar-09, at 4:19 PM, Trent Larson wrote: >> > >> >> Thanks for the suggestion. >> >> >> >> For posterity's sake: my problem was actually with the Maven 2 >> >> build, where >> >> it ignored the properties file (located in with the Java files) when >> >> it >> >> built the jar project. >> >> >> >> Trent >> >> >> >> >> >> On Mon, Mar 16, 2009 at 5:02 PM, Igor Vaynberg >> <[email protected] >> >> >wrote: >> >> >> >>> see iresourcesettings#addstringresourceloader() >> >>> >> >>> make one that loads your properties from some file you keep on the >> >>> classpath >> >>> >> >>> -igor >> >>> >> >>> On Mon, Mar 16, 2009 at 4:00 PM, Trent Larson <[email protected]> >> >>> wrote: >> >>>> I have 2 web applications, and I would like to allow them to share >> >>>> the >> >>> same >> >>>> text files. The only way I've found is to make each >> >>>> WebApplication class >> >>>> extend a common ParentApplication class and make a >> >>>> ParentApplication.properties file to contain the common text; then I >> >>> package >> >>>> the common ParentApplication class and properties in a separate jar >> >>> project >> >>>> and include that in each of the web projects. This works great in >> >>> Eclipse >> >>>> in an exploded environment; unfortunately, it looks like it does >> >>>> not work >> >>>> when I include the ParentApplication artifacts inside a separate >> >>>> jar. I >> >>> get >> >>>> the following error: >> >>>> >> >>>> Caused by: java.util.MissingResourceException: Unable to find >> >>>> property: ' >> >>>> squeeze.presented.by' for component: >> >>> [class=com.max.web.page.bizopp1Page] >> >>>> at org.apache.wicket.Localizer.getString(Localizer.java:269) >> >>>> ..... >> >>>> >> >>>> >> >>>> Is there any way to make this work? Is there another approach >> >>>> where I >> >>> can >> >>>> share the text between these projects? >> >>>> >> >>>> Thanks for any suggestions. >> >>>> Trent >> >>>> >> >>> >> >>> --------------------------------------------------------------------- >> >>> To unsubscribe, e-mail: [email protected] >> >>> For additional commands, e-mail: [email protected] >> >>> >> >>> >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/How-can-I-share-text-resources-with-multiple-web-applications--tp22549375p22592795.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > -- View this message in context: http://www.nabble.com/How-can-I-share-text-resources-with-multiple-web-applications--tp22549375p22594107.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
