Dave Tolls wrote:Well, first off none of this code should be in a JSP page.
It belongs in a Servlet...well, actually it belongs in a service or similar that the servlet calls, so it can be tested easily in isolation.
None of that code you have at the moment can be tested to ensure it is logically correct, without deploying it to a server.
It's also so tightly tied into the HTML side of things I'm surprised you can follow what's going on.
The immediate thing with the bit of code you highlighted is that, if those other fields aren;'t being populated then "receive" must be null.
Dave Tolls wrote:This is because you have too much stuff going on on this page.
You really need to get that code out of there, it is confusing the issue.
Are you sure the correct data is being sent in the request?
Dave Tolls wrote:That doesn't say whether the correct data is being sent in the request.
To do that you need to look at the request itselfd, which will involve using the developer tools for your browser (usually F12).
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Prasad Saya wrote:You can try this (just for testing) and see what is happening with the OUTPUT (I have removed the database related code and kept most of the other stuff as it is) :
Dave Tolls wrote:That <div> in the type input is a typo.
Mayukh Singha Roy wrote:Thanks everyone... I think that div part in type was making a problem.. Now that its fixed. The values are being accepted by the parameters.. But CAN YOU ALL TELL ME HOW TO CHANGE THE DATE FORMAT... My dataBase accepts date in the format yyyy-mm-dd but the html datapicker takes values in the format dd/mm/yyyy.. Any way to change this ??
Consider Paul's rocket mass heater. |