13.07.2015 Views

0A-Servlet+JSP-Revie.. - Custom Training Courses - Coreservlets.com

0A-Servlet+JSP-Revie.. - Custom Training Courses - Coreservlets.com

0A-Servlet+JSP-Revie.. - Custom Training Courses - Coreservlets.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Defining <strong>Custom</strong> URLs: Result20• Eclipse details– Name of Eclipse project is "test"– Servlet is in src/coreservlets/HelloServlet2.java– Deployed by right-clicking on Tomcat, Add and RemoveProjects, Add, choosing test project, Finish, right-clickingagain, StartJava EE training: http://courses.coreservlets.<strong>com</strong>Debugging Servlets21• Use print statements; run server on desktop• Use Apache Log4J• Integrated debugger in IDE– Right-click in left margin in source to set breakpoint (Eclipse)– R-click Tomcat and use "Debug" instead of "Start"• Look at the HTML source• Return error pages to the client– Plan ahead for missing or malformed data• Use the log file– log("message") or log("message", Throwable)• Separate the request and response data .– Request: see EchoServer at www.coreservlets.<strong>com</strong>– Response: see WebClient at www.coreservlets.<strong>com</strong>• Make sure browser is not caching– Internet Explorer: use Shift-RELOAD– Firefox: use Control-RELOAD• Stop and restart the serverJava EE training: http://courses.coreservlets.<strong>com</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!