Search This Blog

Loading...

Monday, August 31, 2009

IndicThreads.com Conference On Java


IndicThreads.com Conference On Java is going to held on 11th and 12th Dec '09 at Pune, India.

This is very intersting event especially for java passioniors and lovers. You can join the conference by visiting the website http://j09.indicthreads.com/ or clicking on the logo on the right side of this page displaying the event like this.

I hope you will enjoy the event and the future of java and many other intersting technologies. I love to be there.

Monday, August 10, 2009

Weblogic Portal Example

Here I am going to make a simple example of Weblogic Portal.

Minimum requirements:
  • Weblogic Portals
  • Weblogic Workshop
  • Weblogic Server
Basically when you download weblogic portals then you will have all the necessary things already installed. It can be downloaded from http://www.oracle.com/technology/software/products/ias/bea_main.html
You have to download Oracle WebLogic Portal 10.3.

Step 1: Setting up the Weblogic Workshop 
  1. Open Weblogic Workshop from Programs -> Oracle Weblogic -> Workshop for Weblogic.
  2. Change the perspective to Portal i.e. Window -> Open Perspective -> Others -> Portal.
Step 2: Create sample application
  1. Create new Portal EAR project from File -> New -> Portal EAR Project.
  2. Name it sampleEAR.
  3. Click next and proceeds with default setting.
  4. Create new PortalWEB project from File -> New -> Portal Web Project.
  5. Name it sampleWEB.
  6. Associate it with sampleEAR by clicking on checkbox if it is not selected and proceeds without any change.
  7. Now select the WebContent, right click and select New -> Portal.
  8. Name it myportal and proceeds.
  9. You will see default portal in the workshop.
  10. Create a jsp e.g. myjsp and then right click on it and click on Generate Portlet.
  11. This will create a myjsp.portlet in application.
  12. You can drag it from the Design Panel to the Portal.
  13. Let’s create another portal which will access the url of the other website.
  14. Right click on WebContent select New -> Portlet.
  15. Name it myportlet and click next.
  16. Select Browser (URL) Portlet.
  17. On next screen in the Content URL input box type http://www.google.com.
  18. Check the checkboxes :
    • Has TitleBar
    • Minimizable
    • Maximizable
    • Floatable
    • Deletable 
  19. Click next
  20. Drag the portlet onto the portal.
Step 3: Deploy on server
  1. Right click on the sampleWEB and select Run As -> Run on Server.
  2. It will open the server window.
  3. Select the Oracle Weblogic server from the dialog box and Click next.

These are the minimum steps to build a sample portal.
You can access the application by: http://localhost:7001/sampleWEB

Enjoy the sample..

Wednesday, July 15, 2009

Java + You

Monday, August 4, 2008

"Java Is Dead, Long Live Java!" – The Future of Java

"Java Is Dead, Long Live Java!" – The Future of Java
— 'Because of its prominence,' writes Bryan Taylor, 'Java gets a lot of attention and with it much criticism, some of it valid.' What many may not realize, Taylor notes, is that some big breakthroughs have arrived and that the Java development landscape is solving important problems. In this column he takes a view of where Java is going to go in the next year or two as these ideas gain traction.

Trackback URL :  Click Here

Wednesday, July 9, 2008

Struts 2.1.2 Released

Yesterday when I was on Google searching for something I found that Apache had released the latest Struts 2 version which is Struts 2.1.2, and promoted to "Beta" on 26 March 2008

You can download it from Struts Download Page

Monday, July 7, 2008

Struts 2 Hello World Example

I had seen many new deveopers struggling against struts2 hello world example. So I decided to write a small example.
Below are the required libraries to run this example which are easily availabel

struts2-core-2.0.11
xwork-2.0.4
commons-logging-1.0.4
commons-logging-api-1.1
freemarker-2.3.8
ognl-2.6.11

The structure of the applictaion which I am following is (Eclipse IDE)
Struts2Demo
|---src
| |----org
| | |----vinod
| | | |----action
| | | | |----HelloWorld।java
|---struts.xml

|---WebContent
| |---jsp
| |---HelloWorld।jsp
|---index.jsp
|---WEB-INF
| |---lib
| |---web.xml


It is true that different IDE's use different structure, but at last when war is build they follow same structure.
Lets start...

HelloWorld.java
package org.vinod.action;

import com.opensymphony.xwork2.ActionSupport;

public class HelloWorld extends ActionSupport{

String greetings = null;

public String execute() throws Exception {
setGreetings("Hello World");
return SUCCESS;
}

/**
* @return the greetings
*/
public String getGreetings() {
return greetings;
}

/**
* @param greetings the greetings to set
*/
public void setGreetings(String greetings) {
this.greetings = greetings;
}

}
HelloWorld.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Struts 2 Example</title>
</head>
<body>
<s:property value="greetings"/>
</body>
</html>
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Struts 2 Example</title>
</head>
<body>
<s:action name="HelloWorldAction" executeResult="true"></s:action>
</body>
</html>
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="hello" extends="struts-default">
<action name="HelloWorldAction"
class="org.vinod.action.HelloWorld">
<result>/jsp/HelloWorld.jsp</result>
</action>

</package>
</struts>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Enjoy the struts2(most popular java framework today)

I had also written some more examples and some solutions of struts which can be easily found at
Struts 2 ajax drop down example
Struts 2 change <actionerror /> <actionmessage />
Struts 2 Session Check Interceptor
About Struts 2

Friday, July 4, 2008

Java Code Names

Yesterday I was crawling web and found some intersting things about java. Firstly when java was release its name is Oak. After some time the creator of java found the name Java.
I found some of the intersting things like the code names of the reeases of the java which I am going to describe below.
VERSION CODE NAME RELEASE DATE
VersionDescription of Code NameCode NameDate of Release
JDK 1.1.4SparklerSept 12, 1997
JDK 1.1.5PumpkinDec 3, 1997
JDK 1.1.6A female character in BibleAbigailApril 24, 1998
JDK 1.1.7Roman cognomen used by several politiciansBrutusSept 28, 1998
JDK 1.1.8Name of a person/Football clubChelsea April 8, 1999
J2SE 1.2PlaygroundPlayground Dec 4, 1998
J2SE 1.2.1 (none) March 30, 1999
J2SE 1.2.2CricketJuly 8, 1999
J2SE 1.3Kestrel May 8, 2000
J2SE 1.3.1Ladybird May 17, 2001
J2SE 1.4.0MerlinFeb 13, 2002
J2SE 1.4.1HopperSept 16, 2002
J2SE 1.4.2MantisJune 26, 2003
J2SE 5.0 (1.5.0)TigerSept 29, 2004
Java SE 6Mustang
Java SE 7 Dolphin
You can these names on the sun website.
Here is the brief history of java. Some of you wanted to know that how many packages are there in java when it is officially released well here are the some facts.
Java 1.0 - 212 classes in 8 packages
Java 1.1 - 503 classes in 23 packages
Java 1.2/2.0 - 1,520 classes in 59 packages
Java 1.3 - 1842 classes in 76 packages
Java1.4 - 2991 classes in 135 packages
Java 5.0 - 3562 classes in 166 packages