zoukankan      html  css  js  c++  java
  • 第一个JSP程序

    本文介绍如何写出第一个JSP程序

    1、配置服务器

    (1)在eclipse中选择Server视图,(ps:很多童鞋说找不到Server,那是因为eclipse的版本问题,请下载JEE版本的eclipse),并单new server wizard超链接

    (2)打开Define a New Server界面中的选择服务器类型列表框,展开apache节点,并选择Tomcat v7.0 Server节点

    20151204170137

    (3)单击下一步,单击Browse按钮,选择已经安装的tomcat服务器安装路径

    20151204171303

    (4)单击完成,在servers视图中添加了 一个服务器项目,可以启动或停止服务器

    2、指定web浏览器

    Window/preferences/.../web browsers指定web浏览器

    20151204171637

    3、编写jsp程序

    新建一个Dynamic Web Project,命名为1.01,全部采用默认选项。

    在WebContent节点下新建jsp文件index.jsp,将index.jsp文件中默认代码修改为以下代码:

    20151204195736

    出现如下错误:

    Several ports (8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

    在命令提示符下,输入netstat -aon | findstr 8080

    20151204200444

    获得该端口被PID为2692的进程占用

    输入tasklist |findstr 2692:

    可以获得当前端口被Tomcat7.exe占用

    继续输入taskkill -F -IM Tomcat7.exe或taskkill /pid 2692 /F

    结束该进程

    再次在eclipse中启动tomcat正常

  • 相关阅读:


    django 认证系统--3
    django 认证系统--2
    django 认证系统--1


    关于二叉树
    [GeeksForGeeks] Remove all half nodes of a given binary tree
    [LintCode] Letter Combinations of a Phone Number
  • 原文地址:https://www.cnblogs.com/wuyudong/p/first-jsp.html
Copyright © 2011-2022 走看看