Return-Path: X-Original-To: apmail-struts-commits-archive@minotaur.apache.org Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36A991738F for ; Sun, 14 Jun 2015 14:10:07 +0000 (UTC) Received: (qmail 62740 invoked by uid 500); 14 Jun 2015 13:39:05 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 46790 invoked by uid 500); 14 Jun 2015 13:38:40 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 19089 invoked by uid 99); 14 Jun 2015 10:53:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jun 2015 10:53:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 422DEE0006; Sun, 14 Jun 2015 10:53:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jogep@apache.org To: commits@struts.apache.org Date: Sun, 14 Jun 2015 10:53:15 -0000 Message-Id: <703f3b3869b14e6e8a0515037a9599e7@git.apache.org> In-Reply-To: <8ea811a266944f6da0ed4a02359c1866@git.apache.org> References: <8ea811a266944f6da0ed4a02359c1866@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/16] struts-examples git commit: Unify artifact names and use "-" instead of "_" http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/controlheader.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/controlheader.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/controlheader.ftl deleted file mode 100644 index 4a15058..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/controlheader.ftl +++ /dev/null @@ -1,28 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" /> - - align="${parameters.align?html}"<#t/> - -><#t/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/doubleselect.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/doubleselect.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/doubleselect.ftl deleted file mode 100644 index f923462..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/doubleselect.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/doubleselect.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /><#nt/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/file.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/file.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/file.ftl deleted file mode 100644 index cae4a2e..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/file.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/file.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close-validate.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close-validate.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close-validate.ftl deleted file mode 100644 index f129156..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close-validate.ftl +++ /dev/null @@ -1,158 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#-- -START SNIPPET: supported-validators -Only the following validators are supported: -* required validator -* requiredstring validator -* stringlength validator -* regex validator -* email validator -* url validator -* int validator -* double validator -END SNIPPET: supported-validators ---> -<#if ((parameters.validate!false == true) && (parameters.performValidation!false == true))> - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close.ftl deleted file mode 100644 index d783454..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-close.ftl +++ /dev/null @@ -1,35 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/control-close.ftl" /> -<#include "/${parameters.templateDir}/simple/form-close.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/form-close-validate.ftl" /> -<#if parameters.focusElement?if_exists != ""> - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-validate.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-validate.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-validate.ftl deleted file mode 100644 index 6597f4e..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form-validate.ftl +++ /dev/null @@ -1,31 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#if parameters.validate?default(false) == true> - - - <#if parameters.onsubmit??> - ${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.id?replace('[^a-zA-Z0-9_]', '_', 'r')}();")} - <#else> - ${tag.addParameter('onsubmit', "return validateForm_${parameters.id?replace('[^a-zA-Z0-9_]', '_', 'r')}();")} - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/form.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/form.ftl deleted file mode 100644 index 5a686dd..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/form.ftl +++ /dev/null @@ -1,33 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/form-validate.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/form-common.ftl" /> -<#if (parameters.validate?default(false))> - onreset="${parameters.onreset?default('clearErrorMessages(this);clearErrorLabels(this);')}" -<#else> - <#if parameters.onreset??> - onreset="${parameters.onreset?html}" - - -> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/control.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/head.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/head.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/head.ftl deleted file mode 100644 index e8a8fb8..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/head.ftl +++ /dev/null @@ -1,24 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> - -<#include "/${parameters.templateDir}/simple/head.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/hidden.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/hidden.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/hidden.ftl deleted file mode 100644 index 92881ab..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/hidden.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> - - - <#include "/${parameters.templateDir}/simple/hidden.ftl" /> - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/inputtransferselect.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/inputtransferselect.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/inputtransferselect.ftl deleted file mode 100644 index f25a6ab..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/inputtransferselect.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/inputtransferselect.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /><#nt/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/label.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/label.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/label.ftl deleted file mode 100644 index 8faf8d6..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/label.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/label.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/optiontransferselect.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/optiontransferselect.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/optiontransferselect.ftl deleted file mode 100644 index e1cd440..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/optiontransferselect.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/optiontransferselect.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /><#nt/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/password.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/password.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/password.ftl deleted file mode 100644 index 202da51..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/password.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/password.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/radiomap.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/radiomap.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/radiomap.ftl deleted file mode 100644 index 008de45..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/radiomap.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/radiomap.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /><#nt/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/reset.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/reset.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/reset.ftl deleted file mode 100644 index 8e6e2b5..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/reset.ftl +++ /dev/null @@ -1,31 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> - -
-<#if parameters.align??> - align="${parameters.align?html}"<#t/> - -><#t/> -<#include "/${parameters.templateDir}/simple/reset.ftl" /> -
<#t/> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/select.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/select.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/select.ftl deleted file mode 100644 index 9d07046..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/select.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/select.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/styles.css ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/styles.css b/themes_override/src/main/webapp/WEB-INF/template/xhtml/styles.css deleted file mode 100644 index dd54904..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/styles.css +++ /dev/null @@ -1,29 +0,0 @@ -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -.wwFormTable {} -.label {font-style:italic; } -.errorLabel {font-style:italic; color:red; } -.errorMessage {font-weight:bold; color:red; } -.checkboxLabel {} -.checkboxErrorLabel {color:red; } -.required {color:red;} -.tdLabel {text-align:right; vertical-align:top; } http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit-close.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit-close.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit-close.ftl deleted file mode 100644 index faa551c..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit-close.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/simple/submit-close.ftl" /> -<#t/> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit.ftl deleted file mode 100644 index 7b82921..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/submit.ftl +++ /dev/null @@ -1,29 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> - -
-<#if parameters.align??> - align="${parameters.align?html}"<#t/> - -><#t/> -<#include "/${parameters.templateDir}/simple/submit.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/text.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/text.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/text.ftl deleted file mode 100644 index 53f1647..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/text.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/text.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/textarea.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/textarea.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/textarea.ftl deleted file mode 100644 index 46f77d9..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/textarea.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/textarea.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/theme.properties ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/theme.properties b/themes_override/src/main/webapp/WEB-INF/template/xhtml/theme.properties deleted file mode 100644 index 84dc155..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/theme.properties +++ /dev/null @@ -1,21 +0,0 @@ -# -# $Id$ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -parent = simple http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/tooltip.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/tooltip.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/tooltip.ftl deleted file mode 100644 index 74938a8..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/tooltip.ftl +++ /dev/null @@ -1,41 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#if parameters.tooltip??><#t/> - <#t/> - src='<@s.url value="${parameters.tooltipIconPath}" includeParams="none" encode="false" />' - <#else><#t/> - src='<@s.url value="/struts/tooltip.gif" includeParams="none" encode="false" />' - <#t/> - <#if parameters.jsTooltipEnabled?default('false') == 'true'> - onmouseover="domTT_activate(this, event, 'content', '${parameters.tooltip}'<#t/> - <#if parameters.tooltipDelay??><#t/> - <#t/>,'delay', '${parameters.tooltipDelay}'<#t/> - <#t/> - <#t/>,'styleClass', '${parameters.tooltipCssClass?default("StrutsTTClassic")}'<#t/> - <#t/>)" /> - <#else> - title="${parameters.tooltip?html}" - alt="${parameters.tooltip?html}" /> - -<#t/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/updownselect.ftl ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/updownselect.ftl b/themes_override/src/main/webapp/WEB-INF/template/xhtml/updownselect.ftl deleted file mode 100644 index bd575f7..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/updownselect.ftl +++ /dev/null @@ -1,25 +0,0 @@ -<#-- -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ ---> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/updownselect.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /><#nt/> http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/template/xhtml/validation.js ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/template/xhtml/validation.js b/themes_override/src/main/webapp/WEB-INF/template/xhtml/validation.js deleted file mode 100644 index e63751b..0000000 --- a/themes_override/src/main/webapp/WEB-INF/template/xhtml/validation.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * $Id$ - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function clearErrorMessagesXHTML(form) { - - // get field table - var table, i, r; - for (i = 0; i < form.childNodes.length; i++) { - if (form.childNodes[i].tagName !== undefined && form.childNodes[i].tagName.toLowerCase() === 'table') { - table = form.childNodes[i]; - break; - } - } - - if (table === null) { - return; - } - - // clear out any rows with an "errorFor" attribute - var rows = table.rows; - if (rows === null){ - return; - } - - var rowsToDelete = []; - for(i = 0; i < rows.length; i++) { - r = rows[i]; - // allow blank errorFor values on dojo markup - if (r.getAttribute("errorFor") !== null) { - rowsToDelete.push(r); - } - } - - // now delete the rows - for (i = 0; i < rowsToDelete.length; i++) { - r = rowsToDelete[i]; - table.deleteRow(r.rowIndex); - //table.removeChild(rowsToDelete[i]); - } -} - -function clearErrorMessages(form) { - clearErrorMessagesXHTML(form); -} - -function clearErrorLabelsXHTML(form) { - // set all labels back to the normal class - var i, elements = form.elements; - for (i = 0; i < elements.length; i++) { - - var parentEl = elements[i]; - // search for the parent table row, abort if the form is reached - // the form may contain "non-wrapped" inputs inserted by Dojo - while (parentEl.nodeName.toUpperCase() !== "TR" && parentEl.nodeName.toUpperCase() !== "FORM") { - parentEl = parentEl.parentNode; - } - if (parentEl.nodeName.toUpperCase() === "FORM") { - parentEl = null; - } - - //if labelposition is 'top' the label is on the row above - if(parentEl && parentEl.cells) { - var labelRow = parentEl.cells.length > 1 ? parentEl : StrutsUtils.previousElement(parentEl, "tr"); - if (labelRow) { - var cells = labelRow.cells; - if (cells && cells.length >= 1) { - var label = cells[0].getElementsByTagName("label")[0]; - if (label) { - label.setAttribute("class", "label"); - label.setAttribute("className", "label"); //ie hack cause ie does not support setAttribute - } - } - } - } - } - -} - -function clearErrorLabels(form) { - clearErrorLabelsXHTML(form); -} - -function addErrorXHTML(e, errorText) { - try { - var row = (e.type ? e : e[0]); - while(row.nodeName.toUpperCase() !== "TR") { - row = row.parentNode; - } - var table = row.parentNode; - var error = document.createTextNode(errorText); - var tr = document.createElement("tr"); - var td = document.createElement("td"); - var span = document.createElement("span"); - td.align = "center"; - td.valign = "top"; - td.colSpan = 2; - span.setAttribute("class", "errorMessage"); - span.setAttribute("className", "errorMessage"); //ie hack cause ie does not support setAttribute - span.appendChild(error); - td.appendChild(span); - tr.appendChild(td); - tr.setAttribute("errorFor", e.id); - table.insertBefore(tr, row); - - // update the label too - //if labelposition is 'top' the label is on the row above - var labelRow = row.cells.length > 1 ? row : StrutsUtils.previousElement(tr, "tr"); - var label = labelRow.cells[0].getElementsByTagName("label")[0]; - if (label) { - label.setAttribute("class", "errorLabel"); - label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support setAttribute - } - } catch (err) { - alert(err); - } -} - -function addError(e, errorText) { - addErrorXHTML(e, errorText); -} - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/WEB-INF/web.xml b/themes_override/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index a5fcf75..0000000 --- a/themes_override/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,19 +0,0 @@ - - -Themes Struts 2 - - index.jsp - - - - - struts2 - org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter - - - - struts2 - /* - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/edit.jsp ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/edit.jsp b/themes_override/src/main/webapp/edit.jsp deleted file mode 100644 index bb1ef76..0000000 --- a/themes_override/src/main/webapp/edit.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - - -Struts 2 Form Tags - Edit Person - - - -

