http://jasperforge.org/projects/
http://jasperforge.org/projects/jasperreports - The world’s most powerful and widely used embeddable Java reporting library for report designers and developers. [getting started]
prompt> cd \program files
prompt> cd jasperreports-<ver>\demo\samples
prompt> dir
prompt> cd barbecue
prompt> ant –p
prompt> ant javac
- Compiles the java source files of the test application
prompt> ant compile
- Compiles the XML report design and produces the .jasper file
prompt> ant fill
- Fills the compiled report design with data and produces the .jrprint file.
prompt> ant viewDesign
http://jasperforge.org/projects/ireport - iReport gives administrators and report designers total control over the contents as well as the look and feel of every report
Jasper reports includes some nice samples and tutorials:
http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/tutorial.html
http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/samples.html
Studio
http://www.jaspersoft.com/sites/default/files/jw-presentations/JW11_JaspersoftStudioinAction_GiulioToffoli.pdf
August 28, 2011
Posted by davidbloom |
J2EE, Open Source, SW Tools, XML |
Leave a Comment
From newteevee is an article about what you can see on GoogleTV from the web in your livingroom .
Mark Cuban writes in with a comment on bnet post and says:
Content owners still have a right to control what devices they want their content seen on and how its seen. Putting something on a website does not make it public domain
From dragonpointtvs is a post taking on Cuban’s points.
An interesting point in all of this is the bandwith by Netflix and other streaming option:
The language will shortly be changing, just as it has for mobile network users, where “unlimited” is basically gone now, and virtually all data plans have either a soft or hard cap.
October 26, 2010
Posted by davidbloom |
Web/Tech |
Leave a Comment
Danny Sullivan has shared his Google TV experience. He bought a Sony Blu-ray player that is Google TV-capable for $400 at Best Buy. It seems the networks now do not want you watching content available online on your PC with a Google TV device As another article on blocked content with Google TV says:
Google TV isn’t stripping the video off the sites. It’s not inserting its own ads into the content. It’s not knocking down firewalls, eating small children nor sacrificing animals. It’s simply letting you use a web browser, exactly as you’d use a web browser on a Windows or Mac computer.
I don’t know about you, but there has been litigation/settlements over sites who aggregate content that was written by others. Now, this is a different scenario where Google has money to be made in the adverstising arena by simply wrapping the networks content. This seems no different than a web site that aggregates a feed they do not own on their site. Where as Netflix pays the networks for their content and charges for it, Google TV content would be a free ride for the comsumer. Marc Cuban gives you his thoughts on this fact.
Another interesting point about Google TV ‘s ”open platform” is by Mark Suster who thinks Google might impact video in a similar way the print industry has been affected by the web:
it would be an understatement to say that traditional media is skeptical about Google’s benevolence and many fear a world in which video content margins are crushed in the way that print & music have been with the primary beneficiary having been Google.
But as much as I would like to drive down to Best Buy and get the Google TV Blue Ray player, just keep in mind that Google TV is not the only game in town.
October 24, 2010
Posted by davidbloom |
Web/Tech |
Leave a Comment
Steve Jobs has a HATE relationship with the Adobe Flash technology on Apple’s media devices. However, the Android platform has not shut its doors to it depite security issues with it, as its available for download. HTML5 is on the horizon and claims to provide a rich multimedia experience without the dreaded plugin download. I would think with HTML5 would have flash beat on the android. Not so much says CNN. However, dull version Flash on Android is available with only the 2.2 version of Google’s operating system.
September 21, 2010
Posted by davidbloom |
Web/Tech |
Leave a Comment
News of the Media Hub from Sprint
A new system software update for Sprint’s Samsung Epic 4G gives this high-end Android OS smartphone support for the Media Hub, a service for renting and buying movies and TV shows that was unveiled just last week.
The new iTunes-like service is getting started with content from NBC Universal, Paramount, and MTV Networks. TV episodes sell for $1.99, movie rentals cost $2.99 to $3.99, while movie sales cost $9.99 to $17.99.
September 19, 2010
Posted by davidbloom |
Video |
Leave a Comment
With Apple TV, you can stream from your apple device to your television. Such as, Pay-per-view of TV shows (for the networks who are on board), or movies from Netflix. But, what is Google TV? How do they compare?
This site states what we think it is:
Based on what has been circulating around the net it appears that Google TV has formed a partnership with both Sony as well as NetFlix to offer streaming on demand video in the best quality possible. Movie Downloads will be in 1080 p HD resolution.
In addition, Google TV Boxes will be pre-installed with Google Chrome for web surfing, will have the ability to utilize and run Android applications. Google TV will integrate into your television, computer and cloud platforms rather seamlessly. Web applications like Twitter, Google’s online photo sharing and storage service will also be included.
As Tim says:
Apple TV / Google TV are throwing down the challenge to all Cable providers. The goal is to ditch your cable boxes, and Blu-ray and instead view live streams direct from the internet directly through TV monitors. This will have a significant impact on the cable television as we know it. It’s only a matter of time television will be an old dusty device that our children’s grand-parents still view due in part Web mania is still a fad…
The google tv developers
September 19, 2010
Posted by davidbloom |
Uncategorized, Video |
Leave a Comment
Yesterday I heard that there was big news coming out of twitterville. A press conference of some sort I heard was taking place. Over the past year or so the twitter thing has really grew on me. Especially, since I have been blogging since the early 2000s, I like the microblogging concept. Anyway, here is timeline of the news about the #newtwitter. Some of the early adopters are not so happy about the tweeting changes.
More info:
http://www.techweet.com/2010/09/14/evan-williams-coughed-up-7500-for-twitter-com-back-in-the-day
http://www.youtube.com/watch?v=BjHDghBtK0A
http://www.readwriteweb.com/archives/twitter_is_not_a_social_network_says_twitter_exec.php
September 16, 2010
Posted by davidbloom |
Blogging, Web/Tech |
Leave a Comment
We should avoid inheritance if we can. Just like this post says:
The difference between is-a and has-a relationships is well known and a fundamental part of OOAD, but what is less well known is that almost every is-a relationship would be better off re-articulated as a has-a relationship
http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance
Other good practice that was mentioned in software was http://www.kitchaiyong.net/2010/02/solid-principle.html
September 14, 2010
Posted by davidbloom |
Web Design |
Leave a Comment
The world of web content is changing before us. Just this week, the N.Y Times has gone on the record and indicated :
“We Will Stop Printing The New York Times Sometime In The Future”.
The way we get news has been for a long time been changing. Some companies have had for while a problem on how we use their content.
With the way the content is shared and presented, there is bound to be people who wan’t a piece of the $$$ pie. Here is a good post on some of the types of news aggregation, and some of the litigation/settlements in the misunderstandings on who has a right to publish the data. Or even, who owns the data. On the outs is the RSS feed reader.
September 12, 2010
Posted by davidbloom |
Current Affairs, Web/Tech, XML |
Leave a Comment
I took just about the whole series of the 21st Century architecture at NFJS 2010 with Brian Sletten. Services (i.e. SOA) is not dead, however expensive is. Avoid the center down approach, and instead use the ecosystem based approach. Invest in the RESTful style. A little complicated, but you are investing in the future. Rest is not about behavior, but about information. It is not a SOAP replacement. Rest gives the freedom to negotiate in the format you like (i.e atom,rss, etc). Leonard Richardson introduced the Rest Maturity Model with Soap being level 0, URL resources level 1, http level 2, and hypermedia level 3. For example, twitter uses alot of JSON and not hypermedia. Some properties to consider with REST is performance (i.e. maybe the first request requires the greatest server hit, and subsequent requests do not), scalability (how it handles the load and scles down for different devices), stateless (part of request), uniform interface (don’t need WSDL), minimize layering. Rest Triangle : Npuns, Verbs, Representations. The important http methods with REST include : Get is a state transfer from server of a resource (i.e. web page), Head is constrained version of Get. Info about resource (i.e. header), Post is where accept by the server at this time an information resource, don’t know if it is recieved by server. (i.e form handling) create and update. Example in early days was usenet news, Put is do know resource. Overwrite idempotent record, Patch is more explecit version of Post, Delete is idempotent, Options ask if allowed to do something. An overview of Http return codes : 200s everything is cool, 204 no response, 300s good stewards (more information), 303 non-networkable address, 400s you screwed up, 500s server in bad state try again laterGood book is Rest In Practice. Artucles: InfoQ on Rest , Rest for Java Developers, Restlets , Net Kernal , The future is Rest . JSR 311 : http://www.infoq.com/news/2008/09/jsr311-approved
Semantic web has public and private link information. Microformats standard, but no common model. RDF is new enabling technology to focus on concepts that provides a global guide to webs of data.Information has a context so people can use it. Purl.org web site example that uses foaf (friend of a friend) with birthday handle. DBpedia data set. Gleaning Resource Descriptions from Dialects of Languages (GRDDL) W3C recommendation structured content. RRFa is RDF attributes (metadata). RDFa is a way to label content to describe a specific type of information, such as a restaurant review, an event, a person, or a product listing. These information types are called entities. Each entity has a number of properties . Freebase , Adaptive Blue. The Curie processing / RDFa spec. The Open Graph protocol enables any web page to become a rich object in a social graph. Enables any web page to have the same functionality as a Facebook Page. The Web Ontology for eCommerce can be found at Good Relations (see best buy). Semantic Web at InfoQueue . Rdfa split. ODF use of RDFA . Books: Pull: The Power of the Semantic Web to Transform Your Business. CommonTag. RDFa test page. RDFa distiller. rdfa.info web site. RDFa parser for fragments. Details on Whitehouse. gov site that uses RDFa .Taxonomy blog. Basics, Long tail
RDF triple , librdf.org/query , rdf about ,rdf-sparql-query , linked data , mulgara.org , sparql query , twinkle, govtrack sparql , reyvu.com with twinkle , relfinder with Kill Bill. Lastly, google supports RDFA
September 7, 2010
Posted by davidbloom |
Web Design, Web/Tech |
Leave a Comment
I am in the process of learning about jQuery. I have used some dojo, and recently most my work on client side has been in GWT . I figured the best place to start is in a slide share. As well, there is a jQuery fundamentals, an online book. jQuery in Action is also online. As the first chapter says :
If you’ve spent any time at all trying to add dynamic functionality to your pages, you’ve found that you’re constantly following a pattern of selecting an element or group of elements and operating upon those elements in some fashion. You could be hiding or revealing the elements, adding a CSS class to them, animating them, or modifying their attributes.
This javascript library make it easier to accomplish these routine blocks of code in your client code.
To collect a group of elements, we use the simple syntax:
$(selector)
or
jQuery(selector)
Known as a wrapper or a wrapped set.
September 6, 2010
Posted by davidbloom |
Uncategorized, Web Design |
Leave a Comment
The iPhone Developer Program License Agreement clause 331 shuts out adobe from iphone , but Phone Gap “which let developers write JavaScript code that runs in WebKit inside a native iPhone app wrapper” is approved and can continue.
The tutorial(s) for Droids is where I decided where to start learning about Phone Gap .
Using phonegap guide on windows , I got Ruby186 with 0.9.1 phonegap-android , and execute command with git (unix) bash:
$ c:/ruby186/bin/ruby droidgap c:/appdev/java/android-sdk-windows/ TestGap TestGap.com.example “c:/www/” “c:/aocapps3″
Other resources:
a good presentation by Brian LeRoux of Nitobi for Ben & Dion on Phone Gap:
- native app fragmentation : “Every Android device had a different screen resolution. Every hardware feature had to be checked, since every Android device had different hardware configurations”
- dom manipulation for cross rowser incompatibilities
- offline storage
- Phone gap internals for apple’s platform uses the public sdk and objective C .
- How you get your app to work for multiplatforms. Mobile web is the solution. Write once, get everywhere using web.
- write web apps use phone gap to package applications
- phone gap abstracts native browser agugment s javascript apis for device sensors data
- iphone devcamp aug 2008- instantiate web view call out from javscript api to native object c, only was throw url browser
- gap://
- geo, camera, sensor, vibration, sound, video, contacts, compass,anything browser can do
- phonegap.jss www folder and index.html
- starting point , can still do native at same time
- create a browser instance, execute javascript from native code, call out from javascript thru url execute native code
- androisbind java object right to browser instance become available as javascript objects
- compatiblity among platforms : mobile spec written in Qunit which is async
Phone Gap tutorial(s) for Iphone:
http://www.infoq.com/articles/mobile-web-development
Phone Gap reccomendation
Cross Platform Titanium and Phone Gap
http://phonegap.pbworks.com/
September 5, 2010
Posted by davidbloom |
Mobile, Web/Tech |
Leave a Comment
EasyMobile Development by Pratik Patel : JQTouch , App Accelerator Titanium , WebKit, Phone Gap , Building iPhone Apps with HTML, CSS, and JavaScript by Jonathan Stark, Aptana
jQuery byNathan Schutta : jQuery Fundamentals , jquery.com, jqueryui.com. More on topic from jquery tuts
Testing web layer: yuitest , js spec , qunit, jsunit ,jslint
September 4, 2010
Posted by davidbloom |
Web Design |
Leave a Comment
There was Big new today by Apple . Here is quick rundown of Steve Job’s state of the union address.
Ipod touch is not an Iphone without a phone, its an iPhone without the contract .
The cloud centric set top box called AppleTV that integrates (AirTunes) with the Ipad for $99 :
“Apple TV, which will be available within a month, will also display shows, movies, photos and music streamed over Wi-Fi from other devices – computers with iTunes installed, as well as iPhones, iPads and the iPod Touch. For example, an iPad owner could start watching a movie on the tablet, then walk into the living room and, with a few taps, finish watching it on the TV screen.”
Apple 99 cent rentals
Apple announces Ping, the social network for music built into iTunes. Don’t forget the GameCenter either
September 2, 2010
Posted by davidbloom |
Web/Tech |
Leave a Comment
NoFluffJustStuff
Resarch Triangle Software Symposium
(August 27 – 29, 2010) at Marriot Hotel.
I attended No Fluff Just Stuff 2010. I will cover what I learned in this blog post.
Collections By Ted Neward: The collection API is seperated by the interfaces, implementation, and the algorithims. Although a Map contains key/value pairs, it is not a collection. This was something Joshua Bloch fought for, and ten years later it still makes sense. Use of initializing collections to null was a mistake. Its better to initialize it to a zero sized collection value (i.e. new ArrayList()). Of coure, certain collections are synchronized where others are not. Refer to the book Java Concurrency in Practice which is a good for learning about thread safe issues. Note of Google Collections (now called Guava).Lastly, use for loops for iteration.
OSGI by Craig Walls : Modularity spec for Java is OSGI. Bundle lifecycle is installed, resolved (everything i need), starting, active (running). Everything defaults to private unless you tell it otherwise. Fragments are partial bundles. You don’t write manifest files yourself. Tools such as Bnd or Bundlor. Apparently OSGI didn’t incorporate JPA (see apache Arries) into it and because of that the springsource community realized that they did not have resources among itslef to take it to new level. As a result, it was taken to a new open source community to get help with it. Eclipse Gemini is the new project. Also, the Spring DM server is now Eclipse Virgo . Other projects include Apache Felix, Paxrunner. See Book Modular Java. See www.habuma.com/osgi/osgi-examples.html
Groovy On GAE (gaelyk) by Tim Berglund : The session started with a discussion of the book The Shallows which covers what the interent does to our brains. This framework is for small quick web applications (page centric). Mention of suitable and non-suitable architectures. Its syntax like coding jsps. Small size war files. Application server in cloud, Data store (big table noSql), Authentication, caaching (MemCache), XMPP (IM), Email, Task Queue, Image API, URL fetching, OAuth, Blobstore. github link . Mention of Dr. Laurie Williams and Pair programming.
Html5 by Brian Sletten : Despite what this website says, HTML5 by w3 is here. There is an ie enabling script even as mentioned here. Microsoft will support HTML5 in their browsers in ie9, and in a sense will be aiding in the phase out of the flash technology. With html5, the multimedia experience is achieved without the plugin that is neccesary with flash. The recourse for flash is supporting html5. Especially, since Steve Jobs changed the licensing agreement not allowing the Apple software to cross compile for adobe. As this html5 preview shows, the new section and article tags are part of the new standard, and replace the need for div tags to achieve this. html5 has a tool to create outlines of html5 conent. The new visual elements progress , meter (shows measurement within a range), details (dropdown with detailed info), input (such as time,date), canvas coordinate system. edspencer has a nice site covering html5 topics like Canvas, web storage api . A chrome html5 demo. The site html5 tutorial is a nice resource such as its canvas cheat cheat. The Codec Hell situation in which Google tried to move theVP8 codec along. The audio part of html5. html5 video player demo , and here is an example of html5 video that can be rotated , and more. The geolocation demo. The offline storage demo. Web workers/socket chat. Lastly, quake on html5. Some other html5 goodies: http://html5boilerplate.com/ , page in chrome http://www.thewildernessdowntown.com/index.html. Silverlight doom ?
August 31, 2010
Posted by davidbloom |
Uncategorized |
1 Comment
In the news lately is the lawsuit of Oracle vs Google over the JVM with the Android platform. I recently jumped on the Droid bandwagon with the purchase of Ed Burnette’s book Hello Android which was updated for Android 2.2. Also, this week I attended the @tridroid meeting here in the area.
In the Burnette book, his first chapter is dedicated to getting started with the sdk and the eclipse plugin (https://dl-ssl.google.com/android/eclipse) and the emulator. Much like this blog post and the android developer Hello World.
[wiki] [forum]
August 22, 2010
Posted by davidbloom |
Mobile, SW Tools |
Leave a Comment
Built for GWT, Pectin makes use of the Presentation Model perspective . By this, Andrew Pietsch, has implemented a library that handles a customized domain or state logic. Here is the demo.
Pectin Basics :
“data up” – frameworks that map the form data from domain bean definition(i.e struts) . The data is collected in regard to the bean definition. There is no business logic based on the User Interface in this model. Moreover, the UI is passive, and the logic is on the server side.
“bottom down” – the “data up” does not work well for GWT, since most of the logic moves to the client, and the server side is just a thin DAO wrapper. Pectin works with the domain bean without being constrained by it.
- View : may implement view or delegate to presenter model
- Bindings : binding widgets to model
- Presentation Model (with plugins) : data and handlers required by view, whereas plugins add additional state to data
- Adapters : creating ValueModel‘s from your domain data (dirty data or not)
- Domain – the data
Value model in Presentation model: provides access and mutation methods (get/set) and notifications when the value is modified using a (gin/juice like) declarative style api. (ValueModel , MutableValueModel)
FieldModels are a ValueModel that hold a reference back to the form that created it.
Related [MVP]
July 12, 2010
Posted by davidbloom |
Web Design |
Leave a Comment
link :
That is the Best description of Rest Ive read! Now I get it – I used to think it was just another competing way of getting information like RPC, SOAP, etc. But I understand from your article that it is a universal way of mapping information
- Roy Fielding’s name is on the HTTP specification.
- The HTTP protocol capabilities are not always utilized.
- http address tells you the location of something anywhere in the world
- REST is an architectural style. It defines a resource which the web address points to. Each resource are simply concepts
- A web page is a representation of a resource. There are many other formats for resources. Therefore, browser can prompt for a certain representation of a concept. Thus, the URL or web address to “the something” can be thought of as a noun.
- Rest allows you to assign verbs to the nouns in away that makes sense (get,put,delete).
July 12, 2010
Posted by davidbloom |
Web Design |
Leave a Comment
The Google App Engine framework
http://passion4java.blogspot.com/2010/06/google-appengine-hello-world-example.html
http://www.slideshare.net/tahirakram/developing-java-web-applications-in-google-app-engine-2749092
On project click properties -> Google -> App Engine -> Configure SDK
For me, C:\eclipse\plugins\com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120\appengine-java-sdk-1.3.0\
“Trying a Demo Application” : the SDK is located in your Eclipse installation directory, under plugins/com.google.appengine.eclipse.sdkbundle_VERSION/, where VERSION is a version identifier for the SDK.
C:\eclipse\plugins\com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141
120> appengine-java-sdk-1.3.0\bin\dev_appserver.cmd appengine-java-sdk-1.3.0\dem
os\guestbook\war
********************************************************
my applicatiion id is dmbgwt
July 8, 2010
Posted by davidbloom |
Web Design |
Leave a Comment
JMS ~ high load where you can add queue’s in front of it to handle weight
Asysnchronous , Message Oriented Middleware
JMS Message Type
Text Message,ObjectMessage,MapMessage..
Queue point to point messaging
Topic – publish /subscribe messaging
A Session is created from the Connection. Unit of work, transactional capability. Responsible for creation of various JMS message types.
Producer (put message on), Consumer (pull message off)
Apache MQ
Destination – point to point or topic are examples
Spring has a JmsTemplate : delegates to collaborators to handle some of work
Message Converter – conver from objects to messages (SimpleMessageConverter)
DestinationResolver – resolve destination names (DynamicDestinationResolver or JNDIDestinationResolver)
Sending messages – one line methods or callback methods
producer call back or session callbacks
MessageDrivenBeans wait for the message. MessageConverters can be used on recption side.
JMS MessageListener aysnchronous reception
Spring has light light weight mechanism for listen for messages, as compared to EJB
SimpleMessageListenerContainer or DefaultMessageListenerContainer
Spring supports 2 phase commit
July 1, 2010
Posted by davidbloom |
Spring |
Leave a Comment
Testing in Spring 3.0 much better. Use @Setup or @Test , @RunWith @ContextConfiguration annotations.
Mocks or Stubs ?
What is AOP
- Capture functionality used throughout app in a single, reusable way, e.g. transaction, logging, security.
- Transaction management, logging, security are cross cutting concerns cutting across multiple objects.
- AOP is the implementation of these cross cutting concern.
Join point: a point in the execution of a program such as a method call or a field assignment. e.g., method1 in Class A and method2 in Class B are the join points that require transaction related advice.
Pointcut: An expression that selects one or more join points. Advice can be associated with a pointcut expression and runs at any join point method.
Advice: Code that is executed at a particular join point that has been selected by a Poincut. Different types of advices are “around,” “before” and “after” advice.
Aspect: A module that encapsulates pointcuts and advice. e.g., transaction, security, logging in this case.
Spring AOP uses aspectJ expression language: http://www.eclipse.org/aspectj
designator (* package.Class.method*(..))
@Before @AfterReturning @AfterThrowing @After @Around
Transactions
ACID: Atomic, Consistent, Isolated, Durable
ACEGI – former name for spring security ~ every other letter (missing B,D,F,H)
July 1, 2010
Posted by davidbloom |
Spring |
Leave a Comment
I am taking the Core Spring Class by VMWARE with Chris Lacy (http://www.chrislacy.net/).
I will note some of the key information I see over the four days.
Building software:
Running software
Dependency Injection
Previous entries on Spring: DIP, Exceptions , Testing , Spring 2.0 , IBatis Spring , Web Flow
June 29, 2010
Posted by davidbloom |
IoC, Spring |
Leave a Comment
The Palm Pre , released in summer of 2009, has been my first splash into the smart phone pool. Up to this point, the device known as the Sprint Krzr was the best thing I had ever put my fingers on, since sliced bread. Oh, how the world has changed in a year. Ever since I received my Palm Pre, Apple has put out a new version of its phone that allows you to run multiple applications at the same time, just like the Palm Pre. Moreover, the Android open source operating system rolled out, and appears to be a major player in the smart phone space. Truth be told, I like all the nifty features and applications that my Palm Pre provides. However, the battery is a serious problem. I can’t go more than breakfast to dinner without charging the phone. Otherwise, you can forget about getting in touch with me. This is beyond annoying when you are out of pocket, and unable to charge your phone. I found the answer this weekend to the problem. The answer is an extended Palm Pre Battery.
Palm Pre Extended Battery You Tube Video
Buy Extended Battery
Seidio Inocell 2600
Alter battery device for touchstone
June 23, 2010
Posted by davidbloom |
Mobile |
Leave a Comment
This video begins the subject of GWT design choices. The video touches on a few thing like the :
- HandlerManager class in GWT 1.6
- GwtMocking
- MVP and testing the presenter
- EventBus
This was found on this post - http://stackoverflow.com/questions/1234389/whats-your-recommendation-for-architecting-gwt-applications-mvc-mvp-or-custom
Since I am mainly just familiar with MVC , lets get into MVP…
From this Model-View-Presenter post, it illustrates their are two flavors of the MVP:
a) Dolphin Smalltalk’s MVP - http://martinfowler.com/eaaDev/SupervisingPresenter.html
b) Passive View – http://martinfowler.com/eaaDev/PassiveScreen.html
View – widgets, responds to user actions, turns to the presenter to handle these user actions
Presenter – presentation logic, tightly coupled with the view, commands the model, changes presentation according to the application rules.
Model – business objects , doesn’t know anything about View/Presenter.
“in MVC there is controller for every widget, and every widget on the screen surface is called view. In MVP on the other hand, due to the elimination of the controller, there is no sentiment for a single widget and the screen itself is called view.”
also see : Use MVP , MVP based Component Library, GWT MVP Sample, eventbus and mock tests
Some clarifications for me. Seems Ext – GWT is also known as GXT (found on this page which talks about JSON vs RPC, to spaghtetti code)
Another interesting thing is the post on difference between a toolkit vs framework
References:
August 15, 2009
Posted by davidbloom |
Web Design, Web/Tech |
1 Comment
Its been a while since I chimed in on the topic of Exceptions:
Checked : (java.lang.Exception). This type of exception represents useful information about the operation of a legally specified request that the caller may have had no control over and that the caller needs to be informed about. With checked exceptions, Java language forces us to document all the anticipated ways in which control might exit a method:
Unchecked : (java.lang.RuntimeException). These are exceptions that occur as a result of programming errors that the program could not be expected to catch.
Now, it is time to talk about the Exception Handling capabilities with DAOs in the Spring Framework
(2.5)
SQL Exception Translator – sql exception can be translated to a DataAccessException using the translate method
- ex1, ex2, ex3 , ex4
The method HibernateDaoSupport :: convertHibernateAccessException – convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
SessionFactoryUtils :
public static DataAccessException convertHibernateAccessException(HibernateException ex) {
if (ex instanceof JDBCConnectionException) {
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof SQLGrammarException) {
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
}
if (ex instanceof DataException) {
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
}
if (ex instanceof LockAcquisitionException) {
return new CannotAcquireLockException(ex.getMessage(), ex);
}
if (ex instanceof ConstraintViolationException) {
return new DataIntegrityViolationException(ex.getMessage(), ex);
}
if (ex instanceof JDBCException) {
return new HibernateJdbcException((JDBCException) ex);
}
if (ex instanceof PropertyValueException) {
return new DataIntegrityViolationException(ex.getMessage(), ex);
}
if (ex instanceof PersistentObjectException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof TransientObjectException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof ObjectDeletedException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof QueryException) {
return new HibernateQueryException((QueryException) ex);
}
if (ex instanceof UnresolvableObjectException) {
return new HibernateObjectRetrievalFailureException((UnresolvableObjectException) ex);
}
if (ex instanceof WrongClassException) {
return new HibernateObjectRetrievalFailureException((WrongClassException) ex);
}
if (ex instanceof NonUniqueResultException) {
return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1);
}
if (ex instanceof StaleObjectStateException) {
return new HibernateOptimisticLockingFailureException((StaleObjectStateException) ex);
}
if (ex instanceof StaleStateException) {
return new HibernateOptimisticLockingFailureException((StaleStateException) ex);
}
// fallback
return new HibernateSystemException(ex);
}
Hibernate Template
September 13, 2008
Posted by davidbloom |
Hibernate & ORM, J2EE, Open Source |
1 Comment
If you download the spring framework with dependencies, one of the modules included is the spring-test.
spring
- Convenient jar file combining all standard modules (except for the test module and the Spring MVC support)
- Also includes the AOP Alliance interfaces (as a convenience)!
- Does not include contents of spring-aspects.jar, spring-test.jar and spring-webmvc*.jar!
spring-test
- Contents: test context framework, JUnit support, JNDI mocks, Servlet API mocks, Portlet API mocks
- Dependencies: spring-core, (spring-context, spring-jdbc, spring-web, JUnit, Servlet API, Portlet API)
As the spring documentation mentions, for unit testing transactional systems you can achieve rollback of your tests pretty easily:
Typically you will extend the subclass, AbstractTransactionalDataSourceSpringContextTests. This class also requires that a DataSource bean definition – again, with any name – be present in the application context. It creates a JdbcTemplate instance variable, that is useful for convenient querying, and provides handy methods to delete the contents of selected tables (remember that the transaction will roll back by default, so this is safe to do).
This problem was identified with MySql.
Nice article here on spring test
This link tells us about the spring testing method calls
AbstractTransactionalDataSourceSpringContextTests superclass
provides the following services:
Injects test dependencies, meaning that we don't need to
perform application context lookups. Injection uses
autowiring by type.
Executes each test method in its own transaction, which is
automatically rolled back by default. This means that even
if tests insert or otherwise change database state, there
is no need for a teardown or cleanup script.
If you want a transaction to commit--unusual, but useful
if you want a particular test to populate the database,
for example--you can call the setComplete() method inherited
from AbstractTransactionalSpringContextTests. This will cause
the transaction to commit instead of roll back.
There is also convenient ability to end a transaction before
the test case ends, through calling the endTransaction() method.
This will roll back the transaction by default, and commit it
only if setComplete() had previously been called.
Provides useful inherited protected fields, such as a JdbcTemplate
that can be used to verify database state after test operations,
or verify the results of queries performed by application code.
An ApplicationContext is also inherited, and can be used for
explicit lookup if necessary.
All the Spring Test Life Cycle Methods
API
- getConfigLocations
- setDataSource
- setTransactionManager
- onSetUpBeforeTransaction
- onSetUpInTransaction
- onTearDownInTransaction
- endTransaction
- onTearDownAfterTransaction
example scenario:
Now onto the 2.5 way of testing:
org.springframework.test.context – Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.
Spring 2.5 continues this rich and convenient testing framework, while now removing the requirement that your unit tests extend Spring framework tests. Instead of subclassing, it uses java annotations.
Related links:
August 24, 2008
Posted by davidbloom |
IoC, J2EE |
1 Comment
Been a while since I started first looking at IBatis. The Spring Framework has a sample application named JPetstore (available in the core download) that gives you an example of IBatis, Spring, and Struts 1.x .
Different Spring Ibatis SQLMaps approaches:
Use Of Annotations
Implementing DAOs based on plain iBATIS API
<bean
id=”dataSource”
class=”org.springframework.jdbc.datasource.SingleConnectionDataSource”
destroy-method=”destroy”
>
<bean id=”transactionManager”
class=”org.springframework.jdbc.datasource.DataSourceTransactionManager”>
<property name=”dataSource” ref=”dataSource”/>
</bean>
<bean id=”sqlMapClient” class=”org.springframework.orm.ibatis.SqlMapClientFactoryBean”>
<property name=”configLocation” value=”classpath:/sqlmap-config.xml”/>
<property name=”dataSource” ref=”dataSource”/>
</bean>
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE sqlMapConfig PUBLIC
“-//ibatis.apache.org//DTD SQL Map Config 2.0//EN”
“http://ibatis.apache.org/dtd/sql-map-config-2.dtd”>
<sqlMapConfig>
<settings defaultStatementTimeout=”5″ />
<sqlMap resource=”MyType.xml” />
</sqlMapConfig>
You can actually omit the ‘transaction-manager’ attribute in the <tx:annotation-driven/> tag if the bean name of the PlatformTransactionManager that you want to wire in has the name ‘transactionManager’.
<!– Instructs Spring to perfrom declarative transaction managemenet on annotated classes –>
<tx:annotation-driven/>
@Autowired
public void setSqlMapClient(SqlMapClient sqlMapClient) {
iBatisTemplate = new SqlMapClientTemplate(sqlMapClient);
}
@@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
- The @Transactional annotation may be placed before an interface definition, a method on an interface, a class definition, or a public method on a class. However, please note that the mere presence of the @Transactional annotation is not enough to actually turn on the transactional behavior.
public MyType insertMyType(MyType myType) {
MyType myType = null;
myType= (MyType) iBatisTemplate.insert(“insertIntoMyType”, MyType;
return myType;
}
Use Of Spring’s DaoSupport Class
<bean
id=”dataSource”
class=”org.apache.commons.dbcp.BasicDataSource”
destroy-method=”close”
>
<bean id=”sqlMapClient” class=”org.springframework.orm.ibatis.SqlMapClientFactoryBean”>
<property name=”configLocation” value=”classpath:/sqlmap-config.xml”/>
<property name=”dataSource” ref=”dataSource”/>
</bean>
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE sqlMapConfig PUBLIC “-//iBATIS.com//DTD SQL Map Config 2.0//EN”
“http://www.ibatis.com/dtd/sql-map-config-2.dtd”>
<sqlMapConfig>
<settings useStatementNamespaces=”true” />
<sqlMap resource=”person.xml” />
</sqlMapConfig>
PersonDaoIbatisImpl extends SqlMapClientDaoSupport
public void addPerson(Person person) {
Long id = (Long) this.getSqlMapClientTemplate().insert(“person.insert”,
person);
person.setId(id);
}
August 17, 2008
Posted by davidbloom |
Uncategorized |
1 Comment
As a total beginner to Spring Web Flow, the main thing I have noticed in going through the material is that there is quite a difference between the 1.x and the new release 2.0.
Web Flow | Spring Web Flow Forum
There seems to be in package org.springframework.webflow.action a FlowAction and a FlowExecutor class. As well, the ExternalContext class which is credited to allowing WF to be decoupled from Servlet API .
I do not see a FlowAction or FlowExecutor in org.spring.webflow.action package like in webflow 1.
Instead, lets look at what we have from the example Spring Flow 2.0 Example application.
To use annotations for the transactions within the example, we do the following:
- Put an tag tx:annotation-driven in the spring config file
- Put @Transactional annotation in the services classes
@Transactional – The @Transactional annotation may be placed before an interface definition, a method on an interface, a class definition, or a public method on a class. However, please note that the mere presence of the @Transactional annotation is not enough to actually turn on the transactional behavior.
You can actually omit the ‘transaction-manager’ attribute in the <tx:annotation-driven/> tag if the bean name of the PlatformTransactionManager that you want to wire in has the name ‘transactionManager’.
<!– Instructs Spring to perfrom declarative transaction managemenet on annotated classes –>
<tx:annotation-driven/>
<!– Drives transactions using local JPA APIs –>
<bean id=”transactionManager” class=”org.springframework.orm.jpa.JpaTransactionManager”/>
The LocalContainerEntityManagerFactoryBean can be configured with all Persistent Unit information like is done here.
@PersistenceUnit – annotated on EntityManagerFactory instances are thread-safe
<!– Creates a EntityManagerFactory for use with the Hibernate JPA provider and a simple in-memory data source populated with test data –>
<bean id=”entityManagerFactory” class=”org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”>
<property name=”jpaVendorAdapter”>
<bean class=”org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter”/>
</property>
</bean>
<!– Deploys a in-memory datasource –>
<bean id=”dataSource” class=”org.springframework.jdbc.datasource.DriverManagerDataSource”>
<property name=”driverClassName” value=”org.hsqldb.jdbcDriver”/>
<property name=”url” value=”jdbc:hsqldb:mem:tutorialSwf”/>
<property name=”username” value=”sa”/>
<property name=”password” value=”"/>
</bean>
<!– Activates annotation-based bean configuration –>
<context:annotation-config/>
Mapping URLs to Handlers – maps request URLs to handlers. A simple way to create URL mapping rules is to define one as follows:
<!– Maps request URIs to controllers –>
<bean class=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>
<property name=”mappings”>
<props>
<prop key=”/f/*”>flowController</prop>
</props>
</property>
<property name=”defaultHandler”>
<!– Selects view names to render based on the request URI: e.g. /main selects “main” –>
<bean class=”org.springframework.web.servlet.mvc.UrlFilenameViewController”/>
</property>
</bean>
The Flow Handler manages executions of a single flow definition. Above the handler selects view based on the URI in a default handler. To Implement one, extend AbstractFlowHandler.
Flow Controller – The FlowHandler MVC integration approach, you define one handler per flow. This is overkill in the cases where default flow handling rules are sufficient. Web controller for the Spring web MVC framework that routes incoming requests to one or more managed web flows. Requests into the web flow system are managed using a configurable ServletFlowExecutionManager.
<!– Handles requests mapped to the Spring Web Flow system –>
<bean id=”flowController” class=”org.springframework.webflow.mvc.servlet.FlowController“/>
The flow executor is the core Web Flow configuration element. Flow execution listeners are also defined in the flow executor.
<!– Executes flows: the central entry point into the Spring Web Flow system –>
<webflow:flow-executor id=”flowExecutor”>
<webflow:flow-execution-listeners>
<webflow:listener ref=”jpaFlowExecutionListener”/>
</webflow:flow-execution-listeners>
</webflow:flow-executor>
FlowRegistry – placed where you register your flows
flow-builder-services attribute – customize the services used to build the flows in a registry…When the tag is defined, you only need to reference the services you want to customize.
<!– The registry of executable flow definitions –>
<webflow:flow-registry id=”flowRegistry” flow-builder-services=”facesFlowBuilderServices”>
<webflow:flow-location-pattern value=”/WEB-INF/flows/**/*.xml”/>
</webflow:flow-registry>
flow scoped persistence context – provides isolation of intermediate edits by only committing changes to the database at the end of flow execution. This pattern is often used in conjunction with an optimistic locking strategy to protect the integrity of data modified in parallel by multiple users.
@PersistenceContext – annotated on EntityManager instances are not thread safe
<flow xmlns=”http://www.springframework.org/schema/webflow” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd”>
<persistence-context/>
…
configure the correct FlowExecutionListener in this case for JPA
<!– Installs a listener that manages JPA persistence contexts for flows that require them –>
<bean id=”jpaFlowExecutionListener” class=”org.springframework.webflow.persistence.JpaFlowExecutionListener”>
<constructor-arg ref=”entityManagerFactory”/>
<constructor-arg ref=”transactionManager”/>
</bean>
…
Here is how they handle the view:
<!– Maps logical view names to Facelet templates (e.g. ‘search’ to ‘/WEB-INF/search.xhtml’ –>
<bean id=”faceletsViewResolver” class=”org.springframework.web.servlet.view.UrlBasedViewResolver”>
<property name=”viewClass” value=”org.springframework.faces.mvc.JsfView”/>
<property name=”prefix” value=”/WEB-INF/”/>
<property name=”suffix” value=”.xhtml”/>
</bean>
Or a simple ViewResolver
July 19, 2008
Posted by davidbloom |
J2EE |
2 Comments
I have been an Eclipse user most of my Java career. Though, I do have limited experience with Visual Age, Forte, JBuilder, and Netbeans. In the Eclipse space, it has been WSAD, MyEclipse, Eclipse WTP (2.x,3.2, Europa 3.3), and RAD 6/7.
Part of NFJS exposed me to IntelliJ. Here is one take on this IDE.
July 17, 2008
Posted by davidbloom |
SW Tools |
Leave a Comment
Spring 2.0 introduced support for various annotations for configuration purposes, such as:
- @Transactional – The @Transactional annotation may be placed before an interface definition, a method on an interface, a class definition, or a public method on a class. However, please note that the mere presence of the @Transactional annotation is not enough to actually turn on the transactional behavior.
- @Required – used to mark a property as being ‘required-to-be-set’ (i.e. an annotated (setter) method of a class must be configured to be dependency injected with a value)
- @PersistenceContext – annotated on EntityManager instances are not thread safe
- @PersistenceUnit – annotated on EntityManagerFactory instances are thread-safe
Thus, to use annotations for the transactions for my purposes, I do the following:
- Put an tag tx:annotation-driven in the config file (i.e applicationContext.xml)
- Put @Transactional annotation in the services class implementation that contains operations on the entity manager
Spring 2.5 introduces support for a complete set of configuration annotations:
- @Autowired in combination with support for the JSR-250 annotations @Resource
- @PostConstruct
- @PreDestroy
July 16, 2008
Posted by davidbloom |
Uncategorized |
1 Comment
As part my learnings of what is new with the Spring Framework, I found a nice Spring Flow 2.0 Example (with JSF and JPA).
The Spring Web Flow 2.0.2 release ( by Erwin Vervaet and Keith Donald ) comes as a separate download from the basic Spring functionality in 2.5.5.
On the Spring Web Flow (SWF) vision from 1.x to 2.x :
“[in 1.0] the SWF controller engine cared for one half of the web request lifecycle; the half related to request processing, often called the action phase. The other half, the render phase, was pushed off on the caller: either Spring MVC, Struts, or JSF front controllers
…..
The downside of this approach is it makes it difficult to apply application control logic during the view rendering phase
…..
Beginning with Web Flow 2.0 M2, the entire web request lifecycle is now under the control of Spring Web Flow, including the view rendering phase.
….
the ability for the SWF engine to communicate with external systems and conversational contexts over HTTP (embedding the proper flow execution callback URL in the redirect that is sent to the external system)”
Reference Guide 2.x
Also, note that getting these Spring Flow 2.x reference sample projects are easy to get a hold of. In the download of Web Flow is a projects/build-spring-webflow directory where you can run ant. It will build Web Flow along with the .war files for the sample projects (ant 1.7 and Java 5 are required to build).
There is a Struts2 plugin for Spring Web Flow called struts2webflow
As far as further examples than the ones above, I found some web flow 2.x examples at this site spring by example.
Spring flow 1.0 showed that it could easily integrate with struts. These sample (1.x) applications can also be found on Java Passion Site. A good 1.x reference is the Practical ntroduction . All the samples projects are Spring IDE projects that importable into Eclipse (see springide or plugin central for spring ide).
Here in the 1.x struts example:
Our first action in the jsp is as follows:
<A href=”flowAction.do?_flowId=birthdate”>Birth Date</A>
This action in the struts config says:
<action path=”/flowAction” name=”actionForm” scope=”request” type=”org.springframework.webflow.executor.struts.FlowAction”/>
We also bind to the Action Form:
<form-bean name=”actionForm” type=”org.springframework.web.struts.SpringBindingActionForm”/>
In the webflow-config.xml we define the flow registry:
<flow:executor id=”flowExecutor” registry-ref=”flowRegistry”/>
<!– Creates the registry of flow definitions for this application –>
<flow:registry id=”flowRegistry”>
<flow:location path=”/WEB-INF/birthdate.xml”/>
<flow:location path=”/WEB-INF/birthdate-alternate.xml”/>
</flow:registry>
Start State : the first state in the flow
<start-state idref=”enterBirthdate” />
View State: selects a view to render
<view-state id=”enterBirthdate” view=”birthdateForm”>
When the execution of the flow starts, enter the enterBirthdate state. Then select the birthdateForm view for display to the user, and pause the flow of execution until a user event happens.
Render Action: initializes the form object.
<render-actions>
<action bean=”formAction” method=”setupForm” />
</render-actions>
For view state, above Initializes the backing “form object” by invoking the setupForm method for formAction.
Note that the action was defined in the webflow-config.xml (instance of spring-webflow-config-1.0.xsd)
<bean id=”formAction” class=”org.springframework.webflow.samples.birthdate.BirthDateFormAction” />
Transition: Each View state must define a transition that leads to another state
<transition on=”submit” to=”processBirthdateFormSubmit” />
Action state: logic that needs to be executed in context of the request, once executed the result flow is returned which the flow may respond to.
<action-state id=”processBirthdateFormSubmit”>
<action bean=”formAction” method=”bindAndValidate”>
<attribute name=”validatorMethod” value=”validateBirthdateForm” />
</action>
transition on=”success” to=”enterCardInformation” />
<transition on=”error” to=”enterBirthdate” />
</action-state>
Related Links for Basic info on JSF:
July 13, 2008
Posted by davidbloom |
J2EE |
1 Comment
I have used derby a while back. Several years later, I wanted to get it installed again on my machine.
In short, Derby is the Java Database that IBM contributed to the open source community. It was known then as cloudscape.
I start off by getting the bin download from the derby database
create DERBY_HOME environment variable : C:\JAVA\derby10\db-derby-10.2.2.0-bin\
Make sure I have my JAVA_HOME environment variable properly set
add to the PATH: C:\JAVA\derby10\db-derby-10.2.2.0-bin\bin\
from the command line:
>sysinfo
>ij
ij is the derby sql client command line
ij>connect ‘jdbc:derby://localhost:1527/mydb;
create=true;traceFile=trace.out;user=user1;password=secret4me’;
C:\JAVA\derby10\db-derby-10.2.2.0-bin\bin>
setNetworkClientCP.bat
C:\JAVA\derby10\db-derby-10.2.2.0-bin\demo\programs\simple>set CLASSPATH=.;%DERB
Y_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbynet.jar;%DERBY_HOME%\lib\derbyclient
.jar;%DERBY_INSTALL%\lib\derbytools.jar
C:\JAVA\derby10\db-derby-10.2.2.0-bin\frameworks>startNetworkserver.bat
C:\JAVA\derby10\db-derby-10.2.2.0-bin\demo\programs\simple>java org.apache.derby
.tools.sysinfo -cp embedded SimpleApp.class
FOUND IN CLASS PATH:
Derby embedded engine library (derby.jar)
C:\JAVA\derby10\db-derby-10.2.2.0-bin\lib\derby.jar
user-specified class (SimpleApp)
C:\JAVA\derby10\db-derby-10.2.2.0-bin\demo\programs\simple
SUCCESS: All Derby related classes found in class path.
get ibm jars for derby
C:\JAVA\derby10\db-derby-10.2.2.0-bin\demo\programs\simple>set CLASSPATH=.;%DERB
Y_HOME%\lib\db2jcc.jar;%DERBY_HOME%\lib\db2jcc_license_c.jar
C:\JAVA\derby10\db-derby-10.2.2.0-bin\frameworks>startNetworkserver.bat
C:\JAVA\derby10\db-derby-10.2.2.0-bin\demo\programs\simple>java SimpleApp jccjdb
cclient
SimpleApp starting in jccjdbc mode.
Loaded the appropriate driver.
Connected to and created database derbyDB
Created table derbyDB
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table derbyDB
Closed result set and statement
Committed transaction and closed connection
SimpleApp finished
/* the default framework is embedded*/
public String framework = “embedded”;
public String driver = “org.apache.derby.jdbc.EmbeddedDriver”;
public String protocol = “jdbc:derby:”;
public static void main(String[] args)
{
new SimpleApp().go(args);
}
void go(String[] args)
{
/* parse the arguments to determine which framework is desired*/
parseArguments(args);
System.out.println(“SimpleApp starting in ” + framework + ” mode.”);
try
{
/*
The driver is installed by loading its class.
In an embedded environment, this will start up Derby, since it is not already running.
*/
Class.forName(driver).newInstance();
System.out.println(“Loaded the appropriate driver.”);
Connection conn = null;
Properties props = new Properties();
props.put(“user”, “user1″);
props.put(“password”, “user1″);
/*
The connection specifies create=true to cause
the database to be created. To remove the database,
remove the directory derbyDB and its contents.
The directory derbyDB will be created under
the directory that the system property
derby.system.home points to, or the current
directory if derby.system.home is not set.
*/
conn = DriverManager.getConnection(protocol +
“derbyDB;create=true”, props);
System.out.println(“Connected to and created database derbyDB”);
conn.setAutoCommit(false);
/*
Creating a statement lets us issue commands against
the connection.
*/
Statement s = conn.createStatement();
/*
We create a table, add a few rows, and update one.
*/
private void parseArguments(String[] args)
{
int length = args.length;
for (int index = 0; index < length; index++)
{
if (args[index].equalsIgnoreCase(“jccjdbcclient”))
{
framework = “jccjdbc”;
driver = “com.ibm.db2.jcc.DB2Driver”;
protocol = “jdbc:derby:net://localhost:1527/”;
}
if (args[index].equalsIgnoreCase(“derbyclient”))
{
framework = “derbyclient”;
driver = “org.apache.derby.jdbc.ClientDriver”;
protocol = “jdbc:derby://localhost:1527/”;
}
}
}
July 5, 2008
Posted by davidbloom |
SW Tools |
Leave a Comment
Starting at about 12:00 tommorow I’ll be arriving at NoFluffJustStuff conference – also known as the Research Triangle Software Symposium. This is put on by Jay Zimmerman and his cast of notable experts from the software industry.
There are a lot of good choices on the menu.
June 20, 2008
Posted by davidbloom |
Uncategorized |
Leave a Comment
jpa spec jsr 317
open jpa manual
In an applicationserver, EntityManager instances are typically injected, rendering the EntityManagerFactory unnecessary.
javax.persistence:
- Persistence : contains static helper methods to obtain EntityManagerFactory
instances in a vendor-neutral fashion.
- EntityManagerFactory: is a factory for Entity-Manager
- EntityManager: is the primary JPA interface used by applications.Each EntityManager manages a set of persistent objects, and has APIs to insert new objects and delete existing ones. EntityManagers also act as factories for Query instances.
- Entity: persistent objects that represent datastore records.
- Query: Query interface is implemented by each JPA vendor to find persistent objects that
meet certain criteria. JPA standardizes support for queries using both the Java Persistence Query Language (JPQL) and the Structured Query Language (SQL). You obtain Query instances from an EntityManager.
JPA uses a version field in your entities to detect concurrent modifications to the same datastore record. When the JPA runtime detects an attempt to concurrently modify the same record, it throws an exception to the transaction attempting to commit last. This prevents overwriting the previous commit with stale data.
private int version;
JPA introduces another form of object identity, called entity identity or persistent identity. Entity identity tests whether two persistent objects represent the same state in the datastore.
May 11, 2008
Posted by davidbloom |
Hibernate & ORM, J2EE |
Leave a Comment
In this post I will cover getting started with the Roller4.0 blogging software including setting up the planet (aggregation server).
Anyway, I am using the mysql database (5.0.41 community edition) with roller 4
(best available) which i placed in Tomcat’s webapps directory naming the folder roller4_0 .
I am using tomcat 5.5 with java5.
Setup: Tomcat’s common/classes folder have placed file roller-custom.properties:
installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=com.mysql.jdbc.Driver
database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb
database.jdbc.username=root
database.jdbc.password=admin
mail.configurationType=properties
mail.hostname=smtp-server.nc.rr.com
mail.username=x
mail.password=x
Important: You need to put the mysql driver, and two other jars into Tomcats’s common/lib directory:
- mysql-connector-java-3.1.13-bin
- activation (obtained from my java 5 lib folder)
- mail (obtained from my java 5 lib folder)
After starting Tomcat, I go to the main screen via url http://localhost:8080/roller4_0/index.jsp
which says I have a successful connection but have no tables . So I click the button to create the tables.

Then, I get the page to create users and the blog.

Yes, you need a planet-custom properties (roller-custom.properties in common/classes) file…
I set up a blog which i called planet which I give a theme of
roller front page…
My weblog template now has
## 1) SITE-WIDE entries (the default)
##set($pager = $site.getWeblogEntriesPager($since, $maxResults))
## 2) PLANET-entries
#set($pager = $planet.getAggregationPager($since, $maxResults))
## The below pager code should work against either
the planet blog _must_ be the frontpage blog (this is not optional as
I thought).enable “Enable aggregated site-wide frontpage” (this is on by default)
“That’s true because the Installation Guide tells you to put the
PlanetModel in the ‘rendering.siteModels’ list.If you want Planet aggregations to be available to all blogs you can
put the model in the ‘rendering.pageModels’ list.
Or, if you are an admin user the you can add the PlanetModel to
individual blogs via the blog’s Preferences->Settings page.”
3- in roller-custom.properties
planet.aggregator.enabled=true
cache.dir= /mycache/planetcache
planet.aggregator.guice.module=\
org.apache.roller.weblogger.planet.business.jpa.RollerPlanetModule
# Tasks which are enabled. Only tasks listed here will be run.
tasks.enabled=ScheduledEntries
Task,ResetHitCountsTask,\
TurnoverReferersTask,PingQueueTask,
RefreshRollerPlanetTask,SyncWebsitesTask
# Set of page models specifically for site-wide rendering
rendering.siteModels=\
org.apache.roller.weblogger.ui.rendering.model.SiteModel,\
org.apache.roller.weblogger.ui.rendering.model.PlanetModel
The installation guide says the planet cache directory property is
named planet.aggregator.cache.dir, but the planet.properties file
looks like it uses cache.dir
It should be RefreshRollerPlanetTask not RefreshPlanetRollerTask
planet-custom.properties:
database.configurationType=jdbc
database.jdbc.driverClass=com.mysql.jdbc.Driver
database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb
database.jdbc.username=x
database.jdbc.password=y
January 6, 2008
Posted by davidbloom |
Uncategorized |
Leave a Comment
One of the struts 2 sample applications is the Mailreader application which has training course via Struts from Square One site .
Building Web Applications
Building Struts 2 Applications [ Welcome] [More ...]
Struts 2 components
Action Handler, Result Handler, Custom Tags
Interceptor : bring custom code into call stack
- Timer Interceptor
- Prepare (able) - If the Action implements Preparable, calls its prepare method.
value stack : stack of objects that expression language can pull from
- Action instance pushed onto stack
Jumpstarting JUnit (More …)
Capturing Input(More …)
Validating Input (More …)
Request Lifecycle in Struts 2 applications
- User Sends request: User sends a request to the server for some resource.
- FilterDispatcher determines the appropriate action: The FilterDispatcher looks at the request and then determines the appropriate Action.
- Interceptors are applied: Interceptors configured for applying the common functionalities such as workflow, validation, file upload etc. are automatically applied to the request.
- Execution of Action: Then the action method is executed to perform the database related operations like storing or retrieving the data from database.
- Output rendering: Then the Result render the output.
- Return of Request: Then the request returns through the interceptors in the reverse order. The returning request allows us to perform the clean-up or additional processing.
Display the result to user: Finally the control is returned to the servlet container, which sends the output to the user browser.
Struts 2 Big Picture
The diagram depicts the architecture of Struts 2 Framework. It shows the the initial request goes to the Servlet container, which is then passed through a standard filer chain.
- ActionContextCleanUp filter: The ActionContextCleanUp filter is optional. It is useful when integrating other technologies such as SiteMesh Plugin.
- FilterDispatcher: the required FilterDispatcher is called, which in turn consults the ActionMapper to determine if the request should invoke an action. If the ActionMapper determines that an Action should be invoked, the FilterDispatcher delegates control to the ActionProxy.
- ActionProxy: The ActionProxy consults the Configuration Files manager, which is initialized via the struts.xml file. Then the ActionProxy creates an ActionInvocation, which implements the command pattern. The ActionInvocation process invokes the Interceptors (if configured) and then invokes the action.
- Once the Action returns, the ActionInvocation is responsible for looking up the proper result associated with the Action result code mapped in struts.xml. The result is then executed, which often (but not always, as is the case for Action Chaining) involves a template written in JSP or FreeMarker to be rendered. While rendering, the templates can use the Struts Tags provided by the framework. Some of those components will work with the ActionMapper to render proper URLs for additional requests.
- Then the Interceptors are executed again in reverse order. Finally the response returns through the filters configured in web.xml file.
- If the ActionContextCleanUp filter is configured, the FilterDispatcher does not clean the ThreadLocal ActionContext. If the ActionContextCleanUp filter is not present then the FilterDispatcher will cleanup all the ThreadLocals present.
Resources
If you install the war on an application server (like tomcat ) you can easily run the sample projtect. Here is the struts 201 slides
Th version I have of the application mentions: “For more about the MailReader, including alternate implementations and a set of formal Use Cases, please visit the Struts University MailReader site” .
The full source code for MailReader is available as svn site, binaries, nightlies
Other Struts2 Trainings include Migrating to Struts2 the and JPA .
REFERENCES:
December 2, 2007
Posted by davidbloom |
AJAX, Struts |
1 Comment
Just last week, I learned about what’s new with Roller in 4.0
Thought it was finally time to try my own installation after being a one time user of this Roller platform on JRoller as user on http://www.jroller.com/interjavanet/ . I had forgotten my password over on that blog, and it did not seem to be stright forward on how you get your password reset.
Did I mention that Roller is now on Apache at http://roller.apache.org ?
They have their own wiki now at http://cwiki.apache.org/confluence/display/ROLLER
Anyway, I am using the mysql database (5.0.41 community edition) with roller 4
(apache-roller-src-4.0-rc9) which i placed in Tomcat’s webapps directory naming the folder roller4_0 .
I am using tomcat 5.5 with java5.
Setup: Tomcat’s common/classes folder have placed file roller-custom.properties:
installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=com.mysql.jdbc.Driver
database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb
database.jdbc.username=root
database.jdbc.password=admin
mail.configurationType=properties
mail.hostname=smtp-server.nc.rr.com
mail.username=x
mail.password=x
Important: You need to put the mysql driver, and two other jars into Tomcats’s common/lib directory:
- mysql-connector-java-3.1.13-bin
- activation (obtained from my java 5 lib folder)
- mail (obtained from my java 5 lib folder)
AFter starting Tomcat, I go to the main screen via url http://localhost:8080/roller4_0/index.jsp
which says I have a successful connection but have no tables . So I click the button to create the tables.

Then, I get the page to create users and the blog.

References :
November 25, 2007
Posted by davidbloom |
Blogging, Struts, SW Tools |
Leave a Comment
Last week was the conference, this week comes people trying to define it. My best definition would be netvibes.com
A checkpoint on Web 2.0 in the enterprise

As such, the situational application would be another web 2.0 concept. this article defines it great.
“where small groups and departments developed their own applications independent of the corporate IT department. Today more and more end users who are not professional programmers are developing web applications that better fit their own needs. A simple example is a wiki, where the users can create and modify the pages and their content. No programmer has to decide ahead of time what the topics of interest will be or the structure and layout of the pages. The users evolve something over time that suites their needs within the time budget they have to invest in the site.”
REST is another buzzwodr like this slide presentation that explains it.
September 19, 2007
Posted by davidbloom |
Web/Tech |
Leave a Comment
In Raleigh, I got a chance to attend IBM’s technical briefing on web 2.0 .
For now, will just list various bits of info that I will organize later.
QEDWiki (Quick and easy design) . Assembly : “QEDWiki is a unique Wiki framework in that it provides both Web users and developers with a single Web application framework for hosting and developing a broad range of Web 2.0 applications.”
Damia . Feeds: “provides easy-to-use tools that developers and IT users alike can use to quickly assemble data feeds from the Internet and a variety of enterprise data sources. The benefits of this service include the ability to aggregate and transform a wide variety of data or content feeds, which can be used in enterprise mashups.”
Mashup Hub. Tag : “Mashup Hub provides two broad areas of support: feed generation for enterprise data sources and a catalog of feeds and user interface (UI) widgets.”
Info 2.0
Many eyes
Baby name wizard
gather.com
second life
strike iron
gold corp
zoho
zoot
September 14, 2007
Posted by davidbloom |
AJAX, Blogging, J2EE, NC, Open Source, SOA, Web/Tech |
Leave a Comment
what is dojo?
Dojo is an Open Source JavaScript UI toolkit. It makes writing JavaScript easier, building great interfaces faster, and deploying dynamic UIs at scale much easier. The foundation of Dojo is “Dojo Base”, a single tiny library which contains Ajax, event handling, effects, blazing fast CSS queries, language utilities, and a lot more. On top of this Base, the rest of Dojo Core adds high-quality facilities for Drag and Drop, extended forms of Ajax and I/O, JSON-RPC, internationalization, and back-button handling.
You can use the div tag to define widget locations and Dojo will place the widget there either during page load or in response to events.
dojo book 0.4 –API — reference documentation — Dojo jot wiki — dojo toolkit home
JavaPassion PDF has 86 pages of info.
What is JSON?
(Using Dojo and JSON to Build Ajax Applications article ) – JSON is a Java library that helps convert Java objects into a string representation. This string, when eval()ed in JavaScript, produces an array that contains all of the information that the Java object contained. JSONObject class , JSONArray class “- Dojo provides an abstraction layer for invoking JSON-RPC requests”
json over xml?
IBM Paper: “JSON is built on two structures:
- A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
- An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence
JSON-RPC is a lightweight remote procedure call protocol in which JSON serializes requests and responses
The request is a single object with three properties:
-
method – A string containing the name of the method to be invoked.
-
params – An array of objects to pass as arguments to the method.
-
id – The request ID. This can be of any type. It is used to match the response with the request that it is replying to.
When the method invocation completes, the service must reply with a response. The response is a single object with three properties:
-
result – The object that was returned by the invoked method. This must be null, in case there was an error invoking the method.
-
error – An error object if there was an error invoking the method. It must be null, if there was no error.
-
id – This must be the same ID as the request it is responding to.
A notification is a special request that does not have a response. It has the same properties as the request object with one exception:
id – Must be null“
Using Dojo and JSON to Build Ajax Applications article: Dojo libraries are organized in packages just like Java code. For this example, we will need to import two packages.
The dojo.io package contains classes that allow us to make HTTP requests using protocols such as XMLHTTPTransport.
The dojo.event package is designed to provide a unified event system for DOM and programmatic events.
The dojo.event.connect() method allows you to associate a handler for the onclick event for myButton:
function onLoad() {
var buttonObj = document.getElementById("myButton");
dojo.event.connect(buttonObj, "onclick",
this, "onclick_myButton");
} function onclick_myButton() {
var bindArgs = {
url: "welcome.jsp",
error: function(type, data, evt){
alert("An error occurred.");
},
load: function(type, data, evt){
alert(data);
},
mimetype: "text/plain",
formNode: document.getElementById("myForm")
};
dojo.io.bind(bindArgs);
}
The magical dojo.io.bind() function is where the power lies. It takes as argument bindArgs, an array of name/value pairs. In this example, we specify five pairs:
url: The URL to make the request to.
mimetype: The response type expected.
load: Code to execute upon success.
error: Code to execute upon error.
formNode: The ID of the form whose fields to submit as parameters to the URL.
Once the call to dojo.io.bind(bindArgs) is made,depending on whether the request encountered any errors, either the load or error code is executed. Both load and error take three arguments:
type: The type of function; it will always be set to load for load() and error for error().
data: The response received. If mimetype is specified as text/plain, data contains the raw response. If, however, text/json is used, data contains the value of eval('(' + responseReceived + ')'), where responseReceived is what the call returned.
evt: The event object.
July 21, 2007
Posted by davidbloom |
AJAX |
Leave a Comment
“I am suggesting that there are those around us who are “serial committers” – they always say yes and rarely say no, even when they should. These individuals become so engulfed by the shear number of commitments that they have made that it becomes impossible for them to execute on any of them, at least not effectively.”
http://cjhemp.wordpress.com/2007/04/28/promise-based-management/
June 25, 2007
Posted by davidbloom |
Uncategorized |
Leave a Comment
http://drdobbs.com/dept/architect/198000264: “”
June 25, 2007
Posted by davidbloom |
Uncategorized |
Leave a Comment
AMIS on Deliver valuable software: “Other posts about the AGILE Principles soon to come:
1. Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. (This one).
2. Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage.
3. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.
4. Business people and developers must work together daily throughout the project.
5. Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.
6. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.
7. Working software is the primary measure of progress.
8. Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.
9. Continuous attention to technical excellence and good design enhances agility.
10. Simplicity–the art of maximizing the amount of work not done–is essential.
11. The best architectures, requirements, and designs emerge from self-organizing teams.
12. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly. “
Forget those fancy tools, and try just enough information in requirement gathering.
June 8, 2007
Posted by davidbloom |
Patterns & UML, SW Tools, Web Design |
Leave a Comment
The Furious Purpose has a good outline on what makes an ideal software job.
- The Team
- The Process
- The Company
- The Product
- The Technology
- The Location (i.e. work at home)
For me, having a software quality plan in place is what you would like to see. Just saw this free (without customizations) for managing the software development process.
Also, collaboration is key for a job where people share knowledge and experiences so that you don’t have to reinvent the wheel everytime. Like this here wiki.
May 31, 2007
Posted by davidbloom |
SW Tools |
Leave a Comment
Business Intelliegence Tool JasperETL - “JasperETL will be available in Open Source and Professional editions, and was developed through a technology partnership with Talend. Led by a team of veteran data integration industry experts, Talend is the first open source software provider for data integration tools.”
ETL is an essential tool that guarantees consistency and fluidity of information in increasingly diverse IT systems. At the center of the decision- making process, ETL allows organizations to move, cleanse, standardize and transform data according to their business needs. JasperETL can be used for both analytic decision support system tasks such as updating data warehouses or marts, as well as for operational solutions such as data consolidation, duplication, synchronization, quality, migration, and change data capture. Performance tests indicate performance up to 50% faster than other leading commercial ETL tools.
JasperETL Open Source edition is available immediately direct from JasperSoft
January 31, 2007
Posted by davidbloom |
Open Source, SW Tools |
Leave a Comment
It seems the video hosting service that AOL uses has a bunch of tecnology based presentations:
Technorati Profile
January 16, 2007
Posted by davidbloom |
Web/Tech |
Leave a Comment
Wow, I am glad to see 2007 here.
As always, New Years Day consists of a lot of football.
January 1, 2007
Posted by davidbloom |
Sports |
Leave a Comment
John Edwards announces . That’s a first.
On of the first memories I have from my childhood is when Nixon stepped down and Ford took the reigns. I did not know about the UNC connection with Gerald Ford til recently. I always heard that Ford was some sort of good athlete.
December 31, 2006
Posted by davidbloom |
Current Affairs |
Leave a Comment
http://www.castor.org/ and get full download where i placed it here
C:/java/castor-1.0.5
C:\java\castor-1.0.5\src>ant jar
put castor jars from C:\java\castor-1.0.5\dist and place in C:/java/castor-1.0.5/lib
C:/java/castor-1.0.5/src/examples/SourceGenerator
test.bat
http://www.castor.org/javadoc/org/exolab/castor/builder/SourceGeneratorMain.html
%JAVA% -cp %CP% org.exolab.castor.builder.SourceGeneratorMain -i invoice.xsd -f -binding-file bindingInvoice.xml
JavaDoc
Marshalling – is the process of traversing a content tree and
writing an XML document that reflects the tree’s content.
org.exolab.castor.xml.Marshaller
Unmarshalling - is the process of reading an XML document and constructing a content tree of Java content objects.org.exolab.castor.xml.Unmarshaller
example
…
It has been a while since I got a chance to look at Struts 2 . At the time I was interested in how to get jars going with JDK 1.4.2.
December 25, 2006
Posted by davidbloom |
XML |
Leave a Comment
Looks as if I missed a great place to attend a Java conference known as the Spring Experience
The Spring Experience schedule looks pretty good.
Related: whats-new-and-cool-in-spring-20
December 11, 2006
Posted by davidbloom |
Spring |
Leave a Comment
jstl provides use of the EL.
JSP 2.0 includes EL (Expression language) : "Personally I use the EL
extensively in all my JSP projects and I’ll never go back to custom tags or
scriptlets for showing the value of a request-scoped variable."
http://weblogs.java.net/blog/jfalkner/archive/2003/10/blarg_3_about_t.html
November 28, 2006
Posted by davidbloom |
Web Design |
Leave a Comment
I downloaded Struts2 (2.0.1) for first time after experimenting with webworks.
My experience at this point with struts2/webworks is limited.
I figured I would start from scratch rather than migrating some old code.
C:\java\struts2\struts-2.0.1\apps
The sample apps they have are
struts2-blank-2.0.1.war
struts2-mailreader-2.0.1.war
struts2-portlet-2.0.1.war
struts2-showcase-2.0.1.war
User List
Contents of struts2-blank-2.0.1 war (folders in bold):
src
- example
– ExampleSupport.java: ExampleSupport extends com.opensymphony.xwork2.ActionSupport
– HelloWorld.java: HelloWorld extends ExampleSupport
- struts.properties: struts.devMode = true
struts.enable.DynamicMethodInvocation = false
- struts.xml: <!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
… <include file="example.xml"/>
- example.xml: <!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
… <package name="example" namespace="/example" extends="struts-default">
<action name="HelloWorld" class="example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>
<action name="Login!*" method="{1}" class="example.Login">
<result name="input">/example/Login.jsp</result>
<result type="redirect-action">Menu</result>
</action>
<action name="*" class="example.ExampleSupport">
<result>/example/{1}.jsp</result>
</action>
WebContent
- WEB-INF
--lib
— commons-collections-3.1
— freemarker-2.3.4
— spring-aop-1.2.8
— spring-context-1.2.8
— spring-web-1.2.8
— struts2-core-2.0.1
— commons-logging-1.0.4
— ognl-2.6.7
— spring-beans-1.2.8
— spring-core-1.2.8
— struts2-api-2.0.1
— xwork-2.0-beta-1
- example
The Struts 2 home page states the Struts 2 requires Java 5. However, an alternate set of jars for Java 1.4.x are available. The challenge here is for people using Java 1.4.X is that the sample apps come with the Java 5 jars.The java 4 jars can be found here. I extracted them to here:
C:\java\struts2\struts-2.0.1\j4\
But, the only file I needed from here was struts2-extras-j4-2.0.0.jar .
copy C:\java\struts2\struts-2.0.1\j4\struts2-extras-j4-2.0.0.jar
C:\java\eclipse\workspace\struts2-blank-2.0.1\WebContent\WEB-INF\lib
as I got the backport files from the nightlies:
http://people.apache.org/builds/jakarta-struts/nightlies/2.0.x/java-1.4/backport/
which i copied to
C:\java\eclipse\workspace\struts2-blank-2.0.1\WebContent\WEB-INF\lib
Then i modified the translate.bat as follows:
java -jar retrotranslator-transformer-1.0.8.jar -srcjar struts2-core-2.0.1.jar -destjar struts2-core-j4-2.0.1.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar struts2-api-2.0.1.jar -destjar struts2-api-j4-2.0.1.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar xwork-2.0-beta-1 -destjar xwork-2.0-j4.jar
The key thing is after the translate takes place to remove the following files:
- struts2-core-2.0.1.jar
- struts2-api-2.0.1.jar
- xwork-2.0-beta-1
Again, a Java 5 version of struts2-extras-j4-2.0.0.jar was not in the struts2-blank-2.0.1 war.
In Summary, my lib folder contains the following jars for 1.4.x:
— commons-collections-3.1
—commons-beanutils-1.6
— commons-digester-1.6
— commons-logging-1.0.4
— freemarker-2.3.4
— spring-aop-1.2.8
— spring-context-1.2.8
— spring-web-1.2.8
— retrotranslator-runtime-1.0.8
— retrotranslator-transformer-1.0.8
— ognl-2.6.7
— spring-beans-1.2.8
— spring-core-1.2.8
— struts2-core-j4-2.0.1
— struts2-api-j4-2.0.1
— xwork-2.0-j4
—struts2-extras-j4-2.0.0
— backport-util-concurrent
— translate.bat
Refer to this issue here
November 24, 2006
Posted by davidbloom |
Struts |
Leave a Comment
I just downloaded the Apache Server on Windows which I have done a while ago alongside IBM’s websphere where they call it Http Server.
I ran the download program that pretty much self installs it. The executable for the Server can be found here
C:\Program Files\Apache Software Foundation\Apache2.2\bin
It appears a bunch of the configuration for server can be found here
C:\Program Files\Apache Software Foundation\Apache2.2\conf
httpd.txt: This is the main Apache HTTP server configuration file. It contains the
configuration directives that give the server its instructions.
Documentation gives details on the meaning of the information in the config file.
November 21, 2006
Posted by davidbloom |
SW Tools, Web Design |
Leave a Comment
I have been reading up about Struts 2.
I figured checking out the webworks framework first might be a good idea.
API – http://www.opensymphony.com/webwork/api/allclasses-frame.html
Config Files – http://wiki.opensymphony.com/display/WW/Configuration+Files
C:\java\webworks\webwork-2.2.2\webapps>ant build -Dwebapp=shopping-cart
Buildfile: build.xml
build:
[delete] Deleting directory C:\java\webworks\webwork-2.2.2\webapps\tmp
[mkdir] Created dir: C:\java\webworks\webwork-2.2.2\webapps\tmp
[copy] Copying 58 files to C:\java\webworks\webwork-2.2.2\webapps\tmp
[javac] Compiling 13 source files to C:\java\webworks\webwork-2.2.2\webapps\
tmp\WEB-INF\classes
[copy] Copying 1 file to C:\java\webworks\webwork-2.2.2\webapps\tmp\WEB-INF
\classes
[war] Building war: C:\java\webworks\webwork-2.2.2\webapps\dist\shopping-c
art.war
[war] Warning: selected war files include a WEB-INF/web.xml which will be
ignored (please use webxml attribute to war task)
BUILD SUCCESSFUL
copy C:\java\webworks\webwork-2.2.2\webapps\dis
t\shopping-cart.war c:\java\apache-tomcat-5.5.17\webapps\
http://localhost:8080/shopping-cart/
learntechnology.net has a basic Webworks example (WAR).
Snippet from xworks.xml:
<default-interceptor-ref name="paramsPrepareParamsStack"/>
<action name="index" class="net.vaultnet.learn.action.EmployeeAction" method="list">
<result name="success">/jsp/employees.jsp</result>
<!– we don’t need the full stack here –>
<interceptor-ref name="basicStack"/>
</action>
<action name="crud" class="net.vaultnet.learn.action.EmployeeAction" method="input">
<result name="success" type="redirect-action">index</result>
<result name="input">/jsp/employeeForm.jsp</result>
<result name="error">/jsp/error.jsp</result>
</action>
- ActionMapper - mapping between HTTP requests and action invocation requests and
vice-versa; may return null if no action invocation request maps,
or it may return an ActionMapping.
- Filter Dispatcher (com.opensymphony.webwork.dispatcher.FilterDispatcher) – filter and its mapping are located in web.xml and defines what requests will be intercepted. Before executing an Action, it loooks through stack of interceptors.
Webworks Interceptors (defined in webwork-default.xml)can be invoked before and after your action is executed. paramsPrepareParamsStack- This is useful for when you wish to apply parameters directly to an object that you wish to load externally.
- <%@ taglib prefix="ww" uri="/webwork" %> : access to the tag library.
November 18, 2006
Posted by davidbloom |
Struts |
Leave a Comment
After being a fan of Flickr for quite a while, and learning of the background of this product, i finally signed up for my own account . Thus, I am ready for the intro , should i be worried?
Another tool of note I enjoy is ITunes, not to be confused with M$FT ‘s Zune . I have not had this experinece with it. Here is one tip that I probably wont try, as I am more interested in setting up my playlists, as I have plenty of Podcasts on my player I listen to these but have not had a use for any .Podcast Tools or lessons on how to podcast . Listening to podcasts via a phone.
Update: Why Microsoft’s Zune music player has little or no chance of denting Apple’s iPod juggernaut [more]
November 14, 2006
Posted by davidbloom |
Web/Tech |
Leave a Comment
OPEN JDK:"Santa Clara-based Sun said it is making nearly all of Java’s source
code — excluding small pockets of code that aren’t owned by Sun —
available under the GNU General Public License. The same type of
license also covers the distribution of the core, or kernel, of the
popular open-source operating system Linux" [q&a]
Why its good : "Java under the GPL means that they can now much more readily cross-leverage each other"
Sutor: "The most widely used license is the GNU General Public License (GPL).
While it is hard to quantify, it appears likely that approximately 70%
of all open source projects use the GPL. Code that uses the GPL is
referred to as “free software.”By its nature, the GPL makes new code that incorporates older GPLed
code also use the GPL. That is, the GPL is somewhat self-propagating as
code that uses it is picked up and re-used elsewhere. This is exactly
as the authors intended.The GNU/Linux operating systems use the GPL. You cannot charge
others for a license to use GPLed software and you must make your
source code available.
Another commonly used license is from the Apache Software
Foundation. This is an open source license that does allow direct use
of the source code within commercial products. Unlike the GPL, the Apache License
allows “defensive termination”: if you sue someone because you claim
that the software infringes on one of your patents, then you lose the
right to freely use the patents of others that are implemented in the
software.
In other words, you stop having the right to use the software if you
are trying to stop others from using it. Much of the open source
software that implements the standards of the World Wide Web is covered
under the Apache license."
freeopen-vs-closed-software
Details of what is available:
The first pieces of source code are available today:
* Java HotSpot technology (JVM)
* Java programming language compiler (javac)
* JavaHelp software
* Sun’s feature phone Java ME implementation
* Java ME testing and compatibility kit framework
Later in 2006, Sun will release these pieces:
* An advanced operating system phone implementation
* The framework for the Java Device Test Suite
Finally, in the first quarter of 2007 the move to free software will be completed as Sun provides these pieces under the GPL:
* A buildable Java SE Development Kit (JDK)
* Project GlassFish (in addition to CDDL)
Duke Open Sourced.
IBM’s take is one of dissapointment but one opinion: "What IBM holds back for its clients only gives it an advantage over
everyone else, especially among the large accounts that can afford its
overhead.The Apache license accepts this reality. The GPL does not. Behind
IBM’s mild complaint is a scream of pain, an acknowledgement that Sun
has cleverly kicked it in the shins."
November 13, 2006
Posted by davidbloom |
J2EE |
Leave a Comment
about this time last year I started exploring the buzz word web 2.0
the Web 2.0 Summit was just held this past week [pod].
Now there is talk of the Web 3.0 : "Back to Web 3.0. There will be one, and it has been associated at this point with concepts of the semantic Web".
Nova Spivack defined the semantic Web :
The Semantic Web is a set of technologies which are
designed to enable a particular vision for the future of the Web – a
future in which all knowledge exists on the Web in a format that
software applications can understand and reason about. By making
knowledge more accessible to software, software will essentially become
able to understand knowledge, think about knowledge, and create new
knowledge. In other words, software will be able to be more intelligent
– not as intelligent as humans perhaps, but more intelligent than say,
your word processor is today.
The blog readwriteweb.com had a nice web2.0 roundup :
web 2.0 vs 1.0
Here is a link to many of the web 2.0 tools .
I personally like netvibes.com a whole lot.
November 13, 2006
Posted by davidbloom |
Web/Tech |
Leave a Comment
in google i put: pserver:guest@cvs.dev.java.net: /cvs dwr
which gave me this url
November 11, 2006
Posted by davidbloom |
Open Source |
Leave a Comment
AJAX: It enhances user interaction by targeting updates from the server
to specific areas of the web page, known as "In-page replacement" . DWR is easy AJAX for Java
Introduction where I learned of Jesse James Garrett from web site Adaptivepath.com is the person who is behind the technology.
AJAX w Java
Google Maps mania
AJAXIAN
Relevance has
Demo from Ajax presentation at Java in Action .
Sun Tip on AJAX
AJAX Talk notes
Eclipse AJAX Toolkit Framework project
Paul Graham : "Basically, what "Ajax" means is "Javascript now works." And that in turn means
that web-based applications can now be made to work much more like desktop ones.
Similarly, RMH tunes in about AJAX
Google Maps
Stu Halloway : "predicts Ajax will be part of nearly all web applications within the next year."
Google Web Toolkit (GWT) this API &samples Designer Tool
Software Development in the Real World: The Complete List of Ajax Tools
(tags: ajax)
November 11, 2006
Posted by davidbloom |
AJAX |
Leave a Comment
I downloaded webtest to c:/java/webtest and started the install . Note that manual for webtest. I believe it makes use of clover the coverage tool.
webtest -buildfile installTest.xml
installTest.xml:
..
<target name="checkWebTest">
<echo message="webtest.home is ${webtest.home}"/>
<testSpec name="check calling and parsing a local file">
<config
host=""
port="0"
basepath="/"
summary="false"
saveresponse="false"
haltonfailure="true"
protocol="file"/>
<steps>
<invoke
description="get local file"
url="${basedir}/testfile.html"/>
<verifyTitle
description="check the title is parsed correctly"
text="Test File Title"/>
</steps>
</testSpec>
</target>
testfile.html:
<html><head>
<title>Test File Title</title>
</head>
<body>
empty
</body>
</html>
November 10, 2006
Posted by davidbloom |
SW Tools |
Leave a Comment
Servlet Filters [ link ] — are not Servlets and they are not responsible for
creating a response.
They are preprocessors of requests before they
reach a Servlet and postprocessors of responses after leaving a
Servlet.
Servlet filters can:
-
Intercept a Servlet’s invocation before the Servlet is called
-
Examine a request before the destination Servlet is invoked
-
Modify request headers and request/response data by subclassing the HttpServletRequest object and wrapping the original request
-
Intercept a Servlet’s invocation after the servlet is called
The designers of Servlet Filters identified the following examples for their use:
Authentication Filters, Logging and Auditing Filters,Image conversion Filters, Data compression Filters, Encryption Filters, Tokenizing Filters, Filters that trigger resource access events, XSL/T filters, Mime-type chain Filter
web.xml:
<filter>
<filter-name>My Filter</filter-name>
<filter-class>com.myproject.MyFilter</filter-class>
<init-param>
<param-name>enable</param-name>
<param-value>yes</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>My Filter</filter-name>
<servlet-name>action</servlet-name>
</filter-mapping>
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
public class MyFilter implements Filter
{
boolean _enable = false;
public void init(FilterConfig fc) throws ServletException
{
String enable=fc.getInitParameter("enable");
if ("yes".equals(enable))
_enable=true
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException
{
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
if (! _enable)
{ // proceed with request
chain.doFilter(request, response);
return;
}
doIt();
chain.doFilter(request, response);
//After
FilterChain.doFilter() returns, the filter can do more processing if it
chooses;
doINextt();
}
public void destroy()
{
}
}
November 5, 2006
Posted by davidbloom |
Web Design |
Leave a Comment
"Basic approach is that pages push themselves onto a trail-stack, and
a normalized version is maintained for showing on a page. ie)
In addition to the normalized user version, a full trail is also
maintained, which could be emailed or stored instead of access logs on
session expiry.
Normalization occurs whenever an element is repeated in a trail, its
http-referer is repeated in a trail [ie sneaky users used the back button]
or possibly when the trail:pop tag is used, though I’ve not had a need to
use that yet."
November 4, 2006
Posted by davidbloom |
Web Design |
Leave a Comment
Stu Halloway : "predicts Ajax will be part of nearly all web applications within the next year."
Tapestry: "component based framework"
Instantiations
November 4, 2006
Posted by davidbloom |
Web Design |
Leave a Comment
After the release of WebWork 2.2.2, the WebWork and Struts communities began a merge that will eventually produce Struts 2. This merger combines these two "action based" frameworks as it is told .
Compared to SpringMVC,
you sacrifice some cleanliness but there is a lot more work done in
certain areas, for example client-side validation, a strong Interceptor
framework and a nice graphical flow
designer – this latter is also a strong area, with WebWork being one of
the pioneer adopters of the freshly unbundled RIFE Continuations package.
Read more »
November 2, 2006
Posted by davidbloom |
Struts |
Leave a Comment
2 User:
3 User_talk:
4 Project:
5 Project_talk:
6 Image:
7 Image_talk:
8 MediaWiki:
9 MediaWiki_talk:
10 Template:
11 Template_talk:
12 Help:
13 Help_talk:
14 Category:
15 Category_talk:
October 27, 2006
Posted by davidbloom |
Web/Tech |
Leave a Comment
RACF is now
called "Security Server" [1]
Putting Latest Security Features to work [redbook]
RACF schema
What is RACF:
RACF stands for Resource Access Control Facility. RACF is a software security product that protects information
by controlling access to it. RACF also controls what the user can do and protects all of the operating system’s
resources. RACF provides this security by identifying and verifying users, authorizing users to access protected
resources and recording and reporting access attempts.
RACF helps meet the needs for security by providing the ability to:
- Identify and verify users
- Authorize users to access the protected resources
- Control the means of access to resources
- Log and report various attempts of unauthorized access to protected resources
- Administer security to meet the goals of security
RACF mag
LDAP integrate
example operation
[1]
[2]
October 10, 2006
Posted by davidbloom |
SW Tools |
Leave a Comment
In Reggie Bush’s first game:
58 yards of revieving, 61 yards rushing
Kellen Winslow playing in first game since injury
1TD, 63 yards receiving
Saints and Falcons lead NFC South as Bucs and Panthers begin season in loss column.
It seemed that Bucs OL being banged up resulted in Simms bad play with 3 picks.
Caddilac Williams had only 22 yards eof rushing mainly due to Ravens strong D.
McNair had a decent first game and seemed like he will has found a favorite target in Mason.
The Panthers just could not solve Vick and Dunn combination. Panthers lacked big play
they usually can count on in Steve Smith. Laverneus Coles hooked up with passes from Pennington quite well today
September 10, 2006
Posted by davidbloom |
Sports |
Leave a Comment