Friday, April 27, 2012

Deploy own version JSF 2.0 on JBoss 6

1. Put your own jsf jar files in the WEB-INF/lib like WEB-INF/lib/jsf2.0.6
2. Add below context parameters in web.xml



<context-param>

    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

    <param-value>true</param-value>

</context-param>

3. Add Listener for JBoss to avoid "Could not find Factory:javax.faces.context.FacesContextFactory" excption if it is necessary.



<listener>

    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

</listener>

Tuesday, January 31, 2012

2011年最火爆的8大Web开发工具

2011年最火爆的8大Web开发工具提到,jQuery和jQuery Mobile,CSS3 PIE,Bootstrap,LESS,Chrome开发人员工具等。一下是全部内容,

2011年最火爆的8大Web开发工具 TechFrom2011总结系列

2011年最火爆的8大Web开发工具:
Web应用开发和部署工具,Bootstrap

Twitter 于8月份推出了一个名为Bootstrap的开发工具包,将Web应用开发与部署变得更为简单快捷。Bootstrap包是一个简单的程序库,同时提供优雅的HTML和CSS规范。Bootstrap使用了一些最新的Web浏览器技术,向开发者提供时尚的排版、样式、按钮、表格、网格、导航等服务,而且占用资源很小,用gzip压缩后只有6K左右。
jQuery和jQuery Mobile,JavaScript代码工具

jQuery是一款免费且开放源代码的JavaScript代码库,而jQuery Mobile是jQuery在手机和平板上的版本。

jquery.jpg

jQuery Mobile不仅能给主流移动平台带来jQuery核心库,还能发布一个完整统一的jQuery移动UI框架,支持全球主流的手机、平板、电子阅读器、台式电脑等平台。据微软关于jQuery的调查显示,jQuery在受访网站中的使用率已从2010年12月的27%上升到2011年12月的42%。
CSS代码工具,CSS3 PIE

CSS3 PIE,全称是 Progressive Internet Explorer,可以让IE6至IE8的所有版本实现大多数的CSS3修饰特性,如圆角、阴影、渐变等等。通过这个工具CSS3 PIE,开发者可以在线修改想要的效果,并即时生成css代码。
开发管理工具,LESS,免费开源

LESS是一个CSS开发管理的强大工具,拓展了CSS的变量、运算符、include、嵌套规则等语法。

less.jpg

LESS从Ruby的LESS library衍生而来,免费开源,实现了和CSS的无缝结合。此外,LESS可以配置成自动最小化所生成的CSS文件,不仅可以节省带宽,还可以改善最终用户的体验。
Chrome开发人员工具

火狐即将死亡的预言或许被夸大其词了,但可以肯定的是Chrome正在侵蚀越来越大的市场份额,其中最主要的一个原因是Web开发人员喜欢Chrome捆绑自带的开发人员工具。

Chrome开发人员工具主要基于WebKit网络检查器(开放源代码WebKit项目的一部分),可让Web开发人员随时随地对网页的CSS、HTML和JavaScript进行实时编辑、调试以及监控。

Chrome开发人员工具不仅能帮助诊断、修复在网页加载、脚本执行以及页面呈现中出现的问题,还可帮助最大限度地了解网页或网络应用程序对CPU以及内存的使用情况。
基于浏览器的Web网络开发IDE工具,SourceKit 和 Ace

网络开发工具中文本编辑工具最受欢迎的是 Vim,但是基于web浏览器的网络IDE开发工具是 Ace,和基于 Ace 构建的SourceKit,之前的名字是 “Bespin” 和 “Skywriter” 。
PhoneGap,基于html5 的开源移动开发框架

之前在基于html5的跨平台手机应用,移动开发开源框架PhoneGap 和跨平台手机应用,移动开发开源框架PhoneGap,基于html5,已支持 facebook登陆中,介绍过移动开发 html5 开源技术框架,其母公司 Nitobi Software> 已经被Adobe公司收购。

