• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with servlets

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am required to do the following tasks as part of a small project for a hotel I am working on currently and I need some help on how to go about doing them:

The requirements are:

-register and login facilities for different users. (Have done the register servlet, need help with the login.)

-Provide facilities to allow different levels of security for users access.

-Hotel staff have administration access and can view a secure part of the website to :
-Log on to site using password facility
-View, insert, update customer, room bookings and service bills related to the Best West database
-Delete customer room bookings

-A facility to randomly pick customers to receive special gift packs for using the site and notify these customers of their gift

-A ticker tape facility which scrolls hotel service information and promotions (accessed dynamically from the database) across the website at regular intervals

Any help would be appreciated on this.

Also I have created a booking servlet with the register one and it seems both of them dont seem to do anything once I press the submit button on the designated page, how can I have multiple servlets functioning from the one project.

I am using Netbeans 5.5 with Tomcat.

PS. I am happy to provide any code required.
[ October 17, 2008: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what's your question? What has you blocked? Sounds like you know what you need to do -- start writing the code and come here for help with problems you run into.

If you are waiting for someone here to do your work for you, well, that's just not going to happen.
 
Eassam Ashraf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well here is what I have done so far:

HTML pages:






Java classes:


















My servlets:





Now as you can see I have done the register and the booking part of it for the customer, what I want to know is how to make multiple servlets work as when I only had the register servlet it was working as soon as I created the booking one, both of them dont work:

here is my web.xml:


From there Login servlet should suffice how do I go about creating one?

Also I have no clue how to do the different security levels and the ability to do the random awards and ticker tape..I need an example to get me going.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, showing us pages and pages of code, and then asking vague questions isn't going to get you far.

Do you really expect people to take the time to read through all that code? In a forum such as this, you can ask for ideas, or you can ask for specific answers to specific questions, but posting an entire application and saying "now what?" isn't going to help you much.

Please ask specific questions or ask for guidelines on how to think about a particular problem.

Pick the next part of the application that you will work on, figure out what has you blocked, and we can take it from there.
 
Eassam Ashraf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay..I can see where you are coming from as I am taking the discussion in different places at once, lets focus on one problem.

I need an idea so that I can create a different levels of security for access. What methods and parameters do I have to include in order to achieve this?
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that you are looking for "DoItFOrMeRanch" not JavaRanch
 
Eassam Ashraf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
:roll:

I am not asking anybody to do it for me..I just need an example to work with. I was hoping someone would provide that example..
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eassam Ashraf:
I need an idea so that I can create a different levels of security for access. What methods and parameters do I have to include in order to achieve this?


Well, you might want to look into the container-managed authentication and roles provided by the Servlet Specification.

Personally, I find that too limiting and build my own authentication and role system from scratch.

The basics of what I set up:
  • There are a number of "permissions" that grant thr right to perform a certains task. For example: "can delete records", or "can adminsiter users".
  • Roles are a collection of permissions that make logical sense as a group. For example: "Adminstartor", "Power user", or "Guest".
  • Users can be assigned to one or more roles.
  • If applicable, users can also be assigned to groups, which can be assigned roles.

  • It's not a trivial task to set up such a system. I know of no off-the-shelf solutions.
     
    Eassam Ashraf
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks, that's what I was looking for!
     
    Greenhorn
    Posts: 12
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    This is indeed not-so-easy to implement task. You will need to create 3 separate entities in the system:
    1) User Group:
    2) Permissions:
    3) User:

    Then, define/assign permissions to each user group, and assign user to the group. You can at the time of log-in set the user group into the session and perform the checks based on that. I have implemented such a system and know the pain of it. I would be glad to help you further. wish you all the luck
     
    Bear Bibeault
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    "Shuki", please check your private messages for an important administrative matter.
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic