Hola Guys,
After reading up a bit and looking through the fcrepo-webapp-fedora
web.xml, here are the three different fixes for loading spring configs
from outside of the WEB-INF directory i could come up with:
1.) import the server's context using
<import resource="file:${FEDORA_HOME}/server/config/spring">
in src/main/webapp/WEB-INF/applicationContext.xml
Pro: quick, no new implementation, easy to configure
Con: ugly, and not really a relative path.
2.) implement ConfigurableWebApplicationContext from Spring and use
<context-param>
<param-name>contextClass</param-name>
<param-value>MyWebapplicationContext</param-value>
<context-param>
in src/main/webapp/WEB-INF/web.xml. This will have Spring's
ContextLoader use the set contextClass as an ApplicationContext.
This is basically the ResourceLoader idea from the commiter's meeting.
Pro: only relative paths for configuration files, since the
implementation could know where to look for the files (i.e. FEDORA_HOME).
Con: work.
3.) pack the spring configuration files into the server jar by adding
the xml files as resources in the maven pom.xml, so they will be
automatically put into the resulting jar file when build. Then spring
will be able to locate server spring configuration files in the classpath.
Pro: quick, no new implementation, no paradigms would be broken
Cons: the configs are in a jar and harder to manipulate
imho and in light of https://jira.duraspace.org/browse/FCREPO-504 i'd
say the third approach seems most atractive to me, since it also
complies with the best practice of having all the configuration of a
webapp in WEB-INF.
regards,
frank
--
Frank Asseg
ePublishing & eScience
Development & Applied Research
Phone +49 7247-808-515
Fax +49 7247 808-133
[email protected]
FIZ Karlsruhe – Leibniz Institute for Information Infrastructure
Hermann-von-Helmholtz-Platz 1
76344 Eggenstein-Leopoldshafen, Germany
http://www.fiz-karlsruhe.de/
-------------------------------------------------------
Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische
Information mbH.
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB
101892.
Geschäftsführerin: Sabine Brünger-Weilandt.
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers