Latest Entries

EJB3 sample demo with Ajax

is the most famous open source application server, especially ideal for business which require strong networking infra-structure.I have been dealing EJB3 with 3 months and I liked it. I was developing web applications using with php, I think, so on I’ll use . In this post, I’ll show a simple demo with EJB3 and Ajax.

Let’s start first build EJB3 beans.This demo gets one string from user and concats it to a “Wellcome :” message and sends it back to user screen. We need a stateless bean that implements an interface.Interfaces are necessary in EJB3 to access from outside the class(e.g. web gui).

package my.test;

import javax.ejb.Stateless;

@Stateless
public class EJB3AjaxBean implements IEJB3Ajax {

public String sayHello(String s) {
return “Welcome : ” + s;
}

}

And our interface:

package my.test;

public interface IEJB3Ajax {

public String sayHello(String s);
}

Task is simple get string and concat it and return it. Now, we need a Jsp page to access our bean to use it.

<%
IEJB3Ajax ejbDemo = null;
try {
InitialContext ctx = new InitialContext();
ejbDemo = (IEJB3Ajax) ctx.lookup(“EJB3Ajax/EJB3AjaxBean/local”);
} catch (Exception e) {
e.printStackTrace();
}
%>
<%
String s = request.getParameter(“name”);
String ss = ejbDemo.sayHello(s);
%>

To initialize our bean accessor, we have used a context lookup, “EJB3Ajax/EJB3AjaxBean/local”.At this point we use same JVM on server and GUI so local implementation used. At this point we have completed our job with EJB3. Now let’s put some javascript to make it much more interesting called Ajax.

var xmlHttp = false;

if (!xmlHttp && typeof XMLHttpRequest != ‘undefined’) {
xmlHttp = new XMLHttpRequest();
}

function callServer() {

var name = document.getElementById(“name”).value;

if ((name == null) || (name == “”)) return;
// URL to connect to
var url = “EJB3Ajax.jsp?name=” + escape(name) ;
// Connection to the server
xmlHttp.open(“GET”, url, true);
xmlHttp.onreadystatechange = updatePage;
// Send the request
xmlHttp.send(null);
}

function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById(“msg”).value = response;
}
}

Name:
<input type=”text” name=”name” id=”name” size=”25″ onChange=”callServer();” />
Msg:
<input type=”text” name=”name” id=”msg” size=”25″ disabled />

Package is avaliable EJB3Ajax.ear

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

XGL on Linux

XGL is a powerfull X Server powered with OpenGL, you should need X Server to run it. It has many features. You should see some fetatures here:

