Installing Oracle Database 11g XE on Fedora 17/18
or
It is just another blog for Java developers.
Java is a set of computer software and specifications developed by Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers.
The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.
Hibernate ORM is an object-relational mapping framework for the Java language. It provides a framework for mapping an object-oriented domain model to a relational database.
package com.ranga;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* This class is used to encode and decode the string data.
* @author Ranga Reddy
* @version 1.0
*/
public class EncodeAndDecodeExample {
private static final String data = "Hello, I am Ranga Reddy. ";
public static void main(String[] args) {
String encodedData = getEncodedData(data);
System.out.println("Encoded Data: " + encodedData);
String decodedData = getDecondedData(encodedData);
System.out.println("Decoded Data: " + decodedData);
}
private static String getDecondedData(String encodedData) {
try {
return URLDecoder.decode(encodedData, "UTF-8");
} catch (UnsupportedEncodingException exception) {
throw new RuntimeException("Does not support UTF-8");
}
}
private static String getEncodedData(String data) {
try {
return URLEncoder.encode(data, "UTF-8");
} catch (UnsupportedEncodingException exception) {
throw new RuntimeException("Does not support UTF-8");
}
}
}
Encoded Data: Hello%2C+I+am+Ranga+Reddy.+
Decoded Data: Hello, I am Ranga Reddy.
<html>
<head>
<title>Spring Demo</title>
</head>
<body>
<a href="hello.do">Click Here</a>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>SpringHelloWorld</display-name>
<description>Hello world Application</description>
<servlet>
<servlet-name>controller</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">Then we will define the url mapping with the Controller bean as shown below:
<property name="mappings">Finally we will define the Controller bean as shown below:
<props>
<prop key="/hello.do">helloController</prop>
</props>
</property>
<bean id="helloController" class="com.ranga.HelloWorld"> </bean>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/hello.do">helloController</prop>
</props>
</property>
</bean>
<bean id="helloController" class="com.ranga.HelloWorld" />
</beans>
package com.ranga;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HelloWorld implements Controller {
@Override
public ModelAndView handleRequest(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception {
System.out.println("HelloWorld");
String str = "Hello World!";
return new ModelAndView("hello.jsp", "message", str);
}
}
<%@page isELIgnored="false" %>
${message}