CDI Portable Extension for Struts 1.3? - struts

here's an idea i have been playing with for a while.
is it possible to mix CDI and Struts 1.3 ?
E.g. via a CDI Portable Extension..?
As for 'why', there are still a few projects 'out there' which are stuck on an old stack and don't have the option to switch to struts 2..
Just throwing it out there, i'm interested in your ideas =)
greetings from germany

I just committed my library to github, called struts-cdi. You should check it out.
https://github.com/reegnz/struts-cdi
It only works with Struts Actions for now, and not with ActionForms. If the need arises, I will also try to do container managed ActionForms. :^)

Stripes Injection Enricher satisfies injection points specified declaratively using standard Java EE annotations (#EJB, #Inject and #Resource).

Related

Ktor: "io.ktor.util.pipeline.ContextDsl" in ktor 2.0

This annotation is documented here but not marked deprecated, however in the migration guide there's no mention of why it was removed, and what should be used instead.
I am totally new to Ktor, and I am supposed to port a 1.6 project to 2 while learning Ktor from scratch. Some leads in this direction will be much appreciated. Thanks
Multiple DSL markers were unified so you can use the KtorDsl annotation instead.

Can I use Ninject Modules in any way in constraining the resolution of a request

In our web project we are using Ninject. Now we are adding plugins to our application. We want plugins to be able to add their own bindings. Ninject modules seems like a logical solution to this problem.
However, I don't see any guidance on how to avoid the following problem. What if a plugin adds a binding to an interface that already had a binding. Now the DependencyResolver will throw an exception when trying to resolve that interface.
I'm trying to make a change to our DependencyResolver that doesn't require rewriting all of the binding statements we've already written in the main application. I don't want a plugin to be able to break my main application. If a plugin needs to apply constraints to make it's bindings work then it is its responsibility.
So here's what I want.
A plugin would not be able to break the core app or another plugin because it added a binding.
It should not be necessary for any change to be made to core application or another plugin when I want to add a new plugin with its own bindings
Where there are multiple instances to choose from it should do the "logical" thing. The core app should get the instance it always would have gotten in the absence of the new plugins. The plugin should get the instance it specifically bound.
It seems like I should be able to override the resolving methods of StandardKernel so that it can implement these rules. It seems like knowing what module a binding was a part of would help resolving. But I can't find module or module name as part of the context, request, bindinginfo, etc.
Any thoughts on how to resolve this issue. I don't see that Ninject seems to answer what seems like a very obvious need for a modular system. A new module shouldn't be able to break an app. (It should only be able to "break" itself.)
You should have a look at Ninject.Extensions.ChildKernel. You could create a ChildKernel per plug-in and then load the plugins' module in their own ChildKernel.
This means that a plugin cannot rely on the bindings of another plugin, but a plugin may rely on the bindings of the Parent Kernel (root / application kernel). So you can provide certain types/services to the plugins.
By the way, if the implementation of Ninject.Extensions.ChildKernel does not match your needs, you might very well choose to implement your own extension. It's not that much code (see ChildKernel source)

How to maintain a maven project with quartz-1.8.6 and quartz-2.x?

I need to use both quartz-1.8.6 and quartz-2.x.x dependencies in the same maven 3 project.
The reason for keeping 1.8.6 is that it's used by a large amount of code and new features are considered to written in spring, and in this case quartz-2.x come into play.
So the question is: how can I keep both these dependencies in the same project ? Maybe add some exclusions?
do you really need to use both of them at the same time
generally the classes may be deprecated. but usage will still be allowed.
You see whole idea of using maven is to avoid multiple jar of same API.
I will suggest code changes and completely using quartz 2.x API.
I was getting similar issue when I used lucene and was switching from 2.2 to 2.8/3, there were not just deprecated methods but many lucene classes were removed i the 2.8 API. I still ended in upgrading the API than using duplicate dependent jars

Struts HeaderAction Class?

When I go to the struts Action api page , I can see all the subclasses of action class like DynamicAction, IncludeAction etc.
but I can't see HeaderAction from JOrganizer (http://jorganizer.sourceforge.net/javadoc/org/juniverse/jorganizer/portal/HeaderAction.html)
Why it is so? Is it because it has been developed by community other than apache?
You're right... In fact, the javadoc program which generates the documentation is not aware of the other products. If you develop a class based on the Action class provided by Apache (in your own project), you will not see the Apache documentation updated.
By the way, Struts is now in version 2 since a (very) long time...

Is there a Maven plugin to generate AS3 classes from Java for BlazeDS?

I'm looking for a maven plugin that would generate ActionScript3 classes from Java classes in order to access them by object remoting.
I've seen FlexMojo but it uses the GraniteDS generator which create some problems when it comes to map Enum objects (which can be fix through a workaround that is describe here : http://dev.c-ware.de/confluence/display/PUBLIC/Flexmojos+generated+AS3+model+with+Enum+support+using+BlazeDS?focusedCommentId=7634946&#comment-7634946 if you've googled your way here this might be useful) when working with BlazeDS.
Everything that I found so far are people who explain how to generate VO classes on flex side using Flash Builder 4, but this solution can not be used in an industrial development environment.
Take a look also on http://flex-annotations.aixcept.net/examples/actionscript.html
I also found this one, and while it is not a maven plug-in it could possibly be turned into one:
https://sourceforge.net/projects/cleartoolkit/
It was created by the guys who authored the book "Enterprise Development with Flex". Look for the utility DTO2Fx.