Search This Blog

Friday, October 18, 2013

To make JSP compatible with IE8 or IE 9

Add the following code to the javascript block.

#if ($browserSniffer.getMajorVersion($request) < 9)
  <meta http-equiv="X-UA-Compatible" content="IE=8" />
#else
  <meta http-equiv="X-UA-Compatible" content="IE=9" />
#end

this will make the jsp compatible with IE 8 or IE 9

Happy Coding !!

 

Monday, September 30, 2013

Session timeout redirection

The session timeout can be handled using few properties in the portal-ext.properties file. .

# Extending session automatically
session.timeout.auto.extend=false



#This property can be used to redirect to home page when the session expires.
session.timeout.redirect.on.expire=true

#Set the login url
auth.login.url=/web/guest/home


note :
for session.timeout.warning=30,
#it is redirects to http://localhost:8080/web/guest/home

for session.timeout.warning=0,
#it is redirects to
#http://localhost:8080/web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_58_struts_action=%2flogin%2flogin&_58_redirect=%2fweb%2f10311%2fwelcome

Set JAVA_HOME variable in Windows



 Find Install Directory

Look for the install path for the Java or Software Development Kit(SDK), to find the installation path do the following:
  1. JDK (Java Development Kit) during default installation, are kept in a directory under C:\Program Files\Java. If it is not there we need to find it on the system.
  2. At the path, there will be a sub-directory like jdk1.6.0_03.

    So, the installation path is  C:\Program Files\Java\jdk1.6.0_08.

 Apply Setting

Once you have found the JDK (Java Development Kit) install path:
  1. Right click on the "My Computer" icon on your desktop and select "Properties".
  2. Click the "Advanced" Tab
  3. Click the "Environment Variables" button
  4. In the  "System Variable" tab, click "New"
  5. Enter the variable name as "JAVA_HOME"
  6. Enter the value as the installation path for the Development Kit
  7. Click "OK" button.
  8. Click "Apply" Changes 

  Check JAVA installation

  1. Click on the "Start" button.
  2. Type in "cmd" in the search bar. Press "Enter" button on the keyboard.
  3. The command prompt must open up. Enter the command "java-version" in it.
  4. It must come up with the java details installed on the system.

Translate Liferay in Your Language.(Pootle)



Now, it is your opportunity to translate Liferay in your own language. Liferay has started a forum for the ardent Liferay lovers to collaborate and translate the entire portal in their own language. This helps the community to customize and present their products with their own liking in their own language. The translate project also shows the percentage of completion of the entire project for each language. Here are two snapshots of the project updated to 30th Sept 2013.




 Liferay Translate or Pootle Here is the link to the project:- http://translate.liferay.com/pootle/ The project can also be accessed through the menu on our home page. Happy Translating Liferay!!

Wednesday, September 11, 2013

Add "HTTPOnly" and "Secure" attribute to Cookie for Liferay

Here are the ways
---------------------------
Secure Attribute
Writing a servlet filter to overwrite the session cookie:

private void rewriteCookieToHeader(HttpServletRequest request, HttpServletResponse response) {
if (response.containsHeader("SET-COOKIE")) {
String sessionid = request.getSession().getId();
String contextPath = request.getContextPath();
String secure = "";
if (request.isSecure()) {
secure = "; Secure";
}
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid
+ "; Path=" + contextPath + "; HttpOnly" + secure);
}
}
------------------------

HTTPOnly Attribute

Go to Tomcat conf/context.xml file ,add

restart tomcat.

My Blog List