Adding a Groovy web console into eclipse(j2ee) and run it at apache tomcat - eclipse

Is there anyone that has done a java interpreter using groovy-all jar file? Maybe sample or example can share it to me or teach me? I meant a interpreter that can parse string(java code) into the textarea and output it as a result like(hello world)

As you need some sample code to implement a web-console using groovy-all.jar, it would strongly recommend taking a look at Groovy Web Console.
Although it's not exactly a Java EE / Tomcat app and it is fairly similar as its a standard Java Servlets API 2.5 based web app. It runs on Google App Engine, which you can try out here. All you need from it is the script execution logic which for most of the part is not app engine specific. Keep in mind, it has dependencies on GAE Apis (through Gaelyk) so you should prune that part out of it to run in it outside Google App Engine.

Related

what is the need & use of apache felix web console bundle in liferay 7.1

I am new in liferay want to perform crud operation using service builder so i want to understand need & use of apache felix web console bundle in liferay 7.1 so that i use it in order to check json/webservice api.
I would say you are not looking at the right tool for the job.
The console enables you to interact with the OSGi framework, a good place to start is not on the console but on the file systems if you are looking into understanding how Liferay uses the framework. The framework is embedded into the web app in order to provide the environment where bundles can live and provide services collectively.
Gogo is an auxiliary tool that enables interaction, you can query if bundles are installed, check the dependencies that you missed and who is providing a certain service or exposing a package.
Most of day-to-day of this kind of information you can also find in the app manager and/or logs.
About testing you api, I assume you are looking for seeing if it was installed and if it was resolved and activated. The app managers can provide the first clue for this, but gogo is an adequate tool as well, you will need to learn its commands and syntax. Do not worry they are trivial, you can find a description on the Apache's project page an on Liferay's dev guide.
Now, if you are looking to test the API for correctives or availability, using gogo will demand custom commands and lots of extra logic other tools provide for you.

Tomcat/WildFly - fast webapp auto-reload on IDE compile-on-save?

Is it possible to do what "mvn jetty:run" does, ie. run it against an extracted webapp and auto-reload/auto-restart the webapp if any of the extracted files have been changed?
Beware! I'm NOT talking about updated WAR files and auto-deploying them. My IDEs currently update the class files directly inside the "extracted" webapp file structure.
Context: I'm wondering what (freely licensed, ie apache/lgpl, not CDDL/GPL) Java EE 7 solution provides the fastest roundtrip times for developing test units against the full stack/bugfixing.
I'm also thinking about continuing to use Jetty 9.4, maybe with openejb, because I'm not using most of the JavaEE features anyways. I'm not really a big fan of IoC/DI because if you try to avoid scanning overhead, you put configuration into XML, whereas setting up an embedded server programmatically is strongly typed and cleaner IMHO (remember jetty.xml? programming Java using XML, wtf...). I also don't like JSTL/JSP etc. because templates feel like PHP and j2html seems much more Java-like to me.
But what I want is JPA transaction handling/connection pools for my Jersey servlets. Currently I'm doing that inside a RequestListener, and a more seamless support seems preferable, though not at the cost of being able to run a full stack jetty embedded server in my unit tests without much hassle.
Update
I'm using a simple BASH script using inotifywait now. It simply uses Glassfish's and WildFly's RESTful admin consoles for redeploy:
https://github.com/jjYBdx4IL/snippets/blob/master/bash/jee_autodeploy.sh
It doesn't even deploy the war, instead it simply deploys the build directory. It should be fast enough for most use cases. And if your app grows too large and increases reload times beyond a certain point, one should probably start thinking about refactoring it into multiple modules anyways.
You could try using OpenLiberty, which was released today and is the core (Java EE 7 complaint) subset of WebSphere Liberty. It comes with an eclipse plugin known as "WebSphere Developer tools" and is under the EPL-1.0 license.
http://openliberty.io/

Find Version of GWT Running On Site

Is it possible to send a javascript command to a site and determine the GWT version running in the browser? The reason I ask is because our QA folks are certifying our software and need a way to look at the version running without taking our word for it by looking at the IDE.
I know that I can do java -jar gwt-dev.jar, but normally we do not deploy that with the software.
The built-in GWT linkers generate a $gwt_version variable in the *.cache.* files.
Assuming you don't have other frames in your app, your GWT app will be in the first frame so you can then get the GWT version used to compile it with frames[0].$gwt_version.

Web framework with user-friendly desktop deployment?

I'm building a web app with Backbone.js (I'm not tied to Backbone yet though). I need a back-end framework only for persistence to a database via a RESTful API. However, I also need to able to deploy it as a 'desktop' app for off-line use, i.e. running a local server and launching a browser window, but I don't want users to have to start a server from the command line to run the application.
I can use SQLite as a database since it's only a single user application, it's just the framework that I'm stuck on. I have looked at the following:
Rails and Django: Default web servers are too flimsy, requires Ruby/Python and runs from the command line. I'm aware of the Bitnami stacks but at 99mb it's too big of a dependency and not exactly hidden from the user.
Sproutcore: Run from command line, also too bulky.
Pyjamas Desktop - Depends on MSHTML which I suspect limits my ability to use HTML5 features.
I'm leaning towards creating a Java app that starts a Scala/Lift server instance and opens a web browser, then sits in the system tray (kind of like WAMP). Is anyone familiar with a tool or framework built for user-friendly deployment as a standalone desktop app?
I do not know if PHP is an option for you? Then I would recommend phpdock.
web2py has a standalone deploy-to-desktop feature with no dependency on Python: http://web2py.com/books/default/chapter/29/14#How-to-distribute-your-applications-as-binaries
As Eydun said, phpdock is an option but it's commercially licensed .
I settled on using Java/Spring/H2/Hibernate/Jetty. I find that Jetty serves requests VERY quickly so the application looks real-time when launched in a browser. There is a tutorial on embedding the Jetty server here. I imagine it's quite trivial to build a GUI that launches the server and a browser.
Another Java option is to use the Play Framework, which may be more at home to those coming from a Django/Rails background. However, the documentation for "creating a standalone version of your application" for Play 2.0+ indicates that they have ditched using Java EE containers (Tomcat/Jetty) and WAR files in favor of running the JARs with the bundled copy of JBoss Netty, so it may take a bit of work to get it running the way you want it.
I would recommend the Play Framework approach if you're OK with using/learning Scala.

how to deploy java desktop application as Java web start

How to deploy java application using java web start, any suggestion for pdf file which I can read and do ?
Here is a step-by-step tutorial here below, which shows how to create the .jnlp for a simple app, signing and packaging the .jar:
http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/
For reference, the java-web-start tag itself is a convenient way to learn moreā€¦