1.先利用花生壳申请免费域名,这个easy啊,可以网上参考申请步骤
注册差不多就这样,
然后记得像上图那样登录花生壳
2.路由器端口映射设置
先进入路由器,一般http://192.168.1.1
我的帐号密码 admin admin123
设置标记的地方,IP地址用自己本机的 端口等下要用,最好不要设置成8009或8080 听同事说貌似电信封了这端口
3.tomcat 的server.xml文件的配置
8868为路由器里配置的端口号
这样web项目就能在外网访问了 域名:端口号/项目名
参考文章
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> <Listener className="org.apache.catalina.core.JasperListener" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8866" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8866" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="xxxx.eicp.net"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- The request dumper valve dumps useful debugging information about the request and response data received and sent by Tomcat. Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> --> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="xxxx.eicp.net" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="xx" docBase="D:\apache-tomcat-6.0.29\webapps\xx" reloadable="true" crossContext="true"></Context> </Host> </Engine> </Service> </Server>
相关推荐
它提供了开发企业级应用程序的标准,包括网络和大型分布式系统、数据库访问和事务处理。Java EE是由Sun Microsystems公司(后被Oracle公司收购)在Java 2 Platform, Enterprise Edition(J2EE)的基础上发展起来的。...
总结来说,JavaEE 技术涵盖了从基础的数据访问到高级的分布式计算等多个方面,为开发者提供了强大的工具和框架来构建复杂的 Web 应用。理解这些技术的核心概念对于成为一名合格的 JavaEE 开发者至关重要。
2. **B/S结构**:即Browser/Server(浏览器/服务器)结构,是一种客户端通过Web浏览器访问服务器端应用程序的模式。这种结构使得系统的维护升级更加方便,用户只需要拥有能够连接互联网的设备即可访问系统。 3. **...
通过这个项目,学习者可以全面掌握Java Web开发的基本流程,从数据库设计到前端展示,从后端逻辑处理到整体架构的构建,对提升个人技能和理解实际开发过程非常有帮助。同时,这个项目也适合作为教学案例,让学生在...
通过SharedPreferences接口,开发者可以方便地读写这些数据,它提供了一种简单的同步访问机制,确保了多线程环境下的安全性。 在Android中,我们通常使用以下方法来操作SharedPreferences: 1. `...
【基于JavaEE的微博平台设计】是一个典型的Web 2.0应用开发项目,它涉及到的主要知识点包括JavaEE技术栈、微服务架构、社交网络、实时通信以及移动互联网应用。 JavaEE,全称Java Platform, Enterprise Edition,是...
在引言部分,文章指出,随着网络技术的发展,越来越多的企业开始开发基于Web的管理信息系统,以便扩大信息访问范围,实现信息资源的共享。为了有效管理和显示大量的信息,分页显示技术成为了Web应用开发中不可或缺的...
本教程涵盖了JavaEE应用程序开发的基础知识和技术要点,包括JavaEE环境的搭建、Servlet和JSP的基本原理及实践、数据库操作技术、JavaBean和标签库的使用、基于MVC模式的项目开发以及Struts框架的应用。通过学习这些...
在校园门户网系统中,JAVAEE能够支持高并发访问,确保系统的稳定运行,并提供灵活的数据访问和事务处理机制。 Mysql数据库作为数据存储的核心,因其开源、高性能、易操作的特性,被广泛应用于各种规模的Web项目。在...
### 基于SSM+MySQL的校园门户网源码数据库 #### 一、项目概述 本项目旨在设计并实现一个基于JavaEE技术栈的校园门户网站。该项目利用Spring MVC(SM)、MyBatis(M)和Spring(S),即SSM框架,并配合MySQL数据库...
- JavaEE:作为企业级应用开发的标准,JavaEE提供了一套完整的开发框架,包括Web服务、数据访问、事务处理等,为校园门户网的开发提供了稳定、可扩展的平台。 - Spring框架:用于处理依赖注入和事务管理,简化了...
结合了当前高校校园网站的开发需求和应用背景,旨在提升校园信息化水平,整合教育资源,促进内外部信息交流。...通过合理的设计和优化,这样的校园门户网将成为连接校园内外的重要桥梁,推动高校的持续发展。
- **辅助工具**:除了基本的开发环境外,还需要一些辅助工具来提高开发效率和代码质量,比如版本控制工具(SVN)、代码比较工具(BeyondCompare)等。 通过以上知识点的梳理,我们可以清晰地了解到J2EE领域的核心概念和...
《JSP学生信息管理系统》是基于JavaEE技术的Web应用程序,旨在实现对学籍信息的有效管理。本系统采用JavaBean、Servlet与JSP相结合的方式,通过JDBC与数据库进行交互,实现了用户友好的界面和高效的后台处理。以下是...
- 内连接、左外连接和右外连接分别用于不同类型的表连接,根据数据需求选择合适的连接类型。 ### 面向对象三大特征 - 继承:支持代码重用和类层次结构的构建。 - 封装:隐藏对象的内部状态,提供对外部的访问控制。...
通过阅读官方文档和参考这些规范,开发者能够更好地把握Java Web开发的技术细节,并且能够更有效地开发和部署Web应用。 由于文档内容是通过OCR扫描生成的,可能存在个别字识别错误或漏识别情况。在实际应用中,...
JavaEE 是一套框架,规定了标准,便有了统一的输出内容,对于 web 的开发,以及相关技术的发展都提供了指导性帮助。SSM 是一个企业级应用框架,支持依赖注入和控制反转,实现模块定义使用,其集成的特性也便于与其他...
- **部署到服务器:** 学习如何将静态HTML页面部署到Web服务器上,使用户可以通过网络访问这些页面。 - **基本标签:** - **分段:<p>:** 用于定义文本段落。 - **字体:<font>:** 用于设置文本的颜色和大小。 ...
通过对现有国内外软件的分析,发现大多数产品虽然基于JavaEE云平台,但不提供真正的SaaS服务,且定制和维护成本高,不适合中小企业。 工程建设行业信息管理平台的主要需求包括: 1. **网络平台**:作为基础架构,...