facebook

ME 5.0.1 Content Assist – Help needed

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #257144 Reply

    cnrindia
    Member

    I have had this trouble since ME 5.0.1.

    We have a lot of old legacy JSPs where a common file is included statically and has some variables declared and defined that are used heavily by the JSP including the common JSP:

    Included jsp: CheckLogin.jsp

    
    
    ...
    
    <%
        Application app = (Application)session.getAttribute("application");
    
    ...
    
    

    A sample JSP including the above JSP:

    
    
    ...
    
    // All imports not show due to copyright issues
    
    <%@ page import="java.lang.*,java.lang.reflect.*,java.util %>
    
    <%@ include file="/common/CheckLogin.jsp" %>
    
    // Proprietary code not shown ...
    
    <%
        Page p = app.getPage("xxx");
    %>
    
    ...
    

    The problem is that with ME 5.0.1 app does not get resolved and as a result the content assist does not work. As a result of this I get over 6000 errors in the code although everything works just fine.

    This same project does not generate any errors with ME 4.1.1 with Eclipse 3.1.2

    I am unable to use ME 5.0.1 and Eclipse 3.2 as a result of this. I tried turning of all validators, etc and other things but this simply does not work.

    I think this is a serious regression in ME 5.0.1

    I am out of ideas. Please help.

    Thanks

    Divyesh

    #257207 Reply

    Riyad Kalla
    Member

    Divyesh,
    This would be a big regression but I cannot reproduce it on my end, please try this example:

    1) Create a new web project
    2) Create a new file, include.jspf, make contents:

    
    <%
        ServletContext ctx = application;
    %>
    

    3) Create index.jsp, make contents:

    
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <%@ include file="include.jspf" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'index.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
        Her is my var <%= ctx %>
      </body>
    </html>
    

    place cursor after ctx and hit dot, you should get autocomplete

    #257386 Reply

    cnrindia
    Member

    I tried the above and it works as you say.

    Like I explained what I have is all legacy code and not very well written and unfortunately I do not have the liberty to rewrite everything at this time. All I can say is that for the same project I do not have issues with Eclipse 3.1.2 and ME 4.1.1.

    I am not sure what to do to get rid of those errors. The jsp compiler does not complain nor do I get any errors. I think this is a ME issue and i am not sure what else could I do help you reproduce this issue?

    Does ME 4.1.1 work with Eclipse 3.2?

    – divyesh

    #257397 Reply

    Riyad Kalla
    Member

    Yes it does sound like a page resolution problem. Is this project by chance a plain Java Project and not a web project? When you open th eproject properties and go down to MyEclipse, what capabilities are enabled on the project?

    #257403 Reply

    cnrindia
    Member

    sorry, I forgot to mention that the project is Java project and not a web project since, again, due to the way the code is structured in our source control, I am unable to set it up as a web project, due to webroot path and other requirements for setting up the project as a web project.

    Even so there have been no resolution issues in the previous releases of ME and I am abe to use it for JSP debugging and new development albeit with reduced capabilities which is acceptable to me.

    So if I scroll down the props of the project “MyEclipse” reports that no capabilities are enabled.

    Is there a workaround or fix for this issue?

    Thanks

    Divyesh

    #257404 Reply

    Riyad Kalla
    Member

    Divyesh,
    Unfortunately I don’t have a solution for you at the moment as MyEclipse is structured around the Web Project project type, but we do support Java Projects to a limited extent when the root of the project is treated as the web root… is that how this project is laid out?

    Alternatively, try and use a relative path (../include.jsp) instead of absolute path

    #257548 Reply

    cnrindia
    Member

    Riyad,

    Thanks for the tip, but that did not help either.

    I did a bit of work to setup the project as a web project without any code changes and and after some tweaking all of the validation errors did go away. However, I still get an error on Content Assist if a variable is defined in an included jsp. I did try out change of using relative paths, but that did not help. In fact now it generates errors.

    Any ideas?

    Thanks

    Divyesh

    #257574 Reply

    Riyad Kalla
    Member

    Divyesh,
    I did find a bug with validation and code assist not working when the web root is treated as the project root and filed those bugs the other day for the development team. So that *should* help you in a future release, but getting autocomplete and validation should work when you create a Web Project and put two new JSPs in the WebRoot dir and have one include the other. I just tried this on Linux and Mac and both worked.

    If you are still having errors, can you outline, in detail what kind of project you have setup and how it’s setup? I might be able to see the issue.

    #257613 Reply

    cnrindia
    Member

    Riyad,

    I think my issue is related to the bug that you found where the webroot and the project root are the same since I have the same setup. Hopefully the future bug fix will fix this issue.

    My setup does have the 2 jsps in different folders. That is, the included jsp is in a folder that is different from the jsp including it as below. Also all the java code is in yet another folder:

    
    / <webroot and project root>
    |
    /jsps/common/<common jsps that get included>
    |
    /jsps/folder-1/<jsps including the jsps from the common folder under project/webroot>
    |
    /jsps/folder-n/<jsps including the jsps from the common folder under project/webroot>
    |
    /java/...<all java bean and other code used by the jsps>
    |
    /META-INF <created by ME>
    |
    /WEB-INF <created by ME>
    

    Hope the above helps.

    Also, like I mentioned, with the above structure all of my validation errors are gone, but content assist does not work, esp. vars declared in included jsps, although some java code completion works in jsps – example, bean and other referenced objects, intermittently.

    Thanks a lot for your help!

    – Divyesh

    #257646 Reply

    Riyad Kalla
    Member

    Divyesh,
    I’m sorry to say this is the bug I did indeed file, MyEclipse gets all confused when the webroot and project root are same and if you double check your log file <workspace dir>\.metadata\.log, you likely have validation exceptions from the validation engine and JSP Indexer exceptions not understanding your project structure.

    #257722 Reply

    cnrindia
    Member

    Riyad,

    Ok. Thanks a lot for looking into this. I will wait for the update which will hopefully have the fixes.

    Any possible dates for the updates?

    – Divyesh

    #257740 Reply

    Riyad Kalla
    Member

    Divyesh,
    It may be a few weeks, we are knee deep in unanounced work at the moment that takes priority, but after that is done, we are waging an all out war on bugs.

    #260277 Reply

    cnrindia
    Member

    Riyad,

    Any word on an update release fixing this issue?

    Thanks

    Divyesh

    #260281 Reply

    Riyad Kalla
    Member

    Ok update:
    We are working on the 5.0.3 release right now, this as well as the validation-failing-when-webroot-is-project-root issues are targetted for 5.0.3. We are also going to be updating underlying frameworks and building ontop of Eclipse 3.2.1 as a target. We are looking at MyEclipse 5.0.3 being a huge bugfix release, lot’s of polish and tightening across the board.

    So as of right now, this should be fixed in 5.0.3. Our target release is Nov 6th.

    #261378 Reply

    cnrindia
    Member

    Riyad,

    Any word on the update to 5.0.3?

    Thanks

Viewing 15 posts - 1 through 15 (of 26 total)
Reply To: ME 5.0.1 Content Assist – Help needed

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