Struts / Tile definitions not recognizing

I'm running build 5734 and trying to get IDEA to fully recognize the config files from a working struts project. In an action such as the following:

IDEA is not recognizing the paths. For the /user/home.do, I do have an action with the path of /user/home configued higher up in the struts config file. As for the other paths, I have tiles configured within the struts-config as follows: ]]>

All of the path items are configured in the various tile def files (with some dependencies on base.xml in some of the other definition files). Any ideas why IDEA doesn't recognize the paths in those 2 situations?

Thanks,
Steve

12 comments

Hi Steve,

it seems IDEA cannot recognize your configuration. Are you using Struts
modules? How your struts-configs are configured in web.xml?

"Steve Wardell" <no_reply@jetbrains.com> wrote in message
news:17378213.1158869809515.JavaMail.itn@is.intellij.net...

I'm running build 5734 and trying to get IDEA to fully recognize the
config files from a working struts project. In an action such as the
following:

>

<action
attribute="registrationForm"
input="/jsp/login/registration.jsp"
name="registrationForm"
parameter="submit"
path="/common/registration"
scope="request"
type="com.blah.MyAction">
<set-property property="secure" value="true"/>
<forward name="show" path="registration"/>
<forward name="etl" path="upload"/>
<forward name="user" path="/user/home.do" />
<forward name="admin" path="changePassword" />
</action>

>

IDEA is not recognizing the paths. For the /user/home.do, I do have an
action with the path of /user/home configued higher up in the struts
config file. As for the other paths, I have tiles configured within the
struts-config as follows:

>

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/conf/tile-defs/admin.xml,
/WEB-INF/conf/tile-defs/base.xml,
/WEB-INF/conf/tile-defs/feedback.xml,/WEB-INF/conf/tile-defs/report.xml,
/WEB-INF/conf/tile-defs/home.xml,/WEB-INF/conf/tile-defs/login.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="false" />
</plug-in>

>

All of the path items are configured in the various tile def files (with
some dependencies on base.xml in some of the other definition files). Any
ideas why IDEA doesn't recognize the paths in those 2 situations?

>

Thanks,
Steve



0

I'm not seeing the Struts modules that you are referring to. The project is setup as a web module. I setup a web resources mapping to have my WEB-INF directory be the /WEB-INF within the web app. When I use the Jave EE Deploy-time view, I see my web.xml and weblogic.xml show under WEB-INF. However, when I look at the Jave EE structure view, it shows a web.xml and weblogic.xml at the top level of the web app and they are more or less empty (a very few lines). I'm not sure where those 2 files are coming from or if they are related to the problem. In my web.xml, here is a snippit of what I have:

ActionServlet org.apache.struts.action.ActionServlet config /WEB-INF/conf/struts-config.xml 1 ActionServlet *.do ]]>

Let me know if you need additional information. The documentation on setting up a web app with or without struts seems somewhat sparse.

Thanks,
Steve

0

Hi Steve,

it seems you have your descriptors misconfigured. Please check it on the Web
Module Settings pane.
The upper two lines should point to your real web.xml and weblogic.xml. If
not, edit the paths.

"Steve Wardell" <no_reply@jetbrains.com> wrote in message
news:9736256.1158936044345.JavaMail.itn@is.intellij.net...

I'm not seeing the Struts modules that you are referring to. The project
is setup as a web module. I setup a web resources mapping to have my
WEB-INF directory be the /WEB-INF within the web app. When I use the Jave
EE Deploy-time view, I see my web.xml and weblogic.xml show under WEB-INF.
However, when I look at the Jave EE structure view, it shows a web.xml and
weblogic.xml at the top level of the web app and they are more or less
empty (a very few lines). I'm not sure where those 2 files are coming from
or if they are related to the problem. In my web.xml, here is a snippit of
what I have:

>

<servlet>
<servlet-name>ActionServlet</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/conf/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

>

<servlet-mapping>
<servlet-name>ActionServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

>

Let me know if you need additional information. The documentation on
setting up a web app with or without struts seems somewhat sparse.

>

Thanks,
Steve



0

That was it. Thanks for your help.

Steve

0

It sounds like I have the same problem as you, but I am pointing to the web.xml and jboss-xml.xml, still It doesn't recordnize the paths define in tiles-strut.tld.

I've tried attaching all of the tiles.xmls, other struts, made every other module a dependency....I can't get it to work...

