Wednesday, August 29, 2007

Glyph Shapes in Windows XP vs Vista

In JIS X 0213:2004, the standard shapes of some glyphs are modified. Glyph shape of “MS Gothic” in XP differs that from in Vista. The version of msgothic.ttc,msmincho.ttc is 2.3 on XP, but 5.0 in Vista. Font version 2.5 and 5.0 includes both old "1990" shape and new "2004" shape.

Font version 2.3 – have only old “1990” shapes. (XP’s default)
Font version 2.5 – have both “1990” and “2004” shapes and “1990” shapes as default.
Font version 5.0 – have both “1990” and “2004” shapes and “2004” shapes as default. (Vista’s default)


New font “Meiryo” has only version 5.0 up-to-date.

Friday, August 17, 2007

Spring: ResourceBundleViewResolver

When using ResourceBundleViewResolver, applicationContext.xml will contain following configuration.

<bean id="viewResolver"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver" >
<property name="basename"><value>views</value></property>
</bean>


The “basename” property is used to tell ResourceBundleViewResolver how to construct
the names of the properties files that contain View definitions.

Sample views.properties file will look like as follows; It should reside in the classes folder of the server(..\WEB-INF\classes\).

pdfView.class=com.springinaction.training.mvc.BookListPdfView

home.class=org.springframework.web.servlet.view.JstlView
home.url=/WEB-INF/jsp/home.jsp
listBooks.class=org.springframework.web.servlet.view.JstlView
listBooks.url=/WEB-INF/jsp/listBooks.jsp
bookdetail.class=org.springframework.web.servlet.view.JstlView

bookdetail.url=/WEB-INF/jsp/bookdetail.jsp

Thursday, August 16, 2007

Apache Axis2/Java Version 1.3 Released


The core engine for Web services, Apache Axis2 a complete re-design and re-write of the widely used Apache Axis SOAP stack, built on the lessons learnt from Apache Axis.


New version is available now @
http://ws.apache.org/axis2/

Wednesday, August 15, 2007

No more NoClassDefFoundError or ClassNotFoundException

I found very interesting site that allow you to find jars,
http://www.docjar.com

Eg: If you want to find jars containing a class just search packagename.CLASSNAME, result will list all the jars containing that class.

Monday, August 13, 2007

Spring Controller interface

Simple Controller (HomeController.java)

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HomeController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("home", "message", greeting);
}
private String greeting;
public void setGreeting(String greeting) {
this.greeting = greeting;
}
}

applicationContext.xml should include :

<bean name="homeControler" class="com.springinaction.training.mvc.HomeController">
<property name="greeting">
<value>Welcome to Book Store!</value>
</property>
</bean>


Also the view resolver and url mapping should be specified in this xml file.

You can access the message variable in home.jsp as :

${message}

Search