- 博客(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
1808
原创 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
748
转载 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
897
转载 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
1030
原创 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
1139
原创 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
2514
原创 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
2762
原创 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
1580
原创 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
1781
原创 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
1495
原创 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
1578
原创 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
77847
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
5472
原创 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
1057
原创 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
612
转载 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
945
转载 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
2482
转载 _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
2886
原创 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
913
原创 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
1009
原创 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
693
原创 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
1846
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
1231
原创 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
663
原创 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
604
转载 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
1514
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
1647
原创 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
9482
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
767
原创 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
435
原创 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
828
原创 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
1711
原创 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
1410
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
1122
转载 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
803
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
1102
原创 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
1777
原创 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
1764
转载 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
2468
原创 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
851
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人