This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 86083 - jspx editor does not show scriptlet code completion
Summary: jspx editor does not show scriptlet code completion
Status: RESOLVED DUPLICATE of bug 46000
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-28 20:05 UTC by ssoong
Modified: 2008-10-13 11:23 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ssoong 2006-09-28 20:05:06 UTC
Hey, how come jspx editor does not offer code-completion pop-up on jspx files? 
I am editing the following jspx getBrowserCookie.jsp on nb5.5 20060926.

Try pressing [ctrl-space] at anywhere you expect the jsp editor to pop up code-
completion and there would be no response. 

Is this a bug or (absence of) feature? It is a rather crucial feature when I 
need to produce precise xml documents without having to manage extraneous 
spaces and line-feeds. Currently I would have to create a similar jsp to debug 
it and then mnually transform the jsp to a jspx.

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:directive.page import="java.util.Enumeration"/>
    <jsp:directive.page contentType="text/xml;charset=UTF-8"/>

    <jsp:element name="cookie">
        <jsp:body>
            <jsp:scriptlet>
                Enumeration headers = request.getHeaderNames();
                if (headers != null) {
                    while (headers.hasMoreElements()) {
                        String h = (String)headers.nextElement();
                        if (h.equalsIgnoreCase("Cookie")) {
                            out.println(request.getHeader(h));
                            break;
                        }
                    }
                }
            </jsp:scriptlet>     
        </jsp:body>
    </jsp:element>
</jsp:root>
Comment 1 ssoong 2006-09-28 20:14:34 UTC
However, the only place that code completion pop-up appears is at this line:

<jsp:directive.page import="java.util.Enumeration"/>

Since it could recognise jsp directive import, I am thinking it should 
scarcely be a problem for jspx editor to drill down to scriplet tags to apply 
jsp code editor environment to a scriptlet body.
Comment 2 ssoong 2006-09-28 21:19:09 UTC
jspx jsp:expression tag too.

<jsp:element name="device">
 <jsp:body>
  <session><jsp:expression>session.getId()
  </jsp:expression></session>
 </jsp:body>
</jsp:element>
Comment 3 ssoong 2006-09-28 21:38:20 UTC
Sorry for the nag ...
but I also notice there is no html/forms component palette when editing a jspx.
Comment 4 Marek Fukala 2007-07-11 15:32:24 UTC
I belive I can fix this issue by:
1) listening on Schlieman parser on top JSPs (Schlieman parser already runs to get navigator, folds, ...) 
   and creating java embedding dynamically in the proper JSP tags (jsp:scriptlet, declaration, ...)
2) Fixing the fake virtual JSP-servlet class provider not to use JspTokenId.SCRIPTLET/DECLARATION/EXPRESSION rather than
exploring the tokens for embedded java

I'll try to do that in 6.0
Comment 5 Marek Fukala 2007-07-13 10:02:42 UTC
done some preparation tasks - java code embeddings are now created in <jsp:scriptlet/declaration/expression> tags,
thought the code completion doesn't work (requires changes in the fake jsp servlet generator) and coloring also seems to
be broken (I need to discuss this with Vita Stejskal).

Checking in JspColoringUpdater.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspColoringUpdater.java,v  <--  JspColoringUpdater.java
initial revision: 1.1
done
Checking in JSPKit.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JSPKit.java,v  <--  JSPKit.java
new revision: 1.44; previous revision: 1.43
done
Checking in JSP.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JSP.java,v  <--  JSP.java
new revision: 1.9; previous revision: 1.8
done
Comment 6 Marek Fukala 2008-10-13 11:23:00 UTC

*** This issue has been marked as a duplicate of 46000 ***