如何运行一个jsp程序? [英] How to run a jsp program?

查看:139
本文介绍了如何运行一个jsp程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简单的jsp程序.有人可以告诉我运行它的步骤吗?

This is a simple jsp program.can anyone tell me the steps to run it?

<%-- 
Document   : helloworld
Created on : Dec 20, 2010, 10:20:48 PM
Author     : eswar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
</head>
<body>

    <p> Hi, <h3><%="Hello!" %></h3></p>
    <p>You successfully run a simple jsp program.</p>
    <p>Learn More concept about jsp.</p>

</body>
</html>

推荐答案

您需要一个JSP/Serlvet容器,该容器可以为您服务JSP页面.有许多可用的JSP/Servlet容器并已使用,但最常用的是 Apache Tomcat .

You need a JSP/Serlvet container that can server JSP pages for you. There a number of JSP/Servlet containers available and used but the most commonly used is Apache Tomcat.

要设置Tomcat

  1. 只需下载并将其解压缩到任何文件夹中
  2. 接下来,将您的应用程序放置在webapps文件夹中
  3. 启动服务器.
  4. 打开浏览器并浏览到URL http://localhost:8080,它应该会打开tomcat的默认页面
  5. 将您的应用程序打包为war,并将其放置在tomcat的webapps文件夹中
  6. 现在访问URL http://localhost:8080/YourApplicatioContext/path/to/jspFile,您将看到JSP文件正在编译并在浏览器中提供服务
  1. simply download it and extract it into any folder
  2. Next, place your application inside the webapps folder
  3. Start the server.
  4. Open your browser and browse to URL http://localhost:8080, it should open the tomcat's default page
  5. Package your application as war, and place it in the webapps folder of tomcat
  6. Now Access the URL http://localhost:8080/YourApplicatioContext/path/to/jspFile and you will see your JSP file being compiled and served in the browser

这篇关于如何运行一个jsp程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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