Displaying keyword search results 71 - 80
Created by Dr. Xi on February 12, 2010 22:39:15 Last update: February 12, 2010 22:39:15
When you start Tomcat for the first time, you may get the "port 8080 is already in use" error. Indeed, port 8080 is commonly used by a lot of development servers by default (Oracle XE for another example). Luckily, it's quite easy to ask Tomcat to use a different port. I use port 8086, which is a natural next step and superior to 8080. Simply edit $CATALINA_BASE/conf/server.xml and change 8080 to 8086:
<!-- A "Connector" represents an endpoint by w...If you have not configured Tomcat 6 for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME , the directory into which you have installed Tomcat 6.
Created by Dr. Xi on February 11, 2010 00:04:02 Last update: February 11, 2010 00:04:02
Servlet container initializes this servlet when it starts up. The content of this element must be a positive integer indicating the order in which the servlet should be loaded. Lower integers are loaded before higher integers. If no value is specified, or if the value specified is not a positive integer, the servlet can be loaded in any order in the startup sequence. In this example, Struts is loaded before cms:
<!-- Struts action servlet setup --> ...
Created by Dr. Xi on February 10, 2010 23:48:23 Last update: February 10, 2010 23:49:13
Servlet mapping examples in web.xml. Struts:
<!-- Struts action servlet setup --> ...Spring:
<servlet> <servlet-name>springapp</...JSF myfaces:
<servlet> <servlet-name>Faces Servl...
Created by Dr. Xi on February 10, 2010 23:39:37 Last update: February 10, 2010 23:39:37
Example web.xml that includes most frequently used elements. This sample is for Servlet Specification 2.4.
<?xml version="1.0" encoding="UTF-8"?> <web-ap...
Created by Fang on August 22, 2009 21:48:12 Last update: January 10, 2010 00:29:08
The POM (Project Object Model, pom.xml ) is at the heart of all Maven builds. It tells Maven how to build your project, just like build.xml for Ant. This is a POM for a simple Hello World project:
<project xmlns="http://maven.apache.org/POM/4.0.0"...Not much can be inferred from the POM file alone, because lots of information is implied . For example, packaging defaults to jar , which means that if nothing is specified, Maven compiles all java files under src/main/java and creates a jar . All Maven POMs inherit from a base Super POM. To see the effective POM for your project, type mvn help:effective-pom :
C:\maven\hello-world>mvn help:effective-pomBelow is the Super POM for Maven 2.0.x.
<project> <modelVersion>4.0.0</modelVersion> ...
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 April 30, 2009 23:26:13 Last update: May 01, 2009 17:08:49
ApplicationResources.properties contains these keys:
test.key.1 = Test Key One test.key.2 = Test Key...Struts (struts-el):
<%@ page contentType="text/html;charset=UTF-8" lan...JSTL
<%@ page contentType="text/html;charset=UTF-8" lan...However, the values for one and two must be passed in from pageScope , requestScope , sessionScope , etc. Values defined by struts bean:define are not interpreted. Important: JSTL tags work with servlet spec 2.4 only. So your web.xml must start with this:
<?xml version = '1.0' encoding = 'windows-1252'?> ...Not this:
<?xml version = '1.0' encoding = 'windows-1252'?> ...However, the latter does work with struts-el tags.
Created by Dr. Xi on November 06, 2008 20:11:19 Last update: March 13, 2009 21:37:36
To run a web app in Oracle Application Server with precompiled JSPs (therefore, not recompiling a JSP when requested), add the following servlet section to web.xml:
<?xml version="1.0" encoding="iso-8859-1"?> <we...Or, uncomment the relevant section in $ORACLE_HOME/j2ee/OC4J_INST/config/global-web-application.xml :
Created by Dr. Xi on October 23, 2008 03:54:04 Last update: October 23, 2008 03:57:44
Add validator plugin in struts-config.xml
<struts-config> . . . ...Set validate="true" on action form
<struts-config> <!-- ========== Form Bean De...Add validation rules in validation.xml
<?xml version='1.0' encoding='windows-1252'?> <...If you override validate , make sure super.validate is called.
package com.example; import javax.servlet.h...Read the documentation: http://struts.apache.org/1.2.4/userGuide/dev_validator.html
Created by Dr. Xi on October 15, 2008 19:49:31 Last update: October 15, 2008 19:49:31
<?xml version="1.0"?> <project name="OC4JDe...Deployment properties:
# Deployment properties targetenv=Development ...