• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Using JFrame in Web App that runs on iSeries

 
Ranch Hand
Posts: 2025
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Websphere to develope web applications. These web apps run on our Application Server from AS400/iSeries machine.

So far all of my apps use JSP, servlets, and classes.

I would like to use a more graphical interface for my apps, maybe JFrame. I can develope the GUI and run it on my local machine(Windows) but when I try and run it on the app server(iSeries) I get a HeadlessException error. I have done all I know to do to get this to work like set headless property to true on the server.

Can someone lead me in the right direction.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things.

1. Your app server is probably not running an X-Windows subsystem so you can't do GUI stuff on it.
2. That isn't how you deliver Swing to the client anyway, so you don't have to worry about it.

You have two options when it comes to delivering Swing to client machines. Applets or JavaWebStart. Applets embed Swing into the web page, similar to how Flash works. With the latest and greatest JRE you can now drag applets out of the browser onto the desktop but I wouldn't get too caught up in that. Java Web Start uses an XML descriptor called a JNLP file to pull down the JAR files, cache them on the client machine and launch a window external to the browser. You are still in the same kind of security sandbox as an applet but you aren't tied to the browser anymore.
 
Steve Dyke
Ranch Hand
Posts: 2025
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Gregg Bolinger wrote:A few things.

1. Your app server is probably not running an X-Windows subsystem so you can't do GUI stuff on it.
2. That isn't how you deliver Swing to the client anyway, so you don't have to worry about it.

You have two options when it comes to delivering Swing to client machines. Applets or JavaWebStart. Applets embed Swing into the web page, similar to how Flash works. With the latest and greatest JRE you can now drag applets out of the browser onto the desktop but I wouldn't get too caught up in that. Java Web Start uses an XML descriptor called a JNLP file to pull down the JAR files, cache them on the client machine and launch a window external to the browser. You are still in the same kind of security sandbox as an applet but you aren't tied to the browser anymore.



Is there examples or something I can get started with on how to do this(Java Web Strart) within Websphere IDE?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly, there's nothing that special about it. You need to know how to do a few things which you aren't going to care about an IDE for anyway.

JAR your application
Sign your JAR (you can use a self cert)
Create the JNLP File
Dump somewhere on the server so that is is accessible via a link

http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/contents.html
 
Steve Dyke
Ranch Hand
Posts: 2025
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Gregg Bolinger wrote:Honestly, there's nothing that special about it. You need to know how to do a few things which you aren't going to care about an IDE for anyway.

JAR your application
Sign your JAR (you can use a self cert)
Create the JNLP File
Dump somewhere on the server so that is is accessible via a link

http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/contents.html



Hate to be a bother but I need to explain my intent to make sure this is going to end up okay. In my web app I make a connection to a remote database, populate a form, present it to user(JSP). The user makes changes and clicks submit which calls a servlet which calls a connection class which updates the data.

My intent is to substitute the JSP for JFrame GUI. Just so I can present the form in a better formated fashion.

Am I looking in the right direction?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
 
Paper beats rock. Scissors beats tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic