Oh my goodness, I am starting to dislike oracle. When I google for "java servlet 2.5 api docs"
The first link is:
* http://www.oracle.com/technetwork/java/javaee/servlet/index.html
and when I go to the page:
* http://tomcat.apache.org/tomcat-6.0-doc/index.html
it has a link to
* Servlet API Javadocs - The Servlet 2.5 API Javadocs.
But the link is a dead link that redirects to
* http://www.oracle.com/technetwork/java/javaee/servlet/index.html
ug.
Well I finally found out that javaee 5 uses servlet api 2.5 so this might work
http://download.oracle.com/javaee/5/api/javax/servlet/package-summary.html
But so might this:
Java Servlet Javadoc API http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/
Thursday, February 17, 2011
Java Servlet In Ubuntu with Tomcat 6
user@desktop:~/Servlet$ sudo apt-get install tomcat6
user@desktop:~/Servlet$ sudo service tomcat6 start
user@desktop:~/Servlet$ sudo service tomcat6 restart
user@desktop:~/Servlet$ sudo service tomcat6 stop
user@desktop:~/Servlet$ sudo service tomcat6 start
user@desktop:~/Servlet$ echo "* used tutorial http://content.hccfl.edu/pollock/ajava/war/myservletwar.htm"
* used tutorial http://content.hccfl.edu/pollock/ajava/war/myservletwar.htm
user@desktop:~/Servlet$ vim SampleServlet.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SampleServlet extends HttpServlet
{
public void doPost ( HttpServletRequest req, HttpServletResponse res ) throws IOException, ServletException
{
doGet( req, res );
}
public void doGet ( HttpServletRequest req, HttpServletResponse res ) throws IOException, ServletException
{
res.setContentType( "text/html" ); // Can also use "text/plain" or others.
PrintWriter out = res.getWriter();
String addr = req.getRemoteAddr();
// Create output (the response):
out.println( "<HTML><HEAD><TITLE>SampleServlet in myServletWar</TITLE></HEAD>" );
out.println( "<BODY><H1 ALIGN=\"CENTER\">" );
out.println( "Hello " + addr + ", from SampleServlet in myServletWar!" );
out.println( "</H1></BODY></HTML>" );
out.close();
}
}
user@desktop:~/Servlet$ mkdir myServletWar
user@desktop:~/Servlet$ mkdir myServletWar/META-INF
user@desktop:~/Servlet$ mkdir myServletWar/WEB-INF
user@desktop:~/Servlet$ mkdir myServletWar/WEB-INF/classes
user@desktop:~/Servlet$ vim myServletWar/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>myServletWar, a first Web Application</display-name>
<description>
This is a simple web application containing a single servlet
of the "Hello, World" variety.
</description>
<servlet>
<servlet-name>myHello</servlet-name>
<servlet-class>SampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myHello</servlet-name>
<url-pattern>/sample</url-pattern>
</servlet-mapping>
</web-app>
user@desktop:~/Servlet$ javac -cp ".:/usr/share/java/servlet-api-2.5.jar" -d myServletWar/WEB-INF/classes/ SampleServlet.java
user@desktop:~/Servlet$ find
.
./myServletWar
./myServletWar/WEB-INF
./myServletWar/WEB-INF/classes
./myServletWar/WEB-INF/classes/SampleServlet.class
./myServletWar/WEB-INF/web.xml
./myServletWar/META-INF
./SampleServlet.java
user@desktop:~/Servlet$ rm -f myServletWar.war
user@desktop:~/Servlet$ jar -cvf myServletWar.war -C myServletWar/ .
user@desktop:~/Servlet$ sudo cp myServletWar.war /var/lib/tomcat6/webapps/
user@desktop:~/Servlet$ curl http://127.0.0.1:8080/myServletWar/sample
user@desktop:~/Servlet$ sudo service tomcat6 start
user@desktop:~/Servlet$ sudo service tomcat6 restart
user@desktop:~/Servlet$ sudo service tomcat6 stop
user@desktop:~/Servlet$ sudo service tomcat6 start
user@desktop:~/Servlet$ echo "* used tutorial http://content.hccfl.edu/pollock/ajava/war/myservletwar.htm"
* used tutorial http://content.hccfl.edu/pollock/ajava/war/myservletwar.htm
user@desktop:~/Servlet$ vim SampleServlet.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SampleServlet extends HttpServlet
{
public void doPost ( HttpServletRequest req, HttpServletResponse res ) throws IOException, ServletException
{
doGet( req, res );
}
public void doGet ( HttpServletRequest req, HttpServletResponse res ) throws IOException, ServletException
{
res.setContentType( "text/html" ); // Can also use "text/plain" or others.
PrintWriter out = res.getWriter();
String addr = req.getRemoteAddr();
// Create output (the response):
out.println( "<HTML><HEAD><TITLE>SampleServlet in myServletWar</TITLE></HEAD>" );
out.println( "<BODY><H1 ALIGN=\"CENTER\">" );
out.println( "Hello " + addr + ", from SampleServlet in myServletWar!" );
out.println( "</H1></BODY></HTML>" );
out.close();
}
}
user@desktop:~/Servlet$ mkdir myServletWar
user@desktop:~/Servlet$ mkdir myServletWar/META-INF
user@desktop:~/Servlet$ mkdir myServletWar/WEB-INF
user@desktop:~/Servlet$ mkdir myServletWar/WEB-INF/classes
user@desktop:~/Servlet$ vim myServletWar/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>myServletWar, a first Web Application</display-name>
<description>
This is a simple web application containing a single servlet
of the "Hello, World" variety.
</description>
<servlet>
<servlet-name>myHello</servlet-name>
<servlet-class>SampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myHello</servlet-name>
<url-pattern>/sample</url-pattern>
</servlet-mapping>
</web-app>
user@desktop:~/Servlet$ javac -cp ".:/usr/share/java/servlet-api-2.5.jar" -d myServletWar/WEB-INF/classes/ SampleServlet.java
user@desktop:~/Servlet$ find
.
./myServletWar
./myServletWar/WEB-INF
./myServletWar/WEB-INF/classes
./myServletWar/WEB-INF/classes/SampleServlet.class
./myServletWar/WEB-INF/web.xml
./myServletWar/META-INF
./SampleServlet.java
user@desktop:~/Servlet$ rm -f myServletWar.war
user@desktop:~/Servlet$ jar -cvf myServletWar.war -C myServletWar/ .
user@desktop:~/Servlet$ sudo cp myServletWar.war /var/lib/tomcat6/webapps/
user@desktop:~/Servlet$ curl http://127.0.0.1:8080/myServletWar/sample
Wednesday, February 16, 2011
javac classpath - semicolon delimited
after installing tomcat 6 for example:
javac -cp ".:/usr/share/java/servlet-api-2.5.jar" SampleServlet.java
javac -cp ".:/usr/share/java/servlet-api-2.5.jar" SampleServlet.java
Wednesday, February 02, 2011
SAML and google apps stuff links
http://code.google.com/googleapps/domain/sso/saml_reference_implementation_web.html
http://code.google.com/googleapps/domain/sso/saml_reference_implementation.html
http://www.google.com/support/a/bin/answer.py?hl=en&answer=60224
http://code.google.com/googleapps/faq.html
https://spaces.internet2.edu/display/SHIB2/Home
http://www.google.com/enterprise/marketplace/
http://code.google.com/googleapps/domain/sso/saml_reference_implementation.html
http://www.google.com/support/a/bin/answer.py?hl=en&answer=60224
http://code.google.com/googleapps/faq.html
https://spaces.internet2.edu/display/SHIB2/Home
http://www.google.com/enterprise/marketplace/
Subscribe to:
Posts (Atom)