JEE stands for Java Enterprise Edition. JEE can use for business, web, client and information applications.
If user want to redirect pages without changing URL: they can use RequestDisptacher
You can build a war file and copy it to webapps folder.Then you can run your application in tomcat server.
JEE Applications
- Web components - JSP,Servlets
- Web services - JAX/WS, JAX/RS
- Data access in Java - JDBC/JPA
- Persist and entities and enterprise Java beans
To create JEE project in Eclipse
- Create Dynamic Web Project
- Under the web contents create your web pages (html files)
You can use Apache Tomcat server to deploy your web application.
To change URL
To change the URL of servlets that you have built, you have to configure web.xml file.
As an example, you have to add following lines to your web.xml file
<servlet>
<servlet-name>helloworld</servlet-name>
<servlet-class>com.amali.surverlet.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> helloworld</servlet-name>
<url-pattern>/hidden/hello.do</url-pattern>
</servlet-mapping>
<servlet-name>helloworld</servlet-name>
<servlet-class>com.amali.surverlet.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> helloworld</servlet-name>
<url-pattern>/hidden/hello.do</url-pattern>
</servlet-mapping>
Manually Deploy applications
- Go to webapps folder in tomcat installation directory
- Create a new folder
- Copy META-INF and WEB-INF folders from your project folder to the newly created folder
- Goto WEB-INF folder and copy classes folder (build-> classes) from project folder
- Start the tomcat server
Comments
Post a Comment