另外,还有更多的移动和网络应用开发 10大优秀开发框架推荐,和 全功能框架平台 Strobe,基于html5的全功能应用开发平台 Strobe,由前苹果核心员工和技术大牛联合创建。


本文科技源TechFrom地址:: http://www.techfrom.com/20315.html

Sunday, August 21, 2011

Install and remove APK Files on Android Device Emulator (Windows)

Install APK

1. Download android SDK.
2. Go to $SDK_ROOT/tools or $SDK_ROOT/platform-tools directory and execute the file ‘emulator.exe’. You might need to also include android virtual device (AVD) to command line execution for example,

./emulator -avd TestDevice
3. Save/copy the APK file directly in the $SDK_ROOT/tools or $SDK_ROOT/platform-tools directory.
4. Goto Shell/Terminal/CommandPrompt, adb install fileName.apk (You will need to shell/terminal/cmd sessions live)

or ./adb install fileName.apk
5.If there is ‘Path not found’ error then you need to add $SDK_ROOT/tools directory to your system PATH settings correctly.

Remove APK

1.Click on menu and then select settings icon >> Click on applications tab>>Go to Manage applications
2. Find the application which you want to remove and uninstall.

Friday, August 19, 2011

Some exceptions we will get and how to resolve when we upgrade the application from java 1.4 to 1.6

This file will be keep on updating.

1.java.lang.IllegalAccessError: class javax.activation.SecuritySupport12 cannot access its superclass javax.activation.SecuritySupport

This issue will happen when we are using the old activation.jar with mail.jar. solution is delete the activation.jar. Sometimes if we are using weblogic.jar, there is a subdirectory javax.activation also need to be deleted.

Thursday, August 11, 2011

Run RichFace 4.0 on GlassFish 3.1 get warning This page calls for XML namespace http://richfaces.org/a4j declared with prefix a4j but no taglibrary exists for that namespace

If you get "This page calls for XML namespace http://richfaces.org/a4j declared with prefix a4j but no taglibrary exists for that namespace" error when running RichFace 4.0 on GlassFish 3.1 with Eclipse, it is always because you didn't deploy the RichFace jar lib to GlassFish path. Try to export below jar files with deploy package

cssparser-0.9.5.jar,
guava-r08.jar,
richfaces-components-api-4.0.0.Final.jar,
richfaces-components-api-4.0.0.Final.jar,
richfaces-components-ui-4.0.0.Final.jar,
richfaces-core-api-4.0.0.Final.jar,
richfaces-core-impl-4.0.0.Final.jar,
sac-1.3.jar

1. Goto project properties
2. Click Deployment Assembly
3. Add above jar files

Done.

Tuesday, August 9, 2011

Upgrade web from struts 1.3 to jsf 2.0

1. Change the tile of web.xml from

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

to:
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

2. Add <jsp-config> before <taglib> to match the new structure of 2.5

<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts/struts-html.tld</taglib-location>
</taglib>
</jsp-config>

3. Add context-param

<context-param>
<description>
Tell the runtime where we are in the project development
lifecycle. Valid values are:
Development, UnitTest, SystemTest, or Production.
The runtime will display helpful hints to correct common mistakes
when the value is Development.
</description>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>

4. Add Faces Servlet

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

5. Add a blank faces-config.xml in WEB-INF

<?xml version="1.0" encoding='UTF-8'?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
</faces-config>

6. Add new jar lib of jstl 1.2 and jsf 2.0.x

jstl-api-1.2.jar
jsf-api.jar
jsf-impl.jar

Problem
In JSF 2.0 web application, during server initialization, it hits following warning message
WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession (key: userBean, value class: com.jsfcompref.model.UserBean).

UserBean
package com.mkyong;

@ManagedBean(name="user")
@SessionScoped
public class UserBean{

//...
}

The “UserBean” is not serializable, Simply make this bean implement java.io.Serializable interface.

package com.mkyong;

import java.io.Serializable;

@ManagedBean(name="user")
@SessionScoped
public class UserBean implements Serializable{

//...
}