ajax - How to use jQuery with in xhtml? -
i using facelets,richfaces,and ajax, in xhtml
facing error while creating datepicker! solution problem?
the code is:
<?xml version="1.0" encoding="iso-8859-1" ?> <!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:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich"> <head> <a4j:loadscript src="jquery/jquery-1.4.2.min.js" /> <a4j:loadscript src="jquery/jquery-ui-1.8.5.custom.min.js" /> </head> <body> <h:form> <rich:panel> <h:inputtext id="mydate" value="" label="test" size="20"/> <rich:jquery selector="#mydate" name="mydate" query="datepicker({changemonth:true,changeyear:true})" timing="onload"/> </rich:panel> </h:form> </body> </html>
error getting is:
info: added library from: jar:file:/d:/ws/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/richtest/web-inf/lib/richfaces-ui-3.3.3.final.jar!/meta-inf/ajax4jsf.taglib.xml oct 8, 2010 1:51:30 pm com.sun.facelets.faceletviewhandler handlerenderexception severe: error rendering view[/jquery/jquery-1.4.2.min.js] com.sun.facelets.faceletexception: error parsing /jquery/jquery-1.4.2.min.js: error traced[line: 1] content not allowed in prolog. @ com.sun.facelets.compiler.saxcompiler.docompile(saxcompiler.java:234) @ com.sun.facelets.compiler.compiler.compile(compiler.java:105) @ com.sun.facelets.impl.defaultfaceletfactory.createfacelet(defaultfaceletfactory.java:197) @ com.sun.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:144) @ com.sun.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:95) @ com.sun.facelets.faceletviewhandler.buildview(faceletviewhandler.java:517) @ com.sun.facelets.faceletviewhandler.renderview(faceletviewhandler.java:567) @ org.ajax4jsf.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:100) @ org.ajax4jsf.application.ajaxviewhandler.renderview(ajaxviewhandler.java:176) @ com.sun.faces.lifecycle.renderresponsephase.execute(renderresponsephase.java:106) @ com.sun.faces.lifecycle.lifecycleimpl.phase(lifecycleimpl.java:251) @ com.sun.faces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:144) @ javax.faces.webapp.facesservlet.service(facesservlet.java:245) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.ajax4jsf.webapp.basexmlfilter.doxmlfilter(basexmlfilter.java:206) @ org.ajax4jsf.webapp.basefilter.handlerequest(basefilter.java:290) @ org.ajax4jsf.webapp.basefilter.processuploadsandhandlerequest(basefilter.java:388) @ org.ajax4jsf.webapp.basefilter.dofilter(basefilter.java:515) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:233) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:263) @ org.apache.coyote.http11.http11processor.process(http11processor.java:844) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:584) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:619) oct 8, 2010 1:51:30 pm com.sun.faces.lifecycle.lifecycleimpl phase warning: executephase(render_response 6,com.sun.faces.context.facescontextimpl@19e733e) threw exception com.sun.facelets.faceletexception: error parsing /jquery/jquery-1.4.2.min.js: error traced[line: 1] content not allowed in prolog. @ com.sun.facelets.compiler.saxcompiler.docompile(saxcompiler.java:234) @ com.sun.facelets.compiler.compiler.compile(compiler.java:105) @ com.sun.facelets.impl.defaultfaceletfactory.createfacelet(defaultfaceletfactory.java:197) @ com.sun.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:144) @ com.sun.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:95) @ com.sun.facelets.faceletviewhandler.buildview(faceletviewhandler.java:517) @ com.sun.facelets.faceletviewhandler.renderview(faceletviewhandler.java:567) @ org.ajax4jsf.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:100) @ org.ajax4jsf.application.ajaxviewhandler.renderview(ajaxviewhandler.java:176) @ com.sun.faces.lifecycle.renderresponsephase.execute(renderresponsephase.java:106) @ com.sun.faces.lifecycle.lifecycleimpl.phase(lifecycleimpl.java:251) @ com.sun.faces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:144) @ javax.faces.webapp.facesservlet.service(facesservlet.java:245) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.ajax4jsf.webapp.basexmlfilter.doxmlfilter(basexmlfilter.java:206) @ org.ajax4jsf.webapp.basefilter.handlerequest(basefilter.java:290) @ org.ajax4jsf.webapp.basefilter.processuploadsandhandlerequest(basefilter.java:388) @ org.ajax4jsf.webapp.basefilter.dofilter(basefilter.java:515) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:233) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:263) @ org.apache.coyote.http11.http11processor.process(http11processor.java:844) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:584) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:619) oct 8, 2010 1:51:30 pm org.ajax4jsf.webapp.basexmlfilter doxmlfilter severe: exception in filter chain javax.servlet.servletexception: error parsing /jquery/jquery-1.4.2.min.js: error traced[line: 1] content not allowed in prolog. @ javax.faces.webapp.facesservlet.service(facesservlet.java:249) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.ajax4jsf.webapp.basexmlfilter.doxmlfilter(basexmlfilter.java:206) @ org.ajax4jsf.webapp.basefilter.handlerequest(basefilter.java:290) @ org.ajax4jsf.webapp.basefilter.processuploadsandhandlerequest(basefilter.java:388) @ org.ajax4jsf.webapp.basefilter.dofilter(basefilter.java:515) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:233) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:263) @ org.apache.coyote.http11.http11processor.process(http11processor.java:844) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:584) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447)
please tell me reason.
according http://seamframework.org/community/howtowritejavascriptinxhtml need to:
<a4j:loadscript src="resource://jquery.js"/>
Comments
Post a Comment