Java and Web Module question

I have one Java Module in my project and four web modules. Some of the JSP's in my web modules depend on the classes in the Java Module. However, IntelliJ doesn't seem to be able to find the classes in the Java Module from the web modules (in the JSP's it says it can't resolve the classes and they are red).

Is there a way to "link" the java module to the web modules?

I also don't really understand the J2EE Module, I set one up but it doesn't really seem to be doing anything for me. How do I let the J2EE Module know that it contains my java module and 4 web modules?

2 comments
Comment actions Permalink

You need to go to the settings for each of your web modules and create a dependency to the Java module:
Project Settings -> Project Structure -> Open the "Modules" node in the tree and select the module -> Dependencies tab -> Add.. Button -> Module Dependency -> Select Java module

Easy, isn't it ;)

If you created a J2EE module you'll find a tab in its settings called "Java EE Application Module Settings". There you can choose other (web and bean) modules to include when building the ear.

0
Comment actions Permalink

Thanks! Didn't notice that module dependency there! Worked great.

I figured the J2EE module thing out shortly after posting.

It annoys me a little bit that I have to setup all these modules even though I don't use IntelliJ to deploy (use ANT) but if I want all of my struts actions, tile definitions, etc recognized I have to setup the web modules.

Took me about 5 tries to get everything setup correctly so IntelliJ recognizes all my struts, tile definitions, etc for each web module (XML Hell!) but I finally got it...good to go now!

0

Please sign in to leave a comment.