Update Information

- -

Use the form below to edit your information.

- - - - - - - - - - - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/index.jsp b/themes_override/src/main/webapp/index.jsp deleted file mode 100644 index 88209d8..0000000 --- a/themes_override/src/main/webapp/index.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - -Struts 2 Form Tags - Welcome - - -

Welcome To Struts 2!

- -

Edit your information

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes_override/src/main/webapp/thankyou.jsp ---------------------------------------------------------------------- diff --git a/themes_override/src/main/webapp/thankyou.jsp b/themes_override/src/main/webapp/thankyou.jsp deleted file mode 100644 index 7c268ef..0000000 --- a/themes_override/src/main/webapp/thankyou.jsp +++ /dev/null @@ -1,21 +0,0 @@ - -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - -Update Successful - - - -

Updated Information

- - -

Your information:

- -

Return to home page.

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/README.txt ---------------------------------------------------------------------- diff --git a/unit-testing/README.txt b/unit-testing/README.txt new file mode 100644 index 0000000..61377ee --- /dev/null +++ b/unit-testing/README.txt @@ -0,0 +1,18 @@ +This is the example project referred to in the +Struts 2 documentation, Unit Testing tutorial. +See: http://struts.apache.org. + +To build the application's war file run mvn clean package +from the project's root folder. + +As part of packaging the war file, Maven will run the unit test. + +The war file is created in the target sub-folder. + +Copy the war file to your Servlet container (e.g. Tomcat, GlassFish) and +then startup the Servlet container. + +In a web browser go to: http://localhost:8080/unit-testing/index.action. + +You should see a web page with Welcome to Struts 2! + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/pom.xml ---------------------------------------------------------------------- diff --git a/unit-testing/pom.xml b/unit-testing/pom.xml new file mode 100644 index 0000000..38ceeee --- /dev/null +++ b/unit-testing/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + struts.apache.org + struts2examples + 1.0.0 + + + unit-testing + + Unit Testing + + + unit-testing + + + war + + + + org.apache.struts + struts2-junit-plugin + ${struts2.version} + jar + test + + + javax.servlet + servlet-api + 2.4 + jar + test + + + javax.servlet + jsp-api + 2.0 + jar + test + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/java/org/apache/struts/register/action/Register.java ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/java/org/apache/struts/register/action/Register.java b/unit-testing/src/main/java/org/apache/struts/register/action/Register.java new file mode 100644 index 0000000..cbdb5e9 --- /dev/null +++ b/unit-testing/src/main/java/org/apache/struts/register/action/Register.java @@ -0,0 +1,64 @@ +package org.apache.struts.register.action; + +import com.opensymphony.xwork2.ActionSupport; +import org.apache.struts.register.model.Person; + +/** + * Acts as a controller to handle actions + * related to registering a user. + * @author bruce phillips + * + */ +public class Register extends ActionSupport { + + private static final long serialVersionUID = 1L; + + private Person personBean; + + + public String execute() throws Exception { + + //call Service class to store personBean's state in database + + return SUCCESS; + + } + + public void validate(){ + + if ( personBean.getFirstName() == null || personBean.getFirstName().length() == 0 ){ + + addFieldError( "personBean.firstName", "First name is required." ); + + } + + + if ( personBean.getEmail() == null || personBean.getEmail().length() == 0 ){ + + addFieldError( "personBean.email", "Email is required." ); + + } + + if ( personBean.getAge() < 18 ){ + + addFieldError( "personBean.age", "Age is required and must be 18 or older" ); + + } + + + } + + + public Person getPersonBean() { + + return personBean; + + } + + public void setPersonBean(Person person) { + + personBean = person; + + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/java/org/apache/struts/register/model/Person.java ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/java/org/apache/struts/register/model/Person.java b/unit-testing/src/main/java/org/apache/struts/register/model/Person.java new file mode 100644 index 0000000..3020bbb --- /dev/null +++ b/unit-testing/src/main/java/org/apache/struts/register/model/Person.java @@ -0,0 +1,62 @@ +package org.apache.struts.register.model; + + +/** + * Models a Person who registers. + * @author bruce phillips + * + */ +public class Person +{ + private String firstName; + private String lastName; + private String email; + private int age; + + public String getFirstName() + { + return firstName; + } + + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + public String getLastName() + { + return lastName; + } + + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public int getAge() + { + return age; + } + + public void setAge( int age) + { + this.age = age; + } + + + public String toString() + { + return "First Name: " + getFirstName() + " Last Name: " + getLastName() + + " Email: " + getEmail() + " Age: " + getAge() ; + } +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/resources/log4j.dtd ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/resources/log4j.dtd b/unit-testing/src/main/resources/log4j.dtd new file mode 100644 index 0000000..1aabd96 --- /dev/null +++ b/unit-testing/src/main/resources/log4j.dtd @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/resources/log4j.xml b/unit-testing/src/main/resources/log4j.xml new file mode 100644 index 0000000..2100cb2 --- /dev/null +++ b/unit-testing/src/main/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/resources/struts.xml ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/resources/struts.xml b/unit-testing/src/main/resources/struts.xml new file mode 100644 index 0000000..21cc563 --- /dev/null +++ b/unit-testing/src/main/resources/struts.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + /index.jsp + + + + + /thankyou.jsp + /register.jsp + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/webapp/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/webapp/META-INF/MANIFEST.MF b/unit-testing/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/unit-testing/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/webapp/WEB-INF/web.xml b/unit-testing/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..794e993 --- /dev/null +++ b/unit-testing/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + +Struts 2 Unit Testing + + index.jsp + + + + + struts2 + org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter + + + + struts2 + /* + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/webapp/index.jsp b/unit-testing/src/main/webapp/index.jsp new file mode 100644 index 0000000..48d3fc5 --- /dev/null +++ b/unit-testing/src/main/webapp/index.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + + +Basic Struts 2 Application - Welcome + + +

