How to Check Your Google Listings

To find out what on your site is indexed on Google, go there and run the following search:

site:mydomain.com

Where “mydomain” is your domain name (change the . com if you have a different domain extension).

Click here for an example.

If you found this interesting, please share.

© Scott S. Nelson

Dynamic Log Location for log4j

I was really surprised that log4j doesn’t have any facility to set the log file location with a relative path. Hard to build a portable application if you need to set the full value of a local path. And don’t talk to me about config files, because that requires reading documentation, which is only read less than it is written.

So, if you use the standard log4j servlet approach to start your logging, you can weave in the following to set your path relative to your app:

org.w3c.dom.NodeList nodes = doc.getElementsByTagName("param");;
org.w3c.dom.Node node = null;//nodes.item(0);
org.w3c.dom.NamedNodeMap nodeMap = null;
for(int i=0; i < nodes.getLength(); i++)
{
    node = nodes.item(i);
    nodeMap = node.getAttributes();
    if(nodeMap.getNamedItem("name")
        .getNodeValue().equals("File"))
    {
        node = nodeMap.getNamedItem("value");
        outputFile = new File(getServletContext().getRealPath(node.getNodeValue()));
        outPutPath = outputFile.getAbsolutePath();
        outPutPath = outPutPath.replace('', '/');
        node.setNodeValue(outPutPath);
    }
}

Then you can set the log location to outPutPath.

Enjoy 🙂

If you found this interesting, please share.

© Scott S. Nelson

PCAnywhere and Your Firewall

I’m always forgetting what ports to set for PCAnywhere use. This time I thought I’d share the link I found on PCAnywhere ports at http://www.nthelp.com/NT6/pcanywhere_ip_port_usage.htm.

Though these days I’m using TeamViewer, which has no problem with firewalls though does get filtered by some networks admins.

If you found this interesting, please share.

© Scott S. Nelson

Facelet Face Off on WLP

If you chose the Facelet aspect for your WLP project in 10.3.2, your portlets will use the “native” (i.e., WLP-only) portlet bridge rather than the “JSR-329” (i.e., crystal ball) bridge.  In case you need to reuse your portlets in another portal framework.

I haven’t had time to try it out, but in theory one could write the .portlet file by hand and still get the best of both worlds.

If you found this interesting, please share.

© Scott S. Nelson

WLP 10.3.2 ClassCastException in FacesContext

If you see:

java.lang.ClassCastException: com.bea.portlet.container.ActionRequestImpl

Try adding the following:

import javax.portlet.ActionRequest;


ActionRequest actionRequest = (ActionRequest) ctx.getExternalContext().getRequest();
HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute(“javax.servlet.request”);

If you found this interesting, please share.

© Scott S. Nelson