javascriptstruts2appfuse

Errors in Stuts2 appfuse app in Eclipse


I have build a Stuts2 multimodule app using Appfuse archetype from Eclipse Juno.

It works fine when ran through MVN Jetty:run.

But When I try to validate the project in Eclipse , it is giving me so many errors I am going to copy the errors here can someone please help me resolve them?

Getting Error :

Syntax error on token ""><s:param><s:text name="", ; expected    in  src/main/webapp/scripts/login.js

Syntax error on token "<", invalid MultiplicativeExpression  line 34  in src/main/webapp/scripts/login.js

Can someone please help with these errors?


Solution

  • It's ok, because it's not a javascript code it has <script type="text/javascript"> tag where the code is. The file is a JSP file. JSP files usually have extension .jsp but there's no restriction to use extension for file name. JSP files or fragments being included to the main JSP file doesn't need to be validated, but if you want the tags to be recognized by IDE you should use JSP taglib directive at the top of the file

    <%@ taglib prefix="s" uri="/struts-tags"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    

    and may be others. It doesn't change the application itself but allows you to validate fragments like a normal JSP.