14

My job has required me to change technologies quite radically. I am fine with this, I am excited to be learning new stuff; but I feel like I am very much a newbie in Java, especially the web development side in which I have zero experience.

Just a little background, I would usually create websites using ASP MVC 3, Razor view engine, C# and on the backend everything will be nicely TDD'd and using EF for data access. With .NET in general I have been doing it for around 4 years.

Now I appreciate that for my purposes I wont find it difficult translating my skills from C# to Java syntactically, it's just everything around it, the frameworks, webservers and stuff which is going to confuse me in the short term. Even using a new IDE will be frustrating at first.

Can anyone offer any advice? I know we want to be using Spring MVC, presumably with Tomcat. Do I need to setup and install Tomcat for dev purposes? Or does eclipse/netbeans (which should I use?!) automagically do that for you, in a similar way that Visual Studio does by making a local IIS webserver to use.

For TDD, is there a good plugin for eclipse/netbeans anyone would recommend so i can just right click a class file and do "run tests"

Any general helpful links, getting started tutorials?

Cheers

3
  • 1
    On the ligther side, find another job ;-) Commented Mar 2, 2011 at 10:19
  • For IDEs, consider IntelliJ IDEA from JetBrains. If not, then NetBeans would be the best alternative. It's got built-in servers like Tomcat and Glassfish. For EJB, Glassfish is better, but if you're only making websites, Tomcat should do. NetBeans does automagically run the app on the webserver. The editors and plugins, and keyboard shortcuts can be adapted to, so development should be easy. I actually find JetBrains IDEs more comfortable to use than Visual Studio. Too bad they don't have an ASP.NET MVC IDE. I don't expect this to be considered an answer, so let it be here. Commented Mar 2, 2011 at 10:54
  • I tried to know if you have moved to Java, but i think you didn't, i knew that from the your interesting tags here!! Commented Jun 29, 2012 at 18:21

4 Answers 4

7

I don't recommend to start with Spring MVC. You should start a far lower level to keep it simple at the start.

I recommend to install an Eclipse IDE version for Java EE Developers. This version contains all the stuff you need except of an application server.

So you have to install a Tomcat yourself.

In Eclipse you can now start with a "new Project" and choose Dynamic Web Project that does all you need for a clean new Web Application.

Out of Eclipse you can then rightclick the project and click Run on Server, which opens a qizard where you configure the things for your Tomcat installation.

This is what the setup is about. And you should use Eclipse, because Eclipse is a standard editor in a professional environment.

What you now should learn or where you should start is first of all learning java if you not already did. And then go on with: Servlet API and Java Server Pages (JSP) API.

You should get you some books on that to get your head around it.

After that it will be much easier to understand what Spring MVC is, what it does and how it works.

Starting with Spring MVC in this case would be like building a house starting with the roof. I think this would fail.

Edit: Just to complete this, I found this link here, which seems to me like a good first starting point.

Edit: Another last thing: the standard library for TDD in Java is called JUnit and there is a nice plugin for Eclipse to use it.

Sign up to request clarification or add additional context in comments.

Comments

2

The big problem is that you are going to stay stuck in the very addictive products of Microsoft, and it's "magical" tools and editors and plugins, even keyboard shortcuts.

So, i think it's very hard to move.

1 Comment

Thanks for the encouragement :)
1

Some suggestions:

  • Test Driven Development - JUnit, HTTPUnit

  • IDE - Eclipse (free), IntelliJ (commercial) - both offer all the advanced IDE features you would expect, including embedded Servers

  • Web framework - Important: a criteria you should use in choosing a framework is whether you can make changes without having to redeploy or restart the server to make a change. (Two examples that support this are Grails (script based) and Tapestry5 (uses live class reloading - I'm sure there are plenty more that do these days....but check this first or you'll waste loads of time waiting to deploy changes)

  • Server - Tomcat7 and Jetty are both good

Jetty is small, fast and flexible, it can make a good choice for development even if you ultimately use another server in production. You can either embed it in Eclipse (RunJettyRun) or write your own hooks to start it, as simple as:

private static void run(int port, String resourceBase, String descriptor) {
    Server server = new Server(port);
    WebAppContext context = new WebAppContext();
    context.setResourceBase(resourceBase);
    context.setDescriptor(descriptor);
    context.setContextPath("/");
    context.setParentLoaderPriority(true);
    server.setHandler(context);
        server.start();
    server.join();
}

Comments

1

Try Oracle ADF(Application Development Framework), It is very similar to Microsoft Visual Studio.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.