I need to access jsf pages component tree on application start up. I found this source on the net UIViewRoot viewRoot = context.getApplication().getViewHandler().createView(context, "/path/to/some.xhtml"); but the resulting viewRoot doesn't have any children. Does anybody know what is the best way to do it? thanks. You forgot to build the view. You can use ViewDeclarationLanguage#
我需要在应用程序启动时访问jsf页面组件树。 我在网上发现了这个资源 UIViewRoot viewRoot = context.getApplication().getViewHandler().createView(context, "/path/to/some.xhtml"); 但由此产生的viewRoot没有任何孩子。 有人知道什么是最好的方法吗? 谢谢。 你忘了建立视图。 你可以使用ViewDeclarationLanguage#buildView() 。 这里是它的javadoc的摘录(重点是我的): 执行特定于此VDL实现的任何操作,以
I have a question regarding generating Java artifacts with wsimport tool (by Maven Jax-WS ) When I generate the Java artifacts from WSDL, I would like to pack the web service project as a WAR file, and its client as a JAR file. Where to put the generated artifacts and where to put the WSDL? What is the best practice regarding organizing web service projects? Thank you in advance! Best re
我有一个关于使用wsimport工具生成Java工件的问题(由Maven Jax-WS提供) 当我从WSDL生成Java构件时,我想将Web服务项目打包为WAR文件,并将其客户端打包为JAR文件。 何处放置生成的工件以及放置WSDL的位置? 关于组织Web服务项目的最佳做法是什么? 先谢谢你! 最好的问候,Jurica Krizanic 这些工件将在客户端和服务器端都需要,因此将它们打包在第三个jar文件中,并将其设置为两者的依赖关系。 WSDL应该转到war的
I create and add a widget to a DockLayoutPanel as so: DockLayoutPanel dockPanel = new DockLayoutPanel(Unit.PCT); dockPanel.addNorth(widget, size); What does the size parameter determine? Google says to use the CSS parameters left, top, width, height, right, and bottom to determine the child's size(at the subsection Constraint-based Layout). Logically, passing the value 100 (with units
我创建并向DockLayoutPanel添加一个小部件,如下所示: DockLayoutPanel dockPanel = new DockLayoutPanel(Unit.PCT); dockPanel.addNorth(widget, size); 尺寸参数决定了什么? 谷歌说,使用CSS参数left,top,width,height,right和bottom来确定孩子的大小(在基于Constraint-based Layout的部分)。 从逻辑上讲,将值100(以单位%)作为大小传递将使该小部件填充它的容器,因为它代表单个维度。 我只想获得一个布
I'm using Jaxb to unmarshal XML into a java object. I need to know when new attributes/elements are in the XML and fail. However by default the unmarshaller is ignoring new elements/attributes. Is there a configuration I can set to fail when new attributes/elements exist in the XML that are not specified in the POJO? My POJO: import javax.xml.bind.annotation.XmlAttribute; import javax.
我正在使用Jaxb将XML解组为一个java对象。 我需要知道XML中的新属性/元素何时失效。 但是,默认情况下,解组器会忽略新的元素/属性。 当POJO中没有指定的XML中存在新的属性/元素时,是否可以设置配置失败? 我的POJO: import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "ROOT") public class Mod
I'm working with mapping XML strings into POJOs and viceversa using JAXB 2.0, and I want to be able to determine the elements in a XML that should be mapped into my annotated POJO classes. Let's say I have the following XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <customer id="1"> <firstName>Peter</firstName> <lastName>Parker</l
我正在使用JAXB 2.0将XML字符串映射到POJO中,反之亦然,我希望能够确定XML中的元素,这些元素应该映射到我的带注释的POJO类中。 假设我有以下XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <customer id="1"> <firstName>Peter</firstName> <lastName>Parker</lastName> <socialSecurityNumber>112233445566</socialSecurityNumber> </cus
I am trying to use byte array like this (JAXB class). However, I am getting all 0s in the msg field even though I pass valid characters. The "id" and "myid" fields are parsed successfully and it is failing for the byte array field. @XmlRootElement(name = "testMessage") @XmlAccessorType(XmlAccessType.FIELD) public class TestMessage { @XmlAttribute private Integer id
我正在尝试像这样使用字节数组(JAXB类)。 但是,即使我传递了有效字符,我仍会在msg字段中获得全0。 “id”和“myid”字段被成功解析,并且对于字节数组字段失败。 @XmlRootElement(name = "testMessage") @XmlAccessorType(XmlAccessType.FIELD) public class TestMessage { @XmlAttribute private Integer id; @XmlElement(name = "myid") private Long myid; @XmlElement(name = "msg") private b
I wrote some Java classes and annotated them with the JAXB annotations. After that I used schemagen to generate an xsd. Then I build an object graph and marshalled it to a xml file. I modified the xml file so that it was not valid anymore. I wanted to use the xsd in the hope the JAXB unmarshalling fails. But it doesn't. Why? JAXB is reading a schema (if the schema XML is wrong JAX
我编写了一些Java类并使用JAXB注释对它们进行了注释。 之后,我使用schemagen生成一个xsd。 然后我构建一个对象图并将其编组为一个xml文件。 我修改了xml文件,使其无效。 我希望使用xsd,希望JAXB解组失败。 但事实并非如此。 为什么? JAXB正在读取模式(如果模式XML错误,JAXB会提供异常),但它会在读取时接受JAXB忽略模式。 SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCH
We are using JAXB to map Java classes into XML files. Currently we use the Java-to-XSD approach by annotating the Java classes. This works fine in general but we've hit the following problem now: we want an attribute of one XML element to refer to another XML element by it's name/ID. Imagine some XML describing a conceptual schema, with the entities defined in <entity> elements
我们使用JAXB将Java类映射到XML文件。 目前我们通过注解Java类来使用Java-to-XSD方法。 这在一般情况下工作正常,但现在我们遇到了以下问题:我们希望一个XML元素的属性通过名称/ ID引用另一个XML元素。 设想一些XML描述概念模式,用<entity>元素和<property>元素定义的实体用于建立链接。 属性的@type属性应该引用同一个文件中的一个实体。 是否可以使用JAXB对此进行建模? 我想象的是在模式中使用xsd:key
Is there any way to just ignore an element from Jaxb parsing? I have a large XML file, and if I could ignore one of the large, complex elements, then it would probably parse a lot quicker. It would be even better if it could not even validate the element contents at all and parse the rest of the document even if that element is not correct. ex:this should only generate Foo.element1 and Foo.e
有什么方法可以忽略Jaxb解析中的元素吗? 我有一个很大的XML文件,如果我可以忽略其中一个大的复杂元素,那么它可能会更快地解析。 如果甚至根本不能验证元素内容,并且即使该元素不正确,也解析文档的其余部分,它会更好。 例如:这应该只产生Foo.element1和Foo.element2 <foo> <element1>I want this</element1> <element2>And this</element2> <bar> <a>A
I am trying to fully automate a build and, most importantly, a release using maven in travis-ci. The way I am attempting to do it it to supply the username and password commandline as properties and have them substituted in the settings.xml file. Then, when running the build, I override the location of settings.xml to be a file I checked in. Everything needed to build and release needs to be ch
我正在试图完全自动化一个构建,最重要的是,在travis-ci中使用maven进行发布。 我试图这样做的方式是提供用户名和密码命令行作为属性并在settings.xml文件中替换它们。 然后,在运行构建时,我将settings.xml的位置覆盖为我签入的文件。构建和发布所需的所有内容都需要检入到回购中。 但是,maven看起来并不像属性替换那样。 例: settings.xml <?xml version='1.0' encoding='UTF-8'?> <settings xsi:schemaLo