求教一个初学者的问题,在线等,比较急 看到你急,我也很急但是,我也不知道是怎么回事。你可以尝试跟踪进jsp文件,看看等等高手出现。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我反复尝试了所有的可能,去掉time.validate()就能正常浏览。当然了,去掉time.validate()说明jsp语句是没有问题的,但是加上这一句,页面就什么都没有,无论是将这一句放在if中,还是放在其他的任何地方,只要出现调用,if..else..就无法工作,不知道到底还判断不判断username.equals(""),我是第一次接触J2ee,过去只有一点j2se的开发经验,不知道怎么判断了还有,上述的例子是我根据《The J2EE Tutorials》里面的第一个范例写的,范例中只用了一个jsp页面,而我多加入了一个index.html,不知道如此一来是不是就影响了deploytool中部署的时候的某些配置继续等,希望大大们帮帮忙 在weblogic中,使用jndi查找得到一个session bean得实例是用如下方法: Context context = getInitialContext();//此方法在下面 Object ref = context.lookup("Enterprise1"); enterprise1Home = (Enterprise1Home) PortableRemoteObject.narrow(ref, Enterprise1.class); enterprise1 = enterprise1Home.create(); private Context getInitialContext() throws Exception { String url = "t3://stone:7001";//这是服务器地址 String user = null; String password = null; Properties properties = null; try { properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); properties.put(Context.PROVIDER_URL, url); if (user != null) { properties.put(Context.SECURITY_PRINCIPAL, user); properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password); } return new InitialContext(properties); } catch(Exception e) {."); throw e; } }声明:这是在weblogic中的做法。上面的方法中涉及到了一个属性设置,然而你的没有,不知是不是这的原因。下面是你的:InitialContext ic = new InitialContext();Object objRef = ic.lookup("java:comp/env/ejb/MyTimeTable");TimeTableHome home = (TimeTableHome)PortableRemoteObject.narrow( objRef,TimeTableHome.class); time = home.create(); 楼上的大哥,你说涉及的一个属性,是指getInitialContext中么?可是似乎InitialContext并不需要重载阿 我自己解决了我的问题,我设计的validate()方法可能是保留字或者是保留方法,或者是不能被重载,但是并不报错,在调用的时候可能调用了原有的方法,导致我的方法失效,或者是出现了编译器无法处理得异常,或者是未抛出的异常。这些事我能考虑到的情况,具体的做法。。很简单。。就把validate()更名就可以正常调用了,同时感谢各位帮助我的朋友,无论你们是否帮上了忙,仍然要谢谢你们关心 谁有好一些的JSF的教程啊? 急急~~~向DWR传递map返回map等对象 为何到了支付宝收银台页面出现了乱码 喜欢看书或着有好书的朋友来推荐下 j2ee开发环境 resin服务器找不到类的问题 weblogic使用问题? 在哪里下载struts eclipse中的ant问题 spring[i] 多数据源出错,好像是属性没有注入进去?大神帮忙看看,在线等。 eclipse下struts开发环境怎么配置 如何在jboss下配出一个web app?
Context context = getInitialContext();//此方法在下面 Object ref = context.lookup("Enterprise1");
enterprise1Home = (Enterprise1Home) PortableRemoteObject.narrow(ref, Enterprise1.class); enterprise1 = enterprise1Home.create(); private Context getInitialContext() throws Exception {
String url = "t3://stone:7001";//这是服务器地址
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties);
}
catch(Exception e) {
.");
throw e;
}
}
声明:这是在weblogic中的做法。
上面的方法中涉及到了一个属性设置,然而你的没有,不知是不是这的原因。下面是你的:InitialContext ic = new InitialContext();Object objRef = ic.lookup("java:comp/env/ejb/MyTimeTable");TimeTableHome home = (TimeTableHome)PortableRemoteObject.narrow(
objRef,TimeTableHome.class);
time = home.create();
可是似乎InitialContext并不需要重载阿