Home > Default > Abstract Classes and JSP

Abstract Classes and JSP

November 30Hits:0
Advertisement
Hi
I'm working on a tool wich can be used by different type of users. For example Employee, Administrator and Manager.
So I thought I could create an abstract class User with subclasses employee, administrator and manager
So depending on who logs on you could initiate the user:
user = new Employee()
However I'm not cuite sure how this works in JSP
Is there a way to do this in the jsp:useBean tag or somewhere else?
thx Babette

Answers

You might want to check out the Delegation Pattern. Its for exactly this case.
What happens if a Manager is also an Administrator? Do you give him two seperate logins to the system?
Most likely you just want a user object, and assign the users "roles"
One thing about the useBean tag it can take both a type and a class attribute:
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1217.html#8865
Class is the actual class of the object to instantiate
Type is the type of object to declare it as - ie either a superclass or interface
<jsp:useBaen name="user" class="com.Employee" type="com.User"/>
Would generate code equivalent to
User user = new Employee().
Cheers,
evnafets

Read other 5 answers

Tags:

Related Articles

  • Abstract Classes and JSPNovember 30

    Hi I'm working on a tool wich can be used by different type of users. For example Employee, Administrator and Manager. So I thought I could create an abstract class User with subclasses employee, administrator and manager So depending on who logs on

  • Reading Session Variables in Abstract Portal Component/ JSP Dynpage or JavaOctober 11

    Hi All, I have a web dynpro for Java component which passes parameters in a session and also navigates to a Java application. Now when I try to read the session parameters in the Java application (JSPDynpage or Abstract Portal Component) I cannot ret

  • JSP FrameWork Software - New ProductNovember 30

    All, We are looking for Beta testers to provide comments and feedback for an upcoming product soon to be released- JSPFrame. Implemented in pure Java and based on the MVC approach to development, JSPFrame provides the following functionality *Data Fo

  • JSP TagLibrary...November 30

    Hi Everyone, I have a doubt in how lifecycle of taglib works... public abstract void setPageContext(javax.servlet.jsp.PageContext); public abstract void setParent(javax.servlet.jsp.tagext.Tag); public abstract javax.servlet.jsp.tagext.Tag getParent()

  • Running SAP Transaction from PortalNovember 30

    Hello, Is there any way to tell from within the ABAP program whether it has been executed from the Portal or from within SAP? Thanks  a lot, Ashley.Hi Ashley, Can you check this topic: ABAP and JavaScript on how to use javascript in abap editors. Bec

  • Object pasing from selectOneMenuNovember 30

    Hi there, I have got an input.jsp witch creates appointments. Each Appointment Object has an owner witch is an Object of class Person. Here an abstract of the jsp: <h:selectOneMenu value="#{AppointmentController.currentAppointment .owner}">

  • OC4J 9.0.4 migrate to 10.1.3.1 JSP fails using abstract class for ResultSetNovember 30

    Consider the following JSP code snipet: <% com.class.SQLDataSource detail = ((com.class.SQLDataSource)request.getAttribute("AcctList")); %> <%while detail.next()) {detail.getRow();%> <tr ...> <td ...><%= detail.getStri

  • Size limitation for a .jsp in abstract portal componentNovember 30

    Hi all, i am facing a problem in case of size of .jsp file in abstract portal component. if i remove some of the content from that file then it works fine, do anybody know is there a limitation from Portal side, or any body know the solution for this

  • Calling a JSP  from abstract portal componentNovember 30

    hi, I have included a JSP in a abstract portal component and on click of submit in 1st JSP i have to show an another JSP.How can i do this??? Regards SushanthWhen you say submit do you mean HTMLB submit or a normal HTML form submit?  If it's the latt

  • Difference between abstract portal component ,dynpages and jsp dynpageNovember 30

    Hi All, I am new to the SAP world.Can you help me out in finding the difference between abstract portal component ,dynpages and jsp dynpage in Portal development.Please send me  any information.Hi, Welcome to SDN Community This blog will brief you th

Copyright (C) 2017 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 15 q. 0.152 s.