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

Key: IDEABKL-3003
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Nikolay Chashnikov
Reporter: Maxim Shafirov
Votes: 2
Watchers: 4
Available Workflow Actions

Mark as Stalled
Operations

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

Jsp Includes. Recognize the opposite way.

Created: 28 Nov 04 22:39   Updated: 10 Jan 07 20:39
Component/s: JSP Editing
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Depend
This issue depends on:
IDEADEV-623 Html / XHTML / JSP /JSPX / XML usabil... Normal Open
 


 Description  « Hide
Refer for discussion to original tracker request at: http://www.intellij.net/tracker/idea/viewSCR?publicId=4057
Let say we have A.jsp and B.jsp and A.jsp has some variables declared and B.jsp includes A.jsp. Thus, usages of the stuff declared in A.jsp are properly resolved in B.jsp. So far so good. In the real world the situation might be somwhat not that strightforward like: A.jsp declares the stuff and B.jsp uses the stuff but does not include A.jsp directly. Instead, both are included (consiquently, A then B) in the third C.jsp.
We need the resolve to work on includes graph rather than playing starting off the file being analysed.

 All   Comments   Work Log   Change History      Sort Order:
Andrei Tokar - 21 May 05 04:49
>>Thus, usages of the stuff declared in A.jsp are properly resolved in B.jsp. So far so good.

Not anymore. All builds after 3296 have this feature broken, so all <%@ page import="..."%>
directives from A.jsp are ignored in B.jsp and unqualified class names are all in red. References in B.jsp to the stuff declared in A.jsp are ok, though.


AlexL - 25 Jan 06 07:23
The simple case were A.jsp includes B.jsp and A.jsp can resolve variables declared in B.jsp. This works fine in IDEA 5.0

But I think Jetbrains needs to really think hard about this other case.
I think a JSP file which relies on variables declared in a JSP file which includes it is called a JSP fragment, and is usually
has .jspf suffix. We have some files like this and we use the .jspf suffix so that when we use the jasper to precompile
the JSPs, we skip the .jspf file because jasper won't compile them.

What this request is asking for is that IDEA use it's knowledge of the project/module to find all JSP files which include the
JSP fragment. So, the variable that the JSP fragment depends on could be declared in multiple places and possibly even
with different datatypes. For example,

A.jsp

<% 
StringBuffer name;
%>
<%@include file="/Fragment.jspf"%>

B.jsp

<%
  String name
%>
<%@include file="/Fragment.jspf"%>

Fragment.jspf

<p> name = <%=name%> </p>

I'm a bit hesitant to see this functionality implemented because it could slow down JSP parsing
further.

One way to limit the scope is to only support this for JSP files with .jspf (JSP Fragment) suffix.


Alexander Chernikov - 10 Jan 07 20:39
In Selena, 6632 the following case works.
A.jspf:
<%! private int attrA = 0; %>
B.jspf:
<%! private int attrB = attrA; %>
C.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body>
  	<%@ include file="A.jspf"%>
  	<%@ include file="B.jspf"%>
  </body>
</html>

References are resolved, at least highlighting and navigation to definition works. Are there still some important cases which does not work?