History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-15359
Type: Bug Bug
Status: Open Open
Assignee: Dmitry Avdeev
Reporter: Rick Reumann
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Tiles definition file - problems with IDEA saying "definition with such name already exists"

Created: 01 Oct 07 17:55   Updated: 03 Oct 07 23:10
Component/s: Editor. Error Highlighting

Environment: windows XP.

Build: 7,126
Severity: Low


 Description  « Hide
I can't exactly pin down the 'logic' that is being used by IDEA to incorrectly state that certain page names already exist in my tiles definition file. It seems to possibly have to do with using "." to separate some of the name definitions but even that doesn't seem to always be the case. In the follow tiles-definition file it is stating that every 'name' already exists EXCEPT for the last one (task.detail.page). It seems so odd though.

For example it's highlighting "sample.page" as already existing (which is odd since it's the only place in the definition the word "sample" even appears, other than sampleForm.jsp. However if I go and add a character to after the 'page' (ie sample.page2) then it appears without any errors.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<!-- main layouts -->
<definition name="main.layout" path="/tiles/mainLayout.jsp">
<put name="header" value="/WEB-INF/jsp/header.jsp" />
<put name="navigation" value="/WEB-INF/jsp/navigation.jsp" />
</definition>
<definition name="basic.layout" path="/tiles/basicLayout.jsp">
<put name="header" value="/WEB-INF/jsp/header.jsp" />
</definition>

<!-- page sections - mostly used for just getting in page name for link on/off -->
<definition name="search.page.layout" extends="main.layout">
<put name="page_name" value="add" />
</definition>
<definition name="tasks.page.layout" extends="main.layout">
<put name="page_name" value="tasks" />
</definition>
<!-- end main page sections -->

<!-- Pages, these should typically all extend a page section above -->
<!-- if custom title, set "page_title" in Request before leaving Action -->
<definition name="login.page" extends="basic.layout">
<put name="page_title" value="Login" type="string"/>
<put name="content" value="/WEB-INF/jsp/login.jsp"/>
</definition>

<definition name="sample.page" extends="search.page.layout">
<put name="page_title" value="Sample Page" type="string"/>
<put name="content" value="/WEB-INF/jsp/sampleForm.jsp"/>
</definition>

<definition name="tasks.page" extends="tasks.page.layout">
<put name="page_title" value="Tasks" type="string"/>
<put name="content" value="/WEB-INF/jsp/tasks.jsp"/>
</definition>
<definition name="task.detail.page" extends="tasks.page.layout">
<put name="page_title" value="Task Details" type="string"/>
<put name="content" value="/WEB-INF/jsp/task.jsp"/>
</definition>

</tiles-definitions>



 All   Comments   Work Log   Change History      Sort Order:
Yann Cébron - 03 Oct 07 22:04
I cannot reproduce this with 7318

Do you have the same tiles-defs.xml mapped multiple times and/or multiple tiles-defs.xml files in your struts-config.xml setup?

Please attach a complete project setup (IPR, IML, relevant config files) to reproduce


Rick Reumann - 03 Oct 07 23:07 - edited
I don't know, I'm about to give up. I figured I'd work on creating another smaller project that I can have someone download to see the behavior I'm talking about, but now I'm running into other issues. For example in my original project IDEA somehow doesn't complain about finding a tile jsp located in web/resources/tiles directory yet in the project I'm trying to use to demonstrate what I was talking about it does complain. I'm guessing all the issues I'm having rely around a directory structure that IDEA has trouble with?

In both projects my directory structure (for both projects) looks like:

appname (root)
-------- lib (contains jars needed for compile only)
-------- src
-------- -------- java (all the java packages)
--------- ------- conf ( log4j.properties, ApplicationResources.properties )
-------- web
-------- -------- resources
-------- -------- -------- css, images, js dirs
-------- -------- -------- tiles ( tiles jsp files)
-------- -------- WEB-INF
-------- -------- -------- jsp dir
-------- -------- -------- lib dir
-------- -------- -------- struts-config
-------- -------- -------- web.xml
-------- -------- -------- tiles-definitions.xml
-------- -------- index.jsp