72 lines
4.2 KiB
HTML
72 lines
4.2 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="task" />
|
|
<meta name="DC.Title" content="Debug servlets" />
|
|
<meta name="abstract" content="Debugging servlets is a special case of debugging classes loaded through a custom class loader. Servlets run in the Java runtime of the IBM HTTP Server. You have several options to debug servlets." />
|
|
<meta name="description" content="Debugging servlets is a special case of debugging classes loaded through a custom class loader. Servlets run in the Java runtime of the IBM HTTP Server. You have several options to debug servlets." />
|
|
<meta name="DC.Relation" scheme="URI" content="debug.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="debserv" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Debug servlets</title>
|
|
</head>
|
|
<body id="debserv"><a name="debserv"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Debug servlets</h1>
|
|
<div><p>Debugging servlets is a special case of debugging classes loaded
|
|
through a custom class loader. Servlets run in the Java™ runtime of the IBM<sup>®</sup> HTTP Server. You have several options
|
|
to debug servlets.</p>
|
|
<div class="section"><p>The easiest way to debug Java programs and servlets that run on your iSeries™ server
|
|
is to use the IBM iSeries System
|
|
Debugger. The IBM iSeries System
|
|
Debugger provides a graphical user interface that enables you to more easily
|
|
use the debugging capabilities of your iSeries server.</p>
|
|
<p>For more information
|
|
about using the iSeries System
|
|
Debugger to debug and test Java programs and servlets that run on your iSeries server,
|
|
see <a href="../rzamq/rzamqmain.htm" target="_blank">IBM iSeries System
|
|
Debugger</a>.</p>
|
|
<p>Another way to debug servlets is by following the instructions
|
|
for <a href="debugcla.htm">classes loaded through a custom class loader</a>.</p>
|
|
<p>You
|
|
can also use the interactive display of your server to debug a servlet by
|
|
completing the following steps: </p>
|
|
</div>
|
|
<ol><li><span>Use the <samp class="codeph">javac -g</samp>command in the Qshell Interpreter
|
|
to compile your servlet.</span></li>
|
|
<li><span>Copy the source code (.java file) and compiled code (.class file)
|
|
to /QIBM/ProdData/Java400.</span></li>
|
|
<li><span>Run the Create Java Program (CRTJVAPGM) command against
|
|
the .class file using optimization level 10, OPTIMIZE(10).</span></li>
|
|
<li><span>Start the server.</span></li>
|
|
<li><span>Run the Start Service Job (STRSRVJOB) command on the job where
|
|
the servlet runs.</span></li>
|
|
<li><span>Enter STRDBG CLASS(myServlet), where myServlet is the name of your
|
|
servlet. The source should be displayed.</span></li>
|
|
<li><span>Set a breakpoint in the servlet and press F12.</span></li>
|
|
<li><span>Run your servlet. When the servlet hits the breakpoint, you can
|
|
continue debugging.</span></li>
|
|
</ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="debug.htm" title="To debug Java programs from the i5/OS command line, select one of the options listed here.">Debug Java programs from an i5/OS command line</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |