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

Key: IDEADEV-13685
Type: Usability Problem Usability Problem
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Avdeev
Reporter: Alexander Chernikov
Votes: 0
Watchers: 0
Operations

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

Web apps: Refactoring of a file, which name matches welcome-file pattern, may be improved

Created: 23 Jan 07 20:03   Updated: 24 Jan 07 13:24
Component/s: J2EE.Web, Refactoring
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 6,658


 Description  « Hide
Get a web module with the following resource directory:
. resource/Welcome.html.
. resource/sub1/Welcome.html.
. resource/sub2/Welcome.html.
. resource/sub3.
And the entry in WEB_INF/web.xml:
<welcome-file-list>
		<welcome-file>Welcome.html</welcome-file>
	</welcome-file-list>

Select resource/Welcome.html, apply Refactor / Move to resource/sub3. See preview, Do refactor.
Refactoring changes web.xml entry to <welcome-file>../sub3/Welcome.html</welcome-file>. Actually this is not correct:
1. welcome-file entry is not a certain resource, but a pattern to be appended to request URI, if this URI matches web app directory: host/context/sub2 will be extended to host/context/sub2/Welcome.html. So, is it reasonable to change the entry at all?
Similar effect with Refactor / Rename: it changes web.xml entry only when root Welcome.html is renamed, and ignores renamings of other Welcome.htmls.

2. Even for users with the single welcome file the result <welcome-file>../sub3/Welcome.html</welcome-file> is not correct, they need <welcome-file>sub3/Welcome.html</welcome-file>.



 All   Comments   Work Log   Change History      Sort Order:
Alexander Chernikov - 24 Jan 07 13:24
Some related thoughts: <welcome-file> value could be not resolved as a reference to a file in the file system at all; but 2 inspections may be introduced:
1. If <welcome-file> value does not match any file existing under resource branch, then a warning can be provided for this entry in web.xml.
2. If some directory under resource branch has no any file matching any entry in welcome file list, then an info can be provided for this directory.