Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on June 04, 2014 16:56:56    Last update: June 04, 2014 16:56:56
The error was something like this: Simple type "ExtraLongEnumListType" was not mapped... Solution: create a binding file to increase the EnumMemberSizeCap limit. The POM file: <dependency> <groupId>org.apach... Contents of bindings.xml : <jaxb:bindings xmlns:jaxb="http://java.sun....
Created by James on October 16, 2013 09:14:24    Last update: October 16, 2013 09:14:24
The initial attempt was to compile the bunch of LESS files with: lessc less/* But then I got errors like: NameError: variable @line-height-computed is undef... The order of LESS files listed is important. Variables are defined in variables.less , so it should be listed first. For Bootstrap, the ordering is defined in bootstrap.less . So all you have to do is ( this is the right way ): lessc bootstrap.less bootstrap-compiled.css Just for the reference, this is the content of bpptstrap.css : /*! * Bootstrap v3.0.0 * * Copyright 2...
Created by Dr. Xi on March 22, 2013 12:18:39    Last update: March 22, 2013 12:18:39
This is a step-by-step guide to create a "contract-first" web service with Apache CXF. It's a lot easier than doing the same thing with Spring-WS. The project uses standard Maven directory layout. Define the data types ( src/main/resources/hello.xsd ): <xs:schema xmlns:xs="http://www.w3.org/200... Define the service ( src/main/resources/hello.wsdl ): <?xml version='1.1' encoding='UTF-8'?> <wsdl:de... Create pom.xml : <project xmlns="http://maven.apache.org/POM/4.... Generate jaxb bindings: $ mvn generate-sources Code the web service ( src/main/java/com/example/cxfdemo/HelloPortImpl.java ): package com.example.cxfdemo; import javax.j... Declare the CXF servlet in web.xml ( src/main/webapp/WEB-INF/web.xml ): <?xml version="1.0" encoding="UTF-8"?> <web-app... Wire up the web service implementation ( src/main/webapp/WEB-INF/cxf-servlet.xml ): <?xml version="1.0" encoding="UTF-8"?> <beans x... Build the WAR: $ mvn clean package After the webapp is deployed (Tomcat running on port 8080), the web service (WSDL) is available via...
Created by Dr. Xi on March 21, 2013 20:29:14    Last update: March 22, 2013 08:58:08
Spring-WS documentation says you can use a Jaxb object as parameter or return type, provided that it is annotated with javax.xml.bind.annotation.XmlRootElement , or is an instance of javax.xml.bind.JAXBElement . But that's a lot easier said than done! For example, if sayHelloResponse is defined as: <xs:element name="sayHelloResponse" type="tns:sayH... then the JAXB generated class is not annotated with XmlRootElement , therefore, unusable for Spring-WS. You have to define the type as: <xs:element name="sayHelloResponse"> <xs:compl... in order to generate a type annotated with XmlRootElement . But that is not always possible. Alternatively, you can use the Maven plugin maven-jaxb2-plugin with the jaxb2-basics-annotate plugin (yes, plugin inside plugin) to inject the XmlRootElement annotation into the generated JAXB class. This is the pom: <project xmlns="http://maven.apache.org/POM/4.0.0"... and the binding file: <?xml version="1.0" encoding="UTF-8" standalone="y......
Created by Fang on December 03, 2011 12:31:20    Last update: December 03, 2011 12:33:23
The <h:outputText> tag generates different output for body text and value attribute. I tested the following with Apache MyFaces 2.1.3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... With value attribute, the output was: <table border='1' cellspacing='0' cellpadding='4'>... With text in body, the output was (i.e., the text was escaped despite escape="false" ): &lt;table border='1' cellspacing='0' cellpadding='...
Created by Fang on November 08, 2011 20:55:00    Last update: November 21, 2011 18:19:44
In the simple taglib example , I used a tag handler class to implement a taglib. This is an example to implement a taglib with a UI component. The purpose is to use a custom tag to split a string and print each part in a separate paragraph, i.e., print <p>john</p> <p>steve</p> <p>mike</p> with custom tag <my:foreach> : <my:foreach var="who" value="john steve mike"> ... These are the files: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... src/main/java/com/example/UIForeash.java : package com.example; import java.io.IOExcep... src/main/resources/META-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <faces-c... src/main/resources/META-INF/foreach.taglib.xml : <?xml version="1.0" encoding="UTF-8"?> <facelet... How to use: Put the JAR file generated by the above project in the WEB-INF/lib folder of the web app. If the web app is a Maven project, just add the taglib project as a dependency:...
Created by mee2 on November 20, 2011 21:00:58    Last update: November 20, 2011 21:10:22
Alfresco community-4.0.b has only 64-bit installer for Linux. These are the steps to manually install it on 32-bit Ubuntu Linux. Download alfresco-community-4.0.b.zip from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco . Install dependencies: $ sudo apt-get install imagemagick swftools postgr... Note: swftools was not available as a package for Ubuntu 11.10, I installed it with source . Create alfresco database: $ sudo bash [sudo] password for alfresco: ... Copy everything from the Alfresco web-server folder to Tomcat: $ cp -R alfresco-community-4.0.b/web-server/* apac... Edit $TOMCAT_HOME/conf/catalina.properties , change shared.loader to: shared.loader=${catalina.base}/shared/classes,${ca... Edit Tomcat conf file conf/server.xml , add URIEncoding="UTF-8" : <Connector port="8080" protocol="HTTP/1.1" ... Customize alfresco-global.properties : $ mv shared/classes/alfresco-global.properties.sam... Edit shared/classes/alfresco-global.properties : ############################### ## Common A... Copy keystore files from alfresco.war : expand alfresco.war , grab the whole keystore directory from...
Created by Fang on November 10, 2011 11:27:37    Last update: November 10, 2011 11:28:25
This has been tested working with Apache MyFaces 2.1.3 running Tomcat 7. Managed bean code: package com.example; import javax.faces.bea... Facelet page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric...
Created by Fang on September 07, 2009 20:44:15    Last update: November 03, 2011 14:43:19
Step 1: Repackage a web app as EAR A Java EE application is a multimodule Maven project. At the very least you'll need to package a WAR and an EAR. To get started, I'll simply re-package the simple webapp as an EAR. Create a directory named javaee-app Copy the webapp from here to javaee-app . Rename struts1app to webapp . Create pom.xml under javaee-app : <project> <modelVersion>4.0.0</modelVersion>... Create a directory named ear under javaee-app . Create pom.xml under ear : <project> <modelVersion>4.0.0</modelVersion>... Modify pom.xml in the webapp directory so that it looks like this: <project> <modelVersion>4.0.0</modelVersion> ... Build with " mvn package " in the javaee-app directory. You can see that ear-1.0.ear is successfully generated in javaee-app/ear/target . Maven successfully resolves dependencies between the sub-projects....
Created by Fang on October 30, 2011 20:35:17    Last update: October 30, 2011 20:37:03
This note lists some of the different behaviors I found using different JSF implementations. In the simple JSF facelet example, I used Sun's reference implementation version 2.0.0-RC: <dependency> <groupId>javax.faces</gro... With this version, the DOCTYPE declaration is dropped when the page is rendered. It doesn't matter what DOCTYPE you declare in your templates, the facelet engine simply drops it. The problem with this is, your page is always displayed in quirks mode , despite your intentions to require standards compliant mode. The DOCTYPE problem is fixed in release 2.0.2-FCS . Change the dependency in pom.xml to: <dependency> <groupId>javax.faces</gro... and test again, you'll find that DOCTYPE is faithfully passed over to the browser (view source at browser). You can delete the DOCTYPE declaration in the xhtml template...
Previous  1 2 3 Next