facebook

[Closed] Add import feature for JSPs

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #247633 Reply

    I’m assuming this isn’t a bug, but an add import (CTRL+SHFT+M) function for JSPs (similar to the one for Java classes) would be great while editing JSPs, although obviously the format of the added import would be something like:

    <%@ page import=”java.sql.Connection” %>

    rather than:

    import java.sql.Connection;

    I am currently using 4.1GA with eclipse 3.1.2. Thanks for a great product.

    #247648

    Riyad Kalla
    Member

    If you autocomplete class name, an import exactly as you state will be added to your page for you. Try it:

    <%
    ArrayLis|<– invoke Autocomplete, select “java.util.ArrayList” and hit Enter.
    %>

    #247699

    Oh no, I know about autocomplete, and it works great. I’m just lazy. I’d rather just type the class name and a hot key combination (like in standard Java files) instead of typing the package name. Also, if you’re not sure exactly what the package name is, using the import function while editing Java files will allow you to pick from a list of packages. This would make editing java code in JSPs more consistent with java classes.

    #247703

    Riyad Kalla
    Member

    I’m confused now… what you describe and how I’m understanding it is what our JSP editor does. Did you try my example? Just create a new JSP page using File > New > JSP, then paste this in there, exactly as is:

    
    <%
      ArrayLis
    %>
    

    then put your cursor after the “s” and hit CTRL-Space, you should be prompted with choices. Select ArrayList from the java.util package and hit enter. Your import will be added to the top of the page and ArrayList will be autocompleted, just like the Java Editor.

    Ok so given that, please describe step-by-step the usability you are looking for, cause I’m not seeing the diff between this and what you typed.

    #247705

    Awesome. That works perfectly. The feature I was trying to describe is what happens when you open a java class without an import for java.util.ArrayList and type:

    ArrayList

    And then control+shift+m. That doesn’t work in the JSP editor. But no worries, I actually like your way better and will adopt it! Thanks.

    #247721

    Riyad Kalla
    Member

    Ahh ok cool, glad it’s working now!

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: [Closed] Add import feature for JSPs

You must be logged in to post in the forum log in