aspose file tools*
The moose likes Struts and the fly likes how to call  action class on application load Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to call  action class on application load" Watch "how to call  action class on application load" New topic
Author

how to call action class on application load

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
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

Joined: May 26, 2003
Posts: 30752
    
156

You could subclass the Struts ActionServlet and redirect to the login URL if a session isn't found.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
can you provide me a sample code. I am not clear on how to implement it.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

response.sendRedirect(url)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call action class on application load