NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Mandy
Joined: 02 Apr 2012 Posts: 1
|
Posted: Mon Apr 02, 2012 8:19 am Post subject: context.xml |
|
|
Hi,
I'm a newbie to servlet-programming and created a little servlet.
It works fine on my developement machine.
The deployment seems to be correctly, but I cant access my config.xml
the context.xml (is in 'Configuration files' and 'Web pages -> META-INF' in netbeans):
| Code: | <?xml version="1.0" encoding="UTF-8" ?>
<Context path="/guid">
<Environment name="webappconfigdir" value="E:\config\Dokuserver" type="java.lang.String" override="false" />
</Context> |
the code to access them:
| Code: | public void init() throws ServletException {
try {
Context context = (Context)new InitialContext().lookup("java:comp/env");
webappConfigdir = (String)context.lookup("webappconfigdir");
DOMConfigurator.configure(webappConfigdir + "\\log4j.xml");
cfg = new Configuration(webappConfigdir + "\\config.xml");
} catch (Throwable t) {
Logger.getLogger(guid.class.getName()).error("Fehler beim Initialisieren", t );
}
|
I also expected to find the context.xml in tomcats catalina/localhost directory, but its in the /meta-inf
1. How can I put the context.xml in the catalina/localhost at deployment, like on the development environment?
2. What I'm doing wrong at my query from the webappConfigdir?
Thanks,
Mandy |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|