Let's talk about Java again. JDK should be installed every time, environment variables should be set, and a helloworld should be compiled to run it. Record it again below:
1. Set java_home as the JDK root directory
2. Add % java_home % bin to path
3. Set classpath to ".; % java_home %/lib/dt. jar; % java_home %/lib/tools. Jar"
At this point, helloworld compilation should not be a problem.
This is a project about Web [struts2 + hibernate + Spring ].
First, I read corejsp. The simplest JSPProgram:
The time on the server is
Later, the book used a lot of space to explain the tag usage of JSP and some concepts related to serverlet. As standard, a WEB-INF folder under the root directory of the Java Web program, 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.
Next, let's take a look at struts2.
Your browser sends to the Web server a request for the URL http: // localhost: 8080/tutorial/helloworld. Action.
-
- The container has es from the Web server a request for the resourceHelloworld. Action. According to the settings loaded from the Web. XML, the container finds that all requests are being routedOrg. Apache. struts2.dispatcher. filterdispatcher, Including*. ActionRequests. The filterdispatcher is the entry point into the framework.
-
- The framework looks for an action mapping named "helloworld", and it finds that this mapping corresponds to the class "helloworld". The framework instantiates the action and callthe Action'sExecuteMethod.
- TheExecuteMethod sets the message and returnsSuccess. The framework checks the action mapping to see what page to load ifSuccessIs returned. The framework tells the container to render as the response to the request, the resourceHelloworld. jsp.
-
- As the pageHelloworld. jspIs being processed, Tag callthe GetterGetmessageOfHelloworldAction, and the tag merges into the response the value of the message.
-
- A pure hmtl response is sent back to the browser.
For detailed information on Struts 2 architecture see big picture.
Finally, I read about Hibernate and tutorial of spring, and I have some knowledge about these technologies.