Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

Information hiding -concept

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
Jasbir21
Asked:
Jasbir21
  • 9
  • 7
  • 2
1 Solution
 
jimmackCommented:
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
 
jimmackCommented:
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
 
kennethxuCommented:
you can change the a page in any frame with this javascript:
parent.listing.location="page.htm";
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jimmackCommented:
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
 
kennethxuCommented:
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
 
jimmackCommented:
Thanx kennethxu.  I appreciate your feedback :-)
0
 
Jasbir21Author Commented:
hi,
 I just see comments,pls give me a bit time.

Thanks
0
 
Jasbir21Author Commented:
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
 
jimmackCommented:
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
 
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.*;
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
 
jimmackCommented:
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
 
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
0
 
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 name.....is stored in table organization.

for adminstrator,it is stored in table admin.




0
 
jimmackCommented:
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
 
jimmackCommented:
Sorry Jasbir21, I was typing when you posted your last comment ;-)

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

thanks
0
 
Jasbir21Author Commented:
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
 
jimmackCommented:
;-)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 9
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now