和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();
......
我想知道一些相关路径的问题,我的jsp不能显示。
难道你就只是拷贝过去吗 ?/???
而且jar包有它的位置的.
我的在我的应用目录下
可能你的web应用根本就没有起,写个简单的JSP程序能够显示吗?比如说hello world?