Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on June 04, 2014 18:59:37    Last update: June 04, 2014 18:59:37
There's really no good solution since Tomcat hardwires the root context to the WAR file name. The easiest solution might be simply rename the WAR file during deployment.
Created by SaranReddy on May 14, 2014 07:59:40    Last update: May 14, 2014 07:59:40
As you have mentioned above, i have changed and its working fine. But my doubt here is, Assume day one you have deployed release abc-RELEASE-0.0.1.war . assume on day 2 you want to deploy second release abc-RELEASE-0.0.2.war. if we hard code the war file name in <Context>, the each and every time when the war file name changes like abc-RELEASE-0.0.3,0.0.4 as per the release then, each and every time we need to change the value at <Context> tag in server.xml file. I want it to be configured only once irrespective of the release As we do in JBOSS. could you please help me in this..
Created by Fang on January 10, 2014 14:07:20    Last update: January 10, 2014 14:07:20
An example project with Spring MVC and Apache Tiles. List of files: ./pom.xml ./src/main/webapp/WEB-INF/web.xml... ./pom.xml : <?xml version="1.0" encoding="UTF-8"?> <pro... ./src/main/webapp/WEB-INF/web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app... ./src/main/webapp/WEB-INF/applicationContext.xml : <?xml version="1.0" encoding="UTF-8"?> <beans x... ./src/main/webapp/WEB-INF/spring-servlet.xml : <?xml version="1.0" encoding="UTF-8"?> <beans x... ./src/main/webapp/WEB-INF/tiles-definitions.xml : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYP... ./src/main/webapp/WEB-INF/jsp/template.jsp : <!DOCTYPE html> <%@ page pageEncoding="UTF-8" %... ./src/main/java/com/example/MyController.java : package com.example; import javax.servlet.S...
Created by Fang on January 06, 2014 12:22:17    Last update: January 06, 2014 12:22:17
Add <mvc:default-servlet-handler/> to the spring servlet config ( spring-servlet.xml ?) so that static files can be handled by the default servlet handler. This is a full configuration file for example: <?xml version="1.0" encoding="UTF-8"?> <beans x...
Created by Fang on December 30, 2013 14:50:08    Last update: December 30, 2013 14:50:08
Starting with 3.1 M1 you can register HttpMessageConverters through a sub-element of mvc:annotation-driven . <?xml version="1.0" encoding="UTF-8"?> <beans x...
Created by Dr. Xi on September 23, 2013 09:00:22    Last update: September 23, 2013 09:17:55
Tsung is an open-source multi-protocol distributed load testing tool. It's written in Erlang , but don't let that dissuade you. Here are some simple steps to get started. Install Tsung. On Ubuntu, this is simply: sudo apt-get install tsung . Create a config file ( tsung.xml ): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYP... Beware of the dumptraffic attribute. You might want to set it to false for a real load test. Run the test: $ tsung -f tsung.xml start Starting Tsung "L... Generate the reports: $ cd /home/drxi/.tsung/log/20130923-1031 $ /usr... Open the report file in your browser: file:///home/drxi/.tsung/log/20130923-1031/report.html . For HTTPS testing change the server line to: <servers> <server host="192.168.80.160" port="...
Created by Dr. Xi on September 18, 2013 19:54:58    Last update: September 18, 2013 19:54:58
You can define a JDBC datasource in $CATALINA_BASE/conf/server.xml under <GlobalNamingResources> like this: <GlobalNamingResources> <Resource name="jd... But you will not be able to lookup the datasource in your webapp, unless you define a link in your per-web-application JNDI context (for example, META-INF/context.xml ): <?xml version="1.0"?> <Context> <Resourc... By tomcat documentation : The GlobalNamingResources element defines the global JNDI resources for the Server. These resources are listed in the server's global JNDI resource context. This context is distinct from the per-web-application JNDI contexts described in the JNDI Resources HOW-TO . The resources defined in this element are not visible in the per-web-application contexts unless you explicitly link them with <ResourceLink> elements.
Created by Fang on August 28, 2013 20:37:17    Last update: August 28, 2013 20:37:17
The default extension for JSF facelet files is .xhtml, which looks so out-of-date these days. I wanted to change the extension from .xhtml to .html, to make it look more modern, even though I still use JSF xhtml in reality. This didn't work ( web.xml ): <servlet-mapping> <servlet-name>Faces Ser... Using the servlet-mapping config without the context-param works, given that the actual file extensions are still .xhtml . But the caveat is, if you request the .xhtml file directly, it will be sent to the browser unprocessed. This worked: <servlet-mapping> <servlet-name>Faces Ser... I'm using myfaces 2.1.11.
Created by Dr. Xi on March 21, 2013 19:47:46    Last update: March 22, 2013 12:30:27
It's normal practice to import types from an external xsd file in WSDL like this: <wsdl:types> <xsd:schema xmlns:xsd="htt... When you use <dynamic-wsdl> and have Commons XMLSchema on the class path, Spring-WS inlines the xsd in the wsdl. But that doesn't happen when you use <static-wsdl> . You can define a SimpleXsdSchema bean to expose the xsd: <?xml version="1.0" encoding="UTF-8"?> <beans x... where the bean id "hello" should match the schemaLocation attribute in the WSDL (without the .xsd suffix). But note that the SimpleXsdSchema does not inline the xsd. It only makes the xsd available via an HTTP URL. Alternatively, you can simply put the xsd file under the content directory of the webapp (just link any CSS or JavaScript). Anyway, that's a lot of manual...
Created by Dr. Xi on March 22, 2013 12:18:39    Last update: March 22, 2013 12:18:39
This is a step-by-step guide to create a "contract-first" web service with Apache CXF. It's a lot easier than doing the same thing with Spring-WS. The project uses standard Maven directory layout. Define the data types ( src/main/resources/hello.xsd ): <xs:schema xmlns:xs="http://www.w3.org/200... Define the service ( src/main/resources/hello.wsdl ): <?xml version='1.1' encoding='UTF-8'?> <wsdl:de... Create pom.xml : <project xmlns="http://maven.apache.org/POM/4.... Generate jaxb bindings: $ mvn generate-sources Code the web service ( src/main/java/com/example/cxfdemo/HelloPortImpl.java ): package com.example.cxfdemo; import javax.j... Declare the CXF servlet in web.xml ( src/main/webapp/WEB-INF/web.xml ): <?xml version="1.0" encoding="UTF-8"?> <web-app... Wire up the web service implementation ( src/main/webapp/WEB-INF/cxf-servlet.xml ): <?xml version="1.0" encoding="UTF-8"?> <beans x... Build the WAR: $ mvn clean package After the webapp is deployed (Tomcat running on port 8080), the web service (WSDL) is available via...
Previous  1 2 3 4 5 6 7 8 9 10 Next