aspose file tools*
The moose likes JSP and the fly likes JSP read only fields ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP read only fields ! " Watch "JSP read only fields ! " New topic
Author

JSP read only fields !

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I no that i can set a field to read only, so the user can' t put something into the field.

Im in a situation where i got 15 jsp pages, and i have to check if the user is read only user, if the user is read only he cant put something into the fields, on the whole page....

Any good ideas, how i best do this in practice ???

Did i really have to set read only on every field, or do domeone have some good ideas ???

Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Set the readOnly property on form element

OR

what I do is not display the element, just display the text.

Eric
Srinivas Krishna
Greenhorn

Joined: Dec 10, 2004
Posts: 8
Hi,

Displaying the text fetching from database is the best idea. if the login is from any of the user other than admin, u just display the fields.

if it is admin, the display should come in the text boxes as editable ones.

try this out


Srinivas Krishna
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874

what I do is not display the element, just display the text


same I do. glad to know many seniors do the same.

I made this post just to add one more in a queue.
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Originally posted by Eric Pascarello:

what I do is not display the element, just display the text.


a very wise suggestion...especially if it is a critical requirement as it is really easy to make the readonly fields editable by using browser extensions. Also, make sure that you have server side checks in place too.

Sonny
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Sonny Gill:


a very wise suggestion...especially if it is a critical requirement as it is really easy to make the readonly fields editable by using browser extensions.


This is the only thing which came into my mind, and I started to do with no text fields at all but just the value.

it means i started thinking like gurus. just kidding, i am a guru .
[ December 10, 2004: Message edited by: Adeel Ansari ]
 
jQuery in Action, 2nd edition
 
subject: JSP read only fields !