Using jbatch in J2SE applications - batch-processing

Can I use jbatch in J2SE applications (without application server)? Is there any example? Thanks!!!

If you don't mind using jberet (https://github.com/jberet), as an alternative implementation of the JSR 352, you'll find links to resources and a standalone example here: Standalone example on jberet (jsr352)

Related

Can Worklight Shell and Inner Applications be used to share common code across applications?

My Worklight project contains two separate hybrid mobile applications. The applications have in common a good deal of HTML, CSS and JavaScript. I need a way to encapsulate the common code so that it can be shared by both applications.
Can Worklight Shell and Inner Applications help me to share common code across applications?
If so, where can I find detailed documentation, example code or tutorials that use Shell and Inner Applications for this purpose?
If not, is there another way to share code across Worklight applications?
Yes you can reuse, you can add to Shell common CSS, Javascript functions, Plugins and they will be applied to all the project that are build on top of that.
If it is a hybrid app you can add CSS, JS, Images under <<WLProject>>/components/<<ShellName>>/common
For any plugins related to android or IOS you can add them into respective folders under <<WLProject>>/components/<<ShellName>>
Cheers !!
Shell development in Worklight could potentially solve this for you, but its complexity is much greater and I am not convinced its price is worth it.
You can review shell development in the Advanced Topics section of the IBM Worklight Getting Started web page.

Accessing dll from applet

I have a "proof of concept" piece of work that crosses over into some unfamiliar territory. I have some experience on J2EE technologies. I'm tasked with connecting an EFTPOS machine to an web application. I am planning to use applet to interact with dll. dll will be running on the client side.
I need to interact with one dll from web application. Please provide me any guidance on this, as I am new to it. I tried interacting with dll from standalone java program, but not able to connect from web application. Any sample codes will be very helpful for me.
Yes that is perfectly possible with an applet. I "connected" an electronice signing device before and it was working very well. Depening on what kind of .dll we are talking about here you need to do the following things:
1.) Create a java access layer / interface for your dll, so that you are able to call the dll functions from java. Depending what kind of dll we are talking about there are several possibilities. The base technology is JNI which is however quite cumbersome to use but luckily there are much more convienient ways out there:
use JNA (if it is a C dll)
use Jacob (if it is a COM component)
use bridj (if it is a c++ dll. You may try swig but haven't used that, so can't tell)
2.) Put your dll inside a jar file and distribute it alongside your applet. How this works is quite nicely described in the jacob project which provides an example for that. You can find it in the source package under jacob-1.17_src.zip\jacob-1.17\samples\com\jacob\samples\applet The example describes the JNLP way to access a native library which will work above java version 1.6.0_10. If you have to use a lower version for some reason, it is also possible but is slightly more tricky...
3.) One more side note: Since the latest available java version (1.7.0_51 or 1.6.0_71) due to security, some rules have been added or tightened for java applets. Now you have to sign your applet with an official certificate and set the right attributes/properties in the manifest, jnlp files. But this has been discussed in great detail here so just search for it. I would probably use a slightly older version for development and if that is working, figuring out how to make it work in the latest java version...
4.) Regarding the interaction part there are also several possibilities. Your Java Applet can call jscript methods from the website it is running in (or also the other way around) or the applet directly communicates with your server. You have all possibilities on that front...

Simple web server to use with IntelliJ on windows?

I am using IntelliJ for a pure Javascript project (some HTML and javascript pages talking to someone else's web services). Right now I am running the page directly from the filesystem, but there are limitations (like not being to write cookies).
Is there a simple web server I can use that will start and stop when I am debugging my project? Like how visual studio will do with ASP.NET or Aptana does?
Thanks!
I have no idea what you are doing, but install XAMPP, it is amazingly simple to use, although it supports PHP/PERL by default, rather than ASP.NET.
if your want to use pure JS&HTML to do something maybe jQuery is a good choise
jQuery with lots of plugins.
if you would like to write some runnable program with Java, please use Tomcat
Hope to help you :)

Java EE: Print pdf on the fly

In my web application (Java EE), I would like to print a pdf file generated on the server side
on the fly in the client side without opening it. The files could be one or many. Is this possible?
I think it is not possible, except if you require clients to install a special application first.
Not just Java EE, it would be the same with any server-side technology.
You either need an additional Java library or to pass it to native code. There is a blog article with some suggestions at http://www.jpedal.org/PDFblog/2010/01/printing-pdf-files-from-java/

What is the most painless and multi-platform way to use scripting?

What is the most painless and multi-platform way to use scripting?...
...for things such as
Compilation
Web application deployment
Web server controlling
Other misc. tasks around web servers...
NOTE: I'm in the Java ecosystem.
Sure, there is Apache Ant, which is pretty multi-platform, but
it isn't scripting.
Depends entirely on what environment you're working in.
For Java you can either use the JavaScript ScriptEngine that ships with the Sun JDK.
Alternatively you could use Groovy, which is a separate download but works on all modern JREs.
For general scripting I'd personally choose Python, because it's available almost everywhere and reasonably compact, while being an awsome language.
The only scripting environment that you'll find on almost all computers these days (no mater what OS/Hardware) is a JavaScript engine. But usually that's confined to the browser and doesn't really allow interaction with anything outside the browser.
I recall reading that Java and Javascript are not not related - so Joachim Sauer's answer puzzles me...
Meanwhile, the original question lists compilation; web application deployment; web server controlling and other misc tasks around web servers.
That's a very broad spectrum, but then the question wasn't 'which the best scripting language?' but 'What is the most painless and multi-platform way to use scripting?' which is not necessarily the same thing.
As BerggreenDK said 'can you elaborate?'