File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window without menu bar ...

 
Mike Yu
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mike Yu
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic