cvs commit: jakarta-struts/src/example/org/apache/struts/webapp/example CheckLogonTag.java

2004-03-12 Thread husted
husted  2004/03/12 21:23:39

  Modified:src/example/org/apache/struts/webapp/example
CheckLogonTag.java
  Log:
  Refine MainMenu and CheckLogon
  
  Revision  ChangesPath
  1.11  +23 -109   
jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java
  
  Index: CheckLogonTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CheckLogonTag.java13 Jan 2004 12:48:44 -  1.10
  +++ CheckLogonTag.java13 Mar 2004 05:23:39 -  1.11
  @@ -3,63 +3,20 @@
* $Revision$
* $Date$
*
  - * 
  - *
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *notice, this list of conditions and the following disclaimer in
  - *the documentation and/or other materials provided with the
  - *distribution.
  - *
  - * 3. The end-user documentation included with the redistribution, if
  - *any, must include the following acknowledgement:
  - *   "This product includes software developed by the
  - *Apache Software Foundation (http://www.apache.org/)."
  - *Alternately, this acknowlegement may appear in the software itself,
  - *if and wherever such third-party acknowlegements normally appear.
  - *
  - * 4. The names "The Jakarta Project", "Struts", and "Apache Software
  - *Foundation" must not be used to endorse or promote products derived
  - *from this software without prior written permission. For written
  - *permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache"
  - *nor may "Apache" appear in their name, without prior written
  - *permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * 
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * .
  + * Copyright 2000-2004 Apache Software Foundation
*
  + * Licensed 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.
*/
  -
  -
   package org.apache.struts.webapp.example;
   
   
  @@ -78,7 +35,6 @@
*
* @version $Revision$ $Date$
*/
  -
   public final class CheckLogonTag extends TagSupport {
   
   
  @@ -92,56 +48,15 @@
   
   
   /**
  - * The page to which we should forward for the user to log on.
  - */
  -private String page = "/logon.jsp";
  -
  -
  -// --- Properties
  -
  -
  -/**
  - * Return the bean name.
  - */
  -public String getName() {
  -
  -return (this.name);
  -
  -}
  -
  -
  -/**
  - * Set the bean name.
  - *
  - * @param name The new bean name
  + * Path to use if a login is needed.

cvs commit: jakarta-struts/src/example/org/apache/struts/webapp/example CheckLogonTag.java LinkSubscriptionTag.java LinkUserTag.java RegistrationForm.java SaveSubscriptionAction.java

2003-01-18 Thread craigmcc
craigmcc2003/01/18 11:48:57

  Modified:src/example/org/apache/struts/webapp/example
CheckLogonTag.java LinkSubscriptionTag.java
LinkUserTag.java RegistrationForm.java
SaveSubscriptionAction.java
  Log:
  Remove unused imports in Struts example webapp.
  
  PR: Bugzilla #16064
  Submitted by: Nayah Hajratwala 
  
  Revision  ChangesPath
  1.7   +4 -9  
jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java
  
  Index: CheckLogonTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CheckLogonTag.java11 Jan 2003 03:08:23 -  1.6
  +++ CheckLogonTag.java18 Jan 2003 19:48:56 -  1.7
  @@ -63,14 +63,9 @@
   package org.apache.struts.webapp.example;
   
   
  -import java.io.IOException;
   import javax.servlet.http.HttpSession;
   import javax.servlet.jsp.JspException;
  -import javax.servlet.jsp.JspWriter;
  -import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.TagSupport;
  -import org.apache.struts.action.Action;
  -import org.apache.struts.util.MessageResources;
   import org.apache.struts.config.ModuleConfig;
   
   
  
  
  
  1.5   +4 -5  
jakarta-struts/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java
  
  Index: LinkSubscriptionTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LinkSubscriptionTag.java  11 Jan 2003 03:08:23 -  1.4
  +++ LinkSubscriptionTag.java  18 Jan 2003 19:48:56 -  1.5
  @@ -68,7 +68,6 @@
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.jsp.JspException;
   import javax.servlet.jsp.JspWriter;
  -import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.ResponseUtils;
  
  
  
  1.6   +4 -5  
jakarta-struts/src/example/org/apache/struts/webapp/example/LinkUserTag.java
  
  Index: LinkUserTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/LinkUserTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LinkUserTag.java  11 Jan 2003 03:08:23 -  1.5
  +++ LinkUserTag.java  18 Jan 2003 19:48:56 -  1.6
  @@ -68,7 +68,6 @@
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.jsp.JspException;
   import javax.servlet.jsp.JspWriter;
  -import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.ResponseUtils;
  
  
  
  1.7   +4 -5  
jakarta-struts/src/example/org/apache/struts/webapp/example/RegistrationForm.java
  
  Index: RegistrationForm.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/RegistrationForm.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RegistrationForm.java 11 Jan 2003 03:08:23 -  1.6
  +++ RegistrationForm.java 18 Jan 2003 19:48:56 -  1.7
  @@ -66,7 +66,6 @@
   import javax.servlet.http.HttpServletRequest;
   import org.apache.struts.action.ActionError;
   import org.apache.struts.action.ActionErrors;
  -import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.validator.ValidatorForm;
   
  
  
  
  1.13  +4 -6  
jakarta-struts/src/example/org/apache/struts/webapp/example/SaveSubscriptionAction.java
  
  Index: SaveSubscriptionAction.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/SaveSubscriptionAction.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SaveSubscriptionAction.java   11 Jan 2003 03:08:23 -  1.12
  +++ SaveSubscriptionAction.java   18 Jan 2003 19:48:56 -  1.13
  @@ -73,8 +73,6 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.struts.action.Action;
  -import org.apache.struts.action.ActionError;
  -import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
  
  
  

--
To unsubscribe, e-mail

cvs commit: jakarta-struts/src/example/org/apache/struts/webapp/example CheckLogonTag.java LinkSubscriptionTag.java LinkUserTag.java

2002-12-12 Thread ekbush
ekbush  2002/12/12 09:36:41

  Modified:src/example/org/apache/struts/webapp/example
CheckLogonTag.java LinkSubscriptionTag.java
LinkUserTag.java
  Log:
  Updated example tags to conform to current standards.  I modified Jim's
  suggested fix only slightly - changing ApplicationConfig to ModuleConfig - but
  he still gets the credit for the fix.
  PR: 12311
  Submitted by: [EMAIL PROTECTED] (Jim Bonanno)
  
  Revision  ChangesPath
  1.4   +9 -6  
jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java
  
  Index: CheckLogonTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/CheckLogonTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CheckLogonTag.java16 Jul 2001 00:44:50 -  1.3
  +++ CheckLogonTag.java12 Dec 2002 17:36:41 -  1.4
  @@ -71,6 +71,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.action.Action;
   import org.apache.struts.util.MessageResources;
  +import org.apache.struts.config.ModuleConfig;
   
   
   /**
  @@ -181,8 +182,10 @@
if (valid)
return (EVAL_PAGE);
else {
  - try {
  - pageContext.forward(page);
  +ModuleConfig config = (ModuleConfig) pageContext.getRequest()
  +.getAttribute(org.apache.struts.Globals.MODULE_KEY);
  +try {
  + pageContext.forward(config.getPrefix() + page);
} catch (Exception e) {
throw new JspException(e.toString());
}
  
  
  
  1.2   +8 -4  
jakarta-struts/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java
  
  Index: LinkSubscriptionTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LinkSubscriptionTag.java  11 Apr 2001 02:10:00 -  1.1
  +++ LinkSubscriptionTag.java  12 Dec 2002 17:36:41 -  1.2
  @@ -72,6 +72,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.config.ModuleConfig;
   
   
   /**
  @@ -166,9 +167,12 @@
   public int doStartTag() throws JspException {
   
// Generate the URL to be encoded
  +ModuleConfig config = (ModuleConfig) pageContext.getRequest()
  +.getAttribute(org.apache.struts.Globals.MODULE_KEY);
   HttpServletRequest request =
 (HttpServletRequest) pageContext.getRequest();
   StringBuffer url = new StringBuffer(request.getContextPath());
  + url.append(config.getPrefix());
   url.append(page);
Subscription subscription = null;
try {
  
  
  
  1.3   +8 -4  
jakarta-struts/src/example/org/apache/struts/webapp/example/LinkUserTag.java
  
  Index: LinkUserTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/LinkUserTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LinkUserTag.java  14 Apr 2001 12:53:08 -  1.2
  +++ LinkUserTag.java  12 Dec 2002 17:36:41 -  1.3
  @@ -72,6 +72,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.config.ModuleConfig;
   
   
   /**
  @@ -166,9 +167,12 @@
   public int doStartTag() throws JspException {
   
// Generate the URL to be encoded
  +ModuleConfig config = (ModuleConfig) pageContext.getRequest()
  +.getAttribute(org.apache.struts.Globals.MODULE_KEY);
   HttpServletRequest request =
   (HttpServletRequest) pageContext.getRequest();
   StringBuffer url = new StringBuffer(request.getContextPath());
  + url.append(config.getPrefix());
   url.append(page);
User user = null;
try {
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: