3

A Java EE application is been developed with JPA and JSF. But it needs advanced printing (like changing the printer and paper depending on requirements without bringing the PrintDialog) and sending fax. A simple Java SE application, running in each client machine, can be developed using Java SE to meet those specific requirements. Is there any way the Web browser can communicate with a Java SE application.

I thought of:

  1. If a XML file is downloaded to a folder where there is the Java SE application which can search to extract the data periodically from newly downloaded XML files, but the download location varies frequently.
  2. Develop a Java Applet,

But not sure about the practicality of the above scenarios.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Buddhika Ariyaratne
  • 2,339
  • 6
  • 51
  • 88
  • This question is too vague to be answered correctly. Are your clients all in the same organization? Do you have control over the types of printers (if they are postscript & networked, you could print directly from the JEE server and set the paper type etc from within the print job). – Tassos Bassoukos Apr 02 '13 at 10:48
  • 1
    This question is likely yo be closed because it'll result in debate, but I'll proffer some recommendations – kolossus Apr 02 '13 at 10:50
  • The clients are distributed over a province. They access the application through internet. The server is GlassFish server running in a vertual server. – Buddhika Ariyaratne Apr 02 '13 at 10:56

2 Answers2

4

There are a number of options but first among them is the web service option. This is what webservices were meant to solve I.e. bridging the gap between disconnected components.

  1. Taking a look at this answer, you can develop a lightweight web service in JavaSE that wraps the desired functionality

  2. Another option you may explore is the embedded Java EE container. Look at this intro to embedded container development to get you started. While it's similar to option 1, here you get a slightly richer feature set with injection, security and container managed transactions

  3. The spring framework is built to run outside of a container so you'll easily get it's full feature set in a humble JavaSE environment. Within spring, your options for distributed computing are numerous. At the bare minimum, you'll gain a managed context(similar to what you'll get from 2. Above, and also services to plug components of a distributed framework together (JMS, Spring-Ws)

Community
  • 1
  • 1
kolossus
  • 20,559
  • 3
  • 52
  • 104
  • @BuddhikaAriyaratne, that's weird because I can reach it. Just Google "oracle jee6 tutorial" and head for using the embedded container section – kolossus Apr 02 '13 at 11:02
3

Another option would be to put that logic in a Java application and launch it on the client's PC via the web application using Java Web Start. That way, you can keep your web application as it is and then launch the web start application for just the print functionality you want?

EdH
  • 4,918
  • 4
  • 24
  • 34