Displaying keyword search results 41 - 49
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 March 08, 2009 20:42:32 Last update: March 08, 2009 20:43:17
encoding : The 'encoding' option tells Vim the encoding of the characters that you use. This applies to the text in buffers (files you are editing), registers, Vim script files, etc. For example: :set encoding=utf-8 You need to use an appropriate font to display Non-ASCII characters: X Windows: :set guifont=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 Win32: :set guifont=courier_new:h12 , or select one from the Edit/Select Font... menu termencoding : Encoding used for the terminal. For the Win32 GUI 'termencoding' is not used for typed characters, because the Win32 system always passes Unicode characters. fileencoding : When you edit a file, vim tries to detect what kind of file you are editing. It uses the encoding names in the ' fileencodings ' option. When using Unicode, the default value is: "ucs-bom,utf-8,latin1"....
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 December 12, 2007 20:30:01 Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf :
LoadModule python_module modules/mod_python.so ...Python script:
import time, os from os.path import basename ...
Created by Dr. Xi on November 15, 2007 04:40:44 Last update: November 15, 2007 04:40:44
Here's some simple Ajax code. The Ajax response is delivered as XML with attributes and an array of data payloads contained in CDATA sections:
// ajax.js function ajaxGet(url, ajaxCallback) ...And the HTML test code:
Created by Dr. Xi on August 10, 2007 21:05:26 Last update: August 10, 2007 21:05:26
<?xml version="1.0" encoding="UTF-8"?> <xsl...
Created by Dr. Xi on May 08, 2007 23:09:39 Last update: May 08, 2007 23:13:07
First create a resource provider for Oracle AQ in orion-application.xml:
<?xml version = '1.0' encoding = 'windows-1252...Then, hook up the EJB to the queue in orion-ejb-jar.xml:
<?xml version = '1.0' encoding = 'windows-1252...Make sure the resource names ('rsname') match among the xml files. Full information is available from the Oracle document titled "Oracle Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0)". Look at Appendix A.