facebook

context assist with jsp’s

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #228583 Reply

    vtatta
    Member

    I created a test web-app using the wizard. During the process it asks for the jstl version to include and I choose 1.0. After creating a JSP (using struts 1.1 template) I am not able to get the context sensitive assist? I see that under the web-inf all the jstl core tld’s are listed but nothing concerned to struts tld’s are in that list. How do I add them and how can I get the context assist to work.

    using Eclipse 3.0.1. myEclipse 3.8.4

    thanks.

    #228588

    Riyad Kalla
    Member

    Right click on your project root, MyEclipse > Add Struts Capabilities.

    It wouldn’t hurt to run through this either: http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/struts/index.html

    #228604

    vtatta
    Member

    thanks so much. I followed the link that you ‘ve provided to create an example app. However I still have a problem with adding html-el tld and context assist of jstl core. More so how do I add another tld. If there is a jar I have to add it through Build java –> libraries etc etc.
    After doin that all the jar files show directly under my project and the IDE gets a bit clumsy. Is there a way to hide them?
    If I switch to Resource perspective it does hide the infomation is that a way to do it?

    #228605

    Riyad Kalla
    Member

    After doin that all the jar files show directly under my project and the IDE gets a bit clumsy. Is there a way to hide them?

    This is default Eclipse behiavor for package view, you can hide these by clicking the down arrow in the top right corner, going to Filters… and filling out the top filter to *.jar.

    If I switch to Resource perspective it does hide the infomation is that a way to do it?

    No, stay in Packaged View, I know it’s strange, I didn’t like it either at first, but most all of the Java functionality is exposed through the Package view like refactoring as such, so just learn to love it 😀

    #228606

    vtatta
    Member

    so just learn to love it 😀

    already beginning to.

    I think you missed this but again how do I add my own tag Lib. I could add the jar file but how about the tld?
    and I have jstl core 1.1 and 1.0 but context assist with core tags still does not work?

    thanks

    #228617

    vtatta
    Member

    figured it out.

    had to add tld to the web-inf and jar file on the class path and the correct URI in the jsp while importing a taglib.

    #228627

    Riyad Kalla
    Member

    Nice catch, sorry I missed that question originally.

    #228966

    tory
    Member

    I am running myEclipse 3.8.4 on a Windows 2000 machine, with Java j2sdk1.4.2_05 installed. When I use myEclipses refactor tool to change the name of a .jsp file, the java content assist ceases to function. Here is an example of what happens: I create a project. I declare a .java class under the ‘src’ folder, inside a package. I then create a .jsp under the ‘webroot’ folder. The .jsp imports the .java class. Inside the ‘<% %>’ tags I say something like ‘some.imported.package.class myClass = new some.imported.package.class();’ (where some.imported.package.class is the actual name of the class) then type ‘myClass.’ and after I type the period the content assist displays the various methods inside the imported class. Now if I use the refactor tool to change the name of the .jsp, and go back to the .jsp and type ‘myClass.’, after I type the period and press ctrl+space, the message I get is “Java Content Assist is not available for the current cursor location.” I am working in a commercial environment, and the company has licenses for myEclipse. Help with this problem would be greatly appreciated.

    Thanks,
    Tory

    #228974

    Riyad Kalla
    Member

    Tory,
    Have you tried closing and reopening the file? What about rebuilding the project?

    #229042

    tory
    Member

    Riyad,
    I have rebuilt the project by going to ‘Project’, then ‘Clean’ in myEclipses menu system. After rebuilding the project, the problem persists. We are using the ‘CVS’ feature in myEclipse, would this affect anything?

    -Tory

    #229046

    Riyad Kalla
    Member

    Tory,
    I was unable to reproduce this, here is my setup, let’s compare notes:

    Setup
    Windows XP Pro, SP2
    JDK 1.4.2_07
    Eclipse 3.0.2 SDK
    MyEclipse 3.8.4 GA for Eclipse 3.0.x

    Steps
    1) Create new Web Project
    2) Create new JSP Page, MyJsp.jsp
    3) Create new class TestClass in the com.test package:

    
    package com.test;
    
    public class TestClass
    {
        private String name = null;
        private String password = null;
    
        public String getName()
        {
            return name;
        }
    
        public void setName(String name)
        {
            this.name = name;
        }
    
        public String getPassword()
        {
            return password;
        }
    
        public void setPassword(String password)
        {
            this.password = password;
        }
    }
    

    4) Use the following JSP contents:

    
    <%@ page language="java" %>
    <%@ page import="com.test.TestClass" %>
    
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
        
        TestClass testClass = new TestClass();
        testClass.setName("Bob");
        testClass.setPassword("password");
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <body>
        Welcome <%= testClass.getName() %>, your password is "<%= testClass.getPassword() %>".
      </body>
    </html>
    

    **NOTE: Autocomplete for getName and getPassword work fine

    5) With the files still open, I refactored the name of MyJsp.jsp to index.jsp
    6) Then I added a new line after the previous autocompleted line of code, like so:

    
    <%@ page language="java" %>
    <%@ page import="com.test.TestClass" %>
    
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
        
        TestClass testClass = new TestClass();
        testClass.setName("Bob");
        testClass.setPassword("password");
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <body>
        Welcome <%= testClass.getName() %>, your password is "<%= testClass.getPassword() %>".
        
        After refactoring, your name is: <%= testClass.getName() %>
      </body>
    </html>
    

    **NOTE: Autocompletion of both getName and getPassword still worked on that new line of code.

    You aren’t using the 3.1M6 release and the beta release of MyEclipse are you? This might have something to do with it.

    #229091

    tory
    Member

    Riyad,
    I have gone as far as uninstalling and re-installing both eclipse and myeclipse. I installed eclipse 3.0.1 and myEclipse 3.4.8. After installing these components, I imported the project from the CVS server. Now the Content Assist feature doesn’t work in any of the original .jsps.

    Tory

    #229092

    tory
    Member

    MyEclipse IS looking to the correct jdk, so that shouldn’t be it. Would the fact that we are using CVS have any effect on things?

    -Tory

    #229093

    Riyad Kalla
    Member

    Tory,
    Please keep in mind that JSP autocomplete is not going to work with Java Projects, these must be Web Projects. Additionally here is a pristine, preinstalled version of Eclipse 3.0.2 SDK and MyEclipse 3.8.4 that you can quickly download and unzip to C:\ and start using, this is sort of a “best case install”, meaning if you have something wrong with this setup, then the issue lies elsewhere: http://www.kallasoft.com/myeclipse/myeclipse_3.8.4.zip

    #229094

    Riyad Kalla
    Member

    MyEclipse IS looking to the correct jdk, so that shouldn’t be it. Would the fact that we are using CVS have any effect on things?

    No, everyone here uses CVS, I use CVS with all my work, etc. The two do not conflict, if they did, we would notice it right away 🙂

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: context assist with jsp’s

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