Solved

URGENT!!--How to direct pages

Posted on 2003-12-11
11
227 Views
Last Modified: 2010-04-01
Hi,

I have an application that is been used by 3 users:

One the volunteers-page1,page2

one the organization-page1,page2 and etc

one user the administrator-page1,page2....

How when the user logs-in,

if volunteer direct into their pages.

if organization ,direct into their pages..

if administrator,direct into their pages..




0
Comment
Question by:Jasbir21
  • 5
  • 3
  • 3
11 Comments
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 100 total points
Comment Utility
just as you have written it in your question......

<%
String type = request.getParameter("userType")  //Here I am assuming that you will get the type from request.
if(type.equals("user"))
{%>
<jsp:forward page="userpage.jsp"/>
<%}
if(type.equals("admin"))
{%>
<jsp:forward page="adminpage.jsp"/>
<%}
if(type.equals("volnteer"))
{%>
<jsp:forward page="volnteerpage.jsp"/>
<%}

that is about it...
All I have done is wrote your english in jsp...:-)
0
 

Author Comment

by:Jasbir21
Comment Utility
hi,
   I think i understand, i never get usertype,but now i will thanks.
  what if i got many pages, i mean:

volunteers-page1,page2

one the organization-page1,page2 and etc

one user the administrator-page1,page2
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
Comment Utility
well.... you will start from one page and then it will navigate from one page to another.........
you can not show all of the pages one by one right???
and I assume that these pages are separate pages to each other.... so they should be able to handle their own navigation in my opinion.....
0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
If you're adding a usertype as you seem to indicate, you can store that in a session variable, rather than having to keep retrieving it from the client (obviously, you'll need to identify the type when they first log in ;-))

Have you had a look at Realms yet?  If you use Realms, you could use:

if (request.isUserInRole("admin"))
{
}
else if (request.isUserInRole("typeA"))
{
}

etc.

Where the role is declared in the Realm data.  Ideally, you'd want to do this with a database, but you should be able to try the idea out quite quickly if you create a "Memory Realm".  Have a look towards the end of this link: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html

If you don't want to use realms, just mention this in your next post and I'll stop nagging on about it ;-)
0
 

Author Comment

by:Jasbir21
Comment Utility
Jimmack,
  I added the usertype, but my problem i found out that i did something that i got an error. I mean, when i click, it does not go to other page. What wrong could i have done....


pls help ,
thanks
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Expert Comment

by:jimmack
Comment Utility
Is there any error output available?

It might be a good idea to display the usertype somewhere (for debugging purposes), so that you know you are comparing it to the correct value.

(eg. if you just did a cut-and-paste with Kuldeepchaturvedi's code, he had a typo for the spelling of volunteer).
0
 

Author Comment

by:Jasbir21
Comment Utility
hi,
 i guess, my problem is the way i navigated the pages, it is not so ok.
So, i thought, if i need to change the navigation of pages a lot, i need to redo a lot of the project...
...so, i thought, i use realm, i think i did something that the realm usertype is not being properly redirected.

Pls help,thanks
0
 

Author Comment

by:Jasbir21
Comment Utility
or, do you think , it is better i change naviagation of pages..

thanks
0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
If you identify the type of user when they have logged in, you can avoid having to check all the time by keeping separate pages for the different types of user (eg. one set of JSPs for admins and another set for normal users).

When your JSP is generating the first response after login, you could modify the links on the page appropriately.

This way, you would only need to do role checking in the pages that they share.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
Comment Utility
well that will need him changing all the code that he has already written...
I would rather suggest to getting straight the navigation of the pages
0
 

Author Comment

by:Jasbir21
Comment Utility
ok, i think i understand,i would work on it now.

I think my main problem is the way i naviagate the pages, is very bad.

Thanks you
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

10 Experts available now in Live!

Get 1:1 Help Now