Thursday, December 11, 2014

Why my JSF navigation failed - for beginners in JSF

JSF navigation did not work for me with the following content

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html">
      from page2.xhtml
      <h:commandButton action="home" value="go to home" />
</html>

Caused a standstill since it did not emit any error in logs.

Since <h:commandButton> produces the html <input type='submit' />, it is supposed to be inside a form. So made the correction and it worked.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html">
      from page2.xhtml
      <body>
       <h:form>
      <h:commandButton action="home" value="go to home" />
       </h:form>
      </body>
</html>

Thursday, December 4, 2014

An excellent article which explains the basics of configuring a JSF application without using any IDE

If you know JSP and are looking for some help to get started on the basics of JSF without using any IDE or build tool (most tutorials use maven, but for those who have no maven knowledge, many things remain hidden), here is yours :

http://www.theserverside.com/tutorial/Slingshot-Yourself-into-JavaServer-Faces-20-Learning-JSF

Once you complete your JSF setup using the above link, then you can use http://www.tutorialspoint.com/jsf/ to explore further.

Friday, June 13, 2014

[SOLVED] Exception while configuring tiles in Struts 1

Got the following exception while configuring tiles with Struts 1.3.10.

INFO: Loading chain catalog from jar:file:/C:/work/eclipseworkspace/pas/1/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/pas/WEB-INF/lib/struts-tiles-1.3.10.jar!/org/apache/struts/tiles/chain-config.xmlJun 13, 2014 10:55:12 PM org.apache.commons.digester.Digester errorSEVERE: Parse Error at line 8 column 77: Document root element "definition", must match DOCTYPE root "tiles-definitions".org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 77; Document root element "definition", must match DOCTYPE root "tiles-definitions". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1599) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3065) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:881) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at org.apache.commons.digester.Digester.parse(Digester.java:1765) at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:281) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:514) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:449) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:266) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:241) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:191) at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:105) at org.apache.struts.tiles.TilesUtilImpl.createDefinitionsFactory(TilesUtilImpl.java:181) at org.apache.struts.tiles.TilesUtil.createDefinitionsFactory(TilesUtil.java:182) at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:226) at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:141) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5198) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)


The problem was : I did not enclose my 'definition' tag in my tiles-defs.xml with the , since i referred Struts Examples page (I'd call it a poor documentation, poor availability too, some pages are missing at this point of time).

Find below the correct tiles-defs.xml :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"http://struts.apache.org/dtds/tiles-config_1_3.dtd">
<tiles-definitions> <!-- THIS TAG WAS MISSING -->
<definition name="default-template" path="/common/tiles/default-layout.jsp">
  <put name="header"  value="/common/Header.jsp" type="string" />
  <put name="menu" value="/common/Menu.jsp" type="page" />
  <!-- put name="body"   value="/index.jsp" type="page"  -->
</definition>
</tiles-definitions>
 




Tuesday, May 21, 2013

Error running javac.exe compiler - ant compilation error


I am using windows 7 and had installed java under C:\Program Files (x86)

May be the space or the special chars in the path should have created problem with ant

Just copied the java folder from C:\Program Files (x86)\ to D: and set my JAVA_HOME to D:\java\jdk1.6.0_11 and added the path D:\java\jdk1.6.0_11\bin to my system path. Ant compiled my code!

Sunday, February 10, 2013

Devices list not appearing on itunes on your computer

Just plug out your usb connector interface and plug-in again

Monday, January 21, 2013

tree command with file listing

tree /f

Saturday, September 15, 2012

Firebird query to list out rows having duplicate values in columns


SELECT * FROM "TABLE1" t1 WHERE EXISTS (SELECT 1 FROM " TABLE1" t2 WHERE t1."COLUMN1" = t2."COLUMN1" AND t1.RDB$DB_KEY < t2.RDB$DB_KEY);

This query will list out only the rows from TABLE1 which have duplicate values in COLUMN1.