jsf - How to pass special characters to ManagedBean -


reading following questions (how set charset in primefaces webapp?), i'm trying pass parameter managedbean specials characters (like i.e.: " '´áéíóúÁÉÍÓÚ& "), using "filterservlet" says in answers of questions it's not working:

jbweb000065: http status 500 - /utf8/utf8_test.xhtml @23,153 value="#{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}" el expression unbalanced: ... #{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}   jbweb000309: type jbweb000066: exception report  jbweb000068: message /utf8/utf8_test.xhtml @23,153 value="#{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}" el expression unbalanced: ... #{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}  jbweb000069: description jbweb000145: server encountered internal error prevented fulfilling request.  jbweb000070: exception  javax.servlet.servletexception: /utf8/utf8_test.xhtml @23,153 value="#{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}" el expression unbalanced: ... #{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}     javax.faces.webapp.facesservlet.service(facesservlet.java:606)     cl.gov.minterior.ncforms.managedbeans.utffilter.dofilter(utffilter.java:39)    jbweb000071: root cause  javax.faces.view.facelets.tagattributeexception: /utf8/utf8_test.xhtml @23,153 value="#{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}" el expression unbalanced: ... #{testbean.testencoding(''´áéíóúÁÉÍÓÚ&')}     com.sun.faces.facelets.tag.tagattributeimpl.<init>(tagattributeimpl.java:115)     com.sun.faces.facelets.compiler.saxcompiler$compilationhandler.createattributes(saxcompiler.java:133)     com.sun.faces.facelets.compiler.saxcompiler$compilationhandler.startelement(saxcompiler.java:259)     org.apache.xerces.parsers.abstractsaxparser.startelement(abstractsaxparser.java:496)     org.apache.xerces.parsers.abstractxmldocumentparser.emptyelement(abstractxmldocumentparser.java:180)     org.apache.xerces.impl.dtd.xmldtdvalidator.emptyelement(xmldtdvalidator.java:810)     org.apache.xerces.impl.xmlnsdocumentscannerimpl.scanstartelement(xmlnsdocumentscannerimpl.java:275)     org.apache.xerces.impl.xmldocumentfragmentscannerimpl$fragmentcontentdispatcher.dispatch(xmldocumentfragmentscannerimpl.java:1653)     org.apache.xerces.impl.xmldocumentfragmentscannerimpl.scandocument(xmldocumentfragmentscannerimpl.java:324)     org.apache.xerces.parsers.xml11configuration.parse(xml11configuration.java:845)     org.apache.xerces.parsers.xml11configuration.parse(xml11configuration.java:768)     org.apache.xerces.parsers.xmlparser.parse(xmlparser.java:108)     org.apache.xerces.parsers.abstractsaxparser.parse(abstractsaxparser.java:1196)     org.apache.xerces.jaxp.saxparserimpl$jaxpsaxparser.parse(saxparserimpl.java:555)     org.apache.xerces.jaxp.saxparserimpl.parse(saxparserimpl.java:289)     javax.xml.parsers.saxparser.parse(saxparser.java:195)     com.sun.faces.facelets.compiler.saxcompiler.docompile(saxcompiler.java:427)     com.sun.faces.facelets.compiler.saxcompiler.docompile(saxcompiler.java:403)     com.sun.faces.facelets.compiler.compiler.compile(compiler.java:124)     com.sun.faces.facelets.impl.defaultfaceletfactory.createfacelet(defaultfaceletfactory.java:319)     com.sun.faces.facelets.impl.defaultfaceletfactory.access$100(defaultfaceletfactory.java:92)     com.sun.faces.facelets.impl.defaultfaceletfactory$1.newinstance(defaultfaceletfactory.java:159)     com.sun.faces.facelets.impl.defaultfaceletfactory$1.newinstance(defaultfaceletfactory.java:157)     com.sun.faces.facelets.impl.defaultfaceletcache$1.newinstance(defaultfaceletcache.java:79)     com.sun.faces.facelets.impl.defaultfaceletcache$1.newinstance(defaultfaceletcache.java:74)     com.sun.faces.util.expiringconcurrentcache$1.call(expiringconcurrentcache.java:99)     java.util.concurrent.futuretask.run(futuretask.java:266)     com.sun.faces.util.expiringconcurrentcache.get(expiringconcurrentcache.java:114)     com.sun.faces.facelets.impl.defaultfaceletcache.getfacelet(defaultfaceletcache.java:117)     com.sun.faces.facelets.impl.defaultfaceletcache.getfacelet(defaultfaceletcache.java:58)     com.sun.faces.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:256)     com.sun.faces.facelets.impl.defaultfaceletfactory.getfacelet(defaultfaceletfactory.java:200)     com.sun.faces.application.view.faceletviewhandlingstrategy.buildview(faceletviewhandlingstrategy.java:908)     com.sun.faces.lifecycle.renderresponsephase.execute(renderresponsephase.java:99)     com.sun.faces.lifecycle.phase.dophase(phase.java:101)     com.sun.faces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:139)     javax.faces.webapp.facesservlet.service(facesservlet.java:594) 

so far, problems seems " ' " (apos) character, because way primefaces transform before it's sended managed bean,

the code call managed bean is:

<h:outputtext value="#{testbean.pruebaencoding('&#39;&#180;&#225;&#233;&#237;&#243;&#250;&#193;&#201;&#205;&#211;&#218;&amp;')}" /> 

and managed bean:

public string pruebaencoding(string strencoded) {      filewriter writer;     try {         writer = new filewriter("/desarrollo/workspaces/workspace-eclipse-mars-test/project/filter.test");          writer.write(strencoded);          writer.close();     } catch (ioexception e) {         e.printstacktrace();     }      return strencoded; } 

thanks help

tip: it's important application can write result file because ant script use stuff()


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -