Wednesday, August 7, 2024

Java lernings

For biggners :

http://theopentutorials.com/examples/java-ee/jax-ws/create-and-consume-web-service-using-jax-ws/
http://javapostsforlearning.blogspot.in/2013/03/jaxws-web-service-eclipse-tutorial.html


http://javapostsforlearning.blogspot.in/2013/03/jaxws-webservice-deployement-on-tomcat.html

<c:set var="myTest" value="testValue"/>
#1:<c:out value="${myTest}" />
#2:<%=pageContext.getAttribute("myTest") %>




Please ensure that you are providing a xml input in the UTF 8 format .
If you creating XML dynamically and provide this for parsing then please ensure you write the content in xml as follows :

 File tempXML = File.createTempFile("xmlfile", "tmp", new File("/tmp"));
 tempXML.deleteOnExit();
    
OutputStream os = new FileOutputStream(tempXML);
OutputStreamWriter bufferedWriter = new OutputStreamWriter(os, "UTF8");

bufferedWriter.write(xmlData);
bufferedWriter.flush();
bufferedWriter.close();    

XSLTInputHandler input = new XSLTInputHandler(tempXML, xslFile);




Logback natively implements the SLF4J API. This means that if you are using logback, you are actually using the SLF4J API. You could theoretically use the internals of the logback API directly for logging, but that is highly discouraged. All logback documentation and examples on loggers are written in terms of the SLF4J API.


http://logback.qos.ch/reasonsToSwitch.html

SLF4J is basically an abstraction layer. It is not a logging implementation. It means that if you're writing a library and you use SLF4J, you can give that library to someone else to use and they can choose which logging implementation to use with SLF4J e.g. log4j or the Java logging API. It helps prevent projects from being dependent on lots of logging APIs just because they use libraries that are dependent on them.
So, to summarise: SLF4J does not replace log4j, they work together. It removes the dependency on log4j from your library/app.

if a project is already using log4j, and you included a library say Apache Active MQ, which has dependency on logback, another logging library, then you need to include them as well, but if Apache Active MQ uses SL4J, you can continue with your logging library, without pain of adding and maintaining new logging framework

Read more: http://javarevisited.blogspot.com/2013/08/why-use-sl4j-over-log4j-for-logging-in.html#ixzz49qnR9Y4v

Take a look here: http://www.slf4j.org/, or even here: http://commons.apache.org/logging/ (Apache Commons Logging is similar to SLF4J) for more info on this concept.

No comments:

Post a Comment