Friday, September 11, 2009

Special characters (#, @, :) in URL

Special characters (#,@,:) in URLs

Special characters as #,@,: in URLs have to be hex encoded.

Example: Your password is ###
It gets encoded to
where 23 is the hex value (0x23) of '#'

Character Hex Conversion


Unsafe characters :
Why: Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded.

Character CodePoints(Hex) CodePoints(Dec)
Space 20 32
Quotation marks 22 34
'Less Than' symbol("<") 3C 60
'Greater Than' symbol (">") 3E 62
'Pound' character ("#") 23 35
Percent character ("%") 25 37

Left Curly Brace ("{") 7B 123
Right Curly Brace ("}") 7D 125
Vertical Bar/Pipe ("|") 7C 124
Backslash ("\") 5C 92
Caret ("^") 5E 94
Tilde ("~") 7E 126
Left Square Bracket ("[") 5B 91
Right Square Bracket ("]") 5D 93
Grave Accent ("`") 60 96

The Best Java Web Framework

This one will be a very short article about my experiences with several Java Web Frameworks out there. Here we go:

Spring MVC It would be a good choice for the most of your needs.

Wicket Interesting to look at – no XML, no JSP (JSTL), just Java and HTML. Can mimic a flow in a WebPage object. Better separation of concerns than, for example, in GWT (e.g. no Javish CSS, etc.). Good Community

The only thing that is off is your dynamic HTML elements are done in Java

Spring Webflow It is a separate beast. It mostly is good, and makes sense, however, in practice, once you need to do something a bit more complex that a shopping cart or a hotel booking app (hint, hint), you can run into problems. “Back button” and “Double click” are not very well handled by the framework, may get an exception while bookmarking (there is a magic recipe, but far from being simple, and intuitive), sharing data across the flow, last resort error handling are not simple, etc.
Stripes It is Good and simple (no XML – conventions), but not very actively maintained - hence not as mature. (good community though) Worth to look at for simple projects.
Struts It's architecture is wrong from the very beginning: Validation (XML - why? What about minimum search criteria, what about several, what about nested OO validators!?) / 0 for NULLs / Multi Action Forms / Testing (without StrutsTestcase) / etc. ) Improved a bit since WebWork merging, but still lots of “code smells”.
JSF Quite hard to keep up with all these JSF based JSP tags + integration with security is not simple + full JSF solutions are usually Frankensteins with many pieces from different vendors.
Tapestry It is not bad, actually make sense, when you get it. But have you ever looked and tried to follow the Tapestry code? - Very complex implementation, if ever need to look inside the code + Tapestry does take time to learn, so forget about a new off-shore team, or fresh out of college not so geeky grads, taking it on.

Some more benefits of using Spring framework:

  • Binding / Validation is done just right – clean, testable, reusable
  • Multiple View options ( PDF, XML, Excel, Atom, etc… ) done easy [AbstractExcelView, AbstractFeedView, AbstractJExcelView, AbstractPdfView, AbstractUrlBasedView, AbstractXsltView ]
  • Annotation based – no XML madness, and very clear when looking at the code – check the Pet Clinic in Spring 3.0 M3
  • Integrates with Spring JS very nicely ( in case needed )
  • Handing requests and parameters with ( Spring ) expression language – quite flexible
  • In Sping 3, MVC is actually REST aware (GET, POST, PUT, DELETE)

Java Tutorials sites

Java Tutorials sites:

Useful lInks for Java

Some useful links for Java technologies: - The official Java developer website - new articles posted weekly. - A great source for Q&A style interaction in the community - Everything about Java and more. you can also get help for your problems in Java and prepare for certification. Best forum. - The Official Java tutorial from Sun - very useful for almost any feature set. Must for detail study of Java. - One of the originals. Weekly updates of Java articles.