Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 - wrong method executed

 
shukla raghav
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple JSP Page



struts.xml



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
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change like below and try it.


 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic