Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call action class on application load

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I access my application as http:localhost:8080/miniHR

I want Loginpage to show up whenever someone accesses(i will check if user is in session...etc) the application like this http:localhost:8080/miniHR. I access my login as
http:localhost:8080/miniHR/login/showlogin.do.

How can I call loginaction class automatically when user accesses the application as http:localhost:8080/miniHR.
appreciate your reply.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could subclass the Struts ActionServlet and redirect to the login URL if a session isn't found.
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide me a sample code. I am not clear on how to implement it.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
response.sendRedirect(url)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic