Recent Notes

Displaying keyword search results 1 - 7
Created by Dr. Xi on April 19, 2012 10:10:08    Last update: April 19, 2012 10:11:06
The default servlet for Tomcat is declared in $CATALINA_HOME/conf/web.xml : <servlet> <servlet-name>default</servle... Therefore, static content is rendered by the default configuration unless you override it with your own definitions. If you want to allow directory listing, just change the listing parameter to true : <init-param> <param-name>listings</para... Change the welcome-file-list to display a default page in lieu of a directory listing: <welcome-file-list> <welcome-file>home.xhtml</... Welcome pages are defined at the Web application level.
Created by Fang on March 30, 2012 12:15:49    Last update: March 30, 2012 12:15:49
1. mvc:default-servlet-handler Configures a handler for serving static resources by forwarding to the Servlet container's default Servlet. Use of this handler allows using a "/" mapping with the DispatcherServlet while still utilizing the Servlet container to serve static resources. HandlerMapping: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Handler: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Attribute Description default-servlet-name The name of the default Servlet to forward to for static resource requests. The handler will try to auto-detect the container's default Servlet at startup time using a list of known names. If the default Servlet cannot be detected because of using an unknown container or because it has been manually configured, the servlet name must be set explicitly. 2. mvc:view-controller Defines a simple Controller that selects a view to render the response. HandlerMapping: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Handler: org.springframework.web.servlet.mvc.ParameterizableViewController Attribute Description...
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 .
Created by Fang on March 23, 2010 03:50:11    Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory...
Created by nogeek on July 30, 2010 23:00:06    Last update: July 30, 2010 23:01:24
It happened on Windows XP with JBoss 5.1.0.GA. This is the stack trace: 2010-07-30 16:39:52,177 ERROR [org.jboss.kernel.pl... According to " (SOLVED) JBAS-7674 solution for JBoss 5.1?? (Windows lock on jnp-service.url) ", the problem seemed to be solved for JBoss 6. In the meanwhile for JBoss 5, disabling Windows Indexing Service seemed to solve the problem. Quote from aforementioned link: It seemed that a file was being locked for some reason, and that file was obviously necessary for JBoss to start. Some further investigation (ok, I admit, I just tried to delete all of JBoss with the faith that it would fail on the locked file), it turns out that file was some file called jnp-service.url in the data directory of the default server. After downloading...
Created by Fang on September 07, 2009 16:39:37    Last update: September 07, 2009 18:43:04
It's easiest to use the archetype plugin to start a new Maven project. I'll use struts 1 as example since it's not in the built-in archetypes for archetype:generate . Generate a simple webapp with archetype:generate : C:\work\maven>mvn archetype:generate -DarchetypeAr... It generates a directory structure like this: struts1app struts1app/pom.xml struts1app/src... with a simple POM: <project xmlns="http://maven.apache.org/POM/4.0.0"... Create settings.xml in $HOME/.m2 , add Java.net repository for Java EE dependencies: <?xml version="1.0" encoding="UTF-8"?> <setting... Add Java EE and Struts dependencies in pom.xml . Note that the Java EE dependency has scope provided , meaning that the web app container provides the jars, therefore we don't need to bundle them with our war fie. <project xmlns="http://maven.apache.org/POM/4.0.0"... Create a directory named java under main , create the Struts form and...
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...