Can't configure web application

Hi

I posted this in the plugins threadbecause I thought it might be a limitation in the Struts Assistantbut now I'm thinking it's an issue with my webapp configuration generally. I'm using IDEA 6.0.1

I'm working with a team that has a fairly extensive JSP/Struts/Tiles/Spring setup, but I'm not sure if their directory structure matches what is expected. From my struts config files, I can navigate to Java classes, but path references to JSPs and tiles configuration don't work (no navigation, and are marked in read). "Go To File" doesn't include my JSPs. The problems might be in the way I set up the project.

Here's the basic layout

/a-project
../top
..../src
....../resources (properties)
....../java (beans, forms, actions, other)
....../webapp
........./tiles
........./other-jsp
........./WEB-INF
.........../classes
.........../lib

There are others, but that's the basics. The struts-config is in WEB-INF, JSPs are either in /webapp or subdirectories. Tiles-config is in /webapp/tiles.

I've tried configuring this in IDEA in several different ways, with mixed results. This is the first time I've tried using IDEA for a web app. There is an IDEA project, and this part of the project is configured as a web module, with root at /webapp.

src/java, src/resources and src/webapp are all configured as content roots, so that I can open them via Go To File (ctrl-shift-n), and src/resources is also in the dependency list, so that it gets packed to webapp/WEB-INF/classes on make.

There is one deployment descriptor, /WEB-INF/web.xml, and src/webapp is listed as a web resource, with path of "/".

When viewing the struts config, I can navigate to Java classes; within the spring config, I can as well. From struts I get errors related to JSP references and tiles references--they show in red, and are not navigable. JSP files are also not listed in Go To Files.

I really have no idea what I'm doing, but I can compile and deploy the module's Java code and properties, and run it (externally). That much is good--but in general it feels like a mess. I don't know if this is because I just don't understand what IDEA is expecting, or if the team is using a non-standard layout (they all work with Eclipse on Linux, I'm using IDEA on Windows; among other things, they use quite a lot of symlinks to ease certain deployment).

So--improper setup may be the cause of my struts woes, but I haven't found the documentation that useful.

Any tips appreciated!
Patrick

2 comments

I have a fairly similar configuration for my project:

top
top/cfg
top/jsp
top/src
top/webapp
top/webapp/WEB-INF

I created the webapp directory so that I can use IDEA web module, and I have ANT script to copy files from cfg (struts, spring, hibernate, tiles, etc) to WEB-INF or WEB-INF/classes, as well as to copy /jsp to /webapp. It's not optimal, but the version control project was already structured (minus the webapp), so I had to work around it. The project configuration is as follows:

content root: top
source path: top/src
output path: webapp/WEB-INF/classes
web module mapping: webapp = /
web.xml: webapp/WEB-INF/web.xml

In you case, I would try:
content root: src
source path: java
output path: webapp/WEB-INF/classes
web.xml: webapp/WEB-INF/web.xml
web module mapping: webapp = /

0

This is a one good ideathanks! For now, I did something similar, namely, I created a base/empty web module, then checked out individual directories from our source tree into the correct location in the modulee.g. where IDEA expects them to be. It mostly works OK, though I feel like I am still fussing with it. Anyway, I don't have any sync scripts, but it's a little more work to sync with CVS. I have IDEA building to a separate explode directory and it seems to work.

Patrick

0

Please sign in to leave a comment.