将独立应用程序连接到web浏览器Java
我正在使用netbeans IDE开发一个独立的时间表调度系统,我想将输出(即创建的时间表)链接到web浏览器,以便用户登录后可以从那里查看。将独立应用程序连接到web浏览器Java,java,Java,我正在使用netbeans IDE开发一个独立的时间表调度系统,我想将输出(即创建的时间表)链接到web浏览器,以便用户登录后可以从那里查看。 我应该怎么做呢?编写一个服务,桌面和浏览器UI都可以以相同的方式访问。两者都可以显示相同的数据。您可以将逻辑封装在服务中,比如ScheduleService(或TimetableService)。假设您具有定义ScheduleService的以下接口: public interface ScheduleService { public List
我应该怎么做呢?编写一个服务,桌面和浏览器UI都可以以相同的方式访问。两者都可以显示相同的数据。您可以将逻辑封装在服务中,比如ScheduleService(或TimetableService)。假设您具有定义ScheduleService的以下接口:
public interface ScheduleService {
public List<Appointment> getAppointments(Date when);
public void setAppointment(Date when, Appointment appointment);
}
当然,对于WebService部分,您可能希望转换输出(通过JSP或XSLT)以生成HTML或任何其他输出格式。我的朋友“Dhiral Pandya”为他的大学项目开发浏览器可能会对您有所帮助
我的按钮是开源java web浏览器
为学校和学院的项目和学习目的而开发。
下载源代码extract.zip文件并将“mybutton”文件夹从“parser\mybutton”复制到C:\
在eclipse中导入项目“omtMyButton”。
需要Java6
下载.exe和源代码:
嘿……我有了另一个想法,还在研究如何去做。既然我在使用持久性,那么使用Servelet呢??但是我没有使用Glassfish的经验,所以我遇到了一些麻烦。servlet与持久性无关——它们是HTTP侦听器。当我说“服务”时,我没有说“肥皂”。您可以使用servlet编写REST服务。一旦有了它,就给它一个持久性类来处理数据库。
public class ScheduleServiceImpl implements ScheduleService {
public List<Appointment> getAppointments(Date when) {
// TODO: get list of appointments
}
public void setAppointment(Date when, Appointment appointment) {
// TODO: create appointment
}
}
public class ScheduleServiceWebServiceImpl implements ScheduleService {
ScheduleService realImplementation = new ScheduleServiceImpl();
public List<Appointment> getAppointments(Date when) {
return realImplementation.getAppointments(when);
}
public void setAppointment(Date when, Appointment appointment) {
realImplementation(when, appointment);
}
}
}