databinder for wicket concept & status - java

Seems like Wicket + DataBinder(https://github.com/wicket-databinder/wicket-databinder) is good solution if you know only plain java and need to write data-driven web app, as i am. But when i use auth functionality of dataBinder i gain error - when i register new user my password and confirm password not match. I look into the code - getConvertedInput() of RSAPasswordTextField return some long Base64 and it's different for password fields. I don't find databinder auth examples on net. Question and thought:
What is the common way of using current version of DataBinder? For example, how i can use net.databinder.auth.components.hib.DataSignInPage?
There is many todo comments in databinder. What of databinder features is stable?
I like that common web functionality is already in databinder, so i don't need reinvent the wheel. Maybe there is more actual alternative for that?
Otherwise i can contribute to databinder. Anyway i need to develop my application, so i can start from that is already in databinder. But i need status of modules(what works and how to use/what not work and what to do). Sorry for my english.

As far as I know, Nathan (author of databinder) has moved on to scala development, and databinder has since been stuck. Your best avenue is to contact Nathan, or one of the 10 forks on github to see how you can reignite development of databinder.
As I don't use databinder, I can't answer this one
I'd see the todo comments as a good pointer to where you can pick up maintaining the code base
There are several libraries that integrate with Wicket in various forms of maintenance.

Today databinder have no contributors. I write to Fausto Bencosme (he was the last). We try to use DataBinder together, but few problems occur. Fausto recommend to use Ebean. I try - looks like it works. So for newbies i recommend Ebean to.

Related

Why can't we use RequestParameterRuleFilter in production?

We are running into an interesting situation on a project where we're trying implement multisite functionality.
There is a component called RequestParameterRuleFilter that we are trying to use to override the “siteid” under certain circumstances.
Oracle's ATG documentation says that this component needs to be turned off in production, and we are trying to figure out why. Using this component saves us a lot of time, but we don’t want to risk any security holes or performance issues because of it.
Does anyone on here have any experience with this component, or know why we should not use this? Or, are there other alternative components built in to ATG that can be easily leveraged to provide multisite functionality?
Here is the link to the documentation: http://docs.oracle.com/cd/E35318_02/Platform.10-1-1/ATGPlatformProgGuide/html/s0902installedrulefilters01.html
I think site runs on domain name not on some param bases which can be manipulated easily, may be that y atg dosn't recommend this. We are using URLPatternMatchingRuleFilter, that resolve site based on domain name...and it is working fine...

Adding business logic in JSP

This has been asked in few times in this thread. But sometimes its hard to make it decouple. Let say Im dealing with session, cookie stuff how do I decouple or basically how do I move the existing code out from the JSP? UseBean will be a good alternative. But how to deal with business logic with lot of HTTPServletRequest and HTTPServerletResponse and its related objects used services?
Thank you
Developing web-applications in Java has evolved quite a lot over the past 10 or so years. PHP-style JSP pages may have been ok-ish in 1999 but not today. At very minimum, you should isolate your business-logic in a servlet and only have your rendering/view in the JSP. That is just the bare-minimum to pass some form of basic level of hygiene. If you are doing any sort of new development or even refactoring, you should look into a more refined MVC/MVP framework. Spring is a good candidate. Maybe not the "coolest" but definitely established and well-known. The tutorial Andrea mentioned is a good place to start. And don't get too nervous about things like "how does it make sure the right request and session is used" - that is what spring-mvc does, it's the core functionality. Go through the tutorials, try it out and then dig deeper to understand what is happening under the hood and how you can customize the behavior to fit your needs.
I suggest you to use a MVC patter to add the business logic to your web application on Java classes instead of add the logic into the JSP.
Take a look to that: http://static.springsource.org/docs/Spring-MVC-step-by-step/part3.html

Building a security framework

I know there are many security frameworks and "building" a security framework is a bad idea.
In the recent project I have worked on, I used spring security to secure the web application. In the process, I over rided/tweaked some spring security classes to fit my requirement.
My management now wants me to "takeout" the things I did and distribute it as a re usable code in an internal portal.
Now, Is this is a fair thing to ask? I tried to explain them it's just some classes build on spring security and nothing special. But they are insisting on "creating" this framework.
Is this a fair requirement ? Any ideas on how to start ? I understand that getting started with spring security is not very easy.
If I am building this, what are the functions I need to provide?
If they need you to "takeout" the things you did then they should know what they want the framework to do. So Its probably better to ask them for requirements directly.
Regarding:
Is this a fair requirement ?
The answer is probably no. If they want you to do something they should give you specific requirements.
Just Yesterday I asked wheter someone knows a security-library which provides security-apis but at a bit lowerlevl than spring-security. Meaning a library which I call instead of a framework where I have to organize the code according to it (ie using a spring context).
So something I would need are apis for example to create safe remember-me tokens, do basic and dighest authentication, connecting to ldap - or just simply where I could use spring-security but without the spring-container).

Understanding the need for struts 2 and commons chain in simple CRUD website

I have a simple CRUD website in development process, almost done. I was asked to refactor the code but this time use struts 2 and commons chain. I read a couple of sites like this but wasn't able to know exactly what will be the key roles done by these two (struts 2 and commons chain) in my project. I was also asked that don't worry about struts tags like in this tutorial as the code that i made earlier can be used.
Can anyone give me an insight. Thanks
Note: A day back I started to see about struts 2
Well any framework is designed (most of them) to provide some sort of ease of use. That should be the driver when you chose one.
In your case, I can comment on Struts2.
Using Struts2 provides and enforces a better design in terms of separation of your code responsibilities (model view controller). This way the over all application design is well formed.
On top of this, framework provides many interesting features like interceptors, out of box request parameter assignments, validation, ui tags etc etc which you can benefit from.
So if you are still in the starting phase, yes - go through various frameworks available and weigh them out in terms of what ease you are looking for.
If the website is almost done, I don't see any compelling reason to adapt Struts 2. In fact, the person who asked you all this is the best person to contact, in this case.
Regarding commons chain, yes it can help you implement Chain of Responsibility pattern if it can solve the cases in hand.

Three-layered approach in PHP

I liked using three layers (data/business logic|services/ui) in Java and wish to apply this to a web site in PHP. What advice, links, tutorials could you suggest in this respect?
P.S: I'm particularly interested in knowing how the domain/entity objects can be written and used.
You could go with some frameworks of PHP.
They already done three layer for you
ZendFramework
CakePHP
This could be interesting for you and help you to choose right framework.
PHPFrameworks
If you want a PHP framework that actually follows the Model View Controll (MVC) pattern then you will need to look at Agavi. Many other frameworks have attempted to implement it but have failed.
Correct me if I am wrong, but this is an MVC approach (Model->View->Controller)?
If so, checkout a framework like CakePHP, they have a pretty good learning zone for you.
You could look at the MVC pattern used in many frameworks for PHP.
You could use frameworks like Kohana, Zend, CakePHP, Yii, which all uses this pattern.
MVC stands for Model-View-Controller, where the model contains the business logic, the view contains the UI, and the controller handles the requests and ties things together.
Symfony (http://www.symfony-project.org/) gets good reviews from my PHP slinging mates

Categories