自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

smile_juan

Liferay, Frameworks(Spring,MyBatis, Hibernate, etc), Java...

  • 博客(137)
  • 资源 (6)
  • 收藏
  • 关注

原创 Windows 7 Task Scheduler Start a Program

I need to set up a Task Scheduler to run my batch job. Here is the steps which described onWindows website:Open Task Scheduler by clicking the Start button , clicking Control Panel, clic

2014-01-03 06:54:43 1776

原创 See how Google celebrates my birthday

It did surprise me today! Google customize the image for celebrating my Birthday! Haha...

2014-01-03 06:08:11 733

转载 Embedding a portlet in web content

Today I had a test embeded portlet in web content. This article exactly shows the steps how to embed portlet in a web content.portlet-id: This is the unique id for a portlet in Liferay.instance-id

2013-04-05 05:48:55 864

转载 Java compareTo, equals and hashcode

Last time, when our team reviewed my code, they pointed several problems of my code. I'm really happy to learn from them. Until now, what I do is only to make the code work. Then, I'll try to refactor

2013-03-23 03:07:23 1020

原创 Liferay And Twitter

Requirements: In our Liferay instance, we need to display organizations' tweets in twitter portlet. Those organizations' twitter account is configured in organization's twitter custom field.Before I

2013-03-21 04:45:43 1129

原创 Liferay on Private Site to get Public Site Page URL

This is a very interesting design in our website. We have a private site only for registered member. There's a youbar portlet which list bunches of articles. Members can share those articles in social

2013-03-21 00:59:48 2501

原创 Liferay PortletURL(Render, Action, Resource)

1.To get currentURL :PortletURL url = PortletURLUtil.getCurrent(renderRequest, renderResponse);2. Creating PortletURL from renderResponse : a.For renderURL:PortletURL renderURL = renderRespons

2013-03-19 23:39:25 2726

原创 Spring load properties file and MessageFormat

During yesterday's code review, learn another way to load properties file by using Spring. Spring is so powerful, I love it!I found there are two ways to do that:1. use 1) Define your properties

2013-03-09 04:03:29 1570

原创 Liferay social bookmarks

It seems very common to connect with social networks in our websites. Liferay provides a tag to connect with facebook, twitter and plusone. It's very convenient to just use one tag.The interesting t

2013-03-07 00:20:52 1762

原创 RESTeasy to make a REST Call

Previously I wrote an article to use Jersey to make a REST call. Afterwards, we changed to use RESTeasy to do that. The reason we changed that doesn't convince me, because we decided to use JSON inste

2013-03-06 23:15:33 1485

原创 Liferay LocalServiceUtil and ServiceUtil

In Liferay, there's a lot of Service Util classes. They're really convenient. One thing I notice is that there's LocalServiceUtil and ServiceUtil class.The difference between them is permission chec

2013-03-06 23:04:39 1550

原创 Required String parameter is not present

I ran into the issue when I try to use Liferay friendly url. Previously, I didn't get the entire idea of friendly url and also how spring mvc works.Here is the steps:1. My view.jsp has a link to

2013-03-06 23:00:59 77771 1

原创 Liferay get Journal Article based on Journal Structure name

Recently, our project uses Liferay web content product a lot. It's very useful. The good thing is content author can go there and change without help with developer. And we can set template for those

2013-03-06 22:36:15 5443

原创 jQuery cache

Yesterday I spent a lot of time on catch this problem. In my app, I need to make a GET Ajax request call to server side. After it's getting the time to DEV, I found the same URL will not be responded.

2013-02-09 06:58:39 1049

原创 Interesting way to validate number

Today when I read my co-worker's codes, I found an interesting way to validate if a string is numeric.Here is my way to do.  Because I'm not good at regex, every time I need to search online and fin

2013-02-08 03:36:51 601

转载 Liferay Inter-portlet communication(client side)

It's very easy to do that. Liferay provides script to do that.This is the syntax: Liferay.fire(eventName, data) Liferay.on(eventName, function, [scope])In my case, one portlet just sends

2013-02-08 01:44:23 932

转载 When start tomcat, got the error: Resource /WEB-INF/classes not found

javax.naming.NameNotFoundException: Resource /WEB-INF/classes not foundat org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)at org.apache.naming.resources.ProxyDirCon

2013-01-30 00:09:36 2473

转载 _blank, _self, _parent, _top, _new

_blank opens a new windows_self opens within the same window_parent is used with a frame, it will open within the inner frame_top is also used with a frame, it will open using the entire w

2013-01-24 22:39:12 2876

原创 JAXB annotations

Here is an example I need to deal with, it looks complicated. With the help of JAXB, it's really easy to get all values from the xml file.For example: article.xml world World A co

2013-01-22 06:29:59 901

原创 Jersey make REST call

When we make a rest call and the response is XML or JSON, it would be better to use plugins other than from scratch. I chose to use Jersey and JAXB. It's very convenient to code.1. We need to add je

2013-01-22 06:15:51 979

原创 Read properties file in a jar

When I set the path of properties file, it's OK when we run in IDE. When I packed it in a jar and tried to run that, it won't pass. It seems strange because the path of the properties will be changed

2013-01-22 01:56:05 685

原创 Java Send email

Sometimes we want to send an email out when catch an exception. We need to use javax.mail jar to help us to do that. Actually we have several ways to do that. Here is to introduce the easiest way with

2013-01-22 01:37:49 1815 1

原创 log4j create a new log file every day

After I joined in new project, I realized log is very important. We can log in console or file. Here is to introduce a way to log in file without overwrite. It's really easy to use log4j.# Define

