learning java/spring from python/django - java

I am required to pick up java (with basic previous experiences) + 1 specific application framework, having spending most of my times in Python and Django. Chose Spring mainly due to my requirements.
May I know what could be the equivalent of Django's development server in Java so I can easily run and check my Java code?

You can deploy a web app using Spring to any Java EE app server. I'd say that the simplest choice would be Tomcat, the Apache servlet/JSP engine.

I would also suggest Jetty which is a lightweight servlet container like Tomcat, but keep in mind the problems regarding deployment of Java EE applications mentioned in this thread Can Jetty be used as a Java EE lightweight application server?.
Another alternative is Glassfish.

If you are working with netbeans then Glassfish is a good fit since there is very good integration between the two.

Related

Java Rest framework + server to expose service to Ruby on Rails

I have a very small Java codebase that I would like to expose as a REST service that responds in JSON format (to be used by a Ruby on Rails project).
I have only notions about Java web servers / web frameworks. What would be:
a. a suitable Java MVC and
b. a java server
to ease my deployment? I am interested in:
easy to build(wrap) the solution
easy to maintain / configure the server
stable (not experimental)
We use CXF extensively. It is very simple standard JAX-RS annotation based. There is a good tutorial to set it up quickly. It works with or without Spring, but easier with spring, this is my preference. The other option would be Spring REST it is very similar to Spring MVC which is very easy if you know spring already, but on the other hand it is not JAX-RS based.
you might want to give Grails a try - it:
shares some similarities with RoR
comes bundled with an application server so it's very easy to get up and running
allows very simple deployment to a Java application server (e.g. Tomcat, Jetty)
has built-in support for JSON
has recent stable releases
is under active development
http://www.restlet.org/
http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html
https://github.com/dhanji/sitebricks (my favorit)
For the server part of the problem, build your code so that it is a servlet and then deploy in a container like Tomcat or Jetty. (There are many others too, but Tomcat and Jetty work very well and are pretty easy to use.)
For the framework, I'd recommend CXF (I've had good success with it in my project) as it keeps the amount of configuration you need to write small (typically just add annotations to mark which methods are to be exposed; the annotations are standardized as JAX-RS), but many others are valid choices too.

Good Web Server/Servlet Container for Clojure Web Apps?

I am looking for a good production web server/servlet container for my compojure web appliction. What are the pros and cons of using Jetty or Tomcat or other server for a Clojure web app using compojure? Is there any good documentation for using a web server with Clojure for production, or tools?
I would prefer a web server that is flexible, easy to configure and has good documentation on how to configure and use it.
I think there is not yet a pure Clojure Webserver, but I heard that people at Apache were working on something like that. On the meanwhile I have some links I found useful myself.
A commentary on Apache + Jetty: http://briancarper.net/blog/510/deploying-clojure-websites
Take a look at this for implementing your own webserver via servlets: Clojure web application - where do I start?
If you don't already have your own infrastructure to run on, you might consider Heroku, which supports Clojure. See their tutorial Getting Started With Clojure on Heroku/Cedar. It's free to start and very easy to scale.
Chas Emerick has a rather old blog post + slides on doing continous integration on webapps right (Heroku, Pallet, War-file or whatever nescessary to NOT roll your own solution).

where we put ejb program in tomcat 6.0 and how to deploy?

I do not have eclipse. and I am having Tomcat 6.0.I write the programs in notepad. and I was successfully run the servlet programs. but I am not know about EJB. that is "where we put the .class files(In which directory)?". and "how to run and how to deploy the EJB programs?" please give sample example. please help me.
Tomcat 6.0 is not an EJB container. EJB's are a rather advanced topic. Do not haste into it. You can jump a mighty long way with servlets without ever needing EJB's or EJB containers.
If you need more services to base your app on, look at Spring, which offers (almost) everything an EJB capable container offers and allows your programs to run on Tomcat 6.
Also Java is a bit verbose to use notepad for non trivial projects. You might consider to upgrade to an environment which gives better support. I am partial to IntelliJ myself, but netbeans and eclipse are nice too for that kind of development.
If you like to stick to notepad approach, you might take a look at grails. It offers all the services but uses groovy as the programming language which makes things a lot more compact allowing to develop JVM based web apps using a lean editor.
You can run only web applications with Tomcat . For application s developed using EJB Use JBOSS. But JBOSS may be very slow. So while development use glassfish. Tomcat is only for jsp and servlets. When it comes to EJB its enterprise application and have to use EJB container like JBOSS or some other EJB container.

How to setup java web architecture on hosting slice/dedicated server?

I want to build web application that is based on java technology (tomcat )
Can I get please suggestions on how to set up the servers (apache – mod_jk – tomcat ? )
And what are the right frameworks to use or not .
For memory and ease of work from the development side ( to use plain jsp or mvc frame works? )
Although you didn't ask for alternatives to tomcat, if you are starting to look into web development you should have a look at Caucho's Resin. I find it is a better alternative than tomcat and makes it very easy to setup a system for test and development. It is completely built in Java and the open source version is free.
From development point of view always use an IDE such as Eclipse or Netbeans, makes the job easier n much faster. Here's a nice tutorial to get you started on developing web applications on Eclipse with Tomact integration - WTP Tutorials

How to start a web application with eclipse

I love eclipse and java. And i want to code my entire web application using eclipse .. right from designing html files to servlets.. I have zero experience in developing web apps .. So How to to setup eclipse for web apps and How do i get started ???
Google even autocompletes this question so you know it's a popular query!
There is very little information that you are providing, and there are actually tutorials for creating web applications with Eclipse and Java. You will want the JavaEE version of Eclipse as a starting point.
If you want to try using a web framework that works with Java I recommend Struts, although this may be too big if you're wanting to develop small web applications (and it's not exactly the easiest thing to start with).
I also recommend installing Apache Tomcat as your server because it's free and easy to use. Here's a good starting tutorial:
http://www.xwt.org/tutorial/eclipse/
Firstly, make sure you've got the Java EE eclipse binary : http://www.eclipse.org/downloads/
As has been mentioned, there are various google-able tutorials on how to set up, deploy and manage web applications under eclipse.

Categories

Resources