facebook

Tutorial on Web Development + Tomcat [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #223755 Reply

    chris.gr
    Member

    Hi, I just installed myeclipse 3.8.3, I have running Tomcat 5.5.

    I tried out the HelloWorld.jsp example.

    But when I make the new HelloWorld.jsp file, it looks different from that of the example:

    java.util is imported, but not the com.genuitec.test.HelloWorld as in the example.

    The auto-import addition of import directives and the java code completion are not working.

    Please help! Here is the source code of a new generated jsp page:

    Besides, the java

    <%@ page language=”java” import=”java.util.*” %>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
    %>

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <base href=”<%=basePath%>”>

    <title>My JSP ‘MyJsp.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>
    This is my JSP page. <br>
    </body>
    </html>

    #223757 Reply

    Riyad Kalla
    Member

    Chris,
    Nothing to worry about, this is the default template; it likely changed since the time of the tutorial, OR the tutorial used a trimmed down page just to make things easier. Also the autoimport should work, try this:
    <%= new ArrayList(); %>

    and let the editor autocomplete ArrayList, it should add it to your imports.

    #223758 Reply

    chris.gr
    Member

    It doesn’t work. No Windows with auto completion opens… Can I look somewhere in the Settings?

    #223759 Reply

    Riyad Kalla
    Member

    Are you sure you are opening the file with the “MyEclipse JSP Editor”? Try and close the file, right click, select “Open With”, is the default “MyEclipse JSP Editor”?

    #223910 Reply

    jwach366
    Member

    3 things:
    a)
    I am having the same problem as chris.gr. I notice also that if I for example change “<%@ page” to “<%@ pe”, Eclipse does not flag the error. I can do anything to HelloWorld.jsp and I’ll get no error flagged as I do when editing a java program (I tested this). And as chris.gr also mentions, content assist is not working. I thought it was because I didn’t have Tomcat configured with Eclipse but I went to Window->Preferences, select Application Servers->Tomcat, enter my Tomcat library name, click enable, go to Tomcat 5/JDK and do the configuration there but still no change. I also verified that I’m using the myEclipse JSP editor.

    b)
    A related question: On the Tomcat/JDK Preferences panel, I click on the ‘Add’ button. I get the Tomcat>Add JVM panel. Using the Browse button, I specify the location of my JDK (I’m using jdk1.5.0). I click on OK and I’m back at the previous panel (the Tomcat/JDK Preferences panel, and the name I specified for my Tomcat JDK name is there). I click on ‘Add’ again but when the Tomcat>Add JVM panel comes up, it is empty again. Is this normal?

    c)
    I did not know what to enter for the Javadoc URL on the Tomcat>JVM panel. I only have a dial-up connection over a phone line. So would I need to download the javadoc? If so, which one? I see in Help’s Application Deployment and Server Mgmt Quickstart’s section 5 (Connection Configuration) for step 3a there, they show http://java.sun.com/j2se/1.4.2/docs/api. Wouldn’t it be a J2EE javadoc?
    Perhaps Eclipse needs this for content assist to work?

    Thanks in advance-

    #223913 Reply

    Riyad Kalla
    Member

    I am having the same problem as chris.gr. I notice also that if I for example change “<%@ page” to “<%@ pe”, Eclipse does not flag the error. I can do anything to HelloWorld.jsp and I’ll get no error flagged as I do when editing a java program (I tested this).

    Please change your MyEclipse shortcut to launch MyEclipse with a JDK vm (nore a JRE vm), for example:
    eclipse.exe -vm c:\j2sdk1.4.2_06\bin\javaw.exe

    The problem is that MyEclipse cannot find javac executable either from the -vm argument or your System’s PATH to compile the JSP page, so it doesn’t know there are problems.

    And as chris.gr also mentions, content assist is not working.

    What are you trying to get autocomplete for? Please post a code snippet… also I have no idea what version of Eclipse or MyEclipse you are running, so the issues could be extremely variable. Please let me know what versions of software you are running.

    I click on ‘Add’ again but when the Tomcat>Add JVM panel comes up, it is empty again. Is this normal?

    Yes, why? You can add any number of JDKs you like… were you expecting this to act like an “Edit”? This button adds these to the Window > Prefs > Java > Installed JREs menu, so you can go edit them there.

    did not know what to enter for the Javadoc URL on the Tomcat>JVM panel. I only have a dial-up connection over a phone line. So would I need to download the javadoc? If so, which one?

    You attach Javadoc to a certain library. In the case of the JDK, you would want to download it from the default Java download page and unzip it somewhere then attach it to rt.jar. If you want to edit the JARs for your J2EE Library set, then yes you can attach the J2EE Javadoc to that.

    The javadoc you “attach” needs to represent the classes contained in the JAR, so if you are editing the JDK page, you would attach the J2SE Javadoc, not J2EE.

    Perhaps Eclipse needs this for content assist to work?

    Nope, it will just give you friendly fly-over descriptions which are nice, but it doesn’t need it to provide basic autocomplete.

    #223939 Reply

    jwach366
    Member

    riyad-
    Sorry about that. Versions I am running:

    Eclipse: eclipse-SDK-3.1M3-win32
    myEclipse: version 3.8.3

    Here is my HelloWorld.jsp:

    <%@ page language=”java” import=”java.util.*” %>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
    %>

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <base href=”<%=basePath%>”>

    <title>My JSP ‘HelloWorld.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>
    This is my JSP page. <br>
    <% out.p
    </body>
    </html>

    This is my JSP, created from doing step 6, ‘Developing JSP Resources’ from MyEclipse Application Developer Guide’s Working

    With Web Projects – Quickstart. I first noticed that content assist was not working when I did step 6.2-Editing

    helloWorld.jsp. I entered ‘<% out.p’ and with my cursor immediately after the ‘p’ I pressed Ctrl->space and nothing

    happened.
    Regarding your first suggestion, how do I change my myEclipse shortcut as you say? I edited my Path environment variable to

    include D:\jdk1.5.0\bin\javaw.exe and launched myEclipse again. (BTWay, it had already and still does also contain

    D:\jdk1.5.0\bin;) I edit HelloWorld.jsp, positioning my cursor again, just after the ‘<% out.p’ and still no content assist

    nor flagging of the error, though content assist and error flagging is working when I edit a .java file in Eclipse.

    Thank you for pointing me to the Window>Prefs>Java>Installed JREs menu.

    Regarding the javadoc, when I specify a javadoc URL on the Window>Prefs>Application Servers>Tomcat>JDK>Add button>

    Tomcat>Add JVM window, does this equate to attaching it to rt.jar? I know where rt.jar is but that’s about it. What does

    Eclipse use the javadoc URL I specify in the Tomcat>Add JVM window for? I guess I just don’t really get what you mean..

    Again, thanks in advance. And thanks for your speedy reply to my last post-

    #223942 Reply

    Riyad Kalla
    Member

    Eclipse: eclipse-SDK-3.1M3-win32
    myEclipse: version 3.8.3

    These are not compatible releases. Please download either Eclipse 3.0.1/MyEclipse 3.8.4, or Eclipse 3.1M4/MyEclipse 3.8.4 Beta for 3.1M4. I am going to stop there as this is why you aren’t seeing autocomplete.

    BTWay, it had already and still does also contain

    D:\jdk1.5.0\bin;

    Ahh, this is all you need then, go ahead and remove the explicit javaw entry you added. It is likely due to the incompatible releases why you aren’t seeing proper behavior.

    Add JVM window, does this equate to attaching it to rt.jar?

    It can, if you go to Installed JREs and edit that JDK you setup, do you see your Javadoc url in the javadoc field?

    What does

    Eclipse use the javadoc URL I specify in the Tomcat>Add JVM window for?

    It will show you on-the-fly Javadoc… like you type new String(“bl.arg”).split(|

    and it will not only popup autocomplete for the split method, but also the Javadoc for that method so you can see what it does. Its pretty cool.

    #223982 Reply

    jwach366
    Member

    a)
    Regarding my current Eclipse and myEclipse versions:
    Eclipse: eclipse-SDK-3.1M3-win32
    myEclipse: version 3.8.3
    I’m also running with Tomcat 5.5.4 (I forgot to mention that before).

    You said: “These are not compatible releases. Please download either Eclipse 3.0.1/MyEclipse 3.8.4, or Eclipse

    3.1M4/MyEclipse 3.8.4 Beta for 3.1M4. I am going to stop there as this is why you aren’t seeing autocomplete.”

    Would you recommend one pairing over the other? e.g. advantages/disadvantages of either?

    b)
    I had asked: “Add JVM window, does this equate to attaching it to rt.jar?”

    You replied: “It can, if you go to Installed JREs and edit that JDK you setup, do you see your Javadoc url in the javadoc

    field”

    Answer: Yes, I do see it. I think I’m OK on this one- I have the j2se 1.4.1 docs downloaded on my machine (from a couple of

    years ago). Do I really only need to specify up to the api folder? (i.e. that folder contains 4 other folders; index-files,

    java, javax, org, a number of HTML docs such as index, help-doc, packages, allclasses-frame et al.) In other words, Eclipse

    knows what to look for if just point it at the api folder?

    Thanks again in advance-

    #223984 Reply

    Riyad Kalla
    Member

    Would you recommend one pairing over the other? e.g. advantages/disadvantages of either?

    If you are a “play it safe, I prefer stable” kind of guy, grab Eclipse 3.0.1/MyEclipse 3.8.4. If you are a more cutting edge “I want to see what’s new in Eclipse 3.1” person OR want to use JDK 5.0 features, then grab the Eclipse 3.1M4 SDK and compatible MyEclipse release. We have a handful of beta testers and good amount of users using the 3.1 Eclipse release and aparently its pretty stable, so you shouldn’t be in any jepordy running it BUT there are some little things with MyEclipse (like the ERD designer showing in only black color) that can be annoying, but can also be worked around.

    I personally prefer using stable releases of software if I can.

    Do I really only need to specify up to the api folder? (i.e. that folder contains 4 other folders; index-files,

    java, javax, org, a number of HTML docs such as index, help-doc, packages, allclasses-frame et al.) In other words, Eclipse

    knows what to look for if just point it at the api folder?

    Yes, it actually looks for one of those packages or index files, and then from that level it can quickly fine the classes you are autocomplete, for example if you autocomplete JButton, it will start in the api folder and ask for “javax/swing/JButton.html” and quickly load the javadoc for you.

    #224111 Reply

    jwach366
    Member

    Riyad,
    Thanks for your advice- I’ve decided to go with Eclipse 3.0.1 and myEclipse 3.8.4. I’ve uninstalled myEclipse 3.8.3 and I’ve finished downloading eclipse-SDK-3.01-win32.zip. I want to uninstall and delete Eclipse version 3.1M3 from my computer but there doesn’t seem to be an uninstall program for it. I’m running Windows 2000. I go to Add/Remove Programs but Eclipse doesn’t appear there. I don’t find an uninstall program with 3.1M3 either. Should there be one? If not, is it ‘safe’ to just delete the folder in which version 3.1M3 resides?
    Thanks in advance-

    #224114 Reply

    Riyad Kalla
    Member

    I want to uninstall and delete Eclipse version 3.1M3 from my computer but there doesn’t seem to be an uninstall program for it.

    They have never had an installer, it’s always just a zip… I’d prefer an installer, but I guess it is up to them ;), until then just erase the old dir and that is effectively an “uninstall”. Make sure to grab your /workspace dir if you need it.

    #224118 Reply

    jwach366
    Member

    Riyad-
    I got Eclipse 3.0.1 installed and went to check it out. I launched Eclipse, it comes up fine, I resize it’s window to take up the bottom half of my screen, click on Help, Help comes up and I resize its window to fill the top half of my screen. I start to go thru the tutorial ‘Setting up your First Java Project and when I for example click on File (to do a File>New>..) the display in Help goes haywire- The printing on the left side of the window (contains all the subject heading links) is all merged together and the printing on the other half of the screen (containing the subject content) is broken up with blobs of sentences overlaying each other in between big empty spaces. I had this very same problem with Eclipse version 2.1.1 a couple of years ago. I’ve been away from Eclipse till just recently though and was relieved to find that in version 3.1M3 the problem had gone away. I believe that I am not somehow looking at version 2.1.1’s Help because ‘Setting up Your First Java Project’ mentions a file- eclipse/plugins/org.eclipse.jdt.ui.examples.projects_3.0.0/archive… (assuming projects_3.0.0 is the tip-off that I’m not looking at version 2.1.1’s Help) and, the two versions are on different drives and version 3.1M3 never demonstrated the problem. Would you know if this is a known problem in version 2.1.1 and 3.0.1? I’m running on an older laptop- A Gateway 5300 Solo with a Pentium III, 670 Mhz with 256MB RAM, Windows 2000 with Service Pack 3. The problem makes it very difficult to go thru a process in Help (on one half of your screen) and follow along, doing the prescribed stuff in Eclipse on the other half of the screen. Given this problem, I’m ready to try the pairing of Eclipse 3.1M4 with myEclipse 3.8.4 beta for Eclipse 3.1M4. Any suggestions?
    Thanks –

    #224119 Reply

    Riyad Kalla
    Member

    I’ve actually never heard/seen that issue before… I wonder if it has something to do with the browser component?

    At any rate, there seems to be a good handful of users (including 3 or 4 of our QA team) using 3.1M4 + the new ME beta and they all say it is pretty stable… I think someone mentioned a flakiness with one of the editor preferences, but that was it really. You might want to do a parallel install (to a new location like C:\Java\Eclipse-3.1M4 and C:\Java\MyEclipse-3.8.4) to make sure they don’t touch the older install on your machine.

    TIP: Eclipse stores EVERYTHING in the workspace. If you remove/rename/delete a workspace, it is a lot like uninstalling and reinstalling Eclipse, it will recreate all the plugin caches and start anew as if it was never installed. This can be a handy tip when trying to track down a problem.

    TIP: Using -clean gives you some of the benefits of a new workspace (Clean cache) while maintaing your existing workspace, it tells Eclipse to dump it’s plugin cache and rebuild it. Again, another handy debugging tip.

    #224122 Reply

    jwach366
    Member

    Browser component- I think I have Internet Explorer 5.0 (I right click on Internet Explorer and go to Properties but don’t find a version). I’m using Earthlink 5.0 though so 5.0 is my guess.
    But does Eclipse touch Internet Explorer? Would IE be the browser component you’re thinking of?
    I’m downloading version 3.1M4 now. In the meantime, if I rename a workspace, then launch that Eclipse version, would this be the kind of thing you mean when you say ‘it is a lot like uninstalling and reinstalling Eclipse?

    Also, using -clean: How would I do that?

    Thank you so much for hanging in with me on this stuff!

Viewing 15 posts - 1 through 15 (of 18 total)
Reply To: Tutorial on Web Development + Tomcat [Closed]

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