jump to navigation

Getting the Current Date September 25, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

Calendar cal = new GregorianCalendar();

// Get the components of the date
int era = cal.get(Calendar.ERA); // 0=BC, 1=AD
int year = cal.get(Calendar.YEAR); // 2002
int month = cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, …
int day = cal.get(Calendar.DAY_OF_MONTH); // 1…
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday, …

replace substring in astring September 25, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

today i found my self in asituation that i need to replace substring in variable string with another
string
in java there is method called replace();
but it’s argument is cahracter and chachter
there is ni string argument so i used that mesthod

static String replace(String str, String pattern, String replace)
{
int s = 0;
int e = 0;
StringBuffer result = new StringBuffer();

while ((e = str.indexOf(pattern, s)) >= 0)
{
result.append(str.substring(s, e));
result.append(replace);
s = e+pattern.length();
}

result.append(str.substring(s));

return result.toString();

}

The Magic Of Ajax4JSF September 22, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

our friend 7azem tried ajax with jsf
it was realy amagic

follow himm…>
I had tried using Ajax4JSF library. I wanted to give some ajax effects to JSF components. The library really is very fantastic and very easy to use (you really don’t have to make much changes for ajaxifying your components).You can download the library from herehttps://ajax4jsf.dev.java.net/nonav/ajax/ajax-jsf/

complete article

http://jroller.com/page/HazemBlog?entry=the_magic_of_ajax4jsf

115876491490442956 September 20, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

today i had some few time to find asolution to a perviouse problem faced me before
it was asmall problem but stopped me alot

when i was load propertiesfile in my application to use it i was use that snippet

Properties properties= new Properties();
properties.load(new FileInputStream(“D:/myworkplace/crrospondencep8/src/cofig-files/configurecustom.properties”));

it’s worked well if and only if take the absolute path and it’s aproblem 4 me

so i found asolution

here’s the solution

/** *

get the Message String that are mapped to the passed *key.

*@param key String. */
public static String getMessageString(final String key)

{
String messageString=”";
try {
PropertyResourceBundle p = (PropertyResourceBundle) ResourceBundle.getBundle (“NameOfYourPropertiesFile”);

messageString = p.getString(key);

} catch (Exception e) { //do whatever you want here. }

eturn messageString;

}

Click on GahooYoogle September 7, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

For all those who find Yahoo and Google search engines tedious and time-consuming, a new website known as GahooYoogle has come up with a solution. This website combines the search engines of Yahoo and Google on one screen. Using a split screen to display the search results of both the engines, this website is proving to be convenient for many net surfers.

http://www.gahooyoogle.com/

“Java Is Dead, Long Live Java!” – The Future of Java September 7, 2006

Posted by essamabdelaziz in Uncategorized.
1 comment so far

It seems that lately lots of writers have been bashing Java. Some people seem to think that Java has stagnated, and that the “hyper-enthusiasts” have left. Well, the rest of us are just quietly coding on a platform that is more exciting than ever. Other technologies like Ruby, PHP, .NET, or AJAX might get more hype and acclaim lately, but hype aside, Java still produces the majority of innovation in the software profession.
You can get a sense of Java’s health by simply looking at how many projects are out there using Java. Pop on over to Sourceforge and look at the number of projects by language: http://sourceforge.net/softwaremap/trove_list.php?form_cat=160.
Certainly Sourceforge is not the final measure, but it’s a reasonable reality check. Anyway, you’ll find 17300+ Java projects, the most of any language. That’s more than PHP (12675), Ruby (425), and .NET (3094 C#, 347 VB.Net) combined.
Because of its prominence, Java gets a lot of attention and with it much criticism, some of it valid. What many may not realize is that some big breakthroughs have arrived and that the Java development landscape is solving important problems. Let’s take a view of where Java is going to go in the next year or two as these ideas gain traction.
The first big arena of innovation is the addition of scripting support. Some people rightly claim Ruby or Python is better the Java for some tasks. Groovy and Beanshell solve these same problems and will become a standard (in the JSR sense) part of the Java stack. Each offers something better than standalone scripting. Both integrate into a truly mixed environment with compiled bytecode and interpreted scripts interoperating smoothly. Beanshell’s syntax offers as little surprise as possible for the Java developer and Groovy gives a Ruby-like syntactic efficiency, but can also be compiled to pure bytecode and reused seamlessly, a big improvement over JRuby or Jython.
Second, the days of heavyweight frameworks are gone. J2EE-style EJBs are out. Now, the lightweight frameworks like Hibernate, Spring, and HiveMind are the future of Java. The heavy Struts of the past is being replaced with two new directions: Struts Shale based on JSF and Struts Ti is a wholesale merge with Webwork. These projects share a common idea that the framework should stay out of the way of your object model. EJB3 takes the same view.
A third major innovation where Java leads is aspect-oriented programming (AOP). AOP will unclutter your code by moving “cross-cutting” concerns like logging and security to transparent method interceptors. AspectJ is the Rolls Royce for AOP, but Spring has lightweight AOP themes as does the new JBoss.
Fourth, the PHP crowd had a legitimate gripe that banging out a simple web page took too much work if you were using JSP and Struts. But our templating solutions like Velocity, Freemarker, and now Groovy don’t make you choose between ultralight text generation and powerful mid-tier solutions. Groovlets should make for some rapid servlet solutions. For those people who really like PHP, keep it: Java 1.6 makes it the reference implementation for the new web scripting language bindings, so you can do your web views in PHP and use Java for model and controller.
Finally, Java’s traditional strength in the tools arena just keeps increasing. Eclipse is the best IDE on the planet, and it appears that Eclipse has reached critical mass like Ant and JUnit did, in that people simply expect solutions that extend it. Eclipse’s team coding capabilities for CVS and Subversion (via the Subclipse plugin) are first-rate. The refactoring and debugging support are top notch. Integration of standard tools like ant, compilers, JUnit, and javadocs are about as good as you can imagine.
So perhaps the hyper-enthusiasts have left and the buzzword mongers will proclaim that Java is dead. If Java is “dead,” it’s only because it was laid to rest so that a better, lighter, more agile, form of Java could replace it, so Long Live Java!

بسم الله الرحمن الرحيم September 7, 2006

Posted by essamabdelaziz in Uncategorized.
add a comment

i wish it will be helpful 4 you brothers and sisters