TechnoBuzz

A Techno Blog, mainly about Java

DW Spring Intro

Link: Intro on DeveloperWorks

Download the Spring Framework 1.2 RC2 Zip file here and extracted it to my c drive (C:\spring-framework-1.2-rc2).

Get the code associated with the article wa-spring1-SpringProject.zip here.
and extracted it to my c:/eclipse/workspace/SpringProject.  Note that I did this in eclipse 3.1

copy spring.jar and spring-context from C:\spring-framework-1.2-rc2\dist to   SpringProject\lib folder.

Get Jakarta Commons Logging  from here and copy  commons-logging.jar to the SpringProject\lib folder.

Find ANT build file within SpringProject
Run as … clean-build
Run as … main

 

July 31, 2005 Posted by | IoC | Leave a comment

JNDI URL from tomcat 5 definition

J2EE Resources
The J2EE standard provides a standard set of elements in the /WEB-INF/web.xml file to reference resources.

Tomcat 5.5
entries in per-web-application InitialContext are configured in the elements that can be specified in either $CATALINA_HOME/conf/server.xml or, preferably, the per-web-application context XML file (either META-INF/context.xml).  example

Tomcat 5.5
separate namespace of global resources for the entire server. These are configured in the element of $CATALINA_HOME/conf/server.xml.

getting up and running with tomcat 5.5

Hibernate 3 and Tomcat

JNDI DataSource  how to 5.5

Some 5.0 Tomcat examples and back some even more

db forums thread

Hibernate says this, or using Hibernate with Tomcat [2] and JNDI , 3.X

Google on topic

July 27, 2005 Posted by | J2EE | Leave a comment

JavaCast: First JavaCast Interview: Craig McClanahan from Sun, Inventor of Struts. Give Us Questions!

Link: JavaCast: First JavaCast Interview: Craig McClanahan from Sun, Inventor of Struts. Give Us Questions!.

July 27, 2005 Posted by | Uncategorized | Leave a comment

MyEclipse

Link: MyEclipse Forum

Link: Wayne Parrott’s Weblog : Weblog.

July 26, 2005 Posted by | SW Tools | Leave a comment

To Persist

Persistence paper

July 26, 2005 Posted by | Hibernate & ORM | Leave a comment

Swik

Link: Swik: “The free and open database of Open Source projects that anyone can edit”

July 25, 2005 Posted by | Open Source | Leave a comment

web tools on eclipse 3.1

I had checked out eclipse 3.0 with the web tools  last year.  Now, Its 3.1 time.

On Eclipse download page,  Get eclipse-SDK-3.1-win32 (The Eclipse SDK
includes the Eclipse Platform, Java development tools, and Plug-in Development
Environment, including source and both user and programmer documentation. If you
aren’t sure which download you want… then you probably want this one.)

