I'm developing a Java server application with Eclipse Indigo, which is deployed to Jetty. Now I'm trying to add authentication to the application with Spring Security. I've added the following definition to my business-layer-context.xml
:
<security:http>
<security:intercept-url pattern="/**" access="ROLE_USER" />
<security:http-basic />
</security:http>
Now, the problem is that Eclipse gives me this error: Error occured processing '/MyServer/WEB-INF/business-layer-context.xml', which is caused by java.lang.NoClassDefFoundError: javax/servlet/Filter. When I deploy the application to Jetty, it works just fine, since Jetty contains the servlet API.
What would be the best way to make Eclipse understand that the application is deployed to servlet container and the API is therefore available? I could add the Jetty servlet JAR to project build path in Eclipse, but that would require each developer to configure the path to Jetty in Eclipse, and I'd like to keep developer specific configurations to the minimum.
So, is there a better way to get rid of the error?