This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

How to pass control from Java program to HTML page?

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I'm sure this isn't the right Forum, but I think Streams might be necessary.
I've written a Java program that inputs a login and password, validates them by checking a file, and when valid I want to exit to an HTML page (or display an error). I'm hoping to use a reference in an HTML file to a JAR packaged file with the program(s) and file in (I've tried a previously written JAR package, and that seems to work on my PC - yet to be trialled on the website!)
Any ideas how I might exit the program and go to the HTML page?
All the best,
Kate!!
 
Bartender
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a JEditorPane to display the HTML. That way you wouldn't be dependent on external applications, and you can feed the HTML directly from your JAR.
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I read, you have an application that is running stand-alone with a GUI that asks for a username and password. After validating, you want an HTML page to come up, correct? Is there a webserver running, or something that can display webpages?
If not, then your application will need to create a frame to display the HTML page in. Follow this link to find out how to do that. So yup, you will be using a stream.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to call your class from a servlet or JSP page (which is a servlet behind the scenes). Those components have the ability to output HTML, as well as passing control to other JSP/Sevrlets or HTML pages.
This is a great book to learn more about these:
http://www.amazon.com/exec/obidos/ASIN/1930110596/jr%5Fbunk-20/002-4678376-1425667
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!