2013-01-22 01:24:31 1219

原创 Java Iterate directory to find files and edit

After mannually modified about 100 pages, I'm tired of doing that. So it's better to write a small program to deal with those thing.1. We need to find those files which we need to modify in differen

2013-01-18 01:13:50 654

原创 Make IDE(Eclipse) not overwrite our configured server setting

This is because of the default setting of IDE. By default, it overwrites every thing we configured when we restart the server. Go to Windows->Preferences->Server, and uncheck the selectbox.

2013-01-12 04:21:18 593

转载 Spring global exception handling with standalone app

I have a standalone app, I need to catch all exceptions. There's one case that when I disconnect the internet, I couldn't connect the database, and database operations are in another component. It'll

2013-01-10 05:12:46 1505 1

转载 java.lang.String cannot be resolved, Indirectly referenced from required .class file

Here is the solution.It's similar to the link I found. http://dev-answers.blogspot.com/2009/06/eclipse-build-errors-javalangobject.htmlGo to properties of project with the build error (right c

2013-01-08 00:37:27 1629

原创 JSP "items" does not support runtime expressions

${datatables.engine} ${datatables.browser} ${datatables.platform} ${datatables.version} ${datatables.grade} In my JSP page, I import JSTL taglib like above, but it gives me the e

2012-12-27 00:07:53 9467 1

转载 Developing portlets using Spring Portlet MVC and Liferay ServiceBuilder

A good blog links to Liferay and Springhttp://xebee.xebia.in/2011/09/04/developing-portlets-using-spring-portlet-mvc-and-liferay-servicebuilder/

2012-12-22 05:40:18 755

原创 JRebel

Recently, I tried an awesome an Tool - JRebel. It saves a lot of time of compile and deploy our project. In my case, I have to package a war file for my project and copy that from dist folder in our S

2012-12-22 02:04:37 428

原创 Customize Liferay SDK plugins(portlet) to Maven project

In our case, we use maven portlet instead of default ant portlet, every time we need to modify. What I do is to create our own template and read properties file to create the project.Here is my exam

2012-12-20 01:07:26 813

原创 Ant Task check if a file exists

This is to remember what I learned when I customize Liferay SDK plugins.In my case, I need to read a properties file and then get those values to create portlet. The first thing, I have to validate

2012-12-20 00:53:57 1696

原创 Get value from properties file outside a jar using Spring

I have a jar file which need to dynamically load external properties file and read values from this properties file. Those values are needed in the java program. With Spring, it's very easy to do that

2012-12-19 06:56:10 1398 1

转载 Java JDBC Performance vs. iBatis vs. Hibernate

http://phillips4jc.blogspot.com/2011/03/java-jdbc-performance-vs-ibatis.htmlhttp://arxiv.org/ftp/arxiv/papers/0710/0710.1404.pdf

2012-12-14 23:21:56 1114

转载 Config log4j in standalone app

1. First make sure you've added the log4j.jar2. config log4j.xml and log4j.propertiesShow an example:log4j.xml log4j.propertieslog4j.rootLogger=DEBUG, CAlog4j.ap

2012-12-14 07:39:42 788 1

原创 Spring config different datasource based on different environment(dev, test, prod) Two ways now

Spring is very powerful when I use Spring more and more, it provides a lot of fancy functions. In my standalone app, I config datasource in context.xml, jdbc.driver.name, url, username, password, all

2012-12-14 06:56:52 1094

原创 Maven generates jar file with main class setting and dependency libs copy

When I write a pure java project, I'm afraid of writing deployment doc. Because I need to generate jar file. The most frustrating thing is add other libs into the jar. Maven is a fabulous tool which g

2012-12-14 06:38:14 1744

原创 Eclipse or IDE integrated with Eclipse .project and .classpath files

Recently, I got a very interesting task. In our daily work, we use Liferay, Liferay uses Ant to create projects. All projects created by Liferay is basic not targeted to our client. So when we create

2012-12-12 22:47:23 1754

转载 Export table data sql scrpit on sql server 2008

Since this is my first time working on sql server, I didn't know how to export data. Previously, I was silly to write the insert sql manually. It's time-consuming.This time, I have to insert a lot of

2012-12-12 00:38:09 2450

原创 Liferay hook works with external customized jar which is built by Spring

I ran into the issue when I was customizing organization in Liferay. My organization hook needs to connect with external tables outside Liferay database. Another limitation is I have to use ant to bui

2012-12-11 07:17:17 845

JIRA用户使用手册(详细版)

JIRA的使用手册,是我自己联系的时候写的,大家可以参考一下,感觉写的还是比较详细了

2009-11-23

Android学习资料

Android的学习资料,不好的地方就是是繁体字版本的,有兴趣的可以自己参考一下吧,我也是刚刚才学,很多都还不会的

2009-11-23

自己动手写一个RSS

这是自己写的一个RSS,重用性和可扩展性都是很好的,是学习RSS的好资料

2009-02-28

金山打字游戏,联系打字的可以看看

这是一款金山打字游戏的程序,大家可以试试,要做这方面打字开发的可以看看,学习里面的打字模式来设计自己的打字游戏

2009-02-13

仿真平台软件(Java,JBuilder)

这是自动化的专业设计,是一个用Java开发的程序,公牛类似于eclipse,大家可以学习一下

2009-02-13

自己手写web服务器源码

自己手写的一个web服务器,实现了304,Cookie和Session。对于初学web服务器的很有帮助

2009-02-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除