Recent Notes
Displaying keyword search results 1 - 10
Created by Fang on January 04, 2013 08:00:37
Last update: January 04, 2013 08:00:37
This is a Maven POM that prints out some built-in project properties:
<project
xmlns="http://maven.apache.org/PO...
Output:
$ mvn validate
[INFO] Scanning for projects.....
Created by Fang on July 25, 2012 12:52:40
Last update: September 14, 2012 13:37:57
Summarized from official JAX-WS documentation : Sending and Receiving SOAP Headers To send a SOAP header:
HelloService helloService = new HelloService(); ... To receive a SOAP header: List<Header> inboundHeaders = bp.getInboundHeaders... Message logging On the client side, set system property: com.sun.xml.ws.transport.http.client.HttpTransport... On the server side, set system property: com.sun.xml.ws.transport.http.HttpAdapter.dump=tru... Propagation of Server-side Stacktrace Propagation of Stack trace is on by default. The whole stacktrace (including nested exceptions) is propagated in the SOAP Fault and the complete exception stacktrace is visible to the client as cause of SOAPFaultException . To turn off stack trace propagation, set this system property on the server: com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptu... Update: At least on the client side, the property name has been changed to: com.sun.xml.internal.ws.transport.http.client.Http... The messages are dumped to stdout . For...
Created by voodoo on June 27, 2012 21:07:34
Last update: June 27, 2012 21:09:44
Because of the utilization of HTTP pipelining, Ubuntu APT had problems working with web proxies like Squid . The problem was fully documented in this bug report:
disable apt http pipelining in quantal
which also provided a way to turn off pipelining manually:
apt-get -o Acquire::http::Pipeline-Depth="0" -y up...
Pipelining is turned off by default as of apt (0.9.6ubuntu1) - Ubuntu Linux 12.10 'Quantal Quetzal' - see link above.
Created by Dr. Xi on June 17, 2012 13:14:25
Last update: June 17, 2012 13:14:25
Link to official Java networking properties page: http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
http.keepAlive (default: true)
Indicates if keep alive (persistent) connections should be supported. Persistent connections improve performance by allowing the underlying socket connection be reused for multiple http requests.
The default is true and thus persistent connections will be used with http 1.1 servers. Set to 'false' to disable the use of persistent connections.
http.maxConnections (default: 5)
If HTTP keep-alive is enabled, this value is the number of idle connections that will be simultaneously kept alive, per-destination.
Created by Dr. Xi on May 24, 2012 20:16:12
Last update: May 24, 2012 20:16:12
IE categorizes web sites into different security zones . You can put specific sites into a certain zone with the "Security" tab in the "Internet Options" dialog. If a site is not specifically configured, IE has default algorithm to assign it to a zone. which can have unexpected results. For example: http://myserver is in the Intranet zone because the name does not contain a dot (.). But if you are using the IP address of myserver , then it goes to the Internet zone, even though myserver may have an internal IP address, or even on the same subnet: http://192.168.2.1 . IE8 and before displays the Zone of a web site in the status bar. IE9 removed the Zone info from the status bar. You...
Created by magnum on July 26, 2010 15:55:41
Last update: March 28, 2012 15:28:02
Given the URL:
http://www.mydomain.com/myWebApp/theServlet/p1/p2/p3;sid=123?param=abc
This would be the output of the various method calls on HttpServletRequest :
String scheme = request.getScheme(); // ...
Created by Fang on March 02, 2012 13:23:35
Last update: March 02, 2012 13:23:35
The landing page after login can be configured with the default-target-url attribute of form-login . If a user was redirected to the login form after requesting a restricted URL, she's redirected to the original requested page after successful login.
An easy configuration looks like this:
<beans:beans xmlns="http://www.springframework.org...
But there are times that you want to do more initialization after login (such as loading user data), or apply more complex logic before redirecting. This is where the authentication-success-handler-ref attribute comes into play. You create a class that implements org.springframework.security.web.authentication.AuthenticationSuccessHandler and use that as the authentication-success-handler-ref :
<http
entry-point-ref="authProcessFilterEn...
This is a skeleton implementation:
public class MyAuthenticationSuccessHandler implem...
Created by Fang on February 21, 2012 20:54:23
Last update: February 21, 2012 20:57:57
Tomcat gzip compression filter can be turned on with " compression=on " in server.xml :
<Connector port="8080" protocol="HTTP/1.1"
...
The default compressed MIME types are: text/html,text/xml,text/plain .
It would be nice to add other types:
<Connector
port="8080"
protocol="HTT...
Created by Fang on February 10, 2012 16:17:13
Last update: February 10, 2012 16:17:13
The annotation @org.hibernate.annotations.Type overrides the default hibernate mapping type used for a column. This can usually be omitted since Hibernate normaly infers the correct type to use.
But @Type is required in ambiguous scenarios such as a java.util.Date attribute, which can map to SQL DATE , TIME or TIMESTAMP . You use the @Type("timestamp") annotation to tell Hibernate that a timestamp converter should be used, which identifies an instance of org.hibernate.type.TimestampType .
@Type can also be used to identify custom type converters, which can be defined with @TypeDef at the class level:
@TypeDefs(
{
@TypeDef(
na...
or with an xml file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mappi...
Created by Fang on January 31, 2012 15:40:34
Last update: January 31, 2012 15:41:28
This is a simple Hello World application with Spring 3 MVC. Like the default Apache HTTPd welcome page, it displays " It works! " when successfully deployed. The sole purpose is to show the minimum elements needed to setup Spring 3 MVC.
I use Maven since it's so much easier than downloading the dependencies manually.
Directory layout:
./src
./src/main
./src/main/webapp
./src/...
pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project...
WEB-INF/web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app...
WEB-INF/applicationContext.xml (empty, but needed):
<?xml version="1.0" encoding="UTF-8"?>
<beans x...
WEB-INF/spring-servlet.xml :
<?xml version="1.0" encoding="UTF-8"?>
<beans x...
WEB-INF/jsp/home.jsp :
<!DOCTYPE html>
<html>
<head>
<title>H...
Build with:
mvn clean package
The resulting webapp is target/springmvc.war .