Welcome To Struts 2!

+ + + +

Please register for our prize drawing.

+ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/webapp/register.jsp ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/webapp/register.jsp b/unit-testing/src/main/webapp/register.jsp new file mode 100644 index 0000000..a4acb15 --- /dev/null +++ b/unit-testing/src/main/webapp/register.jsp @@ -0,0 +1,27 @@ + +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Register + + + +

Register for a prize by completing this form.

+ + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/main/webapp/thankyou.jsp ---------------------------------------------------------------------- diff --git a/unit-testing/src/main/webapp/thankyou.jsp b/unit-testing/src/main/webapp/thankyou.jsp new file mode 100644 index 0000000..3c845bc --- /dev/null +++ b/unit-testing/src/main/webapp/thankyou.jsp @@ -0,0 +1,19 @@ + +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Registration Successful + + +

Thank you for registering for a prize.

+ +

Your registration information:

+ +

Return to home page.

+ + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit-testing/src/test/java/org/apache/struts/register/action/RegisterTest.java ---------------------------------------------------------------------- diff --git a/unit-testing/src/test/java/org/apache/struts/register/action/RegisterTest.java b/unit-testing/src/test/java/org/apache/struts/register/action/RegisterTest.java new file mode 100644 index 0000000..ae94936 --- /dev/null +++ b/unit-testing/src/test/java/org/apache/struts/register/action/RegisterTest.java @@ -0,0 +1,80 @@ +package org.apache.struts.register.action; + + +import com.opensymphony.xwork2.ActionProxy; +import com.opensymphony.xwork2.ActionSupport; +import org.apache.struts2.StrutsTestCase; +import org.junit.Test; + +public class RegisterTest extends StrutsTestCase { + + @Test + public void testExecuteValidationPasses() throws Exception { + + request.setParameter("personBean.firstName", "Bruce"); + + request.setParameter("personBean.lastName", "Phillips"); + + request.setParameter("personBean.email", "bphillips@ku.edu"); + + request.setParameter("personBean.age", "19"); + + ActionProxy actionProxy = getActionProxy("/register.action") ; + + Register action = (Register) actionProxy.getAction(); + + assertNotNull("The action is null but should not be.", action); + + String result = actionProxy.execute(); + + assertEquals("The execute method did not return " + ActionSupport.SUCCESS + " but should have.", ActionSupport.SUCCESS, result); + + } + + @Test + public void testExecuteValidationFailsMissingFirstName() throws Exception { + + request.setParameter("personBean.firstName", "Bruce"); + + request.setParameter("personBean.lastName", "Phillips"); + + request.setParameter("personBean.email", "bphillips@ku.edu"); + + request.setParameter("personBean.age", "17"); + + ActionProxy actionProxy = getActionProxy("/register.action") ; + + Register action = (Register) actionProxy.getAction(); + + assertNotNull("The action is null but should not be.", action); + + String result = actionProxy.execute(); + + assertEquals("The execute method did not return " + ActionSupport.INPUT + " but should have.", ActionSupport.INPUT, result); + + } + + + @Test + public void testExecuteValidationFailsAgeToYoung() throws Exception { + + + request.setParameter("personBean.lastName", "Phillips"); + + request.setParameter("personBean.email", "bphillips@ku.edu"); + + request.setParameter("personBean.age", "19"); + + ActionProxy actionProxy = getActionProxy("/register.action") ; + + Register action = (Register) actionProxy.getAction(); + + assertNotNull("The action is null but should not be.", action); + + String result = actionProxy.execute(); + + assertEquals("The execute method did not return " + ActionSupport.INPUT + " but should have.", ActionSupport.INPUT, result); + + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit_testing/README.txt ---------------------------------------------------------------------- diff --git a/unit_testing/README.txt b/unit_testing/README.txt deleted file mode 100644 index 73a9989..0000000 --- a/unit_testing/README.txt +++ /dev/null @@ -1,18 +0,0 @@ -This is the example project referred to in the -Struts 2 documentation, Unit Testing tutorial. -See: http://struts.apache.org. - -To build the application's war file run mvn clean package -from the project's root folder. - -As part of packaging the war file, Maven will run the unit test. - -The war file is created in the target sub-folder. - -Copy the war file to your Servlet container (e.g. Tomcat, GlassFish) and -then startup the Servlet container. - -In a web browser go to: http://localhost:8080/unit_testing/index.action. - -You should see a web page with Welcome to Struts 2! - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit_testing/pom.xml ---------------------------------------------------------------------- diff --git a/unit_testing/pom.xml b/unit_testing/pom.xml deleted file mode 100644 index 624d0ee..0000000 --- a/unit_testing/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - struts.apache.org - struts2examples - 1.0.0 - - - unit_testing - - Unit Testing - - - unit_testing - - - war - - - - org.apache.struts - struts2-junit-plugin - ${struts2.version} - jar - test - - - javax.servlet - servlet-api - 2.4 - jar - test - - - javax.servlet - jsp-api - 2.0 - jar - test - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit_testing/src/main/java/org/apache/struts/register/action/Register.java ---------------------------------------------------------------------- diff --git a/unit_testing/src/main/java/org/apache/struts/register/action/Register.java b/unit_testing/src/main/java/org/apache/struts/register/action/Register.java deleted file mode 100644 index 3a7f662..0000000 --- a/unit_testing/src/main/java/org/apache/struts/register/action/Register.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.apache.struts.register.action; - -import org.apache.struts.register.model.Person; - -import com.opensymphony.xwork2.ActionSupport; - -/** - * Acts as a controller to handle actions - * related to registering a user. - * @author bruce phillips - * - */ -public class Register extends ActionSupport { - - private static final long serialVersionUID = 1L; - - private Person personBean; - - - public String execute() throws Exception { - - //call Service class to store personBean's state in database - - return SUCCESS; - - } - - public void validate(){ - - if ( personBean.getFirstName() == null || personBean.getFirstName().length() == 0 ){ - - addFieldError( "personBean.firstName", "First name is required." ); - - } - - - if ( personBean.getEmail() == null || personBean.getEmail().length() == 0 ){ - - addFieldError( "personBean.email", "Email is required." ); - - } - - if ( personBean.getAge() < 18 ){ - - addFieldError( "personBean.age", "Age is required and must be 18 or older" ); - - } - - - } - - - public Person getPersonBean() { - - return personBean; - - } - - public void setPersonBean(Person person) { - - personBean = person; - - } - -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/unit_testing/src/main/java/org/apache/struts/register/model/Person.java ---------------------------------------------------------------------- diff --git a/unit_testing/src/main/java/org/apache/struts/register/model/Person.java b/unit_testing/src/main/java/org/apache/struts/register/model/Person.java deleted file mode 100644 index 3020bbb..0000000 --- a/unit_testing/src/main/java/org/apache/struts/register/model/Person.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.apache.struts.register.model; - - -/** - * Models a Person who registers. - * @author bruce phillips - * - */ -public class Person -{ - private String firstName; - private String lastName; - private String email; - private int age; - - public String getFirstName() - { - return firstName; - } - - public void setFirstName(String firstName) - { - this.firstName = firstName; - } - - public String getLastName() - { - return lastName; - } - - public void setLastName(String lastName) - { - this.lastName = lastName; - } - - public String getEmail() - { - return email; - } - - public void setEmail(String email) - { - this.email = email; - } - - public int getAge() - { - return age; - } - - public void setAge( int age) - { - this.age = age; - } - - - public String toString() - { - return "First Name: " + getFirstName() + " Last Name: " + getLastName() + - " Email: " + getEmail() + " Age: " + getAge() ; - } -}