This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 - wrong method executed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 - wrong method executed" Watch "Struts 2 - wrong method executed" New topic

Struts 2 - wrong method executed

shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
Simple JSP Page


Action Class

when i call the application using the following url : http://localhost/Struts2App/user_login.action
i reach the login page (userJSP.jsp). But when i enter the username and password and submit it should ideally execute the userLogin() method in the action class siince the <s:form> tag has value of action attribute as user_login!userLogin . it means it should execute the userLogin method of the action named user_login but it executes the default execute method of the action user_login. why so ? when i am specifying in the form tag which method i want to be called then why is it executing the default method.
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
Change like below and try it.

I agree. Here's the link:
subject: Struts 2 - wrong method executed
Similar Threads
Struts2 newbee - Problem when using form tag
Which is Model and Controller in this example?
method not executing in action class
submitting correct username and password, it again come in login.jsp
problem passing parameters to redirect action