和Application一样,采用JNDI进行定位访问:
1.部署,使用weblogic admin console或相关工具进行部署
2.jsp中
......
Properties properties = new Properties();
properties.put(Context.PROVIDER_URL,"t3://192.168.1.203:7001/");
properties.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
Context context = new InitialContext(properties);
Object ref = context.lookup("StudentSess");
StudentSessHome stuHome = (StudentSessHome) PortableRemoteObject.narrow(ref,StudentSessHome.class);
StudentSess stuSess = stuHome.create();
String ss = stuSess.getName();
......
1.部署,使用weblogic admin console或相关工具进行部署
2.jsp中
......
Properties properties = new Properties();
properties.put(Context.PROVIDER_URL,"t3://192.168.1.203:7001/");
properties.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
Context context = new InitialContext(properties);
Object ref = context.lookup("StudentSess");
StudentSessHome stuHome = (StudentSessHome) PortableRemoteObject.narrow(ref,StudentSessHome.class);
StudentSess stuSess = stuHome.create();
String ss = stuSess.getName();
......
解决方案 »
- struts1.2在action里面怎么取页面参数
- tomcat4做WEB SERVER,通过http://www.xxx.com域名访问,总是自动跳转到http://www.xxx.com/index.jsp
- struts2+json后的struts.xml配置问题
- Tomcat出错啊,启动不起来!求助
- 问题很麻烦.后果很严重
- 一个绝对非常有趣的问题,看谁能解答出来
- 各位: 请问找工作时 公司是否看重证书的威力? Java 程序员应该考哪个认证??
- 谁会配置jsp服务器?tomcat跟IIS结合。
- 求救
- Elastic Job Spring注入对象为空
- 又急,又迷惑!!!关于EJB服务端的理解!!!!!!,
- JBoss3.0.4和JB8集成开发问题
我想知道一些相关路径的问题,我的jsp不能显示。
难道你就只是拷贝过去吗 ?/???
而且jar包有它的位置的.
我的在我的应用目录下
可能你的web应用根本就没有起,写个简单的JSP程序能够显示吗?比如说hello world?