Confused about how java annotations (ie @SecurityDomain) work and what they do (do they generate xml? wsdl?)

▼魔方 西西 提交于 2020-01-05 05:29:04

问题


I have to admit that I am pretty confused how annotations work in java (SOAP) webservices.

What does adding a tag do? I think that maybe adding a tag generates some xml or maybe a wsdl? When I build should I see a difference in those files?

Any description or link would be great. I have done a lot of searching but I think maybe I am searching for the wrong things. For example when I search for:

@securityDomain

I just get garbadge results. I am having difficulty finding a good description of what specific tags do as well as how tags in general work.

Update:

So is it safe to say that you can either use annotations or you can write your own xml/wdsl?


回答1:


@nnotations are defined by the Java language. An Annotation is a class. When you mark something with an annotation, the compiler and runtime arrange for an object of that class to be visible at runtime via java reflection.

The JAX-WS and JAX-B standards each define a raft of annotations. At runtime, or at java2ws(dl) time, they look at those annotations to decide what to do.

It looks to me as if @SecurityDomain in particular is part of JBoss, not any global standard, so you have to read the JBoss documentation to find out what it does.

I found this.



来源:https://stackoverflow.com/questions/2157632/confused-about-how-java-annotations-ie-securitydomain-work-and-what-they-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!