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 Changes Path 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.java 16 Jul 2001 00:44:50 -0000 1.3 +++ CheckLogonTag.java 12 Dec 2002 17:36:41 -0000 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 -0000 1.1 +++ LinkSubscriptionTag.java 12 Dec 2002 17:36:41 -0000 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 -0000 1.2 +++ LinkUserTag.java 12 Dec 2002 17:36:41 -0000 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: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>