I was forced to do some web development in Java because of my work. For beginners, it was difficult to start with understanding the words, but I managed to do it: sweat_smile: It takes about half a day to a day, including the survey. Since this is a procedure that beginners are doing, there may be many inadequacies.
In an attempt to develop SAP-related, I have recorded the JDK installation in the following article (other than the JDK).
--Installation of JDK: Building SAP system connection environment using JCo to PC that even Java beginners can do
Download the installation file from the Official Page Download Site. Run the installation file.
Select "Eclipse IDE for Java EE Developers". I was at a loss between "Eclipse IDE for Java EE Developers" and "Eclipse IDE for Java EE Developers", but the article ["Eclipse for Web development with Java, choose Eclipse IDE for Java EE Developers"](http Judgment by looking at: //javatechnology.net/tool/eclipse-ee-developers/)
Select the installation destination.
Acceptance of license.
I pressed LAUNCH and it failed once, but when I re-run it worked.
Set Workspace as the default.
Select Help-> Eclipse Marketplace from the menu.
Install Eclipse Jetty 3.9.0 and Run-Jetty-Run 1.3.5-nightly (license screen etc. omitted). I rebooted after installing both.
Right-click in Project Explorer and select New-> Project.
Select Dynamic Web Project.
Enter the Project name and Finish. In the screenshot, the item "Target runtime" is "None", but if you enter "J2EE Preview", a warning "The superclass" javax.servlet.http.HttpServlet "was will appear later. "not found on the Java Build Path" disappears. </ sup>
Right-click in the "Web Content" folder of Project Explorer and select New-> Other.
Select JSP File.
Enter the file name and finish.
The JSP file is sourced like this. Described to output the date and time in the body tag.
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%= new java.util.Date() %>
</body>
</html>
Right-click on the created JSP file and select Run As-> 2 Run Jetty.
Open the JSP in your browser. This time, the port is 8080 by default and the project name is HelloWorld, so open it with the following URL (since the file name is "index.jsp", HelloWorld and below are not specified). http://localhost:8080/HelloWorld/
The date and time are displayed like the screen!
Recommended Posts