Tomcat4

2001-04-19 Thread Ali Ozoren

Hi- has anyone got tomcat4 and cocoon work together.. I'm getting
java.lang.ClassCastException when trying to run an xsp page. It works fine
with tomcat3.2.1. any clue?
Thanks --a





cvs commit: jakarta-struts build.xml

2001-04-19 Thread craigmcc

craigmcc01/04/19 17:43:16

  Modified:.build.xml
  Log:
  Add "description" attributes on the targets that are designed to be executed
  directly, so that
  
ant -projecthelp
  
  provides a nice summary.  Removed the "targets" target, which is now redundant.
  
  Revision  ChangesPath
  1.47  +19 -32jakarta-struts/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-struts/build.xml,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- build.xml 2001/03/23 19:22:13 1.46
  +++ build.xml 2001/04/20 00:43:16 1.47
  @@ -16,10 +16,9 @@
   
   
   
  -
  +
   
  -
  +
   
   
   
   
  -
  +
   
   
   
  -
  +
   
   
  -
  +
   
   
   
  @@ -314,7 +318,8 @@
   
  -
  +
   
   
   
  @@ -342,35 +347,17 @@
   
   
   
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  +
   
   
   
   
  -
  +
   
   
  
  
  



cvs commit: jakarta-struts build.bat build.sh

2001-04-19 Thread craigmcc

craigmcc01/04/19 17:33:31

  Removed: .build.bat build.sh
  Log:
  Remove the "build.bat" and "build.sh" scripts, which are no longer
  required to build Struts if you have followed the installation procedures.
  In particular, you will need to have customized your "build.properties"
  file, and added $ANT_HOME/bin to your PATH environment variable.
  
  Now, to build Struts, you execute things like:
  
ant clean dist
  
  on all platforms.



cvs commit: jakarta-struts .cvsignore

2001-04-19 Thread craigmcc

craigmcc01/04/19 17:30:16

  Modified:..cvsignore
  Log:
  Add the "dist" directory to the list of ignored stuff.
  
  Revision  ChangesPath
  1.4   +1 -0  jakarta-struts/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/jakarta-struts/.cvsignore,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- .cvsignore2001/03/23 19:22:12 1.3
  +++ .cvsignore2001/04/20 00:30:16 1.4
  @@ -1,2 +1,3 @@
   build.properties
  +dist
   target
  
  
  



cvs commit: jakarta-struts/doc struts-html.xml

2001-04-19 Thread craigmcc

craigmcc01/04/19 17:26:52

  Modified:doc  struts-html.xml
  Log:
  Add a warning that using  will disable the
  standard cancellation detection that is performed by the controller
  servlet and the Action.isCancelled() method.
  
  In general, this attribute should not be used.  However, in the interest
  of maintaining backwards compatibility, I'm not removing it.
  
  PR:  Bugzilla #1291
  Submitted by:  Scott Cressler <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.6   +5 -0  jakarta-struts/doc/struts-html.xml
  
  Index: struts-html.xml
  ===
  RCS file: /home/cvs/jakarta-struts/doc/struts-html.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- struts-html.xml   2001/04/18 23:10:21 1.5
  +++ struts-html.xml   2001/04/20 00:26:52 1.6
  @@ -442,6 +442,11 @@
   
   Name of the request parameter that will be included with this
   submission, set to the specified value.
  +WARNING - If you set this attribute to a
  +value other than the default, this will NOT be
  +recognized as the cancel key by the Struts controller servlet
  +or the Action.isCancelled() method.  You will
  +need to do your own cancel detection.
   
   
   
  
  
  



session.invalidate() - IllegalStateException

2001-04-19 Thread Ted Bergeron

I am trying to implement a logout in my struts app.  I was using Tomcat 4.0
beta, but have moved to Resin 1.2.5. My problem occurs in both app servers.

The following code works fine until I reach the .

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>

