Possible to have multiple struts 2 facets in the same project

Should I be able to have two seperate struts 2 facets, each connected to their own web facet in IDEA 10? Mostly this appears to work, apart from the fileset dialog of to the struts 2 facets. This seems to share the same filesets across both instances? Although the UI appears to let you specify inidivdual filesets for each instance. When you click OK and go back into project structure you'll find it's discarded some of the filesets you've just added. Also tried hacking the .iml file dirfectly and entering individual  filesets with unique ids via xml directly, when I reloaded the project  it just discarded the second set much as the UI does.

The only way I appear to be able to progress is to put all the struts config files from both web/struts2 facets into the same fileset.Though I need to re-edit this 'shared' filelist to change the ordering depending on which struts.xml config I'm editing at the time, otherwise the actions for one or the other don't resolve (highlighted as errors). Is this how its suppose to work?

No help file on this fileset dialogs either (Help topic "reference.settings.project.structure.facets.struts2.facet" not found).

PS Its my first time with Struts 2 so I could easily be doing things wrong - just these dialogs are adding to my confusion.

- Richard

Message was edited by: Richard Osbaldeston

5 comments
Comment actions Permalink

Hmm not sure how this behaviour has changed overnight (except maybe installing 107.253?) but now it seems the second struts2 facet isn't working at all. Rather all the result/view jsps are highlighted as errors with 'Cannot resolve symbol'. It appears the second struts2 facet is not only sharing filesets but now only validating against the first web facet and not the one its parented to (see attached pic). If add view jsps from this second struts config the new jsps appear in the first (wrong) web root, so this seems likely.

I'm guessing two web & struts facets in the same module is a no-no? I'd have created two modules *except* this is an eclipse shop so I'm dual IDE'ing, creating multiple idea modules inside the parent eclipse one (and only one) project won't go down well.

Tried removing the first stuts config from the shared fileset, that didnt help. Also tried removing the whole first struts2 facet, so I only had one struts facet attached to the the icase web context (in the pic), but that didnt work either, still only validated against the incas web facet? Relutant to remove that web context as its exploded folder artefact is rather complicated (duplicating WTP) and I dont need the pain of recreating it.

Clipboard01.png

0
Comment actions Permalink

Hello Richard,  I was able to reproduce your setup and the non-possibility of multiple Struts facets per module. This in fact is the current implementation/design.  What exactly is your usecase of having multiple web facets per module?   Thanks,  Yann

0
Comment actions Permalink

Thanks Yann, so the problem is as basic as multiple web facets per module? That much seemed to work in for me, its the facets I attached to those where things started acting weird. Would be good if the IDEA UI was a little clearer on whats allowable, its been very confusing as it stands.

My reasoning at the moment is largely circumstantial. I've inherited a large legacy struts2, eclipse project and I'm working on a prototype proposal extension to it. Rather then trying to untangle the legacy interceptors and schema and worries over its poor junit coverage I've plonked my new webapp code alongside the legacy system, but deliberately quite separate. I still need to keep compatibility with its eclipse heritage so sub-modules aren't an option. Plus I've had problems sharing code and trying to split and share code as two eclipse projects in the same workspace. When I do that IDEA & Eclipse keep making clashing/breaking changes to the .classpath files.

If the prototype is sucessful and we get the business I'll probally get the go-ahead to merge the two projects, that should slove the problem.

I did make an effort to use eclipse for a few weeks, but we just couldnt get along.

- Richard

0
Comment actions Permalink

Thanks for your explanation. I will investigate the current behaviour and get back to you ASAP.  Maybe moving the second web-facet together with its S2-facet into a new "dummy" module and declaring a module-dependency works for you as workaround.

0
Comment actions Permalink

The current behaviour w/r to multiple Struts facets per module is IMHO not favourable. This will most probably be changed for IDEA 11 where S2 facet will be attachable to module directly (and only once)  instead of parent web-facet. In the meantime please just use one web-facet with corresponding S2 facet per module.

0

Please sign in to leave a comment.