Tips and Techniques Tips re: errors Obviously, the best approach to reducing bugs is to code to a design and perform testing at incremental stages. However when you don’t know what the problem is then… Whenever you come across an error in your JSP application, you need a mental checklist to help you track down the problem. Version 2.4 Nov 2008 j.c.westlake@staffs .ac.uk
Tips re: errors. Obviously, the best approach to reducing bugs is to code to a design and perform testing at incremental stages. However when you don’t know what the problem is then… - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Tips and TechniquesTips re: errors
Obviously, the best approach to reducing bugs is to code to a design and perform testing at incremental stages.
However when you don’t know what the problem is then…
Whenever you come across an error in your JSP application, you need a mental checklist to help you track down the problem.
• Remember that using GET you are restricted to (usually less than) 1024 chars.
• You should use POST – but GET is good for debugging as you can see it in the url string in the browser – that is the recommendation for your early use of JSP
Database Problems• Be very careful with your SQL statements!• Date values have a pair of # around them, but avoid using DATE types.• If you have a problem with currency fields, use number, set it’s field
size to Decimal and set the format to Currency, then set the number of decimal places and scale to 2 – see next slide
• The autosequence column name does not need to be named in your insert sql statement when writing to a database.
• We recommend you be careful if you use autosequence fields – they can be more trouble than they are worth– Can be nasty when get out of sequence– Your mileage may vary – some people do not experience
many problems with autonumbering keyfields– For example, Nic Shulver always uses them, without issues
out.println("<!--");StringWriter sw = new StringWriter();PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw);out.print(sw);sw.close();pw.close();out.println("-->");