I believe browsers use their cached copy of the page to
display source. So by preventing caching, you should be
able to preclude source viewing. You might try:
<META HTTP-EQUIV="expires" CONTENT="0">
which will cause a "Content has expired from your cache.."
message when they try to view source in NS, but that's only a
25% solution. Better to set HTTP header cache properties:
HTTP/1.1 200 OK
Cache-Control: max-age=0, must-revalidate
Expires: Fri, 30 Oct 1970 05:09:52 GMT
...
Setting "Expires" to any invalid date (ex.: "now") should
be interpreted as a past date, but better to write a valid date
string that is well in the past to be on the safe side. It should
be noted that setting "Expires" to a past date might cause
the portal spiders to drop the URL from their listings. If that's
an issue, try it with only the "Cache-Control" setting. Also note
these methods will prevent the Back button from redisplaying
the page after the user moves on to a new URL.
Further reading: http://www.w3.org/Protocols/
I know of no way to disable the browser's View Source function
(doesn't mean it can't be done) and I suspect when you see that,
it is because the page hasn't finished loading. I suppose you could
do something nasty like just never closing the connection (shudder)
to prevent the View Source from ever activating, but I assume
everyone here is working on the side of Good and would never
do anything that Evil. lol Pointless anyway, since the user could
use their browser's Stop Page Loading and then View Source. -Tom
----- Original Message -----
From: "Pierre-Yves Saumont" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 07, 2001 5:02 AM
Subject: Re: Demo creating and Invisible Jsp code to users
> >Basicaly there is no real way to prevent access to html source.
>
> There must be some way, because I already noticed in some pages, that the
> "view source" item in view menu was disabled. This could be asked for in a
> JavaScript list. (But I won't subscribe to a JavaScript list just for
this.
> So if someone know how to do this, do not hesitate to post the solution
here
> ;-)
>
> Pierre-Yves
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html