tag:blogger.com,1999:blog-89124743963635264742024-02-08T11:05:41.791+00:00Java RamblingsBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-8912474396363526474.post-42290382229686068642013-10-23T13:41:00.002+01:002013-10-23T13:41:31.181+01:00Grails mocking 3rd Party REST serviceshttp://www.objectpartners.com/2013/02/08/grails-testing-mocking-3rd-party-services/
http://freeside.co/betamax/#usageBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-59239702001192181812013-10-22T17:17:00.001+01:002013-10-22T17:17:10.188+01:00Regular Expression Parserhttps://www.debuggex.com/Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-13319128463310807842013-10-04T15:06:00.000+01:002013-10-04T15:06:15.901+01:00Accessing Property File Property from JSPSpring:
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/cas.properties</value>
<value>/WEB-INF/cas-${env}.properties</value>
</list>
</property>
<property name="fileEncoding" value="utf-8"/>
</bean>
<!-- expose specific properties to application -->
<bean id="applicationProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="singleton" value="true" />
<property name="properties">
<props>
<prop key="forgot.password.url">${forgot.password.url}</prop>
</props>
</property>
</bean>
JSP:
<spring:eval expression="@applicationProperties.getProperty('forgot.password.url')" var="url" />
<a href="${url}">Forgot Password</a>
Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-91407966131032631652013-10-01T13:43:00.002+01:002013-10-01T13:43:26.667+01:00Special Character Toolshttp://www.babelstone.co.uk/Unicode/whatisit.html
http://www.utf8-chartable.de/
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_referencesBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-2151498701889359302013-06-27T07:50:00.001+01:002013-06-27T07:50:33.386+01:00Wireframe Mockupshttp://www.balsamiq.com/products/mockupsBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-70854577706449760982013-06-13T15:14:00.001+01:002013-06-13T15:14:25.146+01:00Logback - New Logging mechanismSeen as successor to log4j
http://logback.qos.ch/demo.htmlBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-353783306180863102013-06-06T13:05:00.001+01:002013-06-06T13:05:35.578+01:00Java Memory Detection Toolhttp://plumbr.eu/Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-3099430909697915702012-05-17T09:35:00.001+01:002012-05-17T09:35:22.211+01:00UI JavaScript/HTML Team TipGet someone to knock up some static HTML screens which have common HTML snippets for forms (with style classes) for fonts, tables, buttons, etc..., and do the same for javascript to do things like grey out text fields etc...
This way the team are more likely to apply these styles and javascript snippets more consistently across the app.Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-10787761882945761652012-03-28T13:18:00.002+01:002012-03-28T13:18:43.843+01:00Wordpress Pluginsi-contact-form
http://graphpaperpress.com/themes/sidewinder/
http://graphpaperpress.com/plugins/gpp-category-slider/
http://wordpress.org/extend/plugins/wordpress-gallery-plugin/Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-36303931989632049452012-03-28T09:53:00.001+01:002012-03-28T09:53:25.272+01:00jQuery Galleryhttp://coffeescripter.com/code/ad-gallery/Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-50686891775821852632012-03-28T09:52:00.003+01:002012-03-28T09:52:41.058+01:00HTML 5 Graphhttp://www.rgraph.net/docs/index.htmlBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-56178076684051396642012-03-28T09:52:00.001+01:002012-03-28T09:52:06.062+01:00Javascript Visualisationhttp://thejit.org/Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-57778464795058454282012-03-08T11:09:00.001+00:002012-03-08T11:09:56.938+00:00Speeding up Slow Rendering Pages TipIf you have large amount of text in div's which is making the page slow to load, you can hide the div's, and add expandable's which will open and close the div's. Not only does this make the page cleaner, because your div's are hidden, the page will load much quicker as the browser will not try to render it.Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-35087892957699423412012-03-05T11:33:00.001+00:002012-03-05T11:33:58.186+00:00Maven java:verboseset MAVEN_OPTS=-java:verbose
Note: Do not use quotes around the MAVEN_OPTS values.Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-21986524219800132822011-12-14T20:53:00.001+00:002011-12-14T21:00:01.822+00:00Ditch the Web BrowserThis article is on why I think it is time to ditch the traditional Web Browser, with it's support for HTML (5) and JavaScript, Flash, Silverlight, Java etc..
<h2>
So, the first question is, what is wrong with what we have got?
</h2>
<ul>
<li>
1) In HTML, textfields etc.. are nested within their layout containers. This makes it difficult to move things around within the browser. I think
the 'data' should be sent back as one concern, the 'default' layout as another concern, and the 'widgets' used to render the data in another section.
Validation rules should be sent back separately too. The layout binds widgets with data items and the data items are bound to validation rules.
Look and feel should be separate as well (which it generally is at the moment with CSS, as long as developer's don't add styling inline). Finally,
security rules should be sent back as well. Caching rules should be built into the page too!!!
So, in terms of separating the concerns of a web page, we already have rules:
a) data
b) widgets
c) layout
d) validation
e) styling
f) security
g) caching
The advantage of this, is that we can then leave the layout on the client, and just the data is sent back and forth. The clients can customize the layout information.
</li>
<li>
2) Data interchange format
This is typically HTML, JSON or XML. But it is hard to process these languages on the client side. The data interchange format should be transparent
to the web page, why should it care what the format is? Then we can start supporting technologies like Protocol Buffers and even parts of Thrift.
We have marshallers plugged into the browser to allow it to understand the different standards based data formats.
I mean, if I want to pass some data from a flex widget to a JavaScript widget, how hard is that at the moment, and then call a SOAP based web service
using Ajax? This is far too difficult, this stuff should be simple.
</li>
<li>
3) Strictness
The browsers, allow developers to send back badly formed pages, they also allow developers to put styling inline, just put scripting in the middle of
a page etc.. Why? This is bad practice, we should be trying to help developers create maintainable web pages. Let's make things tighter.
</li>
<li>
4) Speed of new features
To get new features into the browser, we have to wait for a standards committee, then have to wait for it to be implemented into a browser. Why not make the architecture of this new platform, pluggable. We want control still over what get's get officially released however, else you get swamped with plugins, and you don't know which ones work well and which ones don't.
</li>
<li>
5) Development of Web Pages should become easy
Let's open up development to anyone. Let's create a rich IDE and allow a user to drag a button onto their web page, and then right click on the button and select -> "When the user left clicks this button..."
<p>
-> "I want to my text box to ....". -> "turn the colour red"
-> "I want to popup .....". -> "Customer Details Window"
-> "I want to hide ...."
-> "I want to mimize .... "
-> "I want to resize. .... "
-> "I want to move this ... "
-> "I want to reduce this in size by %"
</p>
Typically, we are normally doing very basic things in a web page, but it is really hard work to get a new page of data back
</li>
<li>
6) Richer widgets built in
Why have we still not got a paginatable table available to us, that allows us to sort and filter???? This is such basic functionality that is not available to us.
</li>
<li>
7) Event mechanism
Too restrictive, what if we want to broadcast events within a web page to other components / widgets that we did not even design? (that have come from another site??)
</li>
<li>
8) Graphics built in
Obviously we have HTML 5 now, but needless to say Graphics should be built in, along with Video tags, Charts, Maps (with pluggable providers), Timelines etc..
</li>
<li>
9) Advanced Widgets
SMS message, Nested Webcam Panel, Skype, Social Networking Widgets, Instant Messenger. I want to be able to build up my web page how I want it.
</li>
<li>
10) Back button does not work
With new Ajax / RIA style apps, the back button does not work
</li>
<li>
11) Too many browsers
Constantly trying to get web pages to behave the same in different browsers.
</li>
<li>
12) Testing is hard
</li>
<li>
13) Developing is too hard
</li>
</ul>
<h1>
New Browser Design Goals
</h1>
<ul>
<li>
1) The user should be able to drag and drop their web pages around, to organize the page how they want.
</li>
2) Browser, sent the following items as separate concerns, data, widgets, layout, validation, styling, security, caching.
</li>
<li>
3) User should be able to style up the page how they want.
</li>
<li>
4) User should be able to produce a 'mashup', ie. create a 'pane' and drag it into the web page on the browser.
</li>
<li>
5) Back button should literally 'undo' last action, OR take user back to previous site (if they have just changed URL).
</li>
<li>
6) New Browser, should allow pluginable architecture for new language features. What happens if we want a 3dvideo tag?
</li>
<li>
7) Rich Widget library
</li>
<li>
8) Event bus built in to allow communication between heterogenous components running within the page.
</li>
<li>
9) IDE that allows users to build web pages easily.
</li>
<li>
10) Security should be built in from the ground up
</li>
<li>
11) Parental controls should be configured on widgets
</li>
</ul>Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-19424360825567115602011-12-13T21:31:00.001+00:002011-12-13T21:31:24.720+00:00GWT Plugin How it Works<a href="http://groups.google.com/group/google-web-toolkit/msg/811a63ea4a937136">GWT Plugin Description of how it works</a>Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-84669600254514725082011-12-13T21:23:00.001+00:002011-12-13T21:23:34.112+00:00Spring MVC and Spring WebFlowAnother quick entry to detail my experience with Spring MVC and Spring WebFlow.
<ul>
<li>Spring MVC rocks. It is simple and works.</li>
<li>Spring WebFlow - we used this with Spring MVC, and got ourselves tied in knots at one point deciding what *is* a Web Flow, and it can get tricky when you go from a flow into a sub flow, and then want to exit etc.... All problems that we could of avoided if we had not used Web Flow. Of course, the big USP (with WebFlow is that it supports conversational state. Trouble is, it is not often you actually need that, it is useful if you have a Wizard set of pages to code up.</li>
</ul>
<br></br>
Where we ended up with WebFlow was that we used WebFlow if there was an update screen, that spanned more than one page. If it was a view / read only web page, we would use MVC, and if it was an update screen which was just one page / one form, then we would just use MVC.
<br></br>
In hindsight, I would not use WebFlow again as I don't think the benefit's (conversational state and it manages state for you cleanly so if you spawn multiple browsers you can have no collisions), outweight the negatives of a) having to learn the WebFlow syntax (which increases the learning curve for developers), and b) introduces this grey area of what is, and is not, a flow.
<br></br>Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-88682573855741218322011-12-13T20:44:00.001+00:002011-12-13T21:26:39.875+00:00Thoughts on jQuery, DOJO and GWTHaving used both these JavaScript extensively over the past couple of years, I thought I would give some brief notes into my experiences of using them.
<br></br>
jQuery - this library is excellent at marking up a page with some enhancements. Would I write an entire JavaScript based application using jQuery? I would not use pure jQuery on it's own, if I was going to use it for a heavy js application, I would use a framework / set of patterns for ensuring the code does not end up being very difficult to maintain. The main problem with jQuery 'out of the box', is that it encourages developers to manipulate their pages using selectors and performing actions on those selectors. Whilst this is very powerful, it can also lead to very unmaintainable code, because unless you have a good understanding of what is in the HTML DOM, then you don't really understand what these powerful expressions are doing. Some programmers may document what they are doing, but a lot of programmers will not. But, on the whole, if you want some simple enhancements, jQuery is very impressive, a great set of plugins, and we have not had any problems with the library, it seems very stable, which is great.
<br></br>
DOJO - this library differs significantly to jQuery, in that it encourages the developer to create classes and custom components (called Dijit's) from the start. So in terms of the 'programming model', DOJO win's hands down. Where DOJO is not so great (and I was using version 1.5.1 on a legacy browser IE 6), is that some things are hard to do, such as styling a button. Why is styling a button so hard? Well DOJO nests the button in a load of div's or span's (I forget), and each of these layers has a css class associated with it.
<br></br>
See: <a href="http://dojotipsntricks.com/2011/05/03/styling-dijit-form-button-the-easy-way/">Style Button</a> for more info about styling buttons (although I do not recommend this method, it does highlight there can be difficulties doing such a simple task).
<br></br>
The other reason I am not so keen on DOJO are a) not many people 'seem' to be using it b) it is slow unless you configure your application to go through their Shrinksafe compiler. But, in general, it is 100% JavaScript application, so unless you have a strong team of developers (and preferably JavaScript ones at that), there is plenty of scope to get yourself into problems.
<br></br>
GWT - It is early days with GWT, but so far I have found the development environment quick to setup. I like the showcase (don't they always look good), and the debugging facilities are great. It is a bit of a weird concept, writing Java Code and spitting out JavaScript code, because we are at the end of the day, still manipulating the HTML DOM. In terms of what you get out of the box with GWT, I am using 2.4 and started using the DataGrid the other day, and found it buggy when adding it to a basic dockable resizeable panel, when taken out of the dockable container, it worked.
<br></br>
The upsides of using the Toolkit are that it is going to work well with Google API's, Map's, Calendar's etc... It still does not seem to have taken off quite yet, a jobserve search will show not it's future is still uncertain:
<br></br>
<a href="http://www.google.com/trends?q=GWT">GWT Trend</a>
<br></br>
Maybe the fact it compiles into JavaScript makes people nervous.
<br></br>
So, what would I use for RIA?
<br></br>
It would depend on how 'rich' it needed to be:
<ul>
<li>If I was trying to write a web based application with some widgets enhanced, I would choose Spring MVC with jQuery.</li>
<li>If I was trying to write a really whizzy rich application, I would choose GWT.</li>
</ul>
<br>
The Play Framework looks interesting, but the increase in volume of their forum has not carried on the trend of the previous year:
<br></br>
<a href="http://groups.google.com/group/play-framework/about">Play Framework Forum</a>
<br></br>
however, google trends shows there is more interest in it:
<a href="http://www.google.com/trends?q=Play+framework%2C&ctab=0&geo=all&date=all&sort=0">Play Framework Trends</a>
<br></br>
and just looking at the demo app, it looks like you can just chuck a load of javascript code inline to do stuff, which again, can create a maintenance headache if you have a team of 10 UI dev's going at it.
<br></br>
Of course, if there were graphical elements to the application, then this would bring HTML 5, Adobe Flex and Silverlight into the mix.
<br></br>
The bottom line is that JavaScript is brittle, it always has been, and it always will be. Until the tools for JavaScript improve and developers can get decent refactoring tools / pre-interpreter syntax checking of code, that situation will not change any time soon.
<br></br>
Personally, I think Google needs to try to get rid of HTML / CSS / JavaScript, and create a new type of browser, with a new meta language built from the ground up, where widgets are built into the language, and data is sent in an efficient form (Protocol buffers or Thrift maybe?). Layout and styling should be customizable by the user, just a default hint sent to the browser as a starter for 10.
<br></br>Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-63324450240409186882011-12-13T20:09:00.002+00:002011-12-13T20:09:53.841+00:00UI Screen DesignsI saw an internal demo today from one our developers, who showed us how he could mock up some UI screens, for presentation to a customer using this tool:
Axure - http://www.axure.com/
It seems to work nicely, although I am not sure about how good it would be to build a fully usable prototype. It can certainly do some basic view switching, and looks good for defining simple form based views.Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-73098209461023851002011-11-16T22:00:00.001+00:002011-11-16T22:00:27.103+00:00Process File Handlenetstat -ao<br />Process Explorer<br />ZenmapBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-27181580388025727042011-10-12T19:03:00.000+01:002011-10-12T19:04:00.778+01:00PC HardwaredxdiagBen Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-67537441402515451602011-01-20T09:02:00.001+00:002011-01-20T09:03:45.550+00:00Test Data Generation XMLWhen testing Web Services and you have a need to generate test SOAP responses (or any XML data for that matter), opt for using a template and doing variable substitution from the start. Also, validate the test data files on load. This will end up saving you a bunch of time.Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-77806145688045592842010-12-16T18:09:00.000+00:002010-12-16T18:10:14.130+00:00iText beware!!!!Even though it advertises itself as 'free' and 'open source'. If you use this library for commercial use you have to pay for it (and it is not cheap).Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-41824426297742388792010-12-03T06:42:00.000+00:002010-12-03T06:43:23.478+00:00Spring MVC JSR 303 Empty Strings/**<br /> * Ensures empty strings come in as NULL's<br /> * <br /> * @param binder<br /> */<br /> protected void initBinder(final WebDataBinder binder) {<br /> binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));<br /> binder.registerCustomEditor(Date.class, new StringTrimmerEditor(true));<br /> }Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0tag:blogger.com,1999:blog-8912474396363526474.post-55824762235487297902010-11-24T19:32:00.001+00:002010-11-24T19:32:48.328+00:00Monitor thread usage on Solarisprstat –L –p <pid>Ben Gillhttp://www.blogger.com/profile/09832311947963733786noreply@blogger.com0