facebook

[Closed] JSTL expression problems

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #261171 Reply

    harivenkat
    Member

    Hello,
    I am using Myeclipse workbench
    Version: 5.0.1 GA
    Build id: 20060810-5.0.1-GA

    Tomcat 5 as my web server.
    I created a webproject to work on JSTL, i wrote a simple html file as follows
    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>

    <head>
    <title>This is the HP.html page
    </title>
    </head>

    <body>

    <form method=post
    action= ‘H.jsp’>
    <input type=text name=’text1′>
    <input type=submit value=’Enter a name’>
    </form>
    </body>
    </html>

    ==============
    wrote a JSP file as follows:

    <%@ page language=”java” import=”java.util.*” pageEncoding=”ISO-8859-1″%>
    <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core&#8221; %>

    <html>
    <body>
    <c:set var=”s” value=”${param.text1}”/ >

    We welcome<br>
    <c:out value=”${s}” />
    </body>
    </html>

    =======================
    In the JSP page I am getting 2 errors :

    Multiple annotations found at this line:
    – Unknown tag (c:set).
    – Missing end tag “c:set”

    I just ingorned them as I already closed the c:set
    I tried running the html page, i got the following error:::

    According to TLD or attribute directive in tag file, attribute value does not accept any
    expressions

    Can anyone help me out with this.
    I tried changing uri=”http://java.sun.com/jstl/core&#8221; to uri=”http://java.sun.com/jstl/core-rt&#8221;
    even then I am getting errors.
    Thanks ahead.

    #261204 Reply

    Riyad Kalla
    Member

    From the snippet above, your c:set is not closed, you have

    
    /[SPACE]>
    

    There shouldn’t be any space between the slash and greater than sign, that’s why it’s complaining. Also if you ar egetting unknown tag errors, chances are you forgot to add JSTL libs to your project or if you did, you are using the wrong URI given the version you are using (1.0 and 1.1 use different URIs).

    Lastly, the core and core-rt are 1.0 JSTL impls, and I think choosing the -rt was the right thing to do, I don’t recall. I’d suggest you use JSTL 1.1.

    #261222 Reply

    harivenkat
    Member

    Hello Riyad,
    Thanks for telling me the correction. Now I am not getting that error, but a different one
    ====attribute “}” has no value
    can u help me out with this issue.
    Thanks once again
    Hari

    #261225 Reply

    Riyad Kalla
    Member

    Is this a runtime error? What does the source look like for your page?

    #261228 Reply

    harivenkat
    Member

    <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core&#8221; %>
    <html>
    <body>
    <c:set var=”s” value=”${param.text1}” />
    We welcome<br>
    <c:out value=”${s}” />
    </body>
    </html>

    I am getting that error in the jsp page itself, not a run time error. I got it
    in the same line—–<c:set var=”s” value=”${param.text1}” />
    I am getting a red line near the }—-that says attribute “}” has no value error.

    Ur reply is really appreciated.
    Thanks,
    Hari

    #261229 Reply

    Riyad Kalla
    Member

    Hari,
    Unfortunately I cannot reproduce this. The example you gave, when I pasted it into a JSP in a project with the JSTL 1.1 libs, compiles without any error markers.

    Can you try that locally? Creating a new web project, adding JSTL 1.1 to it, and pasting in the contents you gave me above?

    #261230 Reply

    harivenkat
    Member

    Hello Riyad,
    Thanks for the quick response.
    This is how I am doing the project. I created a file–newproject–myeclipse–j2eeproject–webproject.
    I gave a name for a project–Hello. Checked the option add jstl1.1 libraries to web-inf/lib.
    I got a project structure, where in I see jstl.jar and standard.jar—–the jars required for JSTL.
    I also see all the tlds in the webroot–web-inf/lib.
    I even added JSTL capabilties again.

    I rightclicked on the project, created a new JSP page, removed the default content given and wrote the above lines, and I am getting the error–attribute “}” has no value

    Do u think it is the problem with Tomcat or my creation of my webproject. I even added jars in the tomcat manually and also the tlds, even then I am facing the same error in the JSP page and when I compile the same error i get the web browser—According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    What do u mean my trying it locally?
    Pls let me know how else to make JSTL work.
    Thanks,
    Hari

    #261238 Reply

    Riyad Kalla
    Member

    Hari,
    This is very strange. Can you go to File > Export > Archive, and export tihs project to an archive them send it to support@genuitec.com ATTN Riyad with a link to this thread so I know why I’m getting it?

    #261245 Reply

    Riyad Kalla
    Member

    Hair,
    I got your project, imported it, and rebuilt it and it compiled fine without errors. If you had a chance, would you be able to redownload Eclipse 3.2.1 SDK from http://www.eclipse.org, and MyEclipse 5.0.1 from our site, then reinstall them to new directories, create a new workspace and try your test again? I just can’t reproduce any sort of problem on my end (your code looks fine) so I think it might be an install issue.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: [Closed] JSTL expression problems

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