Coldfusion and J2EE

Normally, different language of web programmings are not easy to integrate in the same web page. Although you want to integrate two programming languages in the same webpage, you gotta separate such coding in different portion in tag or something else. In CFMX, you don't need to do like anymore. If you wanna embed in J2EE tags in CFM page, use tag then. Here is simple coding :

view plain print about
1<cfimport taglib="/WEB-INF/lib/random.jar" prefix="myrand">
2<myrand:number id="randPass" range="000000-999999" algorithm="SHA1PRNG" provider="SUN" />
3<cfset myPassword = randPass.random>
4<cfoutput>
5Your password is #myPassword#<br>
6</cfoutput>

Big Credit to : http://livedocs.adobe.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/Java3.htm#1134309

The beginning of JSP

There are so many extension-less web programming in Web developement environment such as Ruby, PHP, JSP and so on. Among them, I want to tell about the simple coding of JSP. Honestly, I'm just beginner to learn JSP, especially J2EE. Because, I just want to know some applications based on Sun Java. Ok, let's go...

Here is simple JSP file and named as greeting.jsp

view plain print about
1<html>
2<body>
3    Hello World! <br>
4    Current time is <%= new java.util.Date() %>
5</body>
6</html>
And create web.xml file and here is coding needed to be in this file.

view plain print about
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web
3Application 2.3//EN'
'http://java.sun.com/dtd/web-app_2_3.dtd'>

4<web-app>
5<display-name>Hello2</display-name>
6<description>no description</description>
7<servlet>
8<servlet-name>greeting</servlet-name>
9<display-name>greeting</display-name>
10<description>no description</description>
11<!-- what gets called -->
12<jsp-file>/greeting.jsp</jsp-file>
13</servlet>
14<servlet-mapping>
15<servlet-name>greeting</servlet-name>
16<!-- URL from browser -->
17<url-pattern>/greeting</url-pattern>
18</servlet-mapping>
19</web-app>

Then, open tomcat manager and create folder name as hello. Create build folder, then copy above greeting.jsp file in this folder, then create WEB-INF folder in build folder. Finally, web.xml file into WEB-INF

Open your Internet Explorer or Firefox, and can run as http://localhost:8080/hello/greeting. How? It's quite simple, right?

Top of Page