This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

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