0

My application displays the login page, but cannot login.

On the login page, user enters the username and password but on pressing the login button nothing happens.

We have in our JSP :

<s:form id="loginForm" name="loginForm" action="login" namespace="/framework">

The struts-framework.xml file has the action defined as follows:

<global-results>
        <result name="loginShow" type="redirect">loginShow.action</result>
        <result name="toMain">/page/framework/main.jsp</result>
        <result name="logout">/page/framework/logout.jsp</result> 
</global-results>
<action name="login" class="com.abc.action.framework.LoginAction" method="loginCheck"> </action>

In our logs we get the Request start for the action framework/login.action, but no response is obtained thereafter and same is evident from the logs.

For reference I have included the following to my struts.xml after migrating struts to 2.3.24 :

<constant name="struts.enable.DynamicMethodInvocation" value="true" />
Roman C
  • 49,761
  • 33
  • 66
  • 176
  • Whats the namespace value in struts.xml tag ?? – goodyzain Jan 08 '16 at 06:57
  • It is in the file struts-framework.xml. – p_saurabh92 Jan 08 '16 at 07:02
  • try changing the file name from struts-framework.xml to struts.xml...I am not sure though – goodyzain Jan 08 '16 at 07:29
  • No this does not work. Also struts.xml is already existing. – p_saurabh92 Jan 08 '16 at 07:59
  • Do you have an action without results ? We need more informations BTW – Andrea Ligios Jan 08 '16 at 08:52
  • This action has no results instead the global results (updated struts-framework.xml) is referred. Also the functions have been defined accordingly in the jsp as per the AJAX data returned by the method: loginCheck(). – p_saurabh92 Jan 08 '16 at 09:11
  • The action invocation is finished before the action is executed. – Roman C Jan 08 '16 at 09:20
  • What do you return from your action method? Why DMI? Ajax data? – Aleksandr M Jan 08 '16 at 09:26
  • 1
    @Roman C, Thanks for you comment, BTW I am not able to understand your point, can you please explain in detail, although if this so, then in our application this kind of mapping is done in many places approx 1000 places, which we have been using since Struts 2.1.8. also please suggest the possible solution if this is the actual problem – p_saurabh92 Jan 08 '16 at 09:29
  • @ Aleksandr M, in the method , we set the response in ajax data object and return success or error according to the business logic. in detail either it have to go to dashboard of application or redirect to the login page – p_saurabh92 Jan 08 '16 at 09:30
  • @p_saurabh92 If you don't understand it, you should learn Struts2 basics from the documentation or the book. [This question](http://stackoverflow.com/q/3907801/573032) should throw a light to your problems. – Roman C Jan 08 '16 at 09:41
  • Do you see anything in server log ? Also configure a global INPUT result and a global ERROR result if you don't have them locally to actions – Andrea Ligios Jan 08 '16 at 09:54
  • *and return success or error* - but you don't have success or error in global results. – Aleksandr M Jan 08 '16 at 09:57
  • @Roman C, Thanks for your comment. This is not a fresh development issue but an issue of struts migration as I have referred in my previous comment. The legacy code was working fine in struts 2.1.8 but is ending up giving errors after struts migration to 2.3.24. We being new to this version, were clueless on the cause of the issue. Probably we guessed about some missing necessary configuration to be made in our project. – p_saurabh92 Jan 08 '16 at 10:38
  • @ Aleksandr M, Success or error in global results have been configured separately. – p_saurabh92 Jan 08 '16 at 10:52
  • @Andrea, Server logs only show the request start for the above request to which no response is received. Also the global INPUT result and global ERROR have been configured in our application.As a matter of fact this was working fine in 2.1.8. – p_saurabh92 Jan 08 '16 at 11:09
  • I got it, and I understand it's hard for you to extract the right pieces of code needed to reproduce or let us understand the problem (because to know which one to pick, you should already have a clue on the solution, which you don't), but believe me, as it is it's not possible to answer you. We need MORE informations. Also raise devMode to true and you will not see only a request lost in the hyperspace, but a lot of other informations, useful to understand where the flow stops and why. *At least* post the logs (with devMode=true) – Andrea Ligios Jan 08 '16 at 11:12
  • Show how do you submit your form. Is your method being called? – Aleksandr M Jan 08 '16 at 12:44
  • We use image rendering of the submit button in our code as follows: . For more details you may also refer the link- https://struts.apache.org/docs/submit.html – p_saurabh92 Jan 08 '16 at 13:02
  • http://stackoverflow.com/questions/34715137/after-migration-to-struts-2-3-24-file-upload-still-not-supported-for-greater-th – p_saurabh92 Jan 11 '16 at 06:24

1 Answers1

0

Thanks for all your efforts. It was an issue with struts-convention plugin.Works well for me on removing this plugin and mapped dependancies in struts.xml