<%
out.println("Session id is " + session.getId());
if (!session.isNew()) {
out.println("Your Session is OLD. I will invalidate it
here.");
try {
session.invalidate(); // They are here to login.  Kill any prior
sessions before login.
} catch (IllegalStateException e) {
out.println("I had an exception");
}
}

try {
session.setAttribute("lastPageAccessed", "Login");
} catch (IllegalStateException e) {
session = request.getSession(true);
session.setAttribute("lastPageAccessed", "Login");
}
%>


<%-- The following will cause:
500 Servlet Exception
java.lang.IllegalStateException: session is invalid
at com.caucho.server.http.QSession.getAttribute(QSession.java:247)
at org.apache.struts.taglib.html.HtmlTag.currentLocale(HtmlTag.java:219)
at org.apache.struts.taglib.html.HtmlTag.doStartTag(HtmlTag.java:137)
at _jsp._test__jsp._jspService(/test.jsp:30)
at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at com.caucho.jsp.Page.service(Page.java:407)
at com.caucho.server.http.Invocation.service(Invocation.java:285)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:238)
at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
--%>




The code in the taglib reads:

--
protected Locale currentLocale() {

// Create a new session if necessary
HttpSession session = pageContext.getSession();
if (locale && (session == null))
session =
((HttpServletRequest)
pageContext.getRequest()).getSession();
if (session == null)
return (null);

// Return any currently set Locale in our session
//Line 219:
  Locale current = (Locale) session.getAttribute(Action.LOCALE_KEY);


-





cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html FormTag.java

2001-04-19 Thread craigmcc

craigmcc01/04/19 15:58:40

  Modified:src/share/org/apache/struts/taglib/html FormTag.java
  Log:
  When an ActionForm bean instance is created inside the form tag (because
  it was not already there as a result of an Action placing it there), call
  the setServlet() method on this bean so that the bean has access to all of
  the facilities provided by ActionServlet.
  
  PR: Bugzilla #1289
  Submitted by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.10  +18 -4 
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
  
  Index: FormTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FormTag.java  2001/04/18 23:51:30 1.9
  +++ FormTag.java  2001/04/19 22:58:40 1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v 1.9 
2001/04/18 23:51:30 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/04/18 23:51:30 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v 1.10 
2001/04/19 22:58:40 craigmcc Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/04/19 22:58:40 $
*
* 
*
  @@ -72,10 +72,12 @@
   import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.action.Action;
  +import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionFormBean;
   import org.apache.struts.action.ActionFormBeans;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.action.ActionMappings;
  +import org.apache.struts.action.ActionServlet;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.ResponseUtils;
   
  @@ -85,7 +87,7 @@
* properties correspond to the various fields of the form.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.9 $ $Date: 2001/04/18 23:51:30 $
  + * @version $Revision: 1.10 $ $Date: 2001/04/19 22:58:40 $
*/
   
   public class FormTag extends TagSupport {
  @@ -159,6 +161,14 @@
   
   
   /**
  + * The ActionServlet instance we are associated with (so that we can
  + * initialize the servlet property on any form bean that
  + * we create).
  + */
  +protected ActionServlet servlet = null;
  +
  +
  +/**
* The style attribute associated with this tag.
*/
   protected String style = null;
  @@ -516,6 +526,8 @@
try {
Class clazz = Class.forName(type);
bean = clazz.newInstance();
  +if (bean instanceof ActionForm)
  +((ActionForm) bean).setServlet(servlet);
} catch (Exception e) {
throw new JspException
(messages.getMessage("formTag.create", type,
  @@ -588,6 +600,7 @@
onreset = null;
onsubmit = null;
scope = "session";
  +servlet = null;
style = null;
styleClass = null;
target = null;
  @@ -735,6 +748,7 @@
   // Calculate the required values
   name = mapping.getName();
   scope = mapping.getScope();
  +servlet = mappings.getServlet();
   type = formBean.getType();
   
   }
  
  
  



cvs commit: jakarta-struts/web/example tour.htm

2001-04-19 Thread craigmcc

craigmcc01/04/19 15:29:21

  Modified:web/example tour.htm
  Log:
  Reflect the fact that the password field on logon.jsp has
  redisplay=false selected.
  
  PR: Bugzilla #1222
  Submitted by:  Mark Nelson <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.5   +1 -2  jakarta-struts/web/example/tour.htm
  
  Index: tour.htm
  ===
  RCS file: /home/cvs/jakarta-struts/web/example/tour.htm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tour.htm  2001/04/11 02:08:49 1.4
  +++ tour.htm  2001/04/19 22:29:19 1.5
  @@ -169,8 +169,7 @@
 The page address is now logon.do rather than login.jsp. 
 Struts will
   display a validation-error above the logon form. 
  -  Whatever username and/or
  -password you entered before is defaulted on the form.
  +  Whatever username you entered before is defaulted on the form.
   
   Pretty cool, but how does it work?
   struts-config.xml and LogonForm.java
  
  
  



cvs commit: jakarta-struts/doc struts-logic.xml

2001-04-19 Thread craigmcc

craigmcc01/04/19 14:25:05

  Modified:doc  struts-logic.xml
  Log:
  Correct a usage example on the iterate tag.
  
  PR: Bugzilla #1184
  Submitted by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.5   +1 -1  jakarta-struts/doc/struts-logic.xml
  
  Index: struts-logic.xml
  ===
  RCS file: /home/cvs/jakarta-struts/doc/struts-logic.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- struts-logic.xml  2001/04/18 22:04:59 1.4
  +++ struts-logic.xml  2001/04/19 21:25:04 1.5
  @@ -427,7 +427,7 @@
   So, if you wish to iterate over the values of a Hashtable, you would
   implement code like the following:
   
  -
  +
 Next element is 
   
   
  
  
  



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html OptionsTag.java

2001-04-19 Thread craigmcc

craigmcc01/04/19 14:20:36

  Modified:src/share/org/apache/struts/taglib/html OptionsTag.java
  Log:
  Filter the label text of generated options for characters that are
  sensitive in HTML.
  
  PR: Bugzilla #1177
  Submitted by:  [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.6   +1 -1  
jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java
  
  Index: OptionsTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OptionsTag.java   2001/04/18 23:51:31 1.5
  +++ OptionsTag.java   2001/04/19 21:20:34 1.6
  @@ -295,7 +295,7 @@
   if (matched)
   sb.append(" selected");
   sb.append(">");
  -sb.append(label);
  +sb.append(ResponseUtils.filter(label));
   sb.append("\r\n");
   
   }
  
  
  



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html ImgTag.java

2001-04-19 Thread craigmcc

craigmcc01/04/19 14:14:00

  Modified:src/share/org/apache/struts/taglib/html ImgTag.java
  Log:
  Correct a bug setting the "usemap" attribute.
  
  PR: Bugzilla #1159
  Submitted by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.9   +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java
  
  Index: ImgTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ImgTag.java   2001/04/03 19:18:59 1.8
  +++ ImgTag.java   2001/04/19 21:13:58 1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.8 
2001/04/03 19:18:59 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/04/03 19:18:59 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.9 
2001/04/19 21:13:58 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/04/19 21:13:58 $
*
* 
*
  @@ -97,7 +97,7 @@
*
* @author Michael Westbay
* @author Craig McClanahan
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
*/
   
   public class ImgTag extends BaseHandlerTag {
  @@ -444,7 +444,7 @@
   return (this.usemap);
   }
   
  -public void setUsemap(String Usemap) {
  +public void setUsemap(String usemap) {
   this.usemap = usemap;
   }
   
  
  
  



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html ImageTag.java

2001-04-19 Thread craigmcc

craigmcc01/04/19 14:09:31

  Modified:src/share/org/apache/struts/taglib/html ImageTag.java
  Log:
  Correctly save the value of the altKey property setter.
  
  PR: Bugzilla #1155
  Submitted by: Howard Moore <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.8   +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java
  
  Index: ImageTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ImageTag.java 2001/04/03 19:18:59 1.7
  +++ ImageTag.java 2001/04/19 21:09:30 1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v 1.7 
2001/04/03 19:18:59 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/04/03 19:18:59 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v 1.8 
2001/04/19 21:09:30 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/04/19 21:09:30 $
*
* 
*
  @@ -81,7 +81,7 @@
* Tag for input fields of type "image".
*
* @author Oleg V Alexeev
  - * @version $Revision: 1.7 $ $Date: 2001/04/03 19:18:59 $
  + * @version $Revision: 1.8 $ $Date: 2001/04/19 21:09:30 $
*/
   
   public class ImageTag extends SubmitTag {
  @@ -123,7 +123,7 @@
   }
   
   public void setAltKey(String altKey) {
  -this.altKey = null;
  +this.altKey = altKey;
   }