Multipart/Form-Data with Struts 1

2010-10-05 Thread DavidZaz

I have a legacy application using Struts 1.2.8 and I have the following HTML
form:

html:form action=/myAction.do method=post
enctype=multipart/form-data
 html-el:textarea property=userEnteredHtml styleClass=tinyMCE
styleId=tinymce/html-el:textarea
/html:form

If I include multiple blank lines in the tinyMCE editor, the generated HTML
should be:

pnbsp;/p

However, IE posts the following HTML:

p /p

At first glance, I thought that this was exclusively a tinyMCE problem and I
posted on their forum. However, the problem goes away when I remove the
enctype=multipart/form-data from the html:form declaration. Does Struts 1
do anything unusual with the enctype multipart/form-data attribute? It does
not seem that other tinyMCE editor users are experiencing this issue (since
they probably aren't using Struts 1).

Is there any alternative to using multipart/form-data? My form does include
a file upload which is why I initially added the multipart/form-data.
-- 
View this message in context: 
http://old.nabble.com/Multipart-Form-Data-with-Struts-1-tp2988p2988.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Multipart/Form-Data with Struts 1

2010-10-05 Thread DavidZaz

Yes, it only occurs under Internet Explorer. I've reproduced with IE 7 and 8.


Dave Newton-6 wrote:
 
 If you're uploading a file, the form must be multipart.
 
 Which version of IE? Is it only under IE that it happens?
 
 Dave
 
 On Tue, Oct 5, 2010 at 10:16 AM, DavidZaz dzaze...@cait.org wrote:
 

 I have a legacy application using Struts 1.2.8 and I have the following
 HTML
 form:

 html:form action=/myAction.do method=post
 enctype=multipart/form-data
 html-el:textarea property=userEnteredHtml styleClass=tinyMCE
 styleId=tinymce/html-el:textarea
 /html:form

 If I include multiple blank lines in the tinyMCE editor, the generated
 HTML
 should be:

 pnbsp;/p

 However, IE posts the following HTML:

 p /p

 At first glance, I thought that this was exclusively a tinyMCE problem
 and
 I
 posted on their forum. However, the problem goes away when I remove the
 enctype=multipart/form-data from the html:form declaration. Does Struts
 1
 do anything unusual with the enctype multipart/form-data attribute? It
 does
 not seem that other tinyMCE editor users are experiencing this issue
 (since
 they probably aren't using Struts 1).

 Is there any alternative to using multipart/form-data? My form does
 include
 a file upload which is why I initially added the multipart/form-data.
 --
 View this message in context:
 http://old.nabble.com/Multipart-Form-Data-with-Struts-1-tp2988p2988.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 

-- 
View this message in context: 
http://old.nabble.com/Multipart-Form-Data-with-Struts-1-tp2988p29887895.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Release Notes for Struts 2.2

2010-08-25 Thread DavidZaz

I was looking for the Release Notes/What's New for Struts 2.2 on the
following page:

http://struts.apache.org/download.cgi#struts221

The Release Notes link takes me to:

http://struts.apache.org/2.2.1/version-notes-221.html

which is a broken link 404 page.

Does anyone have the correct link to the Struts 2.2 Release Notes? Could the
link be fixed on the main struts page?

Thanks!
-- 
View this message in context: 
http://old.nabble.com/Release-Notes-for-Struts-2.2-tp29535307p29535307.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with Exception Interceptor

2010-02-04 Thread DavidZaz

I have an exception interceptor declared in my struts.xml, but no log
messages ever appear in the log category that I specified. In my struts.xml,
I have the following:

package name=default extends=struts-default
   interceptor-stack name=defaultStack
  interceptor-ref name=exception
true
error.unhandled
WARN
  /interceptor-ref
   /interceptor-stack
/package

In my log4j.xml file, I have the following logger configured:

appender name=CONSOLE class=org.apache.log4j.ConsoleAppender
layout class=org.apache.log4j.PatternLayout

/layout
/appender
logger name=error.unhandled
level value=DEBUG/
appender-ref ref=CONSOLE /
/logger

When I run my application and throw an unhandled exception, the log4j logger
does not print the exception to my appender. As a test, I wrote the
following code into one of my actions:

org.apache.log4j.Logger myLogger =
org.apache.log4j.Logger.getLogger(error.unhandled);
myLogger.warn(Test Message);

The Test Message did appear in my log, but I don't understand why struts
will not provide the same behavior through its exception interceptor.

Does anyone have any ideas about what I am doing wrong?
-- 
View this message in context: 
http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27459864.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Problem with Exception Interceptor

2010-02-04 Thread DavidZaz

I actually had the interceptor-ref configured like that in my source code. It
looks like my code didn't paste from eclipse very well. Sorry about that.

Does the logCategory need to start with com.packageName? Can it start with
error or org or something else?


Cimballi-2 wrote:
 
 You interceptor declaration should be like that :
 interceptor-ref name=exception
   true
   com.xxx
   ERROR
 /interceptor-ref
 
 Cimballi
 
 
 On Thu, Feb 4, 2010 at 4:14 PM, DavidZaz dzaze...@cait.org wrote:

 I have an exception interceptor declared in my struts.xml, but no log
 messages ever appear in the log category that I specified. In my
 struts.xml,
 I have the following:

 package name=default extends=struts-default
   interceptor-stack name=defaultStack
      interceptor-ref name=exception
            true
            error.unhandled
            WARN
      /interceptor-ref
   /interceptor-stack
 /package

 In my log4j.xml file, I have the following logger configured:

 appender name=CONSOLE class=org.apache.log4j.ConsoleAppender
    layout class=org.apache.log4j.PatternLayout

    /layout
 /appender
 logger name=error.unhandled
    level value=DEBUG/
    appender-ref ref=CONSOLE /
 /logger

 When I run my application and throw an unhandled exception, the log4j
 logger
 does not print the exception to my appender. As a test, I wrote the
 following code into one of my actions:

 org.apache.log4j.Logger myLogger =
 org.apache.log4j.Logger.getLogger(error.unhandled);
 myLogger.warn(Test Message);

 The Test Message did appear in my log, but I don't understand why
 struts
 will not provide the same behavior through its exception interceptor.

 Does anyone have any ideas about what I am doing wrong?
 --
 View this message in context:
 http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27459864.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27460190.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Problem with Exception Interceptor

2010-02-04 Thread DavidZaz

As an update, I changed the level in my struts.xml to FATAL and the logging
started working. This behavior confuses me since I don't have any loggers
set higher than DEBUG/INFO in my log4j.xml file. However, this does lead me
to believe that log4j and not struts is the problem.


Cimballi-2 wrote:
 
 :D Ok, I just noticed than the mailing list engine, or maybe google,
 removes the  param  tag...
 
 Cimballi
 
 
 On Thu, Feb 4, 2010 at 4:40 PM, DavidZaz dzaze...@cait.org wrote:

 I actually had the interceptor-ref configured like that in my source
 code. It
 looks like my code didn't paste from eclipse very well. Sorry about that.

 Does the logCategory need to start with com.packageName? Can it start
 with
 error or org or something else?


 Cimballi-2 wrote:

 You interceptor declaration should be like that :
         interceptor-ref name=exception
           true
           com.xxx
           ERROR
         /interceptor-ref

 Cimballi


 On Thu, Feb 4, 2010 at 4:14 PM, DavidZaz dzaze...@cait.org wrote:

 I have an exception interceptor declared in my struts.xml, but no log
 messages ever appear in the log category that I specified. In my
 struts.xml,
 I have the following:

 package name=default extends=struts-default
   interceptor-stack name=defaultStack
      interceptor-ref name=exception
            true
            error.unhandled
            WARN
      /interceptor-ref
   /interceptor-stack
 /package

 In my log4j.xml file, I have the following logger configured:

 appender name=CONSOLE class=org.apache.log4j.ConsoleAppender
    layout class=org.apache.log4j.PatternLayout

    /layout
 /appender
 logger name=error.unhandled
    level value=DEBUG/
    appender-ref ref=CONSOLE /
 /logger

 When I run my application and throw an unhandled exception, the log4j
 logger
 does not print the exception to my appender. As a test, I wrote the
 following code into one of my actions:

 org.apache.log4j.Logger myLogger =
 org.apache.log4j.Logger.getLogger(error.unhandled);
 myLogger.warn(Test Message);

 The Test Message did appear in my log, but I don't understand why
 struts
 will not provide the same behavior through its exception interceptor.

 Does anyone have any ideas about what I am doing wrong?
 --
 View this message in context:
 http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27459864.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 --
 View this message in context:
 http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27460190.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27460842.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Accessing Static Constants from JSP in Struts 2.0.14

2010-01-04 Thread DavidZaz

I'm trying to access a static constant from a JSP page in Struts 2.0.14, but
it is not working.

My JSP page:

s:select list=@org.my.company.mycl...@available_states /

Java code:

package org.my.company;

import java.util.ArrayList;
import java.util.List;

public Class myClass {

public static final ListString AVAILABLE_STATES = getStates();

public static final ListString getStates() {
ListString states = new ArrayListString();
states.add(New York);
return states;
}

When I try to access my jsp page, I receive the following error message:

Caused by: tag 'select', field 'list': The requested list key
'@org.my.company.mycl...@available_states' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]

Does anyone have any suggestion about what needs to be changed?

Thanks!
-- 
View this message in context: 
http://old.nabble.com/Accessing-Static-Constants-from-JSP-in-Struts-2.0.14-tp27018870p27018870.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Accessing Static Constants from JSP in Struts 2.0.14

2010-01-04 Thread DavidZaz

I figured it out.

In myClass, I have an enum listing the different state values. My
AVAILABLE_STATES variable was placed inside the curly braces for the enum.
This inadvertently placed the AVAILABLE_STATES variable inside the enum and
caused Struts 2 to throw an error message.


DavidZaz wrote:
 
 I'm trying to access a static constant from a JSP page in Struts 2.0.14,
 but it is not working.
 
 My JSP page:
 
 s:select list=@org.my.company.mycl...@available_states /
 
 Java code:
 
 package org.my.company;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public Class myClass {
 
 public static final ListString AVAILABLE_STATES = getStates();
 
 public static final ListString getStates() {
 ListString states = new ArrayListString();
 states.add(New York);
 return states;
 }
 
 When I try to access my jsp page, I receive the following error message:
 
 Caused by: tag 'select', field 'list': The requested list key
 '@org.my.company.mycl...@available_states' could not be resolved as a
 collection/array/map/enumeration/iterator type. Example: people or
 people.{name} - [unknown location]
 
 Does anyone have any suggestion about what needs to be changed?
 
 Thanks!
 

-- 
View this message in context: 
http://old.nabble.com/Accessing-Static-Constants-from-JSP-in-Struts-2.0.14-tp27018870p27019067.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org