Posts

Spring Webflow - External Redirect on an end state in a subflow, NoMatchingTransitionException

When using a end-state in a Subflow you may encounter the following exception: NoMatchingTransitionException: No transition found on occurence of event Subflow Note that in a subflow the view attribute of the end-state is ignored, so this redirect needs to be defined in the parent flow. Parent Flow     Updated Subflow

Linking an Icon to an executable in Ubuntu

To link an icon to an executable in Ubuntu you need to do the following: (In my example I will be using Aptana Studio) 1. Open a terminal window and go to  /usr/share/applications 2. Create a desktop file by running sudo gedit app-name.desktop (aptana.desktop) 3. Add the following properties to the .desktop file [Desktop Entry] Type=Application Encoding=UTF-8 Name=Eclipse Comment=Aptana Studio IDE Exec=/opt/Aptana_Studio_3/AptanaStudio3 (your executable) Icon=/opt/Aptana_Studio_3/icon.xpm (your icon) Terminal=false Type=Application Categories=GNOME;Application;Development; StartupNotify=true Save the File If you now search for your application the icon should be linked to the executable. Update: In order to get the icon appearing in the launcher bar, I had to copy the aptana.desktop file into ~/.local/share/applications/ I then pressed the windows key and searched for 'aptana' and dragged the icon to the launcher bar.

Spring Webflow: Unit testing with Parent flows

Recently I had to test a webflow that extended a parent webflow. The documentation didn't offer much in the way of help but did suggest that you use getModelResources() method to register additional flows from the AbstractXmlFlowExecutionTests class @Override protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) { FlowDefinitionResource[] flowDefinitionResources = new FlowDefinitionResource[1]; flowDefinitionResources[0] = resourceFactory.createFileResource("src/main/webapp/WEB-INF/flows/base-flow.xml"); return flowDefinitionResources; } Great! Or so I thought... Below is how I extended the flow to use the base parent flow. I registered the base-flow.xml in the flowRegistry like below and I assumed that the AbstractXmlFlowExecutionTests class would register the flow as id="base" ... This was the wrong assumption, after debugging I no...

IE8, Javascript Errors and console.log

Ran into an issue with IE8 and using the JQuery validation framework. Basically what was happening was that the validation framework was kicking in and identifying the errors (correct) but the form was still getting submitted to the server. (Incorrect!) Anyway after some investigation I found that it was the  console.log statements in the javascript code that was causing the issues. As I was using the developer toolbar provided with IE I wasn't seeing the issue this is because the console object gets created when you open the developer toolbar duh! So if you are getting some weird behaviour check that you don't have any console statements in you Javascript files.

Spring-Webflow Exception The expression string to parse is required and must not be empty

Today I ran into a weird exception that was only happening on IE8, IE9. java.lang.IllegalArgumentException: The expression string to parse is required and must not be empty As this was not happening on Firefox or Chrome I began to wonder what IE was posting to the server.. After some investigation I found that IE was adding the submit button value to the POST url, see below HTML Submit Button: <input type="submit" value="Next" /> The Next value gets appended to the url: http://someurl.com/webflow/viewstate?param1=mark&param2=denieffe& =Next When Spring-Webflow tries to parse this it throws the exception above. My workaround was assign a name attribute to the html which produced a correct parameter mapping HTML Submit Button: <input type="submit" value="Next" name="nextBtn" /> The Next value gets appended to the url: http://someurl.com/webflow/viewstate?param1=mark&param2=denieffe& nextBtn=Next ...

Adding code in blogger

As I'm new to Blogger I couldn't figure out how to highlight my code. So after trawling the web for 5 minutes I found a solution. 1. Create a new Post and switch to the HTML view. 2. Paste the following css and Javascript sources into  the file <script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shCore.js" type="text/javascript"></script> <script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushRuby.js" type="text/javascript"></script> <script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shLegacy.js" type="text/javascript"></script> <link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shCore.css" rel="stylesheet" type="text/css"></link> <link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shThemeDefault.css" rel="stylesheet" type="text/css"...

CSS - Styling Tags

Sometimes I forget how CSS sees the relationship from one tag to another and how to apply different CSS styling rules so I'm writing this post to help me remember. I'm using the book 'CSS - The missing manual' as a reference. Ancestor : A HTML tag that wraps around another tag is its ancestor Decendent : A tag inside one or more tags is a descendent. The <title> tag is inside the <head> and <html>  tags Parent : A parent tag is the closest ancestor of another tag. The <head> tag is the parent of <title> Child : A tag thats wrapped by another tag is a child tag. Sibling : Tags that are children of the same tag are called siblings Styling Groups of Tags To style groups of elements for example to have all header tags to have the same font and color you can create the following rule:  h1, h2, h3, h4 {color: #0EF333;} The Universal Selector (Asterisk *) An asterisk * is a universal selector for selecting every elem...