我在 . 的帮助下将 queryString 中的值设置为 managedBean 的属性<f:viewParam>
。如果我打印属性的值,它对于普通字符正常工作。但是,当 queryString 包含重音字符时,在将值设置为 managedBean 的属性后,如果我打印该属性的值,重音字符将无法正确显示。
.xhtml 代码片段如下:
<f:metadata>
<f:viewParam id="requestString" name="requestString" value="#{aproveOrDenyController.requestString}" />
</f:metadata>
托管豆:
@ManagedBean(name = "aproveOrDenyController")
@ViewScoped
public class AproveOrDenyController extends BaseWebController implements Serializable
{
private String requestString;
public final String getRequestString() {
return requestString;
}
public final void setRequestString(String requestString) {
this.requestString = requestString;
System.out.println(this.requestString);
}
}
如果查询字符串包含...&requestString=abcdefgh&..... 那么它会abcdefgh
正确打印。但是如果查询字符串包含 ...&requestString=SociétéGéniale&.. 那么它会打印SociétéGéniale
. 但我想要SociétéGéniale
。任何指针都会对我很有帮助。
Edit-1 生成的错误:
19:52:49,594 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.ServerService.boot(ServerService.java:266) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_10]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,5]
Message: JBAS014789: Unexpected element '{urn:jboss:domain:1.2}extensions' encountered
at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:85) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:351) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:127) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
... 3 more