Information hiding -concept

not sure if it is right:

<!DOCTYPE html>
<title>Welcome to ..</title>

   Sorry, your browser does not support frames. <BR>
   You need frame support to view this page.
    <frameset rows="90,*">
    <frame src="welcome.html" name="welcome" FrameBorder="no" NoResize="no" scrolling="no">
    <frameset  cols="160,*">
    <frame src="left.html" name="left" FrameBorder="no" NoResize="yes" >
      <frame src="volunteer.jsp" name="listing" FrameBorder="no" NoResize="yes">

the left.html has the login,register buttons and so on.
the welcome.html has the greettings

Now is this right?Then how if the admin logs-in, he would directed to his page with buttons relevent to hime only.

I f volunteer logs-in, he would directed to pages only relevent to hime.

and so on.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You haven't shown any <BODY> </BODY> tags, but this might just be because it's only a sample.

Couldn't you do this in a table instead of frames?  That way you can avoid the check for frame display capability and allow all browsers to view it ;-)

Here's an example.  The layout is rubbish and the INPUT items aren't in a FORM, but hopefully, you'll see what I mean about the idea of using a table instead of frames ;-)

Also, this should prevent future problems with targetting results to frames or identifying which frame a button was in when it was pressed etc. ;-)

I do something similar to this using JSP tags for my site.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <TITLE>Web Page As Table</TITLE>
    <TD VALIGN="TOP" WIDTH="20%">
    Username:<INPUT TYPE="TEXT" NAME="username"/>
    <INPUT TYPE="Button" VALUE="Login"/>
    <INPUT TYPE="Button" VALUE="Register"/>
you can change the a page in any frame with this javascript:
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

If you want different capabilities available to different types of user, then you'll need to store a session variable to determine which user type has logged in.  Then it's up to your application to decide which pages to send back.

kennethxu, quick question for you ;-)  Are frames a good way to go or not?  Personally (in my limited web design experience), I have had lots of problems with them (browsers that don't display them properly, tracking which frame does what etc.).  It looks like you've probably done a lot more of this than me ;-)  What's your opinion?  Do you use frames?
Frankly, I'd like to avoid frames, especially extensive interaction between frames. But sometime it is out of my control that I have to use them. So I do use frame and be fair, frame do have some advantages.
Thanx kennethxu.  I appreciate your feedback :-)
Jasbir21Author Commented:
 I just see comments,pls give me a bit time.

Jasbir21Author Commented:
  i think and try and then i see that, if use session variables, i am using that:
If you want different capabilities available to different types of user, then you'll need to store a session variable to determine which user type has logged in.  
Then it's up to your application to decide which pages to send back.

How to decide , which page to send.
When the user/administrator logs in, set a simple boolean variable in the session (eg. "isAdministrator").  Then when you need to send a page back to the individual that is logged in, you can check to see if they are an administrator or not.
Jasbir21Author Commented:
i not know how to set the variable i mean:

<%@ page import="java.sql.*, java.util.*, com.dhal.*"%>

<jsp:useBean id="acc" class="com.dhal.account" scope="session"/>
<jsp:setProperty name="acc" property="*"/>

I mean in this account class:
package com.dhal;
import java.beans.*;

public class account implements Serializable{

private String username;
private String passwd;
private String verifypwd;

public account(){}

public String getUsername(){

return (username);

public void setUsername(String username){


public String getPasswd(){

return (passwd);

public void setPasswd(String passwd){



if user and addminsitrator use this class to log-in.

Pls help
How do you distinguish between a normal user and an administrator in you application?

Do you have an indicator stored with their username/password combination?

One other thing, it doesn't look like you need the verifypwd attribute in your account class.
Jasbir21Author Commented:
i don't have any indicatior, and i don't know how t o distinguish between user and admin:

I mean i have users of type A: 3 pages belong to them

I have users of type B: 3 differnet pagges belong to them.

I have administrator who have few pages belong to him.

How do i do?Thanks
Jasbir21Author Commented:
Forgot to say , when users of type A, users of type B and administrator logs in, theire username and password are stored in one table .The table is called account.

BUt the other detail info like name,address is stored individually in sepereate tables .

For exampele,
for users of type A, the name,adress.. is stored in table users.

for users of type B, the stored in table organization.

for adminstrator,it is stored in table admin.

You'll need to store some kind of "user type" value with the usernames and passwords.

The way your project seems to be progressing, I think that you should probably look at the following:

Realms - This allows you to manage the usernames, passwords and roles for users that log in to the system.  This way you can specify which users have access to specific pages.  See for more info.

Servlet filters - These allow you to intercept requests for pages and to modify the requests/responses including redirection to other pages etc.  Filters are more of a design isssue, general to Servlets/JSP so aren't covered by the Tomcat docs.  Here's one article, but there are many more available on the net ;-)

(BTW: you're off onto a totally different question now ;-))

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sorry Jasbir21, I was typing when you posted your last comment ;-)

This strengthens the case for Realms as far as I can see :-)
Jasbir21Author Commented:
sorry,i was too much it to the question.Would post another question, pls help on that.

Jasbir21Author Commented:
 i don't know how to put 2 accepted answers together.So, i able to select one.

The answer session variable and realm .

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.