Get the other Web Tools Platform prerequisites.

  • – The EMF driver used in this build is emf-sdo-xsd-SDK-2.1.0.zip
  • – The GEF driver used in this build is GEF-SDK-3.1.zip
  • – Java EMF Model Runtime driver used in this build is JEM-SDK-I20050715.zip
  • In the Web Tools Platform; Runtime section there are two downloads. Select the first one. (The second one also includes the WTP source and is useful if you are developing the WTP or developing on top of the WTP)

    Stable Build: 0.7RC2    WTP Runtime module includes the WST and JST builds in one package wtp-0.7RC2.zip

    Tomcat tutorial (old)

    Tomcat 3.1 tutorial

    wiki

    http://www.eclipseplugincentral.com/index.php

    July 22, 2005 Posted by | SW Tools | Leave a comment

    AJAX at JUG

    Steve Benfield from ClearNova spoke about AJAX at the TriJug last night.

    Jesse James Garrett  from  web site Adaptivepath.com is the person who is behind the technology.

    Follows are my notes from meeting:

    Google using AJAX
    asynchronous communication to the server without fullpage refresh
    Rich internet user application experience
    component oriented model (3 tier client/ server)
    form submit under hood (small pieces bundled up and sent to server without a submit)
    increased number of times data going to server but smaller payloads
    event driven programming

    XMLHttpRequest (MSFT and Mozilla behind it)
    Multiple connections on the page
    There is a call back object.
    Some things that were used in past was a IFRAME – minibrowser in html document, but can only go back to URL that is part of the original message.

    open (assign destination, url, method)
    send (send data)

    states:
    onreadystatechange – event handler
    readystate : 0,1,2,3,4
    status:
    200 OK
    404

    Back buttonand refresh are still issues with AJAX
    The heart of AJAX is controlled via javascript.

    He mentioned a nice firefox extension called aardvark

    Misc related links:

    July 19, 2005 Posted by | Web Design | Leave a comment

    Singularity

    Singularity : time when technological development will be at its fastest.

    July 18, 2005 Posted by | Weblogs | Leave a comment

    Better EE w Spring

    link : "a whirlwind tour of IoC in general and Spring in particular"

    July 17, 2005 Posted by | IoC | Leave a comment

    Tiger

    JSK 1.5 (Tiger) download

    I am interested in learning about annotations : "eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead the information can be maintained in the source files".

    http://jcp.org/en/jsr/detail?id=175ather

    Have seen annotations before (i.e. @depracated). The release 5.0 platform has a general purpose annotation (also known as metadata) facility that permits you to define and use your own annotation types.

    Annotation type declarations are similar to normal interface declarations. An at-sign (@) precedes the interface keyword. Each method declaration defines an element of the annotation type. Method declarations must not have any parameters or a throws clause. Return types are restricted to primitives, String, Class, enums, annotations, and arrays of the preceding types. Methods can have default values. Here is an example annotation type declaration:

    /**
     * Describes the Request-For-Enhancement(RFE) that led
     * to the presence of the annotated API element.
     */
    public @interface RequestForEnhancement {
        int    id();
        String synopsis();
        String engineer() default "[unassigned]"; 
        String date();    default "[unimplemented]";

    An annotation is a special kind of modifier, and can be used anywhere that other modifiers (such as public, static, or final) can be used. By convention, annotations precede other modifiers. Annotations consist of an at-sign (@) followed by an annotation type and a parenthesized list of element-value pairs. The values must be compile-time constants. Here is a method declaration with an annotation corresponding to the annotation type declared above:

    @RequestForEnhancement(
        id       = 2868724,
        synopsis = "Enable time-travel",
        engineer = "Mr. Peabody",
        date     = "4/1/3007"
    )
    

    I believe Hibernate 3 now has this feature so that you can define mappings in source code rather than XML mapping file

    Continue reading

    July 17, 2005 Posted by | J2EE | Leave a comment

    apache iBATIS

    iBATIS   apache. comprised of two main products – DAO and SQLMaps.  The DAO  provides an excellent way of abstracting the persistence layer while the SQLMaps provides your basic Object/Relational Mapping functionality.

    [articles] [FAQ] [mail archives]

    [java developer guide pdf]  [generic developer guide] [tutorial]

    [dao developer guide]

    a blog  Vinny blog    ibatis with struts

    http://del.icio.us/tag/ibatis

    July 15, 2005 Posted by | Hibernate & ORM | 7 Comments

    Collection versus Iterator

    Link: Collection versus Iterator.

    July 15, 2005 Posted by | J2EE | Leave a comment

    jboss and interface21

    This link is pretty entertaining.  EJB3, Spring. Choices.

    July 14, 2005 Posted by | IoC | Leave a comment

    del.icio.us

    I set up a del.icio.us account : http://del.icio.us/dmbwebportals

    July 14, 2005 Posted by | Blogging | Leave a comment

    TSS “Best of” Blogs

    TSS Best of Blogs :  feed site

    July 13, 2005 Posted by | Weblogs | Leave a comment

    The Pro Spring Book

    link: "The sample application developed in the book is a “Spring Blog”; all the code is clear and well explained, and there are several other example all throughout the book (obviously you can find them online: chapter source code and sample application). Overall, “Pro Spring” is a must-have if you plan to use Spring in your project."

    July 12, 2005 Posted by | IoC | Leave a comment

    SourceBeat Chapter

    Based on post a few months back on a positive experience with the Spring Live chapter 2 [tss] , thought I’d finally try it out. [forum] [wiki FAQ]
    JAVA_HOME is C:\j2sdk1.4.2_05\
    ANT_HOME is C:\apache\apache-ant-1.6.2
    CATALINA_HOME is C:\apache\jakarta-tomcat-5.0.27
    PATH has C:\apache\apache-ant-1.6.2\bin;C:\j2sdk1.4.2_05\bin; C:\apache\jakarta-tomcat-5.0.27\bin

    https://equinox.dev.java.net/files/documents/1901/5728/equinox-1.0.zip extract to C:\sourcebeat\

    C:\sourcebeat\equinox>ant new -Dapp.name=myusers

    copy  C:\sourcebeat\myusers to CATALINA_HOME\webapps

    CATALINA_HOME\conf\tomcat-users I added
      <user username="admin" password="admin" roles="manager"/>

    C:\apache\jakarta-tomcat-5.0.27\webapps\myusers>ant list

    C:\apache\jakarta-tomcat-5.0.27\webapps\myusers>ant deploy

    went into manager http://localhost:8080/manager and add myusers directory

    http://localhost:8080/myusers/&nbsp; , get page with:
    "Equinox is a lightweight version of AppFuse. I was inspired to create it when looking at the struts-blank and webapp-minimal applications that ship with Struts and Spring, respectively. These "starter" apps were not robust enough for me, and I wanted something like AppFuse, only simpler. "

    Code up UserDAO ,  User, User.hbm.xml   [Spring live source code]

    Here, I found I must change the url  in the WEB-INF/applicationContext.xml which I changed to
    <property name="url"><value>jdbc:hsqldb:C:/apache/jakarta-tomcat-5.0.27/webapps/myusers/db/appfuse</value></property>

    Also, in this file set the MappingResources property value to indicate the location of
    org/appfuse/model/User.hbm.xml

    C:\apache\jakarta-tomcat-5.0.27\webapps\myusers>ant deploy reload

    C:\apache\jakarta-tomcat-5.0.27\webapps\myusers>ant browse

    The place where you configure a Java EE app to use Spring is in the web.xml file. What you do is
    set the listener :
    <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

    The next step is configuring spring with hibernate. We will look in the applicationContext.xml
    The session factory bean that has a dependency on data source bean:

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
                <list>
                    <value>org/appfuse/model/User.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</prop>
                <prop key="hibernate.hbm2ddl.auto">create</prop>
            </props>
            </property>
        </bean>

    The data source bean:

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
            <property name="url"><value>jdbc:hsqldb:C:/apache/jakarta-tomcat-5.0.27/webapps/myusers/db/appfuse</value></property>
            <property name="username"><value>sa</value></property>
            <property name="password"><value></value></property>
        </bean>

    The transaction manager bean which depends on the session factory:

    <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>

    Now we code up UserDAOHibernate  [Spring live source code]

    In applicationContext.xml we create a  relationship to the UserDAOHibernate :

    <bean id="userDAO" class="org.appfuse.dao.hibernate.UserDAOHibernate"> <property name="sessionFactory"> <ref local="sessionFactory"/> </property> </bean>

    [myusers w/eclipse]

    Some Spring links:

     

    July 12, 2005 Posted by | IoC | Leave a comment

    WSCentral

    The site is called WebsphereCentral.  I am particularly interested in the RAD V6 series.

    July 11, 2005 Posted by | SW Tools | Leave a comment

    XML improvments with Spring

    Spring &XML : "XML is a perfect way to express the static assembly of your application; the configuration that is needed to get things going. Actual behavior related to the problem your application is solving shouldn’t be coded in XML. That’s what the application code is for"

    He goes on to indicate the enhancements to Spring’s XML

    July 10, 2005 Posted by | IoC | Leave a comment

    link blast 7/8

    http://www.henricson.se/mats/StateOfTheArtInServerSideJava.pdf

    http://www.jboss.com/docs/trailblazer

    http://trailblazer.demo.jboss.com/EJB3Trail/

    spring experience

    http://www.theserverside.com/articles/article.tss?l=IOCBeginners

    http://www.jroller.com/comments/raghukodali/Weblog/does_ejb_3_0_really

    July 8, 2005 Posted by | J2EE | Leave a comment

    Persistence Choice Factors

    "The choice of Java persistence technology is not simply a technical decision. Project managers need to also consider some non-technical factors: " [more…]

    July 8, 2005 Posted by | Hibernate & ORM | Leave a comment

    Link Dump 7/7

    Learning Java

    Continue reading

    July 7, 2005 Posted by | Uncategorized | Leave a comment

    Technorati

    I added Technorati to this site today. I want to learn about Tags. Here is One site that uses them.

    And here is my blog shares

    July 2, 2005 Posted by | Blogging | Leave a comment

    Java web logs

    I just noticed that WDJ has what they call blognplay where they provide the ability to set up a blog.

    July 2, 2005 Posted by | Blogging | Leave a comment

    Gosling Q&A

    Father James:

    The Early Days : "the Green project, we decided we wanted to do a prototype. We had to focus. Largely because it was more entertaining, we picked consumer electronics."

    On Microsoft : "They were actually very upstanding, lovely members of the Java community for six months or a year, then they decided that was a bad idea."

    July 1, 2005 Posted by | Uncategorized | Leave a comment

    Gosling Q&A

    Father James:

    The Early Days : "the Green project, we decided we wanted to do a prototype. We had to focus. Largely because it was more entertaining, we picked consumer electronics."

    On Microsoft : "They were actually very upstanding, lovely members of the Java community for six months or a year, then they decided that was a bad idea."

    July 1, 2005 Posted by | Uncategorized | Leave a comment

    Date

    Arron Johnson talks about Dates here

    Depracated

    example of how I deal with dates:

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    Date time = new Date();
    String date = sdf.format(time);

    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime (new Date());
    int hour = calendar.get(calendar.HOUR_OF_DAY);
    int minute = calendar.get(calendar.MINUTE);
    int dayOfWeek = calendar.get(calendar.DAY_OF_WEEK);
    int dayOfMonth = calendar.get(calendar.DAY_OF_MONTH);
    int month = calendar.get(calendar.MONTH);

    July 1, 2005 Posted by | J2EE | Leave a comment

    Being there without being there (IV)

    Blogging Roller comments about his talk

    Peter Pilgrim’s writeup

    BeJug Day 3

    javaone weblogs

    I’ll have to read this one

    Lastly: "The 2005 JavaOne conference multimedia technical sessions, will be available for free to Sun Developer Network (SDN) members. Membership to SDN is free to all developers."

    July 1, 2005 Posted by | J2EE | Leave a comment