• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Replace Print Applet

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been trying to figure out how to replace a Java Applet we use to quickly print invoices so it uses Webstart instead. My question is, can you call a webstart java application and pass it a parameter from the browser? As an example, once an invoice has been completed and paid, when the user clicks a print link, we call(ed) the java applet and passed it a link to the pdf print of the invoice and it would simply send it to the default printer without asking any questions.

Since Google has killed Java today, we've been moving all of our customers to Firefox but worried that it's only a matter of time before they make the same dumb move and we need to find a solution.

P.S. If there is a way to accomplish a quick print method without JAVA I'm all ears. Been looking for that for years though so assuming it doesn't exist.

Thanks,

Glenn
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the information given my initial thought is why not load the invoice pdf in the browser and print it directly from the browser but I'm guessing the problem is much more involved than just printing a pdf.
Please can you give us full details of what you are trying to achieve.
 
Glenn Hancock
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So here is the deal.

To print inside the browser it requires the following steps: 1) click print icon 2) a page opens displaying the pdf 3) click print icon on page 4) click print icon on popup for printer 5) click close icon to close tab and return to app.

We have a business system that runs through the browser and 5 clicks to print every invoice is driving everyone crazy. We used to have a java applet that would allow the following 1) click print icon 2) pickup page on printer

The problem is, Google is playing Microsoft now and has to kill Java with nothing available to replace it just because they know whats good for me. So we're left in the past with nothing to dig out of all the dirt.

What I've done so far: 1) I converted my applet to an application. I added a jnlp file and the necessary java script to call it. However, I can't figure out how to send a parameter (url of pdf it needs to download and print) to the java application. I also can't figure out how to tell it to just run the application instead of bringing up a download page, waiting for it to download, clicking on the downloaded file at bottom of the page to open it and so on. It repeats this for every time you click print. So the guys claiming this is a work around to the JAVA destruction protocol that Google has started, either don't know what they are talking about or I'm missing a major element to the solution.

Thanks,

Glenn
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is Web Start is a deployment-via-the-web process not a means of running a desktop app from a browser ie If you click on a link to a jnlp file then it will start the download process again and not run the previously download app. This may not be the whole story and there may be ways to solve your issue but I'm not very experienced with web start so I will copy this thread to the web start forum in the hope someone there can help you.
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Glenn Hancock wrote:
The problem is, Google is playing Microsoft now and has to kill Java with nothing available to replace it just because they know whats good for me.


That is not true, Glenn. Google's not endorsing Microsoft with its choice to not support Java Plugin for Chrome anymore, simpy dropped support with NPAPI plugins, including Silverlight (which is a Microsoft technology).
We can only hope that Oracle will develop a PPAPI based plugin - which should be still supported for the foreseable future - not to save Applets but at least Java FX - too young to die (even if a number of people would reply that Java FX was born dead instead).
I have a problem very similar to yours. We developed years ago a simple Applet to download packages / updates of a client application on single PCs. I quickly converted it in a standalone application and used Java Web Start to distribute it. And it works.




 
Glenn Hancock
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off, Google dropping support of it might have been ok if there was something else to replace it. It would be akin to them dropping support for flash when Youtube still used it to play videos. If there isn't some other way to perform the task then what are you doing?

So to the point: I have (had) and applet that would allow one click printing from the browser. I was told that webstart was the proper way to deal with it but it appears web start is nothing more than a glorified download process for downloading a java app and then requiring the user to save it and run it if they wanted to run it. So its obviously useless for replacing any applet of any type.

So my question is, if that is not the proper method to use to replace applets then what is? Or did Google really destroy every application on the Internet without ever considering that we'd all be riding bikes to work afterwards?

Thanks,

Glenn
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Glenn Hancock wrote:Or did Google really destroy every application on the Internet ...


Hyperbole rarely accomplishes anything constructive. I've had Java applets disabled on my browsers for a long long time and have yet to come across any site or web app that was "destroyed" by it.

I would also argue that allowing a Java applet unfettered access to local printers is an act that needs blocking. The last thing anyone wants is some site that they visit to start printing spam on their printer.

Like it or not, applets are a dead technology and paying the price of a few extra clicks is the cost of increased security.
 
Glenn Hancock
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I apologize for the offending Hyperbole, however, there are many ways to deal with the issue of accessing a printer or even a JAVA module other than totally destroying its existence. For example, a way to not only turn Java on and off but to tell it specifically which sites it's able to operate on.

We have a business system app that was totally designed using HTML5 and AJAX and we used Java to access credit card systems, cash drawers, printers and the like. So yes, it totally destroyed our ability to service our customers and there apparently is nothing to replace it since no one has offered any alternatives.

Thanks,

Glenn
 
Glenn Hancock
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another quick example: We print barcode labels to a Zebra printer that requires us to send a raw print file. In order to do this we need to be able to find the printer on the computer and then send the raw printer file to it in order to have the labels printed. We again used a Java applet to perform this task and are left wondering, if not Java, then what?

Glenn
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't say I had a solution, I pointed out why these restrictions are being put into place. Security has become a huge deal on the Internet, and unfettered access to the client system (and insecure plugins in general) are being phased out. Whether that screws with apps that used to rely upon these plugins or not is less of a concern.



HTML5 has lots of hidden tricks and shadowy corners -- I keep finding out about new things I didn't know about every day -- perhaps there's something in there that you could use. Client system access has never been an area of concern or focus for me, so I personally don't know.

Failing that, yeah, it sounds like you may need to focus on webstart apps that connect back to the same server as your web app to perform actions that used to be supplied by the applet. Any information you need would have to come from the server in the same way that you used to send that info to the page with the applet.
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:
Failing that, yeah, it sounds like you may need to focus on webstart apps that connect back to the same server as your web app to perform actions that used to be supplied by the applet. Any information you need would have to come from the server in the same way that you used to send that info to the page with the applet.



And if possible I would install such Java standalone application on a centralized server, if possible,with all printers connected as network printers.
I agree with Bear about security issues.
 
Glenn Hancock
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem with webstart apps is that they don't actually start. They just seem to download and then if you want you can run them after they download. But I can't see a way to get one to actually fire off and allow you to pass in parameters to it. So unless I'm missing something I'm completely confused as to why anyone would call those things "WebStart" :-)

Am I incorrect in my opinion? If so, how do you get one to actually start automatically without all the "Where would you like to download" and then having to click it to actually run it?

Thanks,

Glenn
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this may depend on your browser and/or it's setup. If I launch a webstart application from the Java tutorial eg https://docs.oracle.com/javase/tutorial/uiswing/learn/index.html from Opera on my machine then I have to manually run the downloaded jnlp but when I click on the same link from Firefox it downloads the jnlp, runs it, downloads the application and starts the application.

BTW you can pass command line arguments to the application via jnlp. see: http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#application_desc
 
Greenhorn
Posts: 2
Postgres Database PHP Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

To resolve our problem (Applet to JNLP) we had some issues, all of them is not documented (yet):

We use Apache server with PHP, and the only way to pass parameters is construct dynamically jnlp file.

To solve problem with downloading and not executing, we remove url parameter from jnlp tag.

Give a try!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello, we are facing a similar issue with our application. Do we have any new solutions to this problem?
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic