I'm using the Wildfly Java server for my current projects. I have a little Raspberry cluster of them even (I'm going to update the post how to set them up).
So how do I feel about Wildfly?
It's more configuration then programming! But after some talking to developer-friends, that's actually much of Java EE in the beginning.
So the latest part of the project was to make a Login-function. I've made a simple function like this in PHP. So I thought "what the hell".
After some research I found that Java EE hade it built in the servlet (you can even hide it in a simple html-form if you name the components just right).
So I tried to make a "customized" login which would use a form rendered by JSF and sent the values to a JavaBean which would use the servlet-login method.
Sounds easy? Yeah, that was my weekend...
By using built in functions, you got to know all the magic that actually happens, which isn't the same for every Java server, but at least similar.
First you have to choose if your going to save the users in a file, database or LDAP.
You then need to setup the security-domain to use the right options. For me, I needed to use databases,
That meant to connect it to the right JNDI (Datasource for the Database) and this was actually the last piece of the puzzle to fall into place. Many sites write a JNDI that seems to differ from the regular, but nothing is different! Just use the regular JNDI.
For database-solution you need to save the users (passwords and all) and the different roles they have in the database. You then set the queries for users and there passwords in the same security-domain.
For Wildfly you then need to create/edit the jboss-web.xml file to set it to use this security-domain (the one you configured).
You can also set the encryption and hash-algorithm for the password in the security-domain.
Then comes the web.xml configuring. At least this is the same for the most servers.
Here you get to set which options and which pages will and role will demand login and which site is the login-site and an error-site for getting the error-message (can have different for different errors).
I haven't puzzeled together all the pieces and don't really know all the requirements yet, but hopefully I will puzzle it out soon.
Hopefully this is one of the bigger obstacles I will face for my little project.
Impressions of Wildfly so far:
Fast and has many options (standalone, standalone-full, domain, etc).
Neat admin-console, and a good CLI-console.
Bad error-messages from admin-page (unknown error) is a regular occurence.
New server so it doesn't have many sources with examples yet,
Lots of configurations that needs to be done, some which you can't do from the Admin-page.
No comments:
Post a Comment