-
Aug 21st, 2008, 07:24 AM
#1
where to put Properties file and problem about war file
Where can I put the properties file?In tomcat, we can put them in /shared/classes.But in the new platform, where can I put them?
Secondly, I hava put a model.war file in the pickup directory, it deployed successfully, but I hava to input:
http://localhost:8080/model in the browser to get the page, how can I config so that I just input http://localhost:8080 to get the page?
-
Aug 21st, 2008, 07:25 AM
#2
where to put Properties file and problem about war file
-
Aug 21st, 2008, 07:42 AM
#3
where to put Properties file and problem about war file
> Where can I put the properties file? In tomcat, we can put them in /shared/classes.
OSGi is based on explicit exporting and importing of packages. Thus there is no notion of a "/shared/classes" folder on the Platform.
> But in the new platform, where can I put them?
As I mentioned in your previous thread...
http://www.springsource.com/beta/applicationplatform/comments.php?DiscussionID=278&page=1#Item_2
... "if you wish to share properties files across multiple bundles (e.g., in the case of a Shared Services WAR or Web Module), you will then need to place the properties files in a valid Java package (e.g., /com/example/config/mail.properties) and explicitly export that package from the bundle while importing it from other bundles which need the properties files in that package."
Although this approach works, it is perhaps not the best approach. Depending on your use case, you might be better off using ConfigAdmin or exposing your own custom configuration object as a service in the OSGi Service Registry.
> Secondly, I hava put a model.war file in the pickup directory, it deployed successfully,
> but I hava to input: http://localhost:8080/model in the browser to get the page,
> how can I config so that I just input http://localhost:8080 to get the page?
This is the expected behavior and is explained in the Programmer Guide here:
http://static.springsource.com/projects/applicationplatform/1.0.x/programmer-guide/html/ch05s02.html#developing-applications-packaging-war
In addition, the Programmer Guide explicitly explains how to deploy a web application as the root context (i.e., "/") here:
http://static.springsource.com/projects/applicationplatform/1.0.x/programmer-guide/html/ch05s02.html#developing-applications-packaging-web-module-headers
Regards,
Sam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules