File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts2 integration with Spring Security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 integration with Spring Security" Watch "Struts2 integration with Spring Security" New topic
Author

Struts2 integration with Spring Security

Soheil Tayari
Greenhorn

Joined: Apr 04, 2008
Posts: 29
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

Joined: Jan 14, 2004
Posts: 141
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

Joined: Apr 04, 2008
Posts: 29
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

Joined: Apr 04, 2008
Posts: 29
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

Joined: Jan 14, 2004
Posts: 141
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

Joined: Apr 04, 2008
Posts: 29
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 integration with Spring Security