Article Directory
1.eclipse switching to a Java EE project
2. Create server (if no server option, what to do)
3. Customizing new panel Content
4. Create a Dynamic Web project
1.eclipse switching to a Java EE project
2. Create server (if no server option, what to do)
In general, there is a service action card in the lower half of eclipse, if there is no
Here is a hint, click
3. Customizing new panel content
4. Create a Dynamic Web project
File->new->dynamic Web Project
Project Name:helloworld (remaining default)->next->next-> (Generate Web. XML deployment descriptor) tick the checkmark->finish
New Package Com.helloworld.test
New Class Helloworld.java
1 Package com.helloworld.test; 2 3 Public class HelloWorld {45 Public String SayHello () {6 return "SayHello"; 7 }8 }
New hello.jsp under WebContent
1 <%@page Import="Com.helloworld.test.HelloWorld"%>2 <%@ Page Language="Java"ContentType="text/html; charset=iso-8859-1"3 pageencoding="iso-8859-1"%>4 <!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd ">5 <HTML>6 <Head>7 <Metahttp-equiv= "Content-type"content= "text/html; charset=iso-8859-1">8 <title>Insert Title here</title>9 </Head>Ten <Body> One <% A HelloWorld HW= NewHelloWorld (); - System.out.println (Hw.sayhello ()); - %> the </Body> - </HTML>
Right-Hello.jsp->run As->run on service-> all the way to the next and see the results
This is the way that normal development is used
Javaweb core programming using Eclipse Development Javaweb Project