0

I am working on a webapp..i am using SpringMVC for Server side and JavascriptMVC for Client side...now the problem is in javascriptmvc i worked with html pages but now i want to incorporate javascriptmvc with my jsp page...when i open the page locally it works fine but when i deploy it on tomcat it gives Http: 500 error

org.apache.jasper.JasperException: Unable to compile class for JSP: 
An error occurred at line: 37 in the jsp file: /resources/javascriptmvc/todo/tod/index.jsp 
Invalid character constant
34:         <script type='text/ejs' id='todosEJS'>
35:             <% for(var i =0; i < this.length ; i++){ %>
36:                 <li <%= this[i]%>>
37:                 <%= $.View('todoEJS',this[i] ) %>
38:                 </li>
39:             <% } %>
40:         </script>

all this works fine if i change the extension to html, i dont know whats the problem with jsp. Any Help would be appreciated

Fahad Rauf
  • 705
  • 2
  • 8
  • 17

1 Answers1

0

No worries guys, found the solution with the help of a guy from javascriptmvc forum. the problem was jsp page was not picking ejs tag in script. here's what i did

I made a new file 'todoEJS.ejs' in views folder and in it placed this code

<% for(var i =0; i < this.length ; i++){ %>
     <li <%= this[i]%>>
         <%= $.View('todoEJS',this[i] ) %>
     </li>
 <% } %>

and then in the jsp file i changed the script code to to this

<script type='text/ejs' id='todosEJS' src='${pageContext.request.contextPath}/resources/javascriptmvc/todo/todo/views/todoEJS.ejs'>
</script>

and it worked fine.

Fahad Rauf
  • 705
  • 2
  • 8
  • 17