[youtube=http://www.youtube.com/watch?v=Yx9FgLr9oTk]

Features:

  • Decouple window resolution from display resolution. Applications may render windows at a particular resolution, but may be seen on-screen at a different resolution.
  • Fast, simple screen rotation/flipping/panning/magnification.
  • Advanced font rendering, including on-the-fly outline font rendering using textures and fragment programs
  • Simulated hardware overlay planes. This long-time workstation graphics feature could be implemented with texture compositing.
  • Full-screen color manipulation, including gamma correction, contrast enhancement, dimming/brightening, etc.
  • Mixed pixel depths on one screen. Redirected, top-level windows could all have different color depths (8, 16, 24, 32bpp)
  • Arbitrary per window colormaps (fragment program texel lookup)
  • Alternate window color spaces. “video” windows may be stored as YCbCr (smaller than RGB) and converted to RGB on the fly when displayed using texture hardware.
  • Window image compression: Use S3TC texture compression to compress windows whose contents seldom change. Best use would be the desktop background stored in the root window. Potentially big memory savings.
  • New opportunities for antialiased X rendering with OpenGL multisampled surfaces.
  • More

    Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

    Technorati Profile

    Technorati Profile

    Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

    101 Reasons Why Java is Better than .NET

    101 Reasons Why Java is Better than .NET

    1. Public Domain APIs – Any Java public apis are part of the public domain, .NET apis are proprietary and can open the door to a law suit.
    2. Standard Library Source Code Availability – Java source code for the core libraries are available in every J2SDK distribution, .NET sources can only be seen by resorting to illegal means.
    3. dotNet Purity Is A Myth – Java promotes 100% pure Java libraries, for .NET purity is nothing more than a myth.
    4. 75% Of Enterprise Software Development – Avoid becoming one of the 25% of "use-less" employees.
    5. Preferred Platform for Implementing WebServices – Despite billions spent by Microsoft in marketing, surveys continue to reveal that Java is the preferred platform when it comes to Web Services.
    6. Superior Platform for Web Development – ASP.NET is a poorly designed and crippled framework as compared to the richness of frameworks found in Java.
    7. Write Stored Procedures using Java – Most relational databases support writing of stored procedures in the Java language. There has yet to be a production release of a database that supports any .NET languages.
    8. An Abundance of Experienced Practitioners – Nobody seems to know how to write .NET programs well and that's giving .NET a bad name! A pretty lame excuse I must say!
    9. Supportive Open Source Communities – Open Source communities that support distributed development are a plenty in the Java world.
    10. Proven Security – 2 Years after Trust Worthy initiative is launched and we collectively lose $55 billion last year.
    11. No Lizard Brain – .NET programmers continue to struggle with the complexities of a hybrid managed/unmanaged environment.
    12. More Languages – The JVM is more "common" than the CLR.
    13. Smaller Runtime Download
      – You can't run your app if you don't have the runtime.
    14. No Mandatory Upgrade Fees – 3 things a Microsoft shop can't avoid: Death, Taxes and License 6.
    15. More Vendor Choices – .Net is a marketing program. Java is a Market.
    16. Industrial Strength Collection Classes – The .Net libraries look like they were designed by high-school students, First year CompSci? students at best.
    17. FutureProof – The way to ensure your return on investment (i.e. ROI) is that your choice of platform doesn't get obsolete in 5 or even 10 years. Avoid the Microsoft upgrade treadmill!
    18. Larger Talent Pool – Majority of Universities not only teach but require knowledge of Java. That's a big talent pool that you need to consider before you off-shore your project to a different time-zone.
    19. More Contributions From Researchers – Research institutions and universities have consistently provided innovative research not only built on top of Java but also contributing to Java.
    20. US Government Approved – Guess where the billions of dollars spent on the U.S. government's IT renovation is going to?
    21. NoEvilTypeCoercion – Some C++ constructs are meant to be entombed forever, .NET resurrects them with disastrous consquences.
    22. More Mature And Robust O/R Mapping – You can't beat the wealth of O/R mapping solutions found in Java.
    23. Superior Coding Tools – Like having your own personal Java fairy dancing through your code, anticipating your every thought and keystroke.
    24. Sane Coding Conventions – I don't know what's worse Hungarian notation or .NET coding conventions.
    25. Higher Paying Jobs – Somehow you've got to afford those skyrocketing housing prices don't you?
    26. Favored for Implementing P2P – Gnutella and JXTA, anything else legally more pervasive?
    27. PureJavaRDMS – Can't beat the ease of installation when the RDMS is Java based and packaged with the application in a .zip file.
    28. More Exception Handling Options – .NET has no analog to the throws clause in method signatures.
    29. Better Structured Diagramming Frameworks – When going beyond forms and windows, Java can't be beat.
    30. Reusable Open Source IDE Frameworks – Why re-invent the wheel? Start building your killer GUI application on top of killer IDE frameworks.
    31. RobustParserGenerators – Want to build a new language, well you'll need some robust parser building tools.
    32. AspectOrientedProgramming – The next advance in modular software development, get a head start by using Java.
    33. PureJavaWebServers – Customizations and extensions are easier in a web container that's built using the same language as applications. Furthermore, managed environments support better reliability and security.
    34. OpenSourceJavaCompilers – Your tools have got to be able to parse the code before it has any chance in understanding it.
    35. Distributed Caching – Sometimes embarassingly parallel applications aren't the only things that you need to scale.
    36. MultipleReliableMessagingChoices – Java provides more choices for the backbone that integrates the Enterprise.
    37. Faster Development Turnaround – Incremental compilation is unavailable in the .NET environment.
    38. Lightweight Persistence – Sometimes a relational database (RDMS) has too big a footprint.
    39. Open Community Process – How does one contribute to the specification of standards?
    40. Hardware Accelerators – Performance boosting hardware.
    41. More Flexible Licensing Options – Ultimate flexib

      ility in licensing.

    42. EmbeddedDevices – Java inside small packages.
    43. Faster Virtual Machines
    44. MickrokernelArchitectures
    45. ContinuousBuild
    46. WholeProgramOptimization – Please sir may I have a linker?
    47. Comprehensive RDMS Driver Support – Can you find a ADO.NET driver for an open source database?
    48. Superior Code Analysis Tools
    49. NetworkingSupport – Why is MSN managed by a Java based tool?
    50. More Garbage Collection Options
    51. ReliabilityConcerns
    52. Better Web Services Interoperability
    53. Better Domain Specific Languages Support
    54. Painless Upgradability
    55. Simple Side By Side Execution
    56. More Business Rules Engines
    57. Lightweight Containers
    58. Better Business Process Management
    59. Sixty Four Bit Support
    60. e="Trebuchet MS"> Millions Of Java Phones
    61. Garbage Collect Classes – The only way to unload MSIL code is to unload an entire application domain.
    62. More Alternative VM Implementations
    63. Hard Realtime Capabilities
    64. Cross Platform Language Integration
    65. More Extensive XML Support
    66. Better Support For Dynamic Distributed Systems
    67. Superior 2D Drawing
    68. Better GUI Framework – Why isn't VS.NET written in a .NET language?
    69. SuperiorBranding
    70. No Anti Open Source Agenda
    71. Standardized Portal Frameworks – Standardized ""Integration at the glass"".
    72. RunInIntepreterMode – ""We're just not optimized for interpreting""
    73. More Semantic Web Research
    74. Leads In Software Process Best Practices
    75. Better Concurrency Utilities
    76. More Multicasting Libraries
    77. Superior Refactoring Tools
    78. <

      font face="Trebuchet MS"> Higher Demand Therefore More Jobs

    79. Faster And More Reliable Regex
    80. SuperiorBuildEnvironments – A .NET practitioner's concept of a build is F7.
    81. Embarassingly Rich Information Sources
    82. More Open Source Projects
    83. Affordable Industrial Grade IDEs
    84. Standardized Enterprise Connectivity
    85. DynamicLanguagesSupport
    86. MorePDASupport – Why limit oneself to a single PDA brand?
    87. OpenTechnologyRoadmap – .NET is like a five year plan in the former USSR: You know it doesn't actually make sense or help anything, but if you live under it, you're certainly not going to say anything negative about it.
    88. EmergingStandardsSupport
    89. JavaCard – JavaCards? are becomming the preferred method of keeping tabs on your citizenry or customers. If Microsoft ever co-opts this technology then "1984" will become more than just a paperback novel.
    90. Complete Open Source Stack – Open Source code visibility spanning all layers of an application.
    91. NonStopServers – .NET not fault-tolerant enough for Hewlett-Packard-Compaq?
    92. Out Of This World – Java runs on other planets, .NET has yet to leave Terra Firma.
    93. Better Unit Testing Support – More extensions and comprehensive IDE support
    94. More Identity Management Solutions – Can you trust Microsoft to keeping your customer's identity secure and available?
    95. Most UML Tools Implement In Java – Ever wonder why the best UML tools are implemented in Java?
    96. More R&D On Intelligent Agents – Java is the preferred implementation platform for Intelligent Agents.
    97. Easy Rich Client Deployment – No-Touch development was shaky.
    98. Lower Cost for Massively Parallel Systems – How much does it cost to deploy a .NET application on a platform with 10,000 servers like google?
    99. More Profilers – Profilers mitigate the risk of not finding the root cause of show stopping bugs.
    100. Eclipse
    101. OneHunderedReasons

    Reference

    Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

    Yenilendim…

    Uzun süredir aynı arayüze sahip web sitemi sonunda joomlaya taşımayı başardım ve hemde yeni,güzel bir arayüz ile.Eksiklerini bitiremedim ama fenada sayılmaz. Eski domaini satıl aldığım yer fiyatta değişiklik yapınca bende domaini farklı yerden almaya karar verdim ama domain transfer ücreti ile yeni bir domain alınacağı için vazgeçtim.Eski domaini tekrar başka bir yerden alabilmem için dns server havuzuna domainin bırakılması için gerekli işlemleri başlatmama rağmen hala eski domaini başka bir yerden alamıyorum.Durum bundan ibaret olunca yeni bir tane aldım; merturk.com Ziyaretlerinizi bekleriz :)

    Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon



    Copyright © 2004–2009. All rights reserved.

    RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.