This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello all, I'm new to struts and am seeing something weird. I have an application which requires logon. I have set up LogonForm & LogonAction classes to handle this and have configured them in stuts-config.xml as needed. Now the weird part, when I logon the browser goes to a logon.do page. Why would this be? Any help would be appreciated. Paul
.do is the standard extension that the Struts Action servlet responds to. Forms submit to a target, and in struts this is automatically filled as login.do -- view the source of your login form to see it. Make sure the path is right. I would guess that the problem is either an exception (check the error log) or a lack of a .properties file for the app. Viewing the source and the server logs can be your best friends for getting started with struts.
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Joined: Dec 16, 2002
David, I'm glad you brought the above up. Unfortunately, I've confirmed the *.properies file is there and I've also looked at the source of the logon form. The action places it to logon.do. I don't think I've missed anything,have I?
Have you checked out your web.xml file in your web-inf? It should have something looking like this in it: You see in the web xml you are telling the web server that all url patterns ending with .do must be routed through the Struts Action. Hope this helps
<a href="http://www.johnboy.co.za" target="_blank" rel="nofollow">http://www.johnboy.co.za</a><br />Change - When the winds of change blow hard enough, the most trivial things can turn into deadly projectiles.
Joined: Dec 16, 2002
I've confirmed that my web.xml has the correct configuration for the action servlet. The log shows the below Processing a POST for /logon action: Setting locale 'en_US' action: Looking for ActionForm bean under attribute 'LogonForm' action: Creating new ActionForm instance of class 'com.irt.it.logon.LogonForm' action: Storing instance under attribute 'LogonForm' in scope 'request' action: Populating bean properties from this request action: Validating input form properties action: No errors detected, accepting input action: Looking for Action instance for class com.irt.it.logon.LogonAction action: Double checking for Action instance already there action: Creating new Action instance And that is it. Is this what I should be seeing?