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

Key: IDEADEV-23032
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Avdeev
Reporter: t800t8
Votes: 0
Watchers: 1
Operations

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

Web facet makes IDEA cannot find XML file

Created: 22 Oct 07 07:49   Updated: 06 Nov 07 19:33
Component/s: J2EE.Web
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: None
Image Attachments:

1. WebFacetError.png
(24 kb)

Build: 7,361


 Description  « Hide
If I add Web facet, IDEA cannot find the XML file even before adding/after removing Web facet, IDEA can find it.

My module has Spring, Groovy, Hibernate and JPA facets.



 All   Comments   Work Log   Change History      Sort Order:
t800t8 - 22 Oct 07 09:19
Adding "classpath:" resolved the problem
<property name="configLocation" value="classpath:com/springinaction/roadrantz/ehcache.xml"/>

Seems IDEA should automatically add "classpath:" if user select a file from classpath.


t800t8 - 22 Oct 07 09:42
Suggestion:

+ For module without Web facet:

<property name="configLocation" value="[Ctrl + Space when cursor is here]"/>

--> add "classpath:" and display list of package at first level to let user selects one item

+ For module with Web facet:

<property name="configLocation" value="[Ctrl + Space when cursor is here]"/>

--> display list contains "classpath:" and "WEB-INF" to let user select one (currently, after pressing Ctrl + Space, IDEA will add "WEB-INF" automatically)

-->

  • if user selects "classpath:", display list of package at first level to let user selects one item
  • if user select WEB-INF, work as currently

Taras Tielkes - 22 Oct 07 13:33
Related issues:

The general problem is of the linked issues and this one is this: Spring allows both qualified/prefixed as well as unqualified resource references.
When using unqualified references, resolving depends on the type of application context (FileSystemXmlApplicationContext, ClassPathXmlApplicationContext, WebXmlApplicationContext to name some). This is a crucial piece of information that IDEA unfortunately cannot know.

Note that the comments for IDEADEV-18978 describe the problem in more detail (It's marked fixed, but I don't know how the fix works).


Taras Tielkes - 06 Nov 07 19:33
Here's an idea for an alternative solution: make it possible to associate a Spring fileset with a web facet.

This would provide a number of benefits:

  • specific resolving/completion (resolving in servlet context path of specified web facet)
  • filesets without a linked web facet would resolve unqualified paths in classpath
  • IDEA could only suggest "request"/"session"/"globalSession" bean scopes when it makes sense (if matching config is found in linked web facet web.xml)
  • Knowing which relation of filesets and web facets would also enable some Spring MVC related features, like resolving of jsp/html link to controllers.