Eclipse - 发布&运行简单的Web项目 [英] Eclipse - Publish & Run Simple Web Project

查看:68
本文介绍了Eclipse - 发布&运行简单的Web项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须错过一些非常明显的东西,但我根本无法解决如何发布和运行一个简单的JavaScript& HTML项目到本地VM上的Apache服务器。



我已经尝试了本地安装的Eclipse帮助,但是总是似乎要结束,而不填写所需要的全部细节,并且没有给出开始完成需要完成什么应该是一个简单的任务的概述。



我的项目很简单,它包括一个单一的JavaScript文件和目录的链接的HTML文件。我已经创建了一个服务器,给出了VM上的Apache服务器的详细信息,据我所知,我现在需要将项目与服务器链接起来,但是我无法解决如何执行此任务。如果我右键单击项目并转到运行方式/配置 创建,管理和运行配置窗口允许我创建一个新的配置,但服务器选择框不包含服务器。



我真的不知道这是我需要做的,但是我尝试过这么多选项我现在完全失去了。



在服务器窗口中,服务器显示启动,同步,但甚至没有尝试将文件写入服务器目录(安装在我的文件系统上)



我正在使用Eclipse IDE for JavaScript Developers v1.4.1,Eclipse Platformv3.7.1。 >

任何人都可以指出正确的方向发布和运行一个简单的JavaScript&在本地虚拟机上的HTML项目?

解决方案

使用Eclipse在Apache Server上发布静态内容和JavaScript


添加服务器





  1. 窗口 - >显示视图 - >服务器

  2. 右键单击服务器内部选项卡

  3. 新建 - >服务器 - > HTTP服务器 - >下一步

  4. 添加发布目录:在我的情况下(C:\Program Files(x86)\Apache Software Foundation\Apache2.2\htdocs)

  5. 下一步 - >添加端口(在我的情况下为12345)




创建一个Web项目<




  1. 切换到网页浏览(右上角)

  2. 右键单击Project Explorer左侧

  3. 新建 - >项目 - > Web - >静态Web项目

  4. 命名项目

  5. 选择运行时目标作为HTTP服务器

  6. 下一步 - >注意您的默认con文本根

  7. 完成




复制您当前的js和html
Project Explorer中'WebContent'目录中的文件。








在服务器选项卡中





  1. 右键单击HTTP Server

  2. 添加 - 删除 - >添加项目 - >完成

  3. 右键单击Http Server - >发布
    4完成!

  4. <




    您应该可以在发布目录中看到您的内容。
    您可以访问页面



    http:// localhost :/ context_root



    欢呼!


    I must be missing something really obvious but I just cannot work out how to publish & run a simple JavaScript & HTML project to an Apache server on a local VM.

    I have tried the locally installed Eclipse help but it always seems to come to an end without filling in the full details of what is required and there is no summary that gives a start to finish overview of what is needed to complete what should be a straightforward task.

    My project is simple, it is comprised of links to a single JavaScript file and a directory of HTML files. I have created a server, giving the details of the Apache server on the VM, as far as I can tell I now need to link the project with the server but I can't work out how to do this task. If I right click on the project and go to Run As/Configurations the Create, manage and run configurations window allows me to create a new configuration but the server select box contains no servers.

    I really have no idea whether that is what I need to be doing but I have tried so many options that I am now completely lost.

    In the server window it says 'started, synchronised' by the server but it isn't even attempting to write files to the server directory (which is mounted on my file system).

    I am using 'Eclipse IDE for JavaScript Developers' v1.4.1, 'Eclipse Platform' v3.7.1.

    Could anyone point me in the right direction for publishing and running a simple JavaScript & HTML project on a local Virtual Machine?

    解决方案

    Publishing Static Content and JavaScript on Apache Server using Eclipse

    Add Server

    1. Window -> Show View -> Servers
    2. Right click inside servers tab
    3. New - > Server -> HTTP Server -> Next
    4. add publishing dir: in my case (C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs)
    5. Next -> add port (12345 in my case)

    Create a web project

    1. Switch to Web View (Right hand top corner)
    2. Right click Project Explorer in left
    3. New -> Project -> Web -> Static Web Project
    4. Name the Project
    5. Select Runtime Target as HTTP Server
    6. Next -> Notice your default context root
    7. Finish

    Copy your current js and html files in the 'WebContent' directory in Project Explorer.


    In Servers Tab

    1. Right click HTTP Server
    2. Add - Remove -> Add your project -> Finish
    3. Right click Http Server -> Publish 4 done!


    You should be able to see your stuff in publishing directory. you can access the page at

    http://localhost:/context_root

    cheers!

    这篇关于Eclipse - 发布&amp;运行简单的Web项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