12
返回列表 发新帖
楼主: cgh_chen

为什么Oracle的Apache服务器不支持session

[复制链接]
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33会员2006贡献徽章
日期:2006-04-17 13:46:34
11#
 楼主| 发表于 2002-6-11 19:08 | 只看该作者
<%
    application.setAttribute("myName","LL"; (WRONG)
%>
JSP版本
<%= application.getAttribute("oracle.jsp.versionNumber" %> (OK)
<br>
姓名:
<%= application.getAttribute("myName" %> (OK)
Oracle帮助文件中明明有这个例子 在global.jsa中使用
Calendar today = Calendar.getInstance();
application.setAttribute("today", today);
为什么我就不能在一个页面上设置呢。

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
12#
发表于 2002-6-11 19:45 | 只看该作者
oas使用的是apache jserver1.1(老的吐血),apache已經不再會升級jserver,而搞tomcat了

所以,呵呵。。。。。。

使用道具 举报

回复
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33会员2006贡献徽章
日期:2006-04-17 13:46:34
13#
 楼主| 发表于 2002-6-12 07:09 | 只看该作者
我这个是Oracle9i R2带的 WEB服务器,
不会说Oracle 反应这么迟钝吧。

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
14#
发表于 2002-6-12 09:29 | 只看该作者
很有可能!
getAttribute在oas上確實無效,但奇怪的是oas上的例子居然有,你可以查看一下。
我為什麼先前說可以,是因爲我在jdeveloper直接咝械睦?樱?鴍developer 9i内帶了一個oc4j。所以成功了~~~~,後來在oas上咝校?_實有問題,抱歉亂說話了。

因此,我建議不要使用oas的jserver,而使用oc4j。

因爲,oc4j沒有http server,所以需要和apache http server聯和使用

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
15#
发表于 2002-6-12 09:30 | 只看该作者
Oracle9i Application Server (Oracle9iAS) provides a fast, lightweight, highly scalable, and easy-to-use J2EE environment - Oracle9iAS Containers for J2EE (OC4J). OC4J is written entirely in Java and executes on the standard Java Development Kit (JDK) virtual machine. It provides a complete J2EE environment that includes a JSP translator and runtime, a Servlet engine, an Enterprise Java Beans (EJB) container and the rest of the J2EE services such as JNDI, JDBC, JMS. Oracle9iAS supports new and emerging technologies such as Web Services through the implementation of SOAP, WSDL, and UDDI standards.

使用道具 举报

回复
论坛徽章:
0
16#
发表于 2002-6-13 12:41 | 只看该作者
Java 程序中使用的 HttpSession 和 Apache WEB Server 无关。
和 Oracle 对 Java Servlet 规范实现有关。Java Servlet 规范是一个 jar 文件(servlet.jar),里面全部是 Java 接口类,而且 Java Servlet 规范有 2.0,2.1,2.2,2.3 等版本。你的问题可能是运行环境(classpath)中引入的是没有 get/setAttribute 等方法的版本的 servlet.jar

使用道具 举报

回复
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33会员2006贡献徽章
日期:2006-04-17 13:46:34
17#
 楼主| 发表于 2002-6-13 14:16 | 只看该作者
还是不对呀,我把Oracle9i R2的servlet.jar放入classpath,里面明明有setAttribute,getAttribute方法。但是在JSP文件中
    session.putValue("newName","GuoHui"; (OK)
    out.println(session.getValue("newName"); (OK)
    out.print(session.getAttribute("newName"); (no)

错误
99 Method getAttribute(java.lang.String) not found in interface javax.servlet.http.HttpSession. out.print(session.getAttribute("newName");  
下面是servlet的内容
// JBuilder API Decompiler stub source generated from class file
// 2002-6-13
// -- implementation of methods is not available

package javax.servlet.http;

// Imports
import java.lang.String;
import java.lang.Object;
import javax.servlet.http.HttpSessionContext;
import java.util.Enumeration;

public abstract interface HttpSession {

  // Methods
  Object getAttribute(String p0);
  Enumeration getAttributeNames();
  long getCreationTime();
  String getId();
  long getLastAccessedTime();
  int getMaxInactiveInterval();
  HttpSessionContext getSessionContext();
  Object getValue(String p0);
  String[] getValueNames();
  void invalidate();
  boolean isNew();
  void putValue(String p0, Object p1);
  void removeAttribute(String p0);
  void removeValue(String p0);
  void setAttribute(String p0, Object p1);
  void setMaxInactiveInterval(int p0);
}

使用道具 举报

回复
论坛徽章:
0
18#
发表于 2002-6-15 12:00 | 只看该作者
which Oracle IAS are you using?

9i AS 1.0.2.2:
OHS (Apache)->mod_jserv->JServ 1.1.2
OC4J standalone

9i AS 9.0.2:
OHS (Apache)->mod_oc4j->OC4J
last year, OC4J was adopted from orion which was regarded as the fastest and best pure java J2EE server

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表