problems of jsp editor [message #125409] |
Mon, 25 July 2005 04:55  |
Eclipse User |
|
|
|
1) it does not know the classes in serverlet api
write code like this:
HttpSession s = session;
in a jsp file,the jsp editor shows an error that HttpSession
can't be resolved.But you know,every jsp has a session variable.
The same as request,response and so on.
2) problem about include
a) The jsp editor can't deal correctly with a file which includes another
file and this included file inclueds another file too!
here is an example,there are 3 files:
1. test.jsp
<%@page import="java.util.*" %>
<%
//HttpSession s = session;
List list = new ArrayList();
%>
<%@include file="include1.jspinc"%>
2. include1.jspinc
<%
for(int i=0,n=list.size();i<n;i++){
Object o = list.get(i);
%>
<%@include file="include2.jspinc"%>
<%}%>
3. include2.jspinc
<%for(int j=0;j<3;j++){%>
<%=o%>
<%}%>
now,jsp editor shows an error that "o can not be resolved (in file
include1.jspinc)"
b) As we develop jsp files,there may be some jsp files only used as jsp
fragment,
they are not standalone. I think these files should not be compiled by the
jsp editor,
and then there will not be so many errors and will make jsp editor faster!
I think we can add a flag for a jsp file to show whether it is standalone,if
not,
it is not compiled as a jsp file.
|
|
|
Re: problems of jsp editor [message #125524 is a reply to message #125409] |
Mon, 25 July 2005 10:42   |
Eclipse User |
|
|
|
Originally posted by: pavery.us.ibm.com
cheng wrote:
> 1) it does not know the classes in serverlet api
> write code like this:
> HttpSession s = session;
> in a jsp file,the jsp editor shows an error that HttpSession
> can't be resolved.But you know,every jsp has a session variable.
> The same as request,response and so on.
>
There was a bug for this where we weren't including implicit imports in
the JSP translation. This should be fixed now (try w/ a recent build).
> 2) problem about include
>
> a) The jsp editor can't deal correctly with a file which includes another
> file and this included file inclueds another file too!
> here is an example,there are 3 files:
>
> 1. test.jsp
> <%@page import="java.util.*" %>
> <%
> //HttpSession s = session;
> List list = new ArrayList();
> %>
> <%@include file="include1.jspinc"%>
>
> 2. include1.jspinc
>
> <%
> for(int i=0,n=list.size();i<n;i++){
> Object o = list.get(i);
> %>
> <%@include file="include2.jspinc"%>
> <%}%>
>
> 3. include2.jspinc
> <%for(int j=0;j<3;j++){%>
> <%=o%>
> <%}%>
>
> now,jsp editor shows an error that "o can not be resolved (in file
> include1.jspinc)"
>
Does this work if your includes have *.jsp extension? I wonder if we're
filtering out non-jsp content type files when processing includes.
Please open a bug so we can investigate.
> b) As we develop jsp files,there may be some jsp files only used as jsp
> fragment,
> they are not standalone. I think these files should not be compiled by the
> jsp editor,
> and then there will not be so many errors and will make jsp editor faster!
> I think we can add a flag for a jsp file to show whether it is standalone,if
> not,
> it is not compiled as a jsp file.
>
>
This would be a good enhancement request (an option of ignoring
non-standalone JSP fragments during validation).
Thanks for your input,
-phil
|
|
|
Re: problems of jsp editor [message #125697 is a reply to message #125524] |
Mon, 25 July 2005 22:08  |
Eclipse User |
|
|
|
2) the problem is still there if all files are changed to *.jsp.
I hava opened a bug!
"phil avery" <pavery@us.ibm.com> ??????:dc2ton$gvs$1@news.eclipse.org...
> cheng wrote:
>> 1) it does not know the classes in serverlet api
>> write code like this:
>> HttpSession s = session;
>> in a jsp file,the jsp editor shows an error that HttpSession
>> can't be resolved.But you know,every jsp has a session variable.
>> The same as request,response and so on.
>>
> There was a bug for this where we weren't including implicit imports in
> the JSP translation. This should be fixed now (try w/ a recent build).
>
>> 2) problem about include
>>
>> a) The jsp editor can't deal correctly with a file which includes another
>> file and this included file inclueds another file too!
>> here is an example,there are 3 files:
>>
>> 1. test.jsp
>> <%@page import="java.util.*" %>
>> <%
>> //HttpSession s = session;
>> List list = new ArrayList();
>> %>
>> <%@include file="include1.jspinc"%>
>>
>> 2. include1.jspinc
>>
>> <%
>> for(int i=0,n=list.size();i<n;i++){
>> Object o = list.get(i);
>> %>
>> <%@include file="include2.jspinc"%>
>> <%}%>
>>
>> 3. include2.jspinc
>> <%for(int j=0;j<3;j++){%>
>> <%=o%>
>> <%}%>
>>
>> now,jsp editor shows an error that "o can not be resolved (in file
>> include1.jspinc)"
>>
>
> Does this work if your includes have *.jsp extension? I wonder if we're
> filtering out non-jsp content type files when processing includes. Please
> open a bug so we can investigate.
>
>> b) As we develop jsp files,there may be some jsp files only used as jsp
>> fragment,
>> they are not standalone. I think these files should not be compiled by
>> the jsp editor,
>> and then there will not be so many errors and will make jsp editor
>> faster!
>> I think we can add a flag for a jsp file to show whether it is
>> standalone,if not,
>> it is not compiled as a jsp file.
> This would be a good enhancement request (an option of ignoring
> non-standalone JSP fragments during validation).
>
> Thanks for your input,
> -phil
|
|
|
Powered by
FUDForum. Page generated in 0.05795 seconds