• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 integration with Spring Security

 
Soheil Tayari
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Spring Security and I wanted to use it for authentication purposes in my Struts2 application. The problem is that when I define Struts2 filter and Spring Security filter in web.xml and run the application I get the error 404. Both filters are mapped to /* url pattern so I suspect that might be the problem cause when I remove the Spring Security filter Struts2 works fine and I get to my home page. Here is my web.xml file:
 
Chris Montgomery
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure context configuration file lives in WEB-INF rather than WEB-INF/classes?
Could be that Spring isn't finding it.
 
Soheil Tayari
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris Montgomery wrote:Are you sure context configuration file lives in WEB-INF rather than WEB-INF/classes?
Could be that Spring isn't finding it.


Yes it's in WEB-INF.
 
Soheil Tayari
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I fixed it. The problem was that I missed some libraries in the classpath. I kept adding libraries that was missing according to container log file till it stopped complaining :-).
 
Chris Montgomery
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerat news!

With projects I'm invovled with that don't use Maven, libraries can be a pain.
If you can, look in to Maven. Maven will manage most of your libraries and dependencies for you.

Netbeans has a project template for a Maven Web Application. I love it!
I haven't done it in Eclipse...
 
Soheil Tayari
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris Montgomery wrote:Gerat news!

With projects I'm invovled with that don't use Maven, libraries can be a pain.
If you can, look in to Maven. Maven will manage most of your libraries and dependencies for you.

Netbeans has a project template for a Maven Web Application. I love it!
I haven't done it in Eclipse...


Thanks Chris. I will definitely do that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic