- This topic has 3 replies, 3 voices, and was last updated 12 years, 2 months ago by support-swapna.
-
AuthorPosts
-
tg183MemberHello,
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
support-swapnaModeratortg183,
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.
ilFuma86MemberI 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
support-swapnaModeratorAF,
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.
-
AuthorPosts