Re: Browser Back button intercept, no javascript

2022-01-26 Thread Lukasz Lenart
It won't be possible to detect that the given request reached your
application because a user hit the Back button. There is no indication
in HTTP protocol that could tell you so.

Regards
Łukasz

wt., 25 sty 2022 o 22:58 albert kao  napisał(a):
>
> If the user presses the Back button of a browser, my application likes to
> intercept that and display a text message at the current web page.
> How to do that without using javascript?
>
> The following codes show an approach with AbstractInterceptor.
> Please review whether it will work.
> If yes, how to get the flag or value that the Back button of a browser was
> pressed?
> If not, please suggest alternatives.
> Thanks.
>
>
> import java.util.Map;
>
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpSession;
>
> import org.apache.struts2.StrutsStatics;
>
> import com.opensymphony.xwork2.ActionContext;
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
>
>
> public class MyInterceptor extends AbstractInterceptor {
> private Map session;
>
> @Override
> public class MyInterceptor extends AbstractInterceptor {
> private Map session;
>
> @Override
> public String intercept(ActionInvocation invocation) throws Exception {
>final ActionContext context = invocation.getInvocationContext();
>session = context.getSession();
>HttpServletRequest request = (HttpServletRequest);
>   context.get(StrutsStatics.HTTP_REQUEST);
>HttpSession httpSession = request.getSession(true);
>
>synchronized (httpSession) {
>//...
>}
>   }
> }
>
> Struts version is 2.5.26.
>
> 
> Virus-free.
> www.avg.com
> 
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Browser Back Button

2007-01-10 Thread Chetan Pandey
Hi Chris:

 What browser are you using? Is your setup action being executed again,
 or is the browser serving the page from the cache? If the browser is not
 contacting the server, there's nothing you can do.

I am using IE 7.0.

Regarding contacting the server, something very weird is happening.

If my execute method has the following line:

request.getSession().setAttribute(eventForm, new EventForm() );

It will contact the Server - as all debug statements are printed.

However, if I remove this one line, then it doesn't contact the server and
fetches everything from cache - since no debug statement is printed.

I have checked other places also. Clicking back button doesn't go to the
server. Since no debug statement is printed.

Only the presence of the above line makes a weird difference.



Chetan Pandey wrote:
 To avoid this problem I introduced the following
 request.getSession().setAttribute(eventForm, new EventForm()).

If you are using Struts form beans, it might be better to blank the
existing bean instead of creating a new one. Something like this:

EventForm ef = (EventForm)form;

ef.setFoo(null);
ef.setBar(null);
// etc.

It didn't help. Still went to the Server.

 I go to the form page and then click add. It goes to the Preview page.
 Everything shows perfectly. Now I click on the Back Button. Lo and Behold
 ! The Add Fields are all empty.

What browser are you using? Is your setup action being executed again,
or is the browser serving the page from the cache? If the browser is not
contacting the server, there's nothing you can do.

 (Actually, that's not true... if you are using javascript to do some
funny things with the form, submission, etc., then you are likely
causing your own problems. If, however, your form is standard then the
browser /should/ be keeping the form data there if you do a SUBMIT
followed by a BACK).

If the browser /is/ contacting the server, then you need to look at what
is happening in your action. For instance, if the above code is running,
then /of course/ you are ending up with a blank bean.

One way around this would be to put an action /in front/ of the editing
action that blanks any existing form bean and then redirects (not
forwards) to the editing action (which does /not/ blank the bean). In
this case, you'll get a fresh bean for editing, but pressing BACK will
result in the user returning to the edit action instead of the
blank-and-then-edit action. Of course, if the user presses BACK twice,
then you'll get a blank bean again. ;)

Hope that helps,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo8Iu9CaO5/Lv0PARAtAHAJ9RkZfhNyjOdMttiFmuaO9m7TW74ACeLKxB
jStpytMzn+2l6dPLELV//lo=
=qP9A
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Thanks. 

Chetan




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button

2007-01-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chetan,

Chetan Pandey wrote:
 To avoid this problem I introduced the following
 request.getSession().setAttribute(eventForm, new EventForm()).

If you are using Struts form beans, it might be better to blank the
existing bean instead of creating a new one. Something like this:

EventForm ef = (EventForm)form;

ef.setFoo(null);
ef.setBar(null);
// etc.

 I go to the form page and then click add. It goes to the Preview page.
 Everything shows perfectly. Now I click on the Back Button. Lo and Behold
 ! The Add Fields are all empty.

What browser are you using? Is your setup action being executed again,
or is the browser serving the page from the cache? If the browser is not
contacting the server, there's nothing you can do.

(Actually, that's not true... if you are using javascript to do some
funny things with the form, submission, etc., then you are likely
causing your own problems. If, however, your form is standard then the
browser /should/ be keeping the form data there if you do a SUBMIT
followed by a BACK).

If the browser /is/ contacting the server, then you need to look at what
is happening in your action. For instance, if the above code is running,
then /of course/ you are ending up with a blank bean.

One way around this would be to put an action /in front/ of the editing
action that blanks any existing form bean and then redirects (not
forwards) to the editing action (which does /not/ blank the bean). In
this case, you'll get a fresh bean for editing, but pressing BACK will
result in the user returning to the edit action instead of the
blank-and-then-edit action. Of course, if the user presses BACK twice,
then you'll get a blank bean again. ;)

Hope that helps,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo8Iu9CaO5/Lv0PARAtAHAJ9RkZfhNyjOdMttiFmuaO9m7TW74ACeLKxB
jStpytMzn+2l6dPLELV//lo=
=qP9A
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button

2006-05-16 Thread temp temp
Can I use struts token  mechanisim without a formbean ?
Thanks  Regards
  
Manfred Wolff [EMAIL PROTECTED] wrote:  
Found at http://husted.com/struts/catalog.html


Use the Action Token methods to prevent duplicate submits

There are methods built into the Struts action to generate one-use
tokens. A token is placed in the session when a form is populated and
also into the HTML form as a hidden property. When the form is returned,
the token is validated. If validation fails, then the form has already
been submitted, and the user can be apprised.

* saveToken(request)
* /on the return trip,/
  o isTokenValid(request)
  o resetToken(request)

Perhaps someone (me?) must write a documentation? If I have a little
time, and no has do so, I will do.

Manfred


temp temp wrote:
 Can U suggets me an article which clearly explains using struts  tokens  
 mechanisim?

 Manfred Wolff  wrote:  
 Lixin.

 I think mostly it is no problem to go back in a struts implemented
 application. If it ist a problem (e.g. after a logout or if you saved
 data) you can take the struts token mechanism to prevend such backs.

 Manfred

 Lixin Chu wrote:
   
 A cleaner back button solution is almost a must-have for logout:
 after logout, the back button should not bring back the previous page.

 looking at that Gmail does. any idea how it is implemented ?

 


   


-- 
===
Dipl.-Inf. Manfred Wolff
Software Engineer
Fon  : +49 421 534522
Fax  : +49 421 4314578
Mobil: +49 173 2494181
---
http://www.manfred-wolff.de
http://www.struts-it.org
---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: Browser Back Button

2006-05-15 Thread Lixin Chu

A cleaner back button solution is almost a must-have for logout:
after logout, the back button should not bring back the previous page.

looking at that Gmail does. any idea how it is implemented ?


Re: Browser Back Button

2006-05-15 Thread Manfred Wolff

Lixin.

I think mostly it is no problem to go back in a struts implemented
application. If it ist a problem (e.g. after a logout or if you saved
data) you can take the struts token mechanism to prevend such backs.

Manfred

Lixin Chu wrote:
 A cleaner back button solution is almost a must-have for logout:
 after logout, the back button should not bring back the previous page.

 looking at that Gmail does. any idea how it is implemented ?



-- 
===
Dipl.-Inf. Manfred Wolff
Software Engineer
Fon  : +49 421 534522
Fax  : +49 421 4314578
Mobil: +49 173 2494181
---
http://www.manfred-wolff.de
http://www.struts-it.org
---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button

2006-05-15 Thread temp temp
Can U suggets me an article which clearly explains using struts  tokens  
mechanisim?

Manfred Wolff [EMAIL PROTECTED] wrote:  
Lixin.

I think mostly it is no problem to go back in a struts implemented
application. If it ist a problem (e.g. after a logout or if you saved
data) you can take the struts token mechanism to prevend such backs.

Manfred

Lixin Chu wrote:
 A cleaner back button solution is almost a must-have for logout:
 after logout, the back button should not bring back the previous page.

 looking at that Gmail does. any idea how it is implemented ?



-- 
===
Dipl.-Inf. Manfred Wolff
Software Engineer
Fon  : +49 421 534522
Fax  : +49 421 4314578
Mobil: +49 173 2494181
---
http://www.manfred-wolff.de
http://www.struts-it.org
---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

Re: Browser Back Button

2006-05-15 Thread Manfred Wolff

Found at http://husted.com/struts/catalog.html


Use the Action Token methods to prevent duplicate submits

There are methods built into the Struts action to generate one-use
tokens. A token is placed in the session when a form is populated and
also into the HTML form as a hidden property. When the form is returned,
the token is validated. If validation fails, then the form has already
been submitted, and the user can be apprised.

* saveToken(request)
* /on the return trip,/
  o isTokenValid(request)
  o resetToken(request)

Perhaps someone (me?) must write a documentation? If I have a little
time, and no has do so, I will do.

Manfred


temp temp wrote:
 Can U suggets me an article which clearly explains using struts  tokens  
 mechanisim?

 Manfred Wolff [EMAIL PROTECTED] wrote:  
 Lixin.

 I think mostly it is no problem to go back in a struts implemented
 application. If it ist a problem (e.g. after a logout or if you saved
 data) you can take the struts token mechanism to prevend such backs.

 Manfred

 Lixin Chu wrote:
   
 A cleaner back button solution is almost a must-have for logout:
 after logout, the back button should not bring back the previous page.

 looking at that Gmail does. any idea how it is implemented ?

 


   


-- 
===
Dipl.-Inf. Manfred Wolff
Software Engineer
Fon  : +49 421 534522
Fax  : +49 421 4314578
Mobil: +49 173 2494181
---
http://www.manfred-wolff.de
http://www.struts-it.org
---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button

2006-05-12 Thread temp temp
I am not clear using tokens How to use tokens to determine that user clicked on 
browser back button ?
  Thanks  Regards

Rob Manthey [EMAIL PROTECTED] wrote:  And I'll be contrary and toss in a 
Yes, but ... (apol: Eric Berne) 
(as usual, corrections to my notes are welcome)
Yes, but you have to do it programmatically.  I don't think there's
anything in j2ee (or any other web app) interfaces or implementations
that handles this, as Phil said, so you have to make it happen by using
tokens and hand-written code etc etc.   Unless you are progamming a
bank's online faciliity or a www air traffic controller, try not to go
this way (I've done one - it was fairly easy in retrospect but adds a
moderately painful comprehensibility and navigation burden to the app,
so I'm not advising it as a first choice).  Safer to abide by available
technologies and their proper application, as Phil was saying. 
The Back button and serverside webapps *naturally* clash if you provide
no specific code to handle it - *you* have to anticipate that and
program around that reality, from as early as possible in the dev
cycle.  Worse is that the implementation of behaviour of Back by
different browsers is quite different, some taking the purely snapshot
view, others taking the resubmit the url policy ... so there is great
variation in outcomes!
Unfortunately a lot of developers coming from passive web page
development (where Back works perfectly every time) don't realise that
there's a problem until they've completed their first decent size active
serverside web app and someone (usually the customer) says but it
breaks if I click *Back*.
This question was popped here a week ago ... perhaps we need an
auto-responder!
 Rob

Philihp Busby wrote:

 No.

 When people have a problem with back buttons, 95% of the time they are
 either doing one of the following:
 - Confusing the GET and POST methods and their intended purpose with
 forms.
 - Abusing client-side browser scripting for forwarding users.

 On 5/11/06, temp temp  wrote:

 Is there  any way I can  realize  using java that the user
 clicked on browsers back button  ?
   Thanks  Regards



 -
 Yahoo! Mail goes everywhere you do.  Get it on your phone.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.

-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: Browser Back Button

2006-05-12 Thread Rauf Khan

Hi,

  For browser back button solution through javascript, please see this
link.

http://www.webdeveloper.com/forum/showthread.php?t=93935

Regards
Rauf Khan


On 5/12/06, temp temp [EMAIL PROTECTED] wrote:


I am not clear using tokens How to use tokens to determine that user
clicked on browser back button ?
Thanks  Regards

Rob Manthey [EMAIL PROTECTED] wrote:  And I'll be contrary
and toss in a Yes, but ... (apol: Eric Berne)
(as usual, corrections to my notes are welcome)
Yes, but you have to do it programmatically.  I don't think there's
anything in j2ee (or any other web app) interfaces or implementations
that handles this, as Phil said, so you have to make it happen by using
tokens and hand-written code etc etc.   Unless you are progamming a
bank's online faciliity or a www air traffic controller, try not to go
this way (I've done one - it was fairly easy in retrospect but adds a
moderately painful comprehensibility and navigation burden to the app,
so I'm not advising it as a first choice).  Safer to abide by available
technologies and their proper application, as Phil was saying.
The Back button and serverside webapps *naturally* clash if you provide
no specific code to handle it - *you* have to anticipate that and
program around that reality, from as early as possible in the dev
cycle.  Worse is that the implementation of behaviour of Back by
different browsers is quite different, some taking the purely snapshot
view, others taking the resubmit the url policy ... so there is great
variation in outcomes!
Unfortunately a lot of developers coming from passive web page
development (where Back works perfectly every time) don't realise that
there's a problem until they've completed their first decent size active
serverside web app and someone (usually the customer) says but it
breaks if I click *Back*.
This question was popped here a week ago ... perhaps we need an
auto-responder!
Rob

Philihp Busby wrote:

 No.

 When people have a problem with back buttons, 95% of the time they are
 either doing one of the following:
 - Confusing the GET and POST methods and their intended purpose with
 forms.
 - Abusing client-side browser scripting for forwarding users.

 On 5/11/06, temp temp  wrote:

 Is there  any way I can  realize  using java that the user
 clicked on browsers back button  ?
   Thanks  Regards



 -
 Yahoo! Mail goes everywhere you do.  Get it on your phone.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
countries) for 2¢/min or less.

-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save
big.



RE: Browser Back Button

2006-05-12 Thread George.Dinwiddie
I strongly recommend AGAINST that technique.

1. It's very narrow and easily circumvented (by turning off javascript, by 
opening an new window or tab instead of leaving the page you might want to come 
back to).

2. It's very user un-friendly.  It's against W3C recommendations.  It breaks 
the web paradigm.

In my opinion, it's better to learn to create web-apps that don't have an issue 
with the back button than to patch bad apps with bad bandaids such as that.

 - George Dinwiddie
   http://www.idiacomputing.com/

 -Original Message-
 From: Rauf Khan [mailto:[EMAIL PROTECTED] 
 Sent: Friday, May 12, 2006 9:31 AM
 To: Struts Users Mailing List
 Subject: Re: Browser Back Button
 
 
 Hi,
 
For browser back button solution through javascript, 
 please see this link.
 
  http://www.webdeveloper.com/forum/showthread.php?t=93935
 
 Regards
 Rauf Khan
 
 
 On 5/12/06, temp temp [EMAIL PROTECTED] wrote:
 
  I am not clear using tokens How to use tokens to determine 
 that user 
  clicked on browser back button ? Thanks  Regards
 
  Rob Manthey [EMAIL PROTECTED] wrote:  And I'll be 
  contrary and toss in a Yes, but ... (apol: Eric Berne) (as usual, 
  corrections to my notes are welcome) Yes, but you have to do it 
  programmatically.  I don't think there's anything in j2ee (or any 
  other web app) interfaces or implementations that handles this, as 
  Phil said, so you have to make it happen by using
  tokens and hand-written code etc etc.   Unless you are progamming a
  bank's online faciliity or a www air traffic controller, 
 try not to go 
  this way (I've done one - it was fairly easy in retrospect 
 but adds a 
  moderately painful comprehensibility and navigation burden 
 to the app, 
  so I'm not advising it as a first choice).  Safer to abide by 
  available technologies and their proper application, as Phil was 
  saying. The Back button and serverside webapps *naturally* clash if 
  you provide no specific code to handle it - *you* have to 
 anticipate 
  that and program around that reality, from as early as 
 possible in the 
  dev cycle.  Worse is that the implementation of behaviour 
 of Back by 
  different browsers is quite different, some taking the purely 
  snapshot view, others taking the resubmit the url policy ... so 
  there is great variation in outcomes! Unfortunately a lot of 
  developers coming from passive web page development (where 
 Back works 
  perfectly every time) don't realise that there's a problem until 
  they've completed their first decent size active serverside web app 
  and someone (usually the customer) says but it breaks if I click 
  *Back*. This question was popped here a week ago ... 
 perhaps we need 
  an auto-responder!
  Rob
 
  Philihp Busby wrote:
 
   No.
  
   When people have a problem with back buttons, 95% of the 
 time they 
   are either doing one of the following:
   - Confusing the GET and POST methods and their intended 
 purpose with 
   forms.
   - Abusing client-side browser scripting for forwarding users.
  
   On 5/11/06, temp temp  wrote:
  
   Is there  any way I can  realize  using java 
 that the user
   clicked on browsers back button  ?
 Thanks  Regards
  
  
  
   -
   Yahoo! Mail goes everywhere you do.  Get it on your phone.
  
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  -
  Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the 
 US (and 30+
  countries) for 2¢/min or less.
 
  -
  New Yahoo! Messenger with Voice. Call regular phones from 
 your PC and 
  save big.
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button

2006-05-11 Thread Philihp Busby

No.

When people have a problem with back buttons, 95% of the time they are
either doing one of the following:
- Confusing the GET and POST methods and their intended purpose with forms.
- Abusing client-side browser scripting for forwarding users.

On 5/11/06, temp temp [EMAIL PROTECTED] wrote:

Is there  any way I can  realize  using java that the user clicked on 
browsers back button  ?
  Thanks  Regards



-
Yahoo! Mail goes everywhere you do.  Get it on your phone.



Re: Browser Back Button

2006-05-11 Thread Rob Manthey
And I'll be contrary and toss in a Yes, but ... (apol: Eric Berne) 
(as usual, corrections to my notes are welcome)
Yes, but you have to do it programmatically.  I don't think there's
anything in j2ee (or any other web app) interfaces or implementations
that handles this, as Phil said, so you have to make it happen by using
tokens and hand-written code etc etc.   Unless you are progamming a
bank's online faciliity or a www air traffic controller, try not to go
this way (I've done one - it was fairly easy in retrospect but adds a
moderately painful comprehensibility and navigation burden to the app,
so I'm not advising it as a first choice).  Safer to abide by available
technologies and their proper application, as Phil was saying. 
The Back button and serverside webapps *naturally* clash if you provide
no specific code to handle it - *you* have to anticipate that and
program around that reality, from as early as possible in the dev
cycle.  Worse is that the implementation of behaviour of Back by
different browsers is quite different, some taking the purely snapshot
view, others taking the resubmit the url policy ... so there is great
variation in outcomes!
Unfortunately a lot of developers coming from passive web page
development (where Back works perfectly every time) don't realise that
there's a problem until they've completed their first decent size active
serverside web app and someone (usually the customer) says but it
breaks if I click *Back*.
This question was popped here a week ago ... perhaps we need an
auto-responder!
 Rob

Philihp Busby wrote:

 No.

 When people have a problem with back buttons, 95% of the time they are
 either doing one of the following:
 - Confusing the GET and POST methods and their intended purpose with
 forms.
 - Abusing client-side browser scripting for forwarding users.

 On 5/11/06, temp temp [EMAIL PROTECTED] wrote:

 Is there  any way I can  realize  using java that the user
 clicked on browsers back button  ?
   Thanks  Regards



 -
 Yahoo! Mail goes everywhere you do.  Get it on your phone.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Re: Browser back button

2006-03-14 Thread struts lover
Hi Frank,
   
  Thanks for your reply. That solves my problem of back button or other key on 
the keyboard. But I still have the problem with the browser back button. I am 
using Tiles.
   
  It would be nice if you can provide any pointers.
   
  Thanks.

Frank W. Zammetti [EMAIL PROTECTED] wrote:
  Marked OT... this isn't Struts-related...

There isn't any way to do it cross-browser that I am aware of, and there 
isn't any way to do it definitively. However, because you say you are 
working on an Intranet application, you may have some options that you 
otherwise might not...

First thing, spawn a new window for you app with no chrome. This will 
remove the Back button, and the menus that will allow you to access it, 
leaving just keyboard shortcuts.

If you can develop for IE-only, here's something I have found works... 
throw this in your onLoad handler...

document.onkeydown=function(e){if(event.srcElement.type=='text'||event.srcElement.type=='textarea'){return
 
true;}else{return false;}};

This will block the back shortcut. Amazingly, it also seems to block 
reload, and mouse clicks (i.e., if you have the middle mouse button 
mapped to back, as I do). In other words, it seems to pretty well block 
everything that you might be interested in blocking :) But again, it 
is IE-only.

Don't forget too that many will argue that this is terrible web design. 
I happen to disagree, but there are very reasonable arguments to make 
that this is a bad idea. Make sure it's what you really want and need.

Frank

struts lover wrote:
 Hi,
 
 I am using Struts and Tiles for an intranet application. I want to disable 
 the back button.
 
 How can I achieve this?
 
 Any help would be appreciated.
 
 Thanks
 
 
 -
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

Re: [OT] Re: Browser back button

2006-03-14 Thread Frank W. Zammetti
You have to open your application in a chromeless window.  Since you said
the Javascript solved your keyboard problem, you are obviously working in
an IE-only environment, so here's how to do it... Your app must start with
a single page, say index.jsp, which will be:

%@ page language=java session=false %
html
head
titleMy App/title
script
  function openWindow() {
var agt = navigator.userAgent.toLowerCase();
var isMajor = parseInt(navigator.appVersion);
var isMinor = parseFloat(navigator.appVersion);
var isIE = ((agt.indexOf(msie) != -1)  (agt.indexOf(opera) == -1));
var isIE3 = (isIE  (isMajor  4));
var isIE4 = (isIE  (isMajor == 4)  (agt.indexOf(msie 4) != -1) );
var isIE5 = (isIE  (isMajor == 4)  (agt.indexOf(msie 5.0) != -1) );
var isIE55Up = (isIE  !isIE3  !isIE4  !isIE5);
if (isIE55Up) {
  strContent = ;
  strContent = strContent +  br;
  strContent = strContent +  table width=\80%\ cellpadding=\10\  +
cellspacing=\2\ border=\2\ align=\center\;
  strContent = strContent +   tr;
  strContent = strContent +td align=\center\;
  strContent = strContent +
New window should be open, you can do what you want with this one.;
  strContent = strContent +/td;
  strContent = strContent +   /tr;
  strContent = strContent +  /table;
  document.getElementById(Content).innerHTML = strContent;
  desiredWidth = 1180;
  desiredHeight = 936;
  myLeft = (screen.width) ? (screen.width - desiredWidth ) / 2 : 0;
  myTop = (screen.height) ? (screen.height - desiredHeight ) / 2 : 0;
  myOpts = resizable,scrollbars,width=desiredWidth
,height=desiredHeight ,top= + myTop +
,left= + myLeft + ,;
  window.open('index1.jsp', 'MYAPP', myOpts);
}
  }
/script
/head
body onload=openWindow();
div id=Content
 br
 table width=80% cellpadding=10 cellspacing=2 border=2
align=center
  tr
   td align=center
Your browser is not IE, or Javascript is not enabled.  Either way, go
away!
   /td
  /tr
 /table
/div
/body
/html

Change desiredWidth and desiredHeight to the size you want the window to
be.  This will open index1.jsp into a new window with no buttons, menus,
status bar, etc.  This also centers the window upon opening it, something
I generally like.  It also ensures the browser is IE 5.5 or higher.  You
can change that accordingly if you need to support older versions, or want
to further limit it to 6.0+ for instance.

That's all there is to it... this, plus the Javascript from yesterday,
gets you about as close to full control as you can probably reasonably
hope to get.  As long as your OK in an IE-only world, it's pretty nice. 
I'm sure it's not fullproof, but it's more than adequate for typical
users.  Throw in a right-click blocking function and it's pretty good.

(If anyone can duplicate both these things with FF, that would be
fantastic... the chromeless window probably isn't a big deal, but my gut
tells me blocking the back functionality wouldn't be as easy, if possible
at all).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, March 14, 2006 11:37 am, struts lover said:
 Hi Frank,

   Thanks for your reply. That solves my problem of back button or other
 key on the keyboard. But I still have the problem with the browser back
 button. I am using Tiles.

   It would be nice if you can provide any pointers.

   Thanks.

 Frank W. Zammetti [EMAIL PROTECTED] wrote:
   Marked OT... this isn't Struts-related...

 There isn't any way to do it cross-browser that I am aware of, and there
 isn't any way to do it definitively. However, because you say you are
 working on an Intranet application, you may have some options that you
 otherwise might not...

 First thing, spawn a new window for you app with no chrome. This will
 remove the Back button, and the menus that will allow you to access it,
 leaving just keyboard shortcuts.

 If you can develop for IE-only, here's something I have found works...
 throw this in your onLoad handler...

 document.onkeydown=function(e){if(event.srcElement.type=='text'||event.srcElement.type=='textarea'){return
 true;}else{return false;}};

 This will block the back shortcut. Amazingly, it also seems to block
 reload, and mouse clicks (i.e., if you have the middle mouse button
 mapped to back, as I do). In other words, it seems to pretty well block
 everything that you might be interested in blocking :) But again, it
 is IE-only.

 Don't forget too that many will argue that this is terrible web design.
 I happen to disagree, but there are very reasonable arguments to make
 that this is a bad idea. Make sure it's what you really want and need.

 Frank

 struts lover wrote:
 Hi,

 I am using Struts and Tiles for an intranet application. I want to
 

Re: [OT] Re: Browser back button

2006-03-14 Thread Frank W. Zammetti
I should also mention, you will probably want to have a check in all other
pages/Actions that looks for some session variable that only gets sets on
this page... if it isn't found, redirect here.  That way, people can't
jump into any page in your app they want.

And again, I have to say, some people really disagree with things like
this because it runs counter to typical web development.  Make sure it's
appropriate for your situation and environment before tossing out the
prevailing wisdom like this.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, March 14, 2006 12:00 pm, Frank W. Zammetti said:
 You have to open your application in a chromeless window.  Since you said
 the Javascript solved your keyboard problem, you are obviously working in
 an IE-only environment, so here's how to do it... Your app must start with
 a single page, say index.jsp, which will be:

 %@ page language=java session=false %
 html
 head
 titleMy App/title
 script
   function openWindow() {
 var agt = navigator.userAgent.toLowerCase();
 var isMajor = parseInt(navigator.appVersion);
 var isMinor = parseFloat(navigator.appVersion);
 var isIE = ((agt.indexOf(msie) != -1)  (agt.indexOf(opera) ==
 -1));
 var isIE3 = (isIE  (isMajor  4));
 var isIE4 = (isIE  (isMajor == 4)  (agt.indexOf(msie 4) != -1)
 );
 var isIE5 = (isIE  (isMajor == 4)  (agt.indexOf(msie 5.0) != -1)
 );
 var isIE55Up = (isIE  !isIE3  !isIE4  !isIE5);
 if (isIE55Up) {
   strContent = ;
   strContent = strContent +  br;
   strContent = strContent +  table width=\80%\ cellpadding=\10\
  +
 cellspacing=\2\ border=\2\ align=\center\;
   strContent = strContent +   tr;
   strContent = strContent +td align=\center\;
   strContent = strContent +
 New window should be open, you can do what you want with this
 one.;
   strContent = strContent +/td;
   strContent = strContent +   /tr;
   strContent = strContent +  /table;
   document.getElementById(Content).innerHTML = strContent;
   desiredWidth = 1180;
   desiredHeight = 936;
   myLeft = (screen.width) ? (screen.width - desiredWidth ) / 2 : 0;
   myTop = (screen.height) ? (screen.height - desiredHeight ) / 2 : 0;
   myOpts = resizable,scrollbars,width=desiredWidth
 ,height=desiredHeight ,top= + myTop +
 ,left= + myLeft + ,;
   window.open('index1.jsp', 'MYAPP', myOpts);
 }
   }
 /script
 /head
 body onload=openWindow();
 div id=Content
  br
  table width=80% cellpadding=10 cellspacing=2 border=2
 align=center
   tr
td align=center
 Your browser is not IE, or Javascript is not enabled.  Either way, go
 away!
/td
   /tr
  /table
 /div
 /body
 /html

 Change desiredWidth and desiredHeight to the size you want the window to
 be.  This will open index1.jsp into a new window with no buttons, menus,
 status bar, etc.  This also centers the window upon opening it, something
 I generally like.  It also ensures the browser is IE 5.5 or higher.  You
 can change that accordingly if you need to support older versions, or want
 to further limit it to 6.0+ for instance.

 That's all there is to it... this, plus the Javascript from yesterday,
 gets you about as close to full control as you can probably reasonably
 hope to get.  As long as your OK in an IE-only world, it's pretty nice.
 I'm sure it's not fullproof, but it's more than adequate for typical
 users.  Throw in a right-click blocking function and it's pretty good.

 (If anyone can duplicate both these things with FF, that would be
 fantastic... the chromeless window probably isn't a big deal, but my gut
 tells me blocking the back functionality wouldn't be as easy, if possible
 at all).

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 11:37 am, struts lover said:
 Hi Frank,

   Thanks for your reply. That solves my problem of back button or other
 key on the keyboard. But I still have the problem with the browser back
 button. I am using Tiles.

   It would be nice if you can provide any pointers.

   Thanks.

 Frank W. Zammetti [EMAIL PROTECTED] wrote:
   Marked OT... this isn't Struts-related...

 There isn't any way to do it cross-browser that I am aware of, and there
 isn't any way to do it definitively. However, because you say you are
 working on an Intranet application, you may have some options that you
 otherwise might not...

 First thing, spawn a new window for you app with no chrome. This will
 remove the Back button, and the menus that will allow you 

Re: [OT] Re: Browser back button

2006-03-14 Thread struts lover
Hi Frank,
   
  I tried it but could not make it work. Also I am trying something like this.
   
  script
  history.forward();
  /script
   
  This also doesnt work. I am using Tiles.
   
  Thanks.
   
  

Frank W. Zammetti [EMAIL PROTECTED] wrote:
  I should also mention, you will probably want to have a check in all other
pages/Actions that looks for some session variable that only gets sets on
this page... if it isn't found, redirect here. That way, people can't
jump into any page in your app they want.

And again, I have to say, some people really disagree with things like
this because it runs counter to typical web development. Make sure it's
appropriate for your situation and environment before tossing out the
prevailing wisdom like this.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, March 14, 2006 12:00 pm, Frank W. Zammetti said:
 You have to open your application in a chromeless window. Since you said
 the Javascript solved your keyboard problem, you are obviously working in
 an IE-only environment, so here's how to do it... Your app must start with
 a single page, say index.jsp, which will be:

 
 
 
 
  
   function openWindow() {
 var agt = navigator.userAgent.toLowerCase();
 var isMajor = parseInt(navigator.appVersion);
 var isMinor = parseFloat(navigator.appVersion);
 var isIE = ((agt.indexOf(msie) != -1)  (agt.indexOf(opera) ==
 -1));
 var isIE3 = (isIE  (isMajor  var isIE4 = (isIE  (isMajor == 4)  
 (agt.indexOf(msie 4) != -1)
 );
 var isIE5 = (isIE  (isMajor == 4)  (agt.indexOf(msie 5.0) != -1)
 );
 var isIE55Up = (isIE  !isIE3  !isIE4  !isIE5);
 if (isIE55Up) {
   strContent = ;
   strContent = strContent +  
;
   strContent = strContent ++
 cellspacing=\2\ border=\2\ align=\center\;
   strContent = strContent +   ;
   strContent = strContent +;
   strContent = strContent +
 New window should be open, you can do what you want with this
 one.;
   strContent = strContent +;
   strContent = strContent +   ;
   strContent = strContent +  ;
   document.getElementById(Content).innerHTML = strContent;
   desiredWidth = 1180;
   desiredHeight = 936;
   myLeft = (screen.width) ? (screen.width - desiredWidth ) / 2 : 0;
   myTop = (screen.height) ? (screen.height - desiredHeight ) / 2 : 0;
   myOpts = resizable,scrollbars,width=desiredWidth
 ,height=desiredHeight ,top= + myTop +
 ,left= + myLeft + ,;
   window.open('index1.jsp', 'MYAPP', myOpts);
 }
   }

 
 
   
 

align=center
 
   
 Your browser is not IE, or Javascript is not enabled. Either way, go
 away!
 
 
 
 

 
 

 Change desiredWidth and desiredHeight to the size you want the window to
 be. This will open index1.jsp into a new window with no buttons, menus,
 status bar, etc. This also centers the window upon opening it, something
 I generally like. It also ensures the browser is IE 5.5 or higher. You
 can change that accordingly if you need to support older versions, or want
 to further limit it to 6.0+ for instance.

 That's all there is to it... this, plus the Javascript from yesterday,
 gets you about as close to full control as you can probably reasonably
 hope to get. As long as your OK in an IE-only world, it's pretty nice.
 I'm sure it's not fullproof, but it's more than adequate for typical
 users. Throw in a right-click blocking function and it's pretty good.

 (If anyone can duplicate both these things with FF, that would be
 fantastic... the chromeless window probably isn't a big deal, but my gut
 tells me blocking the back functionality wouldn't be as easy, if possible
 at all).

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 11:37 am, struts lover said:
 Hi Frank,

 Thanks for your reply. That solves my problem of back button or other
 key on the keyboard. But I still have the problem with the browser back
 button. I am using Tiles.

 It would be nice if you can provide any pointers.

 Thanks.

 Frank W. Zammetti wrote:
 Marked OT... this isn't Struts-related...

 There isn't any way to do it cross-browser that I am aware of, and there
 isn't any way to do it definitively. However, because you say you are
 working on an Intranet application, you may have some options that you
 otherwise might not...

 First thing, spawn a new window for you app with no chrome. This will
 remove the Back button, and the menus that will allow you to access it,
 leaving just keyboard shortcuts.

 If you can develop for 

Re: [OT] Re: Browser back button

2006-03-14 Thread Frank W. Zammetti
What doesn't work?  And what are you trying to accomplish with
history.forward()?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, March 14, 2006 3:11 pm, struts lover said:
 Hi Frank,

   I tried it but could not make it work. Also I am trying something like
 this.

   script
   history.forward();
   /script

   This also doesnt work. I am using Tiles.

   Thanks.



 Frank W. Zammetti [EMAIL PROTECTED] wrote:
   I should also mention, you will probably want to have a check in all
 other
 pages/Actions that looks for some session variable that only gets sets on
 this page... if it isn't found, redirect here. That way, people can't
 jump into any page in your app they want.

 And again, I have to say, some people really disagree with things like
 this because it runs counter to typical web development. Make sure it's
 appropriate for your situation and environment before tossing out the
 prevailing wisdom like this.

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 12:00 pm, Frank W. Zammetti said:
 You have to open your application in a chromeless window. Since you said
 the Javascript solved your keyboard problem, you are obviously working
 in
 an IE-only environment, so here's how to do it... Your app must start
 with
 a single page, say index.jsp, which will be:






   function openWindow() {
 var agt = navigator.userAgent.toLowerCase();
 var isMajor = parseInt(navigator.appVersion);
 var isMinor = parseFloat(navigator.appVersion);
 var isIE = ((agt.indexOf(msie) != -1)  (agt.indexOf(opera) ==
 -1));
 var isIE3 = (isIE  (isMajor  var isIE4 = (isIE  (isMajor ==
 4)  (agt.indexOf(msie 4) != -1)
 );
 var isIE5 = (isIE  (isMajor == 4)  (agt.indexOf(msie 5.0) != -1)
 );
 var isIE55Up = (isIE  !isIE3  !isIE4  !isIE5);
 if (isIE55Up) {
   strContent = ;
   strContent = strContent + 
 ;
   strContent = strContent ++
 cellspacing=\2\ border=\2\ align=\center\;
   strContent = strContent +   ;
   strContent = strContent +;
   strContent = strContent +
 New window should be open, you can do what you want with this
 one.;
   strContent = strContent +;
   strContent = strContent +   ;
   strContent = strContent +  ;
   document.getElementById(Content).innerHTML = strContent;
   desiredWidth = 1180;
   desiredHeight = 936;
   myLeft = (screen.width) ? (screen.width - desiredWidth ) / 2 : 0;
   myTop = (screen.height) ? (screen.height - desiredHeight ) / 2 :
 0;
   myOpts = resizable,scrollbars,width=desiredWidth
 ,height=desiredHeight ,top= + myTop +
 ,left= + myLeft + ,;
   window.open('index1.jsp', 'MYAPP', myOpts);
 }
   }






align=center


 Your browser is not IE, or Javascript is not enabled. Either way, go
 away!








 Change desiredWidth and desiredHeight to the size you want the window to
 be. This will open index1.jsp into a new window with no buttons, menus,
 status bar, etc. This also centers the window upon opening it, something
 I generally like. It also ensures the browser is IE 5.5 or higher. You
 can change that accordingly if you need to support older versions, or
 want
 to further limit it to 6.0+ for instance.

 That's all there is to it... this, plus the Javascript from yesterday,
 gets you about as close to full control as you can probably reasonably
 hope to get. As long as your OK in an IE-only world, it's pretty nice.
 I'm sure it's not fullproof, but it's more than adequate for typical
 users. Throw in a right-click blocking function and it's pretty good.

 (If anyone can duplicate both these things with FF, that would be
 fantastic... the chromeless window probably isn't a big deal, but my gut
 tells me blocking the back functionality wouldn't be as easy, if
 possible
 at all).

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 11:37 am, struts lover said:
 Hi Frank,

 Thanks for your reply. That solves my problem of back button or other
 key on the keyboard. But I still have the problem with the browser back
 button. I am using Tiles.

 It would be nice if you can provide any pointers.

 Thanks.

 Frank W. Zammetti wrote:
 Marked OT... this isn't Struts-related...

 There isn't any way to do it cross-browser that I am aware 

Re: [OT] Re: Browser back button

2006-03-14 Thread struts lover
Frank,
  I again tried it and now it works. 
  But what would be the argument to the window.open method.
  I am using struts and tiles and all of my uri are like employee.do etc.
   
  I tried doing 
  window.open(location.href, 'MYAPP', myOpts);
  and it went into infinite loop.
   
  Any further help will be highly appreciated.
   
  Thanks.

Frank W. Zammetti [EMAIL PROTECTED] wrote:
  What doesn't work? And what are you trying to accomplish with
history.forward()?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, March 14, 2006 3:11 pm, struts lover said:
 Hi Frank,

 I tried it but could not make it work. Also I am trying something like
 this.

  
   history.forward();
  

 This also doesnt work. I am using Tiles.

 Thanks.



 Frank W. Zammetti wrote:
 I should also mention, you will probably want to have a check in all
 other
 pages/Actions that looks for some session variable that only gets sets on
 this page... if it isn't found, redirect here. That way, people can't
 jump into any page in your app they want.

 And again, I have to say, some people really disagree with things like
 this because it runs counter to typical web development. Make sure it's
 appropriate for your situation and environment before tossing out the
 prevailing wisdom like this.

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 12:00 pm, Frank W. Zammetti said:
 You have to open your application in a chromeless window. Since you said
 the Javascript solved your keyboard problem, you are obviously working
 in
 an IE-only environment, so here's how to do it... Your app must start
 with
 a single page, say index.jsp, which will be:






 function openWindow() {
 var agt = navigator.userAgent.toLowerCase();
 var isMajor = parseInt(navigator.appVersion);
 var isMinor = parseFloat(navigator.appVersion);
 var isIE = ((agt.indexOf(msie) != -1)  (agt.indexOf(opera) ==
 -1));
 var isIE3 = (isIE  (isMajor  var isIE4 = (isIE  (isMajor ==
 4)  (agt.indexOf(msie 4) != -1)
 );
 var isIE5 = (isIE  (isMajor == 4)  (agt.indexOf(msie 5.0) != -1)
 );
 var isIE55Up = (isIE  !isIE3  !isIE4  !isIE5);
 if (isIE55Up) {
 strContent = ;
 strContent = strContent + 
 ;
 strContent = strContent ++
 cellspacing=\2\ border=\2\ align=\center\;
 strContent = strContent +  ;
 strContent = strContent +  ;
 strContent = strContent +
 New window should be open, you can do what you want with this
 one.;
 strContent = strContent +  ;
 strContent = strContent +  ;
 strContent = strContent +  ;
 document.getElementById(Content).innerHTML = strContent;
 desiredWidth = 1180;
 desiredHeight = 936;
 myLeft = (screen.width) ? (screen.width - desiredWidth ) / 2 : 0;
 myTop = (screen.height) ? (screen.height - desiredHeight ) / 2 :
 0;
 myOpts = resizable,scrollbars,width=desiredWidth
 ,height=desiredHeight ,top= + myTop +
 ,left= + myLeft + ,;
 window.open('index1.jsp', 'MYAPP', myOpts);
 }
 }






  align=center


 Your browser is not IE, or Javascript is not enabled. Either way, go
 away!








 Change desiredWidth and desiredHeight to the size you want the window to
 be. This will open index1.jsp into a new window with no buttons, menus,
 status bar, etc. This also centers the window upon opening it, something
 I generally like. It also ensures the browser is IE 5.5 or higher. You
 can change that accordingly if you need to support older versions, or
 want
 to further limit it to 6.0+ for instance.

 That's all there is to it... this, plus the Javascript from yesterday,
 gets you about as close to full control as you can probably reasonably
 hope to get. As long as your OK in an IE-only world, it's pretty nice.
 I'm sure it's not fullproof, but it's more than adequate for typical
 users. Throw in a right-click blocking function and it's pretty good.

 (If anyone can duplicate both these things with FF, that would be
 fantastic... the chromeless window probably isn't a big deal, but my gut
 tells me blocking the back functionality wouldn't be as easy, if
 possible
 at all).

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM: fzammetti
 Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Java Web Parts -
 http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, March 14, 2006 11:37 am, struts lover said:
 Hi Frank,

 Thanks for your reply. That solves my problem of back button or other
 key on the keyboard. But I still have the problem with the browser back
 button. I am using Tiles.

 It would 

Re: [OT] Re: Browser back button

2006-03-14 Thread Frank W. Zammetti
location.href will give you the same page... what you want is whatever 
the *real* initial page of your app is.  For instance, if right now you 
would go to index.jsp as the first page, then rename that to index1.jsp 
and use that as the argument.  The page I gave you would then become 
index.jsp.  Make sense?


Frank

struts lover wrote:

Frank,
  I again tried it and now it works. 
  But what would be the argument to the window.open method.

  I am using struts and tiles and all of my uri are like employee.do etc.
   
  I tried doing 
  window.open(location.href, 'MYAPP', myOpts);

  and it went into infinite loop.
   
  Any further help will be highly appreciated.
   
  Thanks.


Frank W. Zammetti [EMAIL PROTECTED] wrote:
  What doesn't work? And what are you trying to accomplish with
history.forward()?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Re: Browser back button

2006-03-13 Thread Frank W. Zammetti

Marked OT... this isn't Struts-related...

There isn't any way to do it cross-browser that I am aware of, and there 
isn't any way to do it definitively.  However, because you say you are 
working on an Intranet application, you may have some options that you 
otherwise might not...


First thing, spawn a new window for you app with no chrome.  This will 
remove the Back button, and the menus that will allow you to access it, 
leaving just keyboard shortcuts.


If you can develop for IE-only, here's something I have found works... 
throw this in your onLoad handler...


document.onkeydown=function(e){if(event.srcElement.type=='text'||event.srcElement.type=='textarea'){return 
true;}else{return false;}};


This will block the back shortcut.  Amazingly, it also seems to block 
reload, and mouse clicks (i.e., if you have the middle mouse button 
mapped to back, as I do).  In other words, it seems to pretty well block 
 everything that you might be interested in blocking :)  But again, it 
is IE-only.


Don't forget too that many will argue that this is terrible web design. 
 I happen to disagree, but there are very reasonable arguments to make 
that this is a bad idea.  Make sure it's what you really want and need.


Frank

struts lover wrote:

Hi,
  
I am using Struts and Tiles for an intranet application. I want to disable the back button.
   
  How can I achieve this?
   
  Any help would be appreciated.
   
  Thanks



-
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser Back Button (IE) Problem in Struts Land

2004-09-15 Thread Hubert Rabago
You are getting a Page Expired because the page you're trying to go
back to was produced by a POSTed form.  The browser won't rePOST data
to the server unless the user explicitly allows it to (as a security
precaution).  If you want to redisplay form results without the Page
Expired message, either (a) use GET in submitting the form, or (b)
redirect to the display page after processing the POSTed form.

Hubert


On Wed, 15 Sep 2004 18:22:33 -0500, Arumbakkam, Praveen (Contractor)
[EMAIL PROTECTED] wrote:
 Hello and thank you in advance for your reply!
 
 Problem Summary:
 ---
 Unable to eliminate Page Expired error when a user hits on the Browser
 Back button in Internet Explorer 6.x. Hence, Seeking input from the
 Struts community!
 
 App Overview:
 -
 A Stateful Session Bean  CMP based J2EE application using Struts 1.1
 application built using WSAD 5.0.1 Integration Edition, talking to a
 DB2 8.1 UDB and deployed on WAS 5.0.2 EE.
 
 Browser - Internet Explorer 6.x on Windows XP SP1.
 
 Problem:
 
 Although I implemented a collections based Back button
 concept(Allowing the user to physically store page names from the
 start of the business process till the end of the submission and then
 clearing the stack!) to implement the back-button functionality on
 the page to override the Browser back button, my superiors insist that
 I Do something about making the browser's back button to work with
 the App without any Page Unavailable errors and manual page
 refreshing!
 
 I have tried googled solutions, including the following from
 other struts-user groups etc.:
 
 1. Physically setting the META headers Cache-Control and Pragma as
 per W3C recommendations in the JSP's.
 
 2. Using servlet response to set headers with expiration date to the
 past, and including the headers outlined in solution 1. above.
 
 3. Adding controller tag entry and setting nocache=true
 i.e. controller nocache=true / in struts config.
 
 I have been trying to enable this feature but couldn't find any proper
 documentation. Although Struts in Action refers to programmatically
 altering the RequestProcessor by extending it and then altering the
 default controller settings (overriding processNoCache method), I
 can't find anything else. If there is an easier way, I would appreciate
 if any of you can share your thoughts on this.
 
 I have tried to extend RequestProcessor and override the process()
 method. Should I be trying to override some other method? What am I
 doing wrong?
 The ultimate aim is to do a Wizard style app functionality using the
 browser back button!
 
 Some say that this is a IE bug (headers greater than 64 kb get ignored
 and IE reverts to default settings), the explanation of which I am not
 satisfied with!
 
 Any response is appreciated and thank you for your time!
 
 Regards..
 
 Praveen
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]