Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass control from Java program to HTML page?  RSS feed

 
Kate Head
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!!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X 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.
 
jason adam
Chicken Farmer ()
Ranch Hand
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.
 
Roger Graff
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 is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!