facebook

JSP editor problems with JSTL [Closed]

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

    Hi,
    I have the following configuration for ME 2.7 RC2

    What operating system and version are you running?
    Windows XP Professional
    What Eclipse version and build id are you using? (Help > About Eclipse Platform)
    Version: 2.1.2
    Build id: 200311030802
    – Was Eclipse freshly installed for MyEclipse?
    No
    – If not, was it upgraded to its current version using the update manager?
    Yes
    Are any other external plugins installed?
    org.vssplugin 1.5
    How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*
    10
    org.eclipse.pde.build_2.1.0 org.eclipse.pde.core_2.1.0
    org.eclipse.pde.core_2.1.2 org.eclipse.pde.doc.user_2.1.0
    org.eclipse.pde.runtime_2.1.0 org.eclipse.pde.source_2.1.0
    org.eclipse.pde.source_2.1.2 org.eclipse.pde.ui_2.1.0
    org.eclipse.pde.ui_2.1.2 org.eclipse.pde_2.1.0
    What MyEclipse version are you using? (Help > About Eclipse Platform > Features)
    Version: 2.6.200
    Build id: 200312091200-2.7-RC1

    What JDK version are you using to run Eclipse? (java -version)
    java version “1.4.2”
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
    Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
    What JDK version are you using to launch your application server?
    same as above
    <PROBLEM 1>
    The first problem I have is the jsp compile error I am getting in a simple
    Jsp file using jstl feature. I have a test.jsp file containing the following
    text

    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <html>
        <head>
            <title>Test Page</title>
        </head>
        <body>
            <c:set var="testCount" value="0"/>
            <c:out value="${testCount}"/> 
        </body>
    </html>

    and the error message I get on the task window is

      Kind Status Priority Description Resource In Folder Location
      Error javax/servlet/jsp/el/VariableResolver test.jsp eAdmin/web/admin line 0

    If I remove the <c:set ../> line and have the file content like the following
    then the error message is gone.

    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <html>
        <head>
            <title>Test Page</title>
        </head>
        <body>
            <c:out value="0"/>
        </body>
    </html>

    Please suggest me how I can correct this problem.

    <PROBLEM 2>Another problem I am getting is the indentation problem.
    I have set the tab size for the jsp file by using
    (Preference -> MyEclipse -> Editors -> JSP/HTML Editor -> Format)
    to 2 but still I see the tab width on the jsp editor having a size of 4.
    This is not a problem for a new jsp files, but it only happens for the old
    jsp files which are already in my project and came along with unistalling ME
    2.7 RC1 and installing 2.7 RC2. Another interesting thing I see is that when
    I have opened an existing jsp file on the workspace and now when I open
    JSP/HTML Editor-> Format screen and change the tab with to 4 and apply and then
    again set it to 2 and apply then I the jsp file in the workspace gets propery
    indented with 2 tab size. But when I open another existing jsp file then I am
    again back to the square one. I have more than 100 jsp files so I can not repeat
    the whole sequence for all the files.

    <PROBLEM 3>
    Another problem is related with block indentation
    If I select the following two lines from test.jsp page
    <c:set var=”testCount” value=”0″/>
    <c:out value=”${testCount}”/>
    and then press tab for block indentation then along with the
    above two lines </body> lines also gets indented.

    I have also checked the log file under eclipse-> workspace -> .metadata -> .log
    and there is no error message on that.

    #201592 Reply

    Riyad Kalla
    Member

    Fi-Tek,
    Excellent detail in your bug report, let me see if I can help with some of this.

    Problem 1: I’ll have another support person look at this, I’m not sure on this one.

    Problem 2: I didn’t quite understand your problem, but if you have set the tab ident to 2, all you should need to do is open the JSP file then reformat it. As far as reformatting them in a batch (since you have so many files) I’m not sure this is supported in ME yet. Do you want to request this as a feature?

    Problem 3: Thank you for reporting this, there have been a few issues with the indenting with the JSP editor and I don’t know if this problem was known about before. Scott can you check in to see if this issue is still pending?

    #201597 Reply

    Hi,
    About first problem, I forgot to mention that I tried to use JSTL 1.0 as well as JSTL 1.1 jar files. The same code work fine in Tomcat 5.0.16.

    About second problem, I tired to do the reformat of the jsp file after opening up the jsp file in the workspace using Source -> Format and that doesn’t solve the problem. In my understanding if the jsp file is indented using tab then while opening the jsp file the tab size defined in the jsp/html editor preference should be honored and in that way I wouldnot have to reformat the content. Reformatting this way does the job well as far as line breaks, html tags formatting(uppercase/lowercase), line feeds issues are concerned but it still uses tab size as 4 instead of 2(as defined in the preference). I don’t use the option of setting spaces in place of tab.

    Plaese let me know if you need any other information from my side.
    Thanks

    #201600 Reply

    No Operation
    Member

    to Problem 1:

    Error javax/servlet/jsp/el/VariableResolver test.jsp

    this requires a JSP 2.0 library set, guess you are using the delivered JSP 1.3 library set

    to Problem 2

    This IMHO not an MyEclipse issue, thinkin your old JSP files are using spaces not tabs…

    to Problem 3

    Indention is broken and is already reported. We all hope this is fixed soon.

    NOP

    #201604 Reply

    Hi,
    For Problem 1:
    Yaa I was using the default J2EE 1.3 library set in my web project. Will you tell me what jars I will have to for using JSP 2.0 library set?
    The one approach I tried was to remove J2EE 1.3 library set from my web project and including jsp-api.jar, servlet-api.jar files bundeled with Tomcat 5.0.16 into my project by putting it into WEB-INF/lib dir. But still I am getting the same error.

    For Problem 2:
    I am not using spaces in place of tabs, infact I usually don’t use space for indenting purpose but I still verified few files by opening up in ultraedit and viewing the tab and space characters.

    Thanks

    #201610 Reply

    No Operation
    Member

    to 1:
    you need the servlet.jar version 2.4. You get this from SUN.

    to 2:
    no idea then, sorry

    NOP

    #201653 Reply

    For Problem #1
    Apache Tomcat 5.0.16 supports Servlet 2.4 and JSP 2.0 specs and jsp-api.jar contains javax/servlet/jsp/el/VariableResolver class.
    Thanks

    #201657 Reply

    Riyad Kalla
    Member

    Fi-Tek have all your issues been resolved or did you need clarification with anything else w.r.t. this topic? (Thank you for the follow up post with your solution incase anyone else has the same problem)

    #201660 Reply

    Nope,
    I still have the same problem. I was just explaining to NOP that Tomcat 5.0.16 jar files are servlet 2.4/JSP2.0 compatible as he mentioned to use JSP 2.0 libraries and its not solving the problem. I hope that you guys will give me some kind of help on the above said issues.
    Thanks

    #201662 Reply

    No Operation
    Member

    I was just explaining to NOP that Tomcat 5.0.16 jar files are servlet 2.4/JSP2.0 compatible as he mentioned to use JSP 2.0 libraries and its not solving the problem

    sorry to read that, but are thise JARs really in the build path of your project?

    NOP

    #201668 Reply

    Riyad Kalla
    Member

    Fi-Tek,
    So sorry this has taken so long, I’ve forwarded your question on to the super-support team.

    #202325 Reply

    Riyad Kalla
    Member

    Fi-Tek,
    Did you get your problem resolved? I just came across this thread trying to help another person with a similar problem.

    #202362 Reply

    Hi Riyad,
    My first problem is solved. Let me tell you how it happened.
    As NOPE suggested to use JSP 2.0 apis I tried to use JSP 2.0 apis of TOMCAT 5.0.16 (jsp-api.jar and servlet-api.jar) by putting it into WEB-INF/lib location of my webproject. I also removed J2EE 1.3 libraries from my project. But it didnot solve my problem. I also tried to do a complete refresh (by right click on the project on package explorer and clicking refresh) of my project and this also didn’t solve the problem. I was kind of frustrated but I kept on working as those files were working fine in tomcat. Then day before yesterday my machine was restarted (Eclipse and project was opened) due to power failure. And when I restarted Eclipse then my project started recompiling all the jsp files and that solved the problem. So what I missed was the recompiling all the jsp files of my project after putting jsp-api.jar and servlet-api.jar files which I didn’t do as I said I have more than 100 jsp files and recompiling takes a lot of time. It would be a nice feature to have the compile/recompile option for a single jsp file which will consider the most recent libraries included in the project.

    I still have the other two problems.
    Thanks

    #202364 Reply

    Riyad Kalla
    Member

    Yes unfortunately those indentation problems or hopefully fixed in the GA release. Thank you for posting your solution though, next time I’ll be sure to suggest to poeople to recompile their project as Step #1 🙂

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: JSP editor problems with JSTL [Closed]

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