Community
Participate
Working Groups
Build Identifier: M20100909-0800 when apply tag proposals in JSP Editor, if the tag is a top level node, which means its parent is DOM Document, then the applied proposal text will get a more "<" before cursor position. Like user input "<jsp:at" at the beginning of document and apply jsp:attribute proposal, then the editor replace it with "<<jsp:attribute name=""></jsp:attribute>". Reproducible: Always Steps to Reproduce: 1.New a jsp file by Jsp file wizard, and use JSP Template "New JSP File(html)". 2.Input "<jsp:at"at the beginning of editor. 3.Press CTRL+SPACE. 4.Apply "jsp:attribute" proposal. 5.Then you can see the wrong applied text: "<<jsp:attribute name=""></jsp:attribute>".
Bin, based on the build identifier, I am assuming that you are using Eclipse 3.6 SR1, which corresponds to WTP 3.2.2. Have you tried 3.6 SR2 yet?
The computer was not taking into account the offset created by the leading < when calculating the replacement text. Changes have been checked into HEAD. Thanks for the bug report.
I found the bug is still there with WTP 3.3.1, could u check this again?
Created attachment 205451 [details] patch It looks like this original fix would have only worked with an empty document, not one that had contents. This patch should correct that.
Released the changes to 3_3_Maintenance and HEAD. Thanks for re-opening this.
This problem is still present in Eclipse 3.7.2 (WTP 3.3.2). Eclipse: Eclipse Java EE IDE for Web Developers. Version: Indigo Service Release 2 Build id: 20120216-1857
Reopen please. Or I should open new bug?
(In reply to comment #7) > Reopen please. Or I should open new bug? Hi Victor, I'm unable to reproduce this in Indigo based on the original description of the bug. Do you have a different scenario that you're experiencing this with?
(In reply to comment #8) > I'm unable to reproduce this in Indigo based on the original description of the > bug. Do you have a different scenario that you're experiencing this with? OK. I've got two scenarios. The first is similar to reporter's - with new JSP file. 1. Create new JSP file in existing project (right click on Project Explorer/Navigator/etc. -> New -> Other... or File -> New -> Other... or Ctrl+N, then choose JSP file, then Finish). 2. Delete everything except of the first line. Content of JSP should look like: <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 3. Position cursor on the second line (empty) and type "<jsp:a" (without quotes). JSP proposals should appear with single selected choice jsp:attribute. 4. Press Enter. JSP will now look like <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <<jsp:attribute name=""></jsp:attribute> Second scenario: with existing JSP file. 1. I have existing JSP file with following content: <%@page contentType="text/html; charset=UTF-8"%> <div class="center"> <button>OK</button> </div> note that 2nd and 4th lines are empty. 2. Place cursor to the second line. Type jsp:a, press Enter. 3. Place cursor to the fourth line. Type the same jsp:a, press Enter. Resulting JSP: <%@page contentType="text/html; charset=UTF-8"%> <<jsp:attribute name=""></jsp:attribute> <div class="center"> <jsp:attribute name=""></jsp:attribute> <button>OK</button> </div>
Created attachment 212900 [details] Example of JSP file causing error
Have you reproduced error?
(In reply to comment #11) > Have you reproduced error? Hi, Victor. I am able to reproduce it now. I think the leading page directive was important to reproducing.
(In reply to comment #12) > (In reply to comment #11) > > Have you reproduced error? > > Hi, Victor. I am able to reproduce it now. I think the leading page directive > was important to reproducing. Oh also, if you you invoke content assist and type out jsp:a, you won't have this problem. It seems to be related to leading with the <, which I may have forgotten when trying to reproduce.
Checked in changes. The problem was in how the < is parsed when on a new line. By being on a new line after the page directive, the < became the last document region. So this needed to be checked.
(In reply to comment #14) > Checked in changes. Is this fix available for Eclipse 3.8? I've installed Eclipse SDK (Version: 3.8.0 Build id: M20120626-2030) and latest Web Tools/Java Web Tools, but this problem persists.