i want to develop a web application with
--> 2 jsps hidden values as 1, 2 as stepnum
-->servlet will see the stepnum then it calls a method according to that
-->that method saves the form data in jsp in to mysql db
mysql db driver in lib folder palced.
But it is not storing in the db & also not returning result jsp apge
One more doubt why if any form data left blank that value not storing as null in db Bcz for my simple application I realised that all fields hsould be entered why?
Note:some code edited by me due to the ambiguity caused.
Thanks for the support not simply!
Why it is not possible to simply leave the rules for handling the user form fields which we allow him to left them.
and the db will have null ,the problem for tomcat or servlet or db i heard any lefted form fields are not treated as empty string is it true?
and ... thanks
This is way too much code for anyone to go through - what's a DB schema got to do with servlet dispatcher issues? Please edit your post and remove at least 90% of the code that's irrelevant to the issue; that'll increase the chances of someone looking at it in detail.
It's very difficult to follow those gazillion lines of code. Could you please put your code on diet? I mean, could you please report just the lines you assume are not doing what they are suppose to do?
if you agree, we can try to solve the Sql problem first.
First sorry for the inconvenience !
let me tell you in words
1) check the user input in servlet with if condition for stepnum=1/2
2)if 1 then call the utility method with the other parameters we got from the same jsp page
3)in that utility call a method to connect to db and return status
3)display that status to result.jsp (dispatch)
same for if (stepnum="2")
it will call another method in the same utility classes
Joined: Oct 27, 2009
i frogot no sql exception error occured /displayed
just not dispalying any error & not result.jsp and not data inserted.
Joined: Mar 22, 2005
The point is not that people might not understand what the code is about, the point is that most of the code you posted can't possibly be related to the issue at hand. So why make anyone try to go through it?
As a side note, I see there are string comparisons using the "==" operator - that's not how strings are compared, you should use the "equals" method instead.
Joined: Apr 10, 2010
I found one first problem.
In your jsp you specified a property of your form
I don't see any file to upload so delete it.
If you don't, the servlet doesn't receive the request parameters. Better, it receives them null
Please, begin to try that and see what happens.
Joined: Apr 10, 2010
Yes, please Kumar, in your bean we need to see just s2Main method. You can delete the others.
We don't need to see web.xml (it's right i can guarantee) and the table creation, at the moment.
And if you can,please delete all those unuseful comments, they are just rumors to our understandings