Thursday, 18 September 2014

How To Install and Configuration of Eclips and Apache Tomcat Server

  • Install Eclips
  • Configure File Type
           o Select Window - Preferences.
           o Expand the Gereral Branch, and highlight Content Types.
           o Select the Text node in the tree that appears in the window.
           o In the File Associations box, add the following expression  *.sql, *.inc, *.jsp and *.css




  • Install Tomcat
  • Project Creation in Eclips
            o Select File .....New ..... Project
            o Select Java Project and click the Next Button
            o Set the Project name to website12.
            o Under Project Layout, make sure that the box next to Create seperate source and output folders is checked.
            o Click the next button.
            o select the Source Tab.
            o Set the Default Output folder to website12/web/WEB-INF/classes.
            o Select the Libraries tab.
            o Click the Add External JARs button.
            o Navigate to C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib.
            o Select servlet-api.jar and jsp-api.jar and Click the Open Button.
            o Click the Finish button to create the website12 project.
  • Deployment Description [web.xml]
            o Expand the webfolder.
            o Right-click on the WEB-INF folder and select New...File.
            o Specify a name of web.xml and click the OK button.
            o In the text editor window that appears for web.xml,  insert the contents of the following code listing, and save the file or you can copy paste from C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT\WEB-INF.


<?xml version="1.0" encoding="ISO-8859-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>HelloWorld Application</display-name>
    <description>
        This is a simple web application with a source code organization
        based on the recommendations of the Application Developer's Guide.
    </description>

    <servlet>
        <servlet-name>Home</servlet-name>
        <servlet-class>website12</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Home</servlet-name>
        <url-pattern>/Home</url-pattern>
    </servlet-mapping>
</web-app> 
 

  • In Eclipse Create a new file in the top level of your website project called website.xml 
     <Context path="/website12" docBase="web folder path" />
  •  Go to the manager application
               o Set the context path to /website12
  • Set the XML Configuration file URL to "website.xml path"
  • Create index.jsp page inside "web"folder.
  • To run this page open browser and write localhost:8085/website12/index.jsp

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Followers

Submit Website

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger