facebook

ME 9 – Javascript validation – JSTL var in function name

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

    tg183
    Member

    Hello,

    in the following code example a validation error is shown in the function line. Apparently the JSTL variable ${varname} is seen as part of the function name, which of course is not allowed. Once deployed, it all works correctly, though.

    
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"   prefix="c"%>
    <%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html" %>
    <c:set var="varname" value="25" />
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
        function myfunc_${varname}(){ //Validation error shown here
            alert("in myfunc_${varname}");
        }
    </script>
    </head>
    <body>
        <html:button property="whatever" onclick="myfunc_${varname}();">Click Me</html:button>
    </body>
    </html>
    

    This behaviour is new in ME 9.0, in version 8.6 no error was shown.

    Thanks in advance,
    Thomas

    #316736 Reply

    support-swapna
    Moderator

    tg183,

    Thank you for posting it. I could replicate the issue at my end.
    I will file a PR for the dev team to work on it.

    #329503 Reply

    ilFuma86
    Member

    I have the same problem with MyEclipse 10.6.

    Would seem that myEclipse can’t validate JSTL (expressions or tags) in side the tag <script> of a JSP

    I hope this problem will be fixed soon.

    AF

    @tg183 wrote:

    Hello,

    in the following code example a validation error is shown in the function line. Apparently the JSTL variable ${varname} is seen as part of the function name, which of course is not allowed. Once deployed, it all works correctly, though.

    
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"   prefix="c"%>
    <%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html" %>
    <c:set var="varname" value="25" />
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
        function myfunc_${varname}(){ //Validation error shown here
            alert("in myfunc_${varname}");
        }
    </script>
    </head>
    <body>
        <html:button property="whatever" onclick="myfunc_${varname}();">Click Me</html:button>
    </body>
    </html>
    

    This behaviour is new in ME 9.0, in version 8.6 no error was shown.

    Thanks in advance,
    Thomas

    #329545 Reply

    support-swapna
    Moderator

    AF,

    Our dev team is looking into this issue for the next release. We apologize for the delay in fixing this issue for 10.6.

    Sorry for inconvenience caused.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: ME 9 – Javascript validation – JSTL var in function name

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