Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

j_security_check or login.do

 
Kalle Anka
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm quite new at Struts and J2EE. This is a problem im faced with now.
i'm trying to get a "login" and "register" functionality working togheter with Struts.

<form action="j_security_check"> is the way I have learned earlier for container based authentications. However I would like to make this go through a Struts action... like <form action="login.do">

Is there any way to from within the Struts action call the container based authorization (j_security_check)? Do u suggest any other solutions?

best wishes
Kalle
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My suggestion would be to keep your login form as a regular, non-struts jsp and register it in the web.xml file, just as you do with your non-struts applications. Once the user is authenticated, you can use the J2EE security APIs within your action class to verify roles, etc.

When you write a struts application, not every page has to use struts html tags.
 
Kalle Anka
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Merrill,

I was thinking about that solution. But doesnt you loose alot of the strengths of Struts if doing so: like single point of entry and maintaince.

It just seem so strange that Struts creators havnt thought of integrating the j2ee authentication with Struts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic