Posted by Unknown on 2:10 AM
Labels:

You can submit your site in yahoo or google or most of other search engines for free. This will help the search engines know about the existence of your website and will be indexed for search results. Typically most of the search engines are based upon yahoo, msn or google and display the search results by using these search engines.


here are links to submit your site to yahoo, google and msn.


Yahoo: https://siteexplorer.search.yahoo.com/submit

Google: http://www.google.com/addurl/?continue=/addurl

Msn: http://search.msn.com/docs/submit.aspx

Posted by Unknown on 2:05 AM
Labels:

Google Page rank is based on back links. Back links are Links pointing to your website from another website. The more back links you have the higher your PR will be.

1. Join forums, forums are a great way to achieve links to your website. In most forums you are allowed to have a signature and in your signature you can put a link to your website. But another important note to look on is making sure the forum is somewhat related to your website. You will still get credit if it's not, but if it's related to your website than you will be accomplishing two tasks at once.

You will be advertising for your website (bringing in targeted traffic) You will also be building your websites presence.

Your websites presence is very important to your survival. The more people see, or hear about your website the more credibility you will have and this increases your chances of having these visitors come back and possibly become leads.

2. Submit to search engine directories. Search engine directories are a good way to get a free link to your website. They also increase your chances at being listed higher on popular search engines like Google, and overture.

Most search engine directories allow you to submit to their website for free. This will allow you to increase your web presence by being listed on another search engine, and it will also be a free link.

Remember the more links you have the higher your PR will be

3. Using ezine ads (or newsletters). Creating an ezine will probably be the most beneficial step you can take to increasing your web presence. When you create an ezine you will be able to keep visitors coming back to your website for more by using signatures and giving special deals.

Ezine's will also allow you to increase your back links. By creating an ezine you can submit your information about your ezine to an ezine directory. This directory will than link to your website(thus giving you a free link).

4. Creating and publishing articles. Articles are an easy source of generating new traffic. You can include your signature in your article. This will bring in more traffic from article submission directories.

Your signature usually consists of 4 to 8 lines. Usually the first line would be the title of the website that you are trying to advertise. The last line would be the link to the website and the lines in between these would be a sales pitch to draw your viewers into your website.

5. Links from related websites. Gaining links from related websites can be one of the most frustrating tasks you can attempt.



Posted by Unknown on 10:39 PM
Labels:


Below is the example of implementing phase listener in JSF. It's also has been shown that how we can implement our custom ajax component within JSF lifecycle. But please keep in mind that writing numbers of Phase listener are not encouraging in JSF as it kills performance.


/** Created on Feb 01, 2008
*/
package misc.listener;

import java.io.PrintWriter;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* @author Hiren
*/
public class AjaxPhaseListener implements PhaseListener {
/* (non-Javadoc)* @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
*/
public void afterPhase(PhaseEvent evt){
System.out.println("******Phase Id: *****"+ evt.getPhaseId());FacesContext ctx = evt.getFacesContext();
Map headers = ctx.getExternalContext().getRequestHeaderMap();
HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
//Capturing each request after each phase of JSF lifecycle
HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
if("Test-Ajax".equalsIgnoreCase((String)headers.get("Ajax-Request"))){
System.out.println("********This is an TEST-AJAX call");
System.out.println("******* Query String=> " + request.getQueryString());
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
try{
PrintWriter out = response.getWriter();
out.write("Hiren Dutta");
out.flush();
}catch(Exception ex){ //too lazy too write nythin :)
}
ctx.responseComplete();//LetJSF know to skip rest of the lifecycle.
}
}
//Terminating condition for this phase listener.Here we are plugging our own //component
/* (non-Javadoc)

* @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
*/
public void beforePhase(PhaseEvent arg0) {
// Feelin lazy....
}

/* (non-Javadoc)
* @see javax.faces.event.PhaseListener#getPhaseId()
*/
public PhaseId getPhaseId() {
return PhaseId.PROCESS_VALIDATIONS;
}
}

Posted by Unknown on 2:55 PM

Below is the code conversion for XMLGregorianCalander to Date and Date to XMLGregorianCalander.

/**
* Convert java.util.Date into XMLGregorianCalendar object.
* @param date Date Object.
* @return XMLGregorianCalendar Object.
* @see XMLGregorianCalendar XMLGregorianCalendar.
*/
public static XMLGregorianCalendar toXMLGregorianCalendar(final Date aDtDate) {
XMLGregorianCalendar mVReturnCal = null;
try {
final GregorianCalendar mVCalendar = new GregorianCalendar();
mVCalendar.setTime(aDtDate);
mVReturnCal = DatatypeFactory.newInstance()
.newXMLGregorianCalendar(mVCalendar);
} catch (DatatypeConfigurationException ex) {
APPLICATION_LOG.error("Exception is=>",ex);
}
return mVReturnCal;
}
/**
* Convert java.util.Date into XMLGregorianCalendar object. Time Format.
* @param date Date Object.
* @return XMLGregorianCalendar Object.
* @see XMLGregorianCalendar XMLGregorianCalendar.
*/
public static XMLGregorianCalendar toXMLGregorianCalendarTime(final Date aDtDate) {
XMLGregorianCalendar mVReturnCal = null;
try {
final XMLGregorianCalendar mvTempCal = toXMLGregorianCalendar(aDtDate);
mVReturnCal = DatatypeFactory.newInstance()
.newXMLGregorianCalendarTime(
mvTempCal.getHour(),
mvTempCal.getMinute(),
mvTempCal.getSecond(),
mvTempCal.getTimezone());
} catch (DatatypeConfigurationException ex) {
APPLICATION_LOG.error("Exception is=>",ex);
}
return mVReturnCal;
}
/**
* Convert XMLGregorianCalendar to java.util.Date object.
* @param mVXMLCal XMLGregorianCalendar Object
* @return Date Object
* @see XMLGregorianCalendar
*/
public static java.util.Date toDate(final XMLGregorianCalendar mVXMLCal) {
java.util.Date mDtDate = null;
try {
final GregorianCalendar mVGregCalendar =
mVXMLCal.toGregorianCalendar();
mDtDate = mVGregCalendar.getTime();
} catch (Exception ex) {
APPLICATION_LOG.error("Exception is=>",ex);
}
return mDtDate;
}