顺便附一个测试页,将下面代码保存为一个.jsp 文件放到你的默认网站目录下,
<%@ page contentType= "text/html;charset=gb2312"%>
<html>
<head>
<title>HI-JSP实验</title>
</head>
<body>
<%
String Msg = "This is JSP test! 看到这段话,恭喜你,成功了!";
out.print("Hello World!");
%>
<h3><%=Msg%></h3>
The current date and time is <%=new java.util.Date() %>
<br>
<%
String str = "Using trim() and substring() can be very useful";
out.println(str);
%>
</body>
</html>
下面说一下配置多站点的方法。
目的: 给域名 youjava.com 建立一个jsp 的网站 ,该网站位置于d:\wwwroot\youjava_com
步骤:
1,首先,在iis 中新建一个网站 域名为 youjava.com
2,在该站点上新建一个虚拟目录,名为 scripts , 本地路径为c:\inetpub\scripts
3,修改 c:\resin-3.0.24\conf\resin.conf
将默认的站点复制,并在下面粘贴一份:
<!-- configures the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- configures an explicit root web-app matching the
- webapp‘s ROOT
-->
<web-app id="/" document-directory="c:/inetpub/wwwroot "/>
<resin:if test="${java.isJava5()}">
<!--
- Administration application /resin-admin
-
- password is the md5 hash of the password.
- localhost is true to limit access to the localhost
-->
<resin:set var="resin_admin_password" default=""/>
<resin:set var="resin_admin_localhost" default="true"/>
<web-app id="/resin-admin" document-directory="${resin.home}/php/admin"/>
</resin:if>
</host>
将上面 蓝色内容分别修改如下:
<!-- configures the default host, matching any host name --> 修改为 <!-- youjava.com-->
<host id="" root-directory="."> 修改为 <host id="youjava.com" root-directory=".">
<web-app id="/" document-directory="c:/inetpub/wwwroot "/>
保存——重启resin 完成。
注意,在上面的配置中,只配置了主域名 youjava.com 的访问,如果需要多域名访问如
<host-alias>www.youjava.com</host-alias>
即可,每一行一个别名。
在不同的resin 版本中 resin.conf 的配置 方法是不一样的。但只要明确,每一个站点的配置其实就是从 站点名称开始 也就是 <host id= 的上一行,到 /host> 结束。
分页: [1] [2]
- 上一篇:全国各地受理专项备案的通信管理局列表
- 下一篇:Flash网站的流量统计