又一次要搞一下 Java,每次都要装下 JDK,设置下环境变量,编译一个 HelloWorld来运行一下。下面再记录一次:
设置JAVA_HOME为JDK的根目录
把%JAVA_HOME%bin添加进path
设置classpath为 “.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar”
至此编译HelloWorld应该不成问题了。
由于这是一个关于Webstruts2+Hibernate+Spring
的项目
首先我通读了 CoreJsp一书。最简单的JSP程序:
A simple date example
The time on the server is
<%= new java.util.Date() %>
之后该书用了大量的篇幅讲解了JSP的标签用法及与ServerLet相关的一些概念。作为标准,JAVA Web程序的根目录下要有一个WEB-INF文件夹,The WEB-INF directory contains the web.xml file as well as two different directories: classes and lib. classes contains Servlet and utility classes needed by the application. lib contains JAR files that might contain Servlets, JavaBeans, and utility classes that might be useful to the application. The web.xml file, commonly known as the deployment descriptor, contains configuration and deployment information about the Web application. It can contain information about the application in general, such as MIME type mappings, error pages, session configuration, and security. It can contain information about definitions and mappings to both JSP pages and Servlets. Another type of information that can be contained within the deployment descriptor is Servlet context initialization parameters.
然后就是研究一下struts2
Your browser sends to the web server a request for the URL http://localhost:8080/tutorial/HelloWorld.action.
For detailed information on Struts 2 architecture see Big Picture.
最后又看了Hibernate,和Spring的tutorial,对这些技术有了一些了解。