Solved

Information hiding -concept

Posted on 2003-12-04
18
333 Views
Last Modified: 2013-11-19
not sure if it is right:

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

</head>
   <frameset>
   <noframe>
   Sorry, your browser does not support frames. <BR>
   You need frame support to view this page.
   </noframe>
   
    <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">
      </frameset>
     </frameset>
     
</html>

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.

0
Comment
Question by:Jasbir21
  • 9
  • 7
  • 2
18 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9874717
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 ;-)

0
 
LVL 15

Expert Comment

by:jimmack
ID: 9874946
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">
<HTML>
<HEAD>
  <TITLE>Web Page As Table</TITLE>
</HEAD>
<BODY>
<TABLE CELLSPACING="1" CELLPADDING="5" BORDER="1" WIDTH="100%">
  <TR>
    <TD VALIGN="TOP" WIDTH="20%">
    <BR>
    Username:<INPUT TYPE="TEXT" NAME="username"/>
    <BR>
    <INPUT TYPE="Button" VALUE="Login"/>
    <BR>
    <INPUT TYPE="Button" VALUE="Register"/>
    <TD VALIGN="TOP">
    <CENTER><H1>Welcome</H1></CENTER>
    </TD>
  </TR>
</TABLE>
</BODY>
</HTML>
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9874953
you can change the a page in any frame with this javascript:
parent.listing.location="page.htm";
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9874986
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?
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9875294
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.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9875332
Thanx kennethxu.  I appreciate your feedback :-)
0
 

Author Comment

by:Jasbir21
ID: 9881672
hi,
 I just see comments,pls give me a bit time.

Thanks
0
 

Author Comment

by:Jasbir21
ID: 9893559
hi,
  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.
thansk
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9893573
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.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Jasbir21
ID: 9900821
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.*;
import java.io.Serializable;

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){

this.username=username;
}

public String getPasswd(){

return (passwd);
}

public void setPasswd(String passwd){

this.passwd=passwd;
}




}


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

Pls help
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9903274
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.
0
 

Author Comment

by:Jasbir21
ID: 9903663
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
0
 

Author Comment

by:Jasbir21
ID: 9903760
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 name.....is stored in table organization.

for adminstrator,it is stored in table admin.




0
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9903770
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 http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html 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 ;-)

http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html

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

Expert Comment

by:jimmack
ID: 9903776
Sorry Jasbir21, I was typing when you posted your last comment ;-)

This strengthens the case for Realms as far as I can see :-)
0
 

Author Comment

by:Jasbir21
ID: 9908592
sorry,i was too much it to the question.Would post another question, pls help on that.

thanks
0
 

Author Comment

by:Jasbir21
ID: 9908608
hi,
 i don't know how to put 2 accepted answers together.So, i able to select one.

The answer session variable and realm .

Thanks
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9908676
;-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now