This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes Debug problem with login form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Debug problem with login form" Watch "Debug problem with login form" New topic

Debug problem with login form

Siamak Saarmann
Ranch Hand

Joined: Aug 21, 2004
Posts: 78

I have build a simple login form and double checked everything but something goes wrong. As soon as I press the login button , an empty page ( http://localhost:8084/cust/ ) appears instead of redirecting to login page or showing the main.jsp. I do not receive any error and this resulting page's source is empty.

I put a System.out.println to see if LoginAction's execute is being called and it seems to me that it is not even being called. And also no error appears in Tomcat's log.

Let me excuse for putting the code here before someone reminds me.

1- Would someone please help me with this.

2- How are we supposed to find the problem without any error message (how should we debug such problems).

[ June 05, 2006: Message edited by: Siamak Saarmann ]

PhD Artificial Intelligence, OCJP1.6
Siamak Saarmann
Ranch Hand

Joined: Aug 21, 2004
Posts: 78
After something about 6 hours ! I finally found the problem. I have been a programmer for almost 19 years and this is a shame

The problem was from my LoginAction's execute method.

The problem was from the type "ServletResponse" of request and response variables. They should have been "HttpServletResponse".

I wanted once use the NetBeans's code completing capabilities and it did this to me. It has also been smart enough!! to add below imports to my code!

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

Anyway, thank you.

I agree. Here's the link:
subject: Debug problem with login form
It's not a secret anymore!