ARGGGHHH

Sam

0

Does it resolve paths to web resources (JSP) in your struts-config.xml correctly? If yes, then your Tiles-plugin setup within struts-config.xml is probably wrong.

0

They do resolve mostly, but sometimes not...What do you mean - your Tiles-plugin setup within struts-config.xml: The header? Includes? I'm not sure I understand.

0

I meant your Tiles-plugin definition within your struts-config.xml, something like

    

]]>


Can you give more specific examples for what JSPs do not resolve?

0

What is interesting is that IDEA flagged the tilesplugin definition as duplicated. When I looked, both were identical so I deleted one....hmmm.

Also, IDEA is confused about what directory cuz some of the the .jsps it can't find appeared at first glance to be there. (If found some and not others in the same directory) So I tried to take the suggested action...Create Directory...to see where IDEA thought they were. It turned out IDEA was looking in a completely different directory not mentioned anywhere in any of the settings for the Module. (really...not mentioned anywhere...I checked and recheck). Why? I have a theory...

I can't get IDEA to build and package the .ear file the way it is put together in the ant script. I either don't know how, or it can't be done..(thus the feature to allow ant to be the build master) so...I abandoned my attempt to have IDEA be the builder/packager and said to myself.."Self, just use the ant build script"...well...one of the things the ant build does is merge WEB-INF directories from 2 different places into 1.../sites/www.capitol-linkages, /flashrecruit/web/recruiter-public/docroot/base into /flashrecruit/web/recruiter-public/docroot/merge, which is deleted and re-created on every ant build and ALSO the docroot of the project...so IDEA is probably korn-fused about where its supposed to look for validation...

So...1) is it necessary for me to ensure that the .ear file is identical to the one the ant build produces (packaging various .property files, creating merged jars, etc...) or can IDEA produce one that - perhaps different - works just fine (or better)?
2) Is it possible to build and package the ear just using IDEA...regardless of the complexity of the project...

Also...I'm in IDE-TALK and registered as sampaw for my jabber ID. I'm loaded and ready to im if you are...just give me knock...

THANK YOU!

0

Sorry Yann...wasn't clear on something...I deleted the flagged duplication of the plugin definition weeks ago...so it wasn't something I just found...maybe its required....

Sam
jabber: sampaw

0

Are you sure you set up your web resources mappings correctly?

0

Actually no. I'm trying to "learn by example". Are talking about the the web.xml setting for the module?

Does "Deployment Root" always refer to the deployment root of the Module or the project? I have one J2EE module, 4 Web Modules, and 5 Java Modules. Is there always a one to one mapping of the Web Resources to a Module? or can a Module reference more than one Resource? If not, should I set up ..docroot/base web resources as a module (not the ..docroot/merge) or use the docroot/WEB-INF?

What about sites/www.capital-linkages.com/public-site/docroot/WEB-INF and sites/www.capital-linkages.com/intranet-site/docroot/WEB-INF? Should I have modules for these?

explaination:
K...the main project dir is /Vectrics
Under vectrics:
/Vectrics/FlashRecruit
/Vectrics/sites
/Vectrics/vectrics-core (base level stand alone java classes for everything)

under /Vectrics/FlashRecruit/..
.../META-INF/application.xml
../src-[common | recruit_usr | recruit-data-objects | web-jar] (one each Java packages)
../webservice (Web package but no struts)
../web

under /Vectrics/FlashRecruit/web/..
../employer/docroot - web project with struts, spring, tiles, etc...
../graphics-gen/docroot - simple web project
../intranet/docroot - web project with struts, spring, tiles, etc...
../public-web

under /Vectrics/FlashRecruit/web/public-web/..
../base/docroot web project with struts, spring, tiles, etc...
../merge/docroot web project with struts, spring, tiles, etc... **THIS IS THE DIRECTORY THAT ANT DELETES AND RECREATES from MERGES WITH ../base AND:

under /Vectrics/sites/..
../www.capital-linkages.com/intranet-site/docroot --->> MERGED INTO /Vectrics/FlashRecruit/web/intranet/docroot
../www.capital-linkages.com/public-site/docroot --->> MERGED INTO /Vectrics/FlashRecruit/web/public-site/merge/docroot


This is probably TMI...sorry if I'm not giving you the right info...

again....THANK YOU!!!

0

Please sign in to leave a comment.