Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Popup JFrames open on server not, but need to open through web browser.

Posted on 2004-11-23
14
Medium Priority
?
272 Views
Last Modified: 2010-03-31
In my application, Java code is called in by a JSP Page, running on a server.  Exceptions and Error popup boxes which should display through the users browser are opening on the server, and the actual user never gets to see them.  The java code runs blind most of the time, and only needs to display errors and exceptions when, or if they occur.

I need to enclose these Exceptions, and error popups and route them for display for the user through their browser.

I used swing classes ( Jframe, Jpanel, etc)  to build the popups, and they work very well, but only when the application runs locally.

Can you help suggest a way to make this happen?

Stuart
0
Comment
Question by:milspecs
  • 7
  • 5
12 Comments
 
LVL 92

Expert Comment

by:objects
ID: 12659193
jsp pages are executed on the server so that would be expected.
You should instead be adding the appropriate html to the response to display the error to the user.
0
 

Author Comment

by:milspecs
ID: 12659761
I'm new to the idea of JSP pages... I have limited experience with them, I'm looking for a way to help reengineer the error and exception output from the java code, so that it can appear on the browser rather than at the server, and do not have a good handle on exactly how to do that.

Is there a simple example that can be passed my way that would open a new window, and display my current output?

--- Milspecs
0
 
LVL 92

Expert Comment

by:objects
ID: 12659801
perhaps use some javascript to popup an alert when the page loads.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:milspecs
ID: 12660151
I suppose... I'll look into using an alert, but had hoped to get some of the original look of the Exception and Error popups into the display.

Can an alert function like a wrapper of sorts?

Stuart...
0
 
LVL 92

Expert Comment

by:objects
ID: 12660181
>  but had hoped to get some of the original look of the Exception and Error popups into the display.

then you'll need to use an applet or something that provides the capability your require

> Can an alert function like a wrapper of sorts?

what do you mean?
0
 

Author Comment

by:milspecs
ID: 12660498
The Exception Frames for example  take parameters, and display exceptions in small windows with scroll bars, on a colored background, with explainiation text, etc.

If I could mimic this, and make it look similar to the existing codes, it would be easier for the existing users to understand, and would more closely match their documents.

How would I invoke an applet?

Can alert display a complex object, for example a whole frame and it's contents, can It simply wrap around an existing body of display code, or does it just do text?
0
 
LVL 92

Expert Comment

by:objects
ID: 12660521
http://java.sun.com/docs/books/tutorial/applet/index.html

not sure how practical an applet would be though, as the load time may mean the error popup appears a little after the page has completed loading.
0
 

Author Comment

by:milspecs
ID: 12660885
I must be completely out in left field, and not thinking about this right.....

If I am running code on the server, from a client machine somewhere else, is it even possible to open a second window on the client machine under program control, and fill it with anything.

is there some sort of replacement for the JFrame that is web sensitive, a "JWebFrame" as it were that performs the same sort of function as a JFrame, but instead of going directly to the local system, reaches out to where it can open a browser window.

--- Stuart
0
 
LVL 92

Expert Comment

by:objects
ID: 12660902
not without using an applet, and it will riun on the client not the server.
0
 

Author Comment

by:milspecs
ID: 12660983
This is obviously much more complicated than I thought...

Is it possible to have an applet the responds to commands given by application the server.  Could it for example take an object as a command/parameter, and perform some task.  I'm thinking that the way to do this could be to create an applet that listens, and dispatch it objects geared to perform specific funtions.  It would have to listen for requests, and perform the operations.

I had hoped for a simple wrapper that would just allow me to abstract the creating of a window across environments, since most do not require anything but simply to be displayed.

-- Stuart
0
 
LVL 92

Expert Comment

by:objects
ID: 12661011
the applet would need to connect to the server (using a Socket for example) to achieve that.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 12732585
Personally I wouldn't recomend using an applet for this due to the load time involved.
The page will load first, followed by the applet which would not be clear to the user.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question