How To Create A Web Application in Eclipse
How To Create A Web Application in Eclipse
01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 16. 17. 18.
Download and install http://tomcat.apache.org/ Download and install Eclipse IDE for Java EE Developers Start Eclipse Window -> Preferences -> Web -> CSS+HTML+JSP -> Encoding: ISO 10646/Unicode(UTF-8) Window -> Open Perspective -> Other -> Java EE File -> New -> Dynamic Web Project Enter Project name Target Runtime -> [New] -> Apache -> Apache Tomcat vX.X -> Next -> Tomcat installation directory -> [Browse] -> <Path to tomcat>\Tomcat X.X -> Finish Finish Right click on WebContent -> New -> JSP (index.html / index.jsp as startfile) -> Next -> Use JSP template -> New JSP File(xhtml) -> Finish Right click on project -> Run As -> Run on Server -> Finish Project is available under http://localhost:8080/projectname To change the context root/URI in eclipse : Right click on project -> Properties ->Web Project Settings -> "New Context root" -> Apply -> OK -> OK Right click project -> Export -> WAR file -> Destination: -> [Browse] -> <Path to tomcat>\Tomcat X.X\webapps (write name in small letters) -> Save -> Finish To change the context root/URI for tomcat just rename the WAR file Stop Eclipse-tomcat-server by pressing STRG+ALT+S Start tomcat ("<Path to tomcat>\Tomcat X.X\bin\tomcatXw.exe") Now Project is deployed in tomcat and can be used without eclipse
Download and install http://tomcat.apache.org/ Download and install Eclipse IDE for Java EE Developers Start Eclipse Window -> Preferences -> Web -> CSS+HTML+JSP -> Encoding: ISO 10646/Unicode(UTF-8) Window -> Open Perspective -> Other -> Java EE Right click on Project Explorer -> Import -> WAR file -> WAR file [Browse] -> "UnitConverter_DWP.war" -> Open Target Runtime -> [New] -> Apache -> Apache Tomcat vX.X -> Next -> Tomcat installation directory -> [Browse] -> <Path to tomcat>\Tomcat X.X -> Finish
1/2
Next -> Finish Goto http://jscience.org/ and download JScience (Get Library) (you only need jscience.jar of the zip-file) Copy jscience.jar to /<eclipse-workspace>/UnitConverter_DWP/WebContent/WEBINF/lib In eclipse press F5 Project -> Clean... -> OK Rightclick on project -> Run As -> Run on Server -> Finish Project is available: http://localhost:8080/UnitConverter_DWP or http://localhost/UnitConverter_DWP To change the context root/URI in eclipse : Right click on project -> Properties ->Web Project Settings -> "New Context root" -> Apply -> OK -> OK
2/2