Tomcat config question...

Hi all..

I'm playing around with the Web4J framework and can get it to run just fine outside of the IDE per the tutorial on that site.  However, I'm not sure what to do with the following XML tomcat config material --

<!-- Example of a Tomcat configuration file for this application. -->
<!-- The 'YOUR_MYSQL_...' items refer to a MySQL account. The given values are phony. Please change them. -->
<!-- Assumes MySQL is running on the default port 3306. Please change if necessary. -->

<!-- Maps a URL context under Tomcat to a location on your file system. Please change 'docBase': -->
<Context docBase="/Users/nrf/projects/electricity" reloadable="true">
<Resource
   name="jdbc/electricity"
   auth="Container"
   type="javax.sql.DataSource"
   username="test"
   password="test"
   driverClassName="org.postgresql.Driver"
   url=" jdbc:postgresql://localhost:5432/electricity?useServerPrepStmts=false"
   maxActive="10"
   maxIdle="5"
/>
</Context>


In the standalone tutorial, the reader is responsible for installing the above xml file into the tomcat directory [TOMCAT_HOME]\conf\Catalina\localhost\

If I'm using Idea Ultimate, do I need to still do that by hand or is that something the IDE does for me?
4 comments
Comment actions Permalink

Hello,

Just add the config xml into the Tomcat context descriptor of your artifact and deploy artifact from IDEA integration.

Regards,
Michael

0
Comment actions Permalink

Thanks Michael.. Do you know if there's any recent docs that cover this aspect of using Idea?  This is the first time I've done something that wasn't pre-packaged and want to ensure I don't get stuck when I get home in front of things (I don't have access to that machine/environment right now).  Thx!  I will give it a shot regardless.

0
Comment actions Permalink

Hello,

To create the descriptor go to: File->Project structure->Facets->choose your Web facet->press Add Application Server specific descriptor-> choose Tomcat Server / Tomcat Context Descriptor -> OK -> OK
The descriptor file will be located at: <module root>/web/META-INF/context.xml.
Edit the file as you wish, and IDEA will do the rest on deploy.

Regards,
Michael

0
Comment actions Permalink

Thanks Michael!  Spot on I believe..  Just for my own edification/reference later, I can read up here about the web-facets specific to Idea 12

0

Please sign in to leave a comment.