Handler Interceptors For Annotation Based Configuration in Spring

September 28, 2009 by Ana

Here’s what you need to have in your *-servlet.xml file:

<context:annotation-config />
<context:component-scan base-package="com.travelfusion.tfweb.guide.controller" />

<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
   <property name="interceptors">
      <ref bean="myInterceptor" />
   </property>
</bean>

<bean id="myInterceptor" class="com.company.MyInterceptor">
  <property name="openingTime"><value>9</value></property>
  <property name="closingTime"><value>18</value></property>
</bean>

And your interceptor class something like:

public class MyInterceptor implements HandlerInterceptor {
   private int openingTime;
   private int closingTime;

   @Override
   public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) throws    Exception {
      // TODO Auto-generated method stub
   }

   @Override
   public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) throws    Exception {
      // TODO Auto-generated method stub
   }

   @Override
   public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
        Calendar cal = Calendar.getInstance();
        int hour = cal.get(HOUR_OF_DAY);
        if (openingTime <= hour < closingTime) {
           return true;
        } else {
           response.sendRedirect("http://host.com/outsideOfficeHours.html");
           return false;
        }
   }
}

Fixing Eclipse Tomcat Timeout

September 28, 2009 by Ana

To fix “Server Tomcat v6.0.18 was unable to start within 10 seconds. If the server requires more time, try increasing the timeout in the server editor” double click you server in the Servers perspective and increase the timeout value to complete server operations like in the image below.

Picture 3

It’s been so long, again!

September 22, 2009 by Ana

It’s quiet crazy how time goes so fast! I haven’t had any time to make posts here, but I hope to write some more in the near future, and if not here at least on Travelfusion’s blog (I’ll post the link here when we go live). I’ve been working for Travelfusion since July and it’s been a great experience! If you want to find cheap flights you should check our website. I am currently the lead developer for the site and we have a planned a major redesign, so there are so many cool things to implement using GWT. Drop by anytime and give us some feedback.

I am loving London, so much to do, never bored – well almost never – and visiting friends and family once a month just makes up for the occasionally lonely days.

Here are some pictures of a team building event. I can’t say for sure that shooting each other is team building but it was a lot of fun.

CIMG2141

7425_1037848722631_1717903954_93695_4269726_n

Handsome bunch

May 23, 2009 by Ana

IMG_7162

I had to post this one. Guys, sorry if you don’t like to be online, but you’re all very good looking, so it shouldn’t be a problem. :)

@Farewell dinner November 2008, Amsterdam

Ending up at a museum

May 22, 2009 by Ana

Not everything is wasted time…3 years ago me and Bas worked on a “mashup” of Google maps, when that was a very HOT subject and Ajax apps where appearing on every corner of the web. The project was closed and our domain name taken but the good news is that we managed to stay in the museum of modern betas for eternity. Plus we learned a lot from that experience and now I am trying to get Bas to put it live on his domain so we can remember from time to time how much fun we had doing it.

River Tejo, the sunset and new challenges

April 2, 2009 by Ana

It’s been a while. I have moved back to Portugal after 4.5 years in Holland. It was a journey, a good one. Now I start a new one with very different weather conditions. :) I travel by ferry daily and in the evening the sunset + the warm breeze alongside the river Tejo feels just great.

I am working as an IT Consultant now and it’s very different but also interesting. On my free time I work on my next big thing. My project should go live somewhere this year (I hope), and if it does I will post about it.

For now I won’t be writing much about programming or Java because I don’t really have time and my work is more directed at business analysis these days. I miss working with the latest technologies, but what I am doing now is also interesting and I still get to taste a bit of coding at home.

TomTom Local Search with Google

October 3, 2008 by Ana

TomTom Gox40 LIVE series was announced a couple of weeks ago. One of the projects I have been working on for this product was TomTom Local Search. For this project I worked closely with Google to use their Local Search API and with the TomTom Navigator team for client/server integration. This is very cool technology and it was a lot of fun building it.

‘Users can tap into the latest local Google listings from the TomTom GO LIVE to locate anything from Indian restaurants to flower shops wherever they are. They can just type in any search word, find matching locations and the device will take them there.’

Search for a business near you or somewhere else…

Get a list of results ordered by relevance and see the rating and business details for each of them.

Browse in the map for the results and call the business to make a reservation or appointment for example and navigate there. :)

Simple, useful and cool!!!

For more info on the Gox40 series and the other LIVE services for here.

Software Development Tools

September 15, 2008 by Ana

I have used the tools listed below for software development, debugging, testing and for editing images for user interfaces. :) Hope you find them useful too!

XMLSpy

Altova® XMLSpy® is the industry’s best selling XML editor and XML development environment, with advanced functionality for modeling, editing, and debugging XML Schema, DTD, XSLT 1.0/2.0, XQuery, SOAP, WSDL, Office Open XML (OOXML), and more. XMLSpy provides multiple editing views, entry helpers, wizards, comprehensive validation and error-handling, and a host of debugging and testing utilities. Code gen in Java, C#, and C++, plus Visual Studio and Eclipse integration, let you develop the most advanced XML and Web services apps for the environment of your choice.

SoapUI

SoapUI is Free and Open Source and is used for Inspecting Web Services, Invoking Web Services, Developing Web Services, Web Service Simulation and Web Service Mocking and Functional Testing of Web Services Load Testing of Web Services over HTTP.

Fiddler (HTTP)

Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

SQLYog

SQLyog MySQL GUI is the most powerful MySQL manager and admin tool, combining the features of MySQL Query Browser, Administrator, phpMyAdmin and various other MySQL Front Ends and MySQL clients in a single intuitive interface.

Notepad++

Notepad++ is a free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages. It runs in the MS Windows environment.

MultipleIEs

Usefull for testing web application in different versions of IE in only one machine.

GIMP

GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

Tortoise SVN

TortoiseSVN is a really easy to use Revision control / version control / source control software for Windows. Since it’s not an integration for a specific IDE you can use it with whatever development tools you like. TortoiseSVN is free to use. You don’t need to get a loan or pay a full years salary to use it.

Scrum World: I am a developer

July 22, 2008 by Ana
  • First thing in the morning, I check the scrum board to see which task is in progress and assigned to me
  • I don’t have anything in progress, so it is time to pick up something new
  • I follow the priorities and I pick up something from the top of the list
  • I work on the task, comply with best practices, write unit and integration tests
  • When I am done I create a review for a peer and move the tasks to the ‘Review’ column
  • I take some time to review the tasks that are assigned to me, so my colleagues can also progress
  • My task comes back from review and I need to make some minor changes
  • After making the changes I update the files in the review and quickly get an OK from a peer
  • I move the task to the ‘Testing’ column
  • At the end of the day I deploy a release on the development environment, which includes all the tasks which are now in the ‘Testing’ column, including the one I implemented today

The next day…

  • As usual my work isn’t quite finish because a bug was raised by the test team on the task I implemented yesterday
  • I fix the issue and make sure the unit and integration tests are up to date
  • I create a review which is approved after a few hours
  • I deploy the fix on the development environment
  • I check later and notice the issue has been moved to the ‘Done’ column by the test team
  • I realize how good it is to use Scrum and work together with everyone in the team to achieve our common goals!

The other side of things

July 16, 2008 by Ana

Here on the development department we are rarely aware of what’s happening on the marketing side and when we less expect they come up with nice campaigns for the projects we are working on. :) This is the case of our project MapShare which is now getting even more attention because of the new “Change Spotting” campaign. To read more about it and see the video drop by the website.

The ducks part is my favorite. :)