[root@redhat6 /tmp]# unzip jakarta-ant.zip [root@redhat6 /tmp]# unzip jakarta-tomcat.zip [root@redhat6 /tmp]# unzip jakarta-tools.zip Archive: jakarta-tools.zip inflating: jakarta-tools/javac.jar inflating: jakarta-tools/moo.jar inflating: jakarta-tools/projectx-tr2.jar inflating: jakarta-tools/servlet-2.2.0.jar inflating: jakarta-tools/testdriver.jar |
[root@redhat6 local]# ls JP.IO bin games lib sbin JSDK2.0 doc info jpio.tar.gz man src apache etc jdk1.2.2 pgsql tomcat |
[root@redhat6 bin]# ERROR reading ./../conf/server.xml At Line 72 /Server/ContextManager/Context/ FATAL: configuration error |
[root@redhat6 bin]# ./tomcat.sh start Guessing TOMCAT_HOME from tomcat.sh to ./..Setting TOMCAT_HOME to ./.. Using classpath: .:./../lib/ant.jar:./../lib/jasper.jar:./../lib/servlet.jar:./../lib/test:./../lib/webserver.jar:./../lib/xml.jar:/usr/local/jdk1.2.2/lib/tools.jar [root@redhat6 bin]# Starting tomcat. Check logs/tomcat.log for error messages Context log: path="/examples" Adding context path="/examples" docBase="webapps/examples" Context log: path="" Adding context path="" docBase="webapps/ROOT" Context log: path="/test" Adding context path="/test" docBase="webapps/test" Starting tomcat install="./.." home="/usr/local/tomcat" classPath=".:./../lib/ant.jar:./../lib/jasper.jar:./../lib/servlet.jar:./../lib/test:./../lib/webserver.jar:./../lib/xml.jar:/usr/local/jdk1.2.2/lib/tools.jar" Context log: path="/admin" Automatic context load docBase="/usr/local/tomcat/webapps/admin" Context log: path="/admin" Adding context path="/admin" docBase="/usr/local/tomcat/webapps/admin" |
Starting endpoint port="8080" handler="org.apache.tomcat.service.http.HttpConnectionHandler" Starting endpoint port="8007" handler="org.apache.tomcat.service.connector.Ajp12ConnectionHandler" |
<%@ page language="java" contentType="text/html; charser=Shift_JIS" %> <% out.println("こんにちは!Tomcat JSPを使っています。"); %> |
[postgres@redhat6 jdbc]$ ls CHANGELOG Makefile README_6.3 makeVersion.java Implementation README example postgresql [postgres@redhat6 jdbc]$ make javac makeVersion.java make: javac: Command not found make: *** [makeVersion.class] Error 127 |
[postgres@redhat6 jdbc]$ export JV=/usr/local/jdk1.2.2/bin [postgres@redhat6 jdbc]$ export PATH=$JV:$PATH [postgres@redhat6 jdbc]$ make javac makeVersion.java make $(java makeVersion) make[1]: Entering directory `/usr/local/src/postgresql-6.5.2/src/interfaces/jdbc ' javac postgresql/Connection.java テ: ./postgresql/Driver.java 、マソ萓ゥ、オ、、ハ、、 API 、サネヘム、゙、ソ、マ・ェ。シ・ミ。シ・鬣、・ノ、キ、ニ、、 、゙、ケ。」セワコル、ヒ、ト、、、ニ、マ。「"javac -deprecation" ・ウ・゙・・ノ、サネヘム、キ、ニ、ッ、タ、オ、、。」 キルケ 1 クト javac postgresql/geometric/PGbox.java javac postgresql/geometric/PGcircle.java javac postgresql/geometric/PGline.java javac postgresql/geometric/PGlseg.java javac postgresql/geometric/PGpath.java javac postgresql/geometric/PGpolygon.java javac postgresql/util/PGmoney.java javac postgresql/jdbc2/ResultSet.java javac postgresql/jdbc2/CallableStatement.java テ: postgresql/jdbc2/CallableStatement.java 、マソ萓ゥ、オ、、ハ、、 API 、サネヘム、゙、ソ、マ・ェ。シ・ ミ。シ・鬣、・ノ、キ、ニ、、、゙、ケ。」セワコル、ヒ、ト、、、ニ、マ。「"javac -deprecation" ・ウ・゙・・ノ、サネヘム、キ、ニ、ッ、タ 、オ、、。」 キルケ 1 クト jar -c0f postgresql.jar $(find postgresql -name "*.class" -print) \ postgresql/errors.properties postgresql/errors_fr.properties make[1]: Leaving directory `/usr/local/src/postgresql-6.5.2/src/interfaces/jdbc' ------------------------------------------------------------ The JDBC driver has now been built. To make it available to other applications, copy the postgresql.jar file to a public place (under unix this could be /usr/local/lib) and add it to the class path. Then either add -Djdbc.drivers=postgresql.Driver to the commandline when running your application, or edit the properties file for your application (~/.hotjava/properties under unix for HotJava), and add a line containing jdbc.drivers=postgresql.Driver More details are in the README file and in the main postgresql documentation. ------------------------------------------------------------ To build the examples, type: make examples To build the CORBA example (requires Java2): make corba ------------------------------------------------------------ [postgres@redhat6 jdbc]$ ls CHANGELOG Makefile README_6.3 makeVersion.class postgresql Implementation README example makeVersion.java postgresql.jar |
[root@redhat6 bin]# export CLASSPATH=/usr/local/JSDK2.0/lib/jsdk.jar [root@redhat6 bin]# ./javac ParamServlet.java ParamServlet.java:19: ・皈ス・テ・ノ getPararameter(java.lang.String) 、マ interface jav ax.servlet.http.HttpServletRequest 、ヌクォ、ト、ォ、熙゙、サ、。」 String value = req.getPararameter(name); ^ ParamServlet.java:26: ・皈ス・テ・ノ getPararameterValues(java.lang.String) 、マ interfa ce javax.servlet.http.HttpServletRequest 、ヌクォ、ト、ォ、熙゙、サ、。」 String values [] = req.getPararameterValues(name); ^ ・ィ・鬘シ 2 クト |
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class CookieServlet extends HttpServlet { public void doGet ( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { int counter = 0; Cookie[] cookies = req.getCookies(); for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals("counter")) { counter = Integer.parseInt (cookies[i].getValue()); } } counter++; Cookie counterCookie = new Cookie("counter", Integer.toString(counter)); // counterCookie.setmaxAge(60); res.addCookie(counterCookie); ロ−ドしていく分、カウンタ−がアップしていきます。 |
import java.io.*; import java.util.Enumeration; import javax.servlet.*; import javax.servlet.http.*; public class CounterServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { HttpSession session = req.getSession(true); res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(" |