File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes window without menu bar ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window without menu bar ..." Watch "window without menu bar ..." New topic
Author

window without menu bar ...

Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi,
I have a JSP page (page1.jsp)that is opened in a window with menu bar, button bar and Address field. In this JSP page, there is a form from which I submit another JSP page (page2.jsp).
I want page2.jsp opens in the same window as page1.jsp, but without menu bar, button bar and Address field in the window.
Can someone tell me how to do it?


Thanks,<br />Mike
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I really don't think this is possible. And more, I don't think it's wise either.
Can you tell us what you hope the benefit of hiding the commonly available button and address bars would be for the users your application?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Because page2.jsp is only used for user to input some data and submit the data. So I don't users to other buttons. After the data is submit, it will return to page1.jsp that has all the commonly used features.
Do you have some better ideas?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

The problem here is that you want to send the data to page2.jsp by submitting the form, whereas you can only remove the menus etc using the javascript 'window.open()' function.
All is not lost, you can submit to a page, have that page gather the data and call window.open and pass on the data in the url then close itself.
Again we run into the problem that you are doing this to stop the user from using the buttons, and in reality you can't. You can remove the back button but you can't stop someone from pressing 'alt-back arrow'. You can remove the refresh button but you can't disable 'control-R'.
It sounds like what you are trying to achieve is stopping users from reloading a page that is the result of a submitted form. When they do this, it resubmits the form and you get duplicated data.
The way I normally manage this is to have page1.jsp submit to a Servlet, the Servlet processes the data then does a response.sendRedirect to the confirmation page. If they reload, they simply reload the confirmation page withour breaking anything else.
Dave
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Another top trick for preventing duplicates which I hardly ever see used is to generate a unique "transaction number" in a hidden field of the form each time the form is sent to the client. Then if a user submits the form more than once (deliberately, or as a result of a page refresh, etc.) the server can recognize that the form with that "transaction number" has already been processed, and handle it appropriately.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is always the world of cookies if you want to do it client side.
There are problems with cookies not being enabled or person clearing them out, but an easy way around a server side solution.
Session Cookies are a great thing!!
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Thank you all for your useful input.
I have another question: when I update the data in the table, and refresh the page, I always get message like "This page cannot be refreshed without resending ....". Users have to press "Retry" so that the page can be reloaded.
Is it possible to get rid of this message or write code to do the same thing as clicking "Retry".
[ July 08, 2002: Message edited by: Mike Yu ]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
if you form is small, you coud use "GET" instead "POST" method - so form will be resubmitted without asking a user
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: window without menu bar ...
 
Similar Threads
populate the form field with the submitted input
Sending data to popup window
history.back() not retaining changed values in previous page after window.open() call
Difference Between Client side Redirect and Server Side Redirect
open a popup window of a pop up window from the parent window