Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

January 17, 2011

note to self: get maven nature on projects in (my)eclipse

myeclipse: v8.6
plugins/ software:
mavensupport for myeclipse (m4e)
maven integration for eclipse (m2)

now, if a project wasn't "maven-enabled", i often had to manually edit the .project file to make it so, even with mavensupport installed.

but if you also install "maven integration for eclipse", you can right-click a project without maven nature and select "(m2) myeclipse maven -> enable dependency management".

a last piece of the puzzle seems to be needed - i think i enabled some advanced option in m4e (might even have been seemingly unrelated, like advanced tabs in pom).  but a coworker disabled m4e after installing m2 and then got the right-click option to enable maven for a project...

edit: it seems i only had to enter the maven settings (myeclipse -> maven), and then exit (apply).  without changing anything... then the "(m2) myeclipse maven -> enable dependency management" option emerged...

August 27, 2010

tapestry 5 custom validation error message

in our system/ configuration, in order to customize T5 validation messages using the T5 validation message language key conventions, i had to use the following language keys:
  • "required" as language key for a required field
    - f.ex. when i use t:validate="required" in a .tml file
  • "number-format-exception" for a number field, and integer-format-exception for an integer field
    - when an input field attached to an integer property gets a letter, f.ex. 
using "%s" in the language expression will give access to the name of the field, f.ex. having an error message like "%s must be completed".
    what did NOT work for us, even if it worked for others (ref information below), was any prefix with field or form name, or a postfix of -message...


    Apache Tapestry - Form Input and Validation:
    Customizing Validation Messages

    Each validator (such as "required" or "minlength") has a default message used (on the client side and the server side) when the constraint is violated; that is, when the user input is not valid.

    The message can be customized by adding an entry to the page's message catalog (or the containing component's message catalog). As with any localized property, this can also go into the application's message catalog.

    The first key checked is formId-fieldId-validatorName-message.
    • formId: the local component id of the Form component
    • fieldId: the local component id of the field (TextField, etc.)
    • validatorName: the name of the validator, i.e., "required" or "minlength"
    If there is not message for that key, a second check is made, for fieldId-validatorName-message.

    If that does not match a message, then the built-in default validation message is used.

    http://tapestry.1045711.n5.nabble.com/T5-Overriding-integer-validation-message-td2436931.html#a2436931:

    (from the answers)

    You should add a prefix consisting of the field id (and optionally the form 
    id).
    (Igor)

    To generalize messages overrides for all form, you can contribute to ValidationMessagesSource service in your AppModule class with your own
    property file. (Christophe)

    Trial and error have yielded: [field id]-integer-message  (xfile80303)
    Blogged with the Flock Browser

    March 8, 2010

    Spring Batch

    Many applications within the enterprise domain require bulk processing to perform business operations in mission critical environments. These business operations include automated, complex processing of large volumes of information that is most efficiently processed without user interaction. These operations typically include time based events (e.g. month-end calculations, notices or correspondence), periodic application of complex business rules processed repetitively across very large data sets (e.g. insurance benefit determination or rate adjustments), or the integration of information that is received from internal and external systems that typically requires formatting, validation and processing in a transactional manner into the system of record. Batch processing is used to process billions of transactions every day for enterprises.

    Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the Spring Framework, while making it easy for developers to access and leverage more advance enterprise services when necessary.
    Spring Batch
    Blogged with the Flock Browser

    February 23, 2010

    so you haven't seen complaints about maven?

    have you only heard good things?  i'm surprised...

    here's some stuff to balance it out.

    first, a couple of common complaints:
    • too complex
    • too rigid
    • too buggy
    • too opaque
    • difficult and time-consuming to debug problems
    then, a couple of links:
    Howard @ tapestry, maven vs ivy
    a collection of links on negative maven experiences


    January 31, 2010

    interface code smells

    Interfaces are a very useful language feature, but are much abused. Symptoms include:
    1. An interface is only implemented by one class
    2. A class implements multiple interfaces. Often touted as an advantage of interfaces, usually it means that the class in question is violating the principle of separation of concerns.
    3. There is an inheritance hierarchy of interfaces (often mirrored by a hierarchy of classes). This is the situation you're trying to avoid by using interfaces in the first place. Too much inheritance is a bad thing, both for classes and interfaces.
    All these things are code smells, IMO.
    (Jim Cooper)
    Why do most system architects insist on first coding to an interface? - Stack Overflow
    Blogged with the Flock Browser

    January 18, 2010

    powermock

    PowerMock is a framework that extend other mock libraries
    ....
    By using a custom classloader no changes need to be done to the IDE or continuous integration servers which simplifies adoption.
    ....
    PowerMock aims to extend the existing API's with a small number of methods and annotations to enable the extra features. Currently PowerMock supports EasyMock and Mockito.
    powermock - Project Hosting on Google Code
    Blogged with the Flock Browser

    August 25, 2009

    Integrating EJB 3 and Spring

    EJB 3 and Spring are often cast as contenders. However there are a growing number of applications that combine the strengths of both these technologies to create compelling best-of-breed solutions.

    This session is an introduction to creating powerful hybrid solutions with EJB 3 and Spring. It outlines some of the use cases where such integration makes sense and demonstrates how to inject Spring beans into EJB, ... as well as inject Session beans into Spring beans.
    ....
    Attend and learn how to tightly integrate Spring and Java EE 5 to utilize EJB 3 features, such as:
    • Minimal configuration;
    • 100% annotations;
    • Distributed transactions;
    • JAAS security;
    • Seamless JPA EntityManager/EntityManagerFactory injection,
    • Statefulness;
    • Passivation.
    TheServerSide Java Symposium - Language
    Blogged with the Flock Browser

    February 18, 2009

    Tapestry Central: Importance of toString()

    Tapestry mostly use ToStringBuilder from Jakarta commons-lang.
    Tapestry Central: Importance of toString()
    Blogged with the Flock Browser

    January 9, 2009

    java to rtf, aspose.words

    Aspose.Words allows developers to build or modify documents and formatting with ease using a document object model consisting of over 100 classes.

    Developers can programmatically create, modify, extract and replace all document elements including sections, headers, footers, paragraphs, lists, tables, text, fields, hyperlinks, bookmarks and images. Developers can specify detailed formatting for any document element. All drawing objects including shapes, textboxes, images, OLE objects and controls are supported and you can perform things such as insert watermarks or extract images easily.

    Aspose.Words also provides useful security and utility features like joining or splitting documents, copying fragments between documents, protecting and unprotecting documents, modifying document properties and inserting HTML fragments into the document.
    DOCX DOC RTF WordML HTML TEXT-Java .NET Word Processing Components

    hmm - stiff price, but might be worth it...
    Blogged with the Flock Browser

    December 3, 2008

    Exjali - EXpressiveness JAva LIbrary

    Inspired by the buzz around Java 7 and "new" JVM language (Groovy, JRuby, Scala, ...), Exjali is a small Java librairy, allowing more expressive statements without altering the language. Exjali includes some attempts for ranges of integers, SQL-like functions, IO facilities, functors and named parameters.
    Exjali
    Blogged with the Flock Browser

    October 4, 2007

    annotation: @SuppressWarnings

    Excluding warnings using SuppressWarnings

    Help - Eclipse SDK (at the bottom of this page...)

    Java 5.0 offers the option to the user to disable compilation warnings relative to a subset of a compilation unit using
    the annotation java.lang.SuppressWarning.

     @SuppressWarning("unused") public void foo() {
    String s;
    }

    Without the annotation, the compiler would complain that the local variable s is never used. With the annotation, the compiler silently ignores this warning locally to the foo method. This enables to keep the warnings in other locations of the same compilation unit or the same project.

    The list of tokens that can be used inside an SuppressWarning annotation is:

    • all to suppress all warnings
    • boxing to suppress warnings relative to boxing/unboxing operations
    • cast to suppress warnings relative to cast operations
    • dep-ann to suppress warnings relative to deprecated annotation
    • deprecation to suppress warnings relative to deprecation
    • fallthrough to suppress warnings relative to missing breaks in switch statements
    • finally to suppress warnings relative to finally block that don't return
    • hiding to suppress warnings relative to locals that hide variable
    • incomplete-switch to suppress warnings relative to missing entries in a switch statement (enum case)
    • nls to suppress warnings relative to non-nls string literals
    • null to suppress warnings relative to null analysis
    • restriction to suppress warnings relative to usage of discouraged or forbidden references
    • serial to suppress warnings relative to missing serialVersionUID field for a serializable class
    • static-access to suppress warnings relative to incorrect static access
    • synthetic-access to suppress warnings relative to unoptimized access from inner classes
    • unchecked to suppress warnings relative to unchecked operations
    • unqualified-field-access to suppress warnings relative to field access unqualified
    • unused to suppress warnings relative to unused code

    March 7, 2007

    tomcat 6

    ny stabil tomcat:

    TSS: Tomcat 6 released and stable
    Apache has announced that Tomcat 6.0.10 has been released and is considered stable. Tomcat 6 ... implements the "Servlet 2.5 and JSP 2.1 specifications, a refactored clustering implementation, advanced IO features, and improvements in memory usage."

    Raible designs: Upgrading to Tomcat 6
    it has to be the least painful major Tomcat upgrade I've ever done

    September 29, 2006

    WUI - alternativ til JSP

    ser jo lovande ut...

    WUI - Web User Interface Framework
    JSP development sucks

    Let's face it: no two browsers support HTML, XHML, CSS or JavaScript consistently. Wasn't Java supposed to let you "write once, run everywhere"? Well today you can, and you don't have to use applets.

    JSPs were great in the infancy of Web development in Java. Today, it's clear that they're the wrong tool for the job. They promote model-1 programming and offer very little reuse potential for the application programmer. Sure there's TAGLIBs. They're no silver bullet: they're performance hogs, they add new dependencies, new semantics and offer very poor reuse capabilities unless you're the author of the tag library itself.

    September 11, 2006

    java vs scriptspråk

    jf tanken om å ha eit "kjerneverktøy" og skilja ut så mykje som mogleg av perifere, isolerte ting og tang, eller "add-ons"... (td å legga til info for mange på ein gong)

    sjekk diskusjon om sterke og svake sider ved kompilerte språk vs skript-språk.

    enter jruby, som køyrer på jvm...

    javaBin - Sun adopterer JRuby
    JRuby er en implementasjon av programmeringsspråket Ruby i java som gjør det mulig å kjøre ruby-programmer på en JVM, og som også gir muligheter for tett integrasjon mellom java og ruby-kode. JRuby vil fortsette under samme open-source lisens som tidligere.

    August 24, 2006

    java og skriptspråk

    interessante tankar...
    gjeld vel for ting som php, pearl, ruby også

    The Snowtide Blog » Blog Archive » Working Together: Python/Java & Open Source/Commercial
    In general, Java and Python don’t really mix. Their architectures, best-practices, object models, and philsophies are pretty divergent in a lot of ways. Because of this, you don’t often find them cohabiting peacefully.

    However, there are significant advantages to be had by bringing these two environments together. Python is a really elegant language, and is very well-suited to whole classes of software development that are much more painful to tackle in Java. Java has its advantages as well: a very mature standard library, a huge array of third-party library support, fantastic development environments, and the backing of big players in IT. As always, there’s a right tool for each job, and sometimes Java works best, and sometimes Python works best, but a combination would truly be more than the sum of its parts.

    May 2, 2006

    om java... (humor)

    :)

    The Joel on Software Discussion Group - Why do I need to know UNIX?:
    ....
    "Java is write-once, debug-everywhere..."

    April 25, 2006

    creates complete, working J2EE applications from a database or UML model

    JAG 6.0 released: Tapestry 4, XFire SOAP & Acegi Security: "JAG is a Swing application that creates complete, working J2EE applications from a database or UML model.

    JAG 6.0 adds support for Java5-based templates. The template makes extensive use use of Java 5 annotations and generics and uses Hibernate 3 for persistence. For the presentation tier, either Tapestry or Struts can be selected.

    The following improvements have been made in the 6.0 release:
    Tapestry 4 support
    XFire SOAP framework (based on STAX)
    Acegi security login
    Rome RSS feed support
    Many to many relations support
    Jasper PDF Reports
    generation of a Intellij 5 project file for a web application"

    April 21, 2006

    Business Intelligence and Reporting with BIRT

    Java Feature — Business Intelligence and Reporting with BIRT @ JAVA DEVELOPER'S JOURNAL: "Open Source Business Intelligence software is finally coming into its own, with three major players coming to the fore: JasperReports, Pentaho, and BIRT (Business Intelligence and reporting tools). Business Intelligence technology comprises solutions for delivering enterprise data in the form of customizable reports, facilitating such practices as data mining and decision support systems. Of the three leading projects, both JasperReports and BIRT are commercial Open Source; they are backed by JasperSoft and BI veteran Actuate respectively. Pentaho uses the more traditional collaborative Open Source model. One of BIRT's distinguishing features is that it's an official Eclipse project, giving it a strong endorsement by one of the leading forces in the Java community. Our team chose BIRT after some due diligence on the other two because of our prior experience with Actuate and deep appreciation of all things Eclipse.

    This article presents a 'first experience' approach to BIRT."

    March 9, 2006

    frameworks

    eg drar gjerne på tssjs 2006....

    TSSJS BOF: Web Framework Sweet Spots: "The objective of this BOF is to discuss the various open source web frameworks and what each does well. Matt kicks off the discussion by highlighting the good features of various frameworks, (results of pre-conference discussions with various framework authors to get their opinions on what problems their framework solves best) as well as debunk some myths based on audience members real-world experiences.

    Yesterday, I sent an e-mail the authors of the most popular web frameworks in JavaLand. In my opinion, these are (in alphabetical order): Cocoon, JSF, RIFE, Seam, Spring MVC, Spring Web Flow, Struts, Trails, Tapestry, WebWork and Wicket."

    March 3, 2006

    digi.no - BEA åpner kildekode

    digi.no - BEA åpner kildekode: "BEA ... frigi[r] kildekoden av sine Kodo Java Persistence API-er basert på spesifikasjonen Enterprise Java Beans 3.0 (EJB3) .... Open JPA.
    ....
    [vil gi fordeler for de som] utvikle[r] etter en blandingsmodell med kommersiell programvare og rammeverk av åpen kildekode. "