Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:09:22+00:00 2026-06-03T14:09:22+00:00

I know this question is not a good question because it’s open to a

  • 0

I know this question is not a good question because it’s open to a gazillion of answers but here it is:

I am new to Java EE 6 (on JBoss AS 7), I am coming from a Tomcat + spring world.
My first real web application is something like a simple crud with jsf jpa hibernate and ejb.
Now I need to secure a URL (/admin/*) with the most trivial login form.
I already have two tables (hibernate entities) named “User” (username, password, role_id and other data) and “Role” (code,name and little more).
I could make my own LoginController, session scoped which manage the login related issues but I don’t know how to say “hey, it’s only for /admin path!”
So…. I began reading about web.xml configuration: security constraints, jdbc realms, and so on. However, sorry, but I still can’t reach a good knowledge point, I am too addicted to tutorials and learning-by-doing.

Can you help me find an example project with a simple login form?
Or at least some tutorial or a few advice on how to bind my login form to my db tables? I don’t need 500 pages of accurate documentation. Just trying to make “standard” authentication work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:09:25+00:00Added an answer on June 3, 2026 at 2:09 pm

    Ok. First of all authentication mechanism is not provided by Java EE standard. Only role-based authentication is a part of specification. So every application server must have its custom authentication mechanism, which enables us to use database, LDAP, etc to store user credentials.

    In case of JBoss it looks as follows.

    (1) You need to define security-constraint in your web.xml (there are tons of tutorials how to do this). It tells which URLs are need login. You need to define login-config element in order to choose how the user will log-in – using browser popup window or custom form.

    (2) You need to define on JBoss side security-domain in configuration/standalone.xml. See this example for instance.

    (3) You need to join (1) and (2). This is done in jboss-web.xml file withing WEB-INF of your application. It looks more or less

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
              <security-domain>NAME-OF-DOMAIN-DEFINED-IN-STEP-2</security-domain>
              <context-root>ROOT-OF-YOUR-APP</context-root>
    </jboss-web>
    

    I am not sure how it is in case of JBoss 7, but in previous versions you needed to add java:/jaas/ prefix, so security-domain content would be java:/jaas/NAME-OF-DOMAIN-DEFINED-IN-STEP-2.

    Besides, if you know Spring Framework you may consider usage of Spring Security, bypassing Java EE mechanisms.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if it's right to ask this question here or not. I'm
I know this might seem a controversial question but it really is not meant
I know this is a total newbie question, but the answer may not be
I know abstract fields do not exist in java. I also read this question
This may not be a programming question, but I don't know where to ask
this is my first question here :) I know that I should not check
I know, this might be a very basic question but I am not 100%
I'm posting this question because I do not know the best/correct way of doing
I hardly know how to state this question, let alone search for answers. But
I know, that this question was created many times, but it is stil open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.