You can only stop the most casual of viewers from accessing the source. The
javascript below will disable the right click but anyone with  a slight clue
can still get to your source. Basicaly there is no real way to prevent
access to html source.

function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Ayhan
Demirci (It-Tmo)
Sent: Wednesday, June 06, 2001 10:34 AM
To: [EMAIL PROTECTED]
Subject: Demo creating and Invisible Jsp code to users


Hello All

I have a project that based on several JSPs and one Database Servlet
On this project I want to prepare a demo package that will run on
installed machine for limited time.
 I have two question about it;

1- How can i prepare this demo which will expire in 30-days on installed
machine ?
    I mean where have to i write and check expiration date on installed
machine?


2- How can the JSP source code be invisible to users that attempting
view source command in browser window by clicking right mouse button?
   I mean how can i restrict the source code visibility in JSP's
(HTML-JavaScript  ) when running on Browser Window?

Thanks a lot,
Ayhan



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you are not the intended recipient you are hereby notified that any
dissemination, forwarding, copying or use of any of the information is
prohibited.

The opinions expressed in this message belong to sender alone. There is no
implied endorsement by TURKCELL.

This e-mail has been scanned for all known computer viruses.

***************************************************************************

___________________________________________________________________________
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

Reply via email to