Struts Classic and token not working on one server on Firefox

2010-01-08 Thread Greg Dunn
We're using the Token system in our application, which is installed at
several hundred sites, each with their own JBoss and Apache servers
which we administer.  It works perfectly at every site but one, where a
token mismatch comes up every time if the user is on Firefox.  There is
no problem using IE.

Has anyone seen this and can you point us in the direction of solving
the problem?

The code is basic, in the first action class we have:

saveToken(request);

which forwards to a JSP, and in the second we have:

if (!isTokenValid(request) ) {
return (mapping.findForward("tokenFail"));
}
resetToken(request);


Thank you,

Greg

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



ValidatorAction - NoClassDefFoundError

2008-04-25 Thread Greg Dunn
I just upgraded from Struts 1.2.8 to 1.3.8 and my custom Validators
aren't working.  The standard included validators all work fine.  I have
commons-validator-1.3.1.jar in my .war file web-inf/lib.  I deleted the
stand alone validator-rules.xml file from same.  

Any assistance would be appreciated.



This is in Validation.xml

http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd";>

>>






This is my custom validator class:


package cc.nisc.css.web;

import org.apache.commons.validator.Field;
import org.apache.commons.validator.GenericValidator;
import org.apache.commons.validator.ValidatorAction;
import org.apache.commons.validator.util.ValidatorUtils;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.validator.Resources;

import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;

/**
 * @author Greg
 * @version $Id: ACHCheck.java,v 1.1, 2006-01-17 17:46:15Z, Greg$
 */
public class ACHCheck implements Serializable {

public static boolean validateACHRouting(Object bean,
ValidatorAction va,
 Field field, ActionMessages
errors,
 HttpServletRequest request)
{
String value;

if (isString(bean)) {
value = (String) bean;
}
else {
value = ValidatorUtils.getValueAsString(bean,
field.getProperty());
}

if (GenericValidator.isBlankOrNull(value)) {
return true;
}

if (value.length() != 9) {
errors.add(field.getKey(),
Resources.getActionMessage(request, va, field));
return false;
}

int n = 0;

for (int i = 0; i < value.length(); i += 3) {
n += CharToInt(value.charAt(i)) * 3
+ CharToInt(value.charAt(i + 1)) * 7
+ CharToInt(value.charAt(i + 2));
}

// If the resulting sum is an even multiple of ten (but not
zero),
// the aba routing number is good.
if (n != 0 && n % 10 == 0)
return true;
else {
errors.add(field.getKey(),
Resources.getActionMessage(request, va, field));
return false;
}
}

public static int CharToInt(char chr) {
return Integer.parseInt(CharToString(chr));
}

public static String CharToString(char chr) {
return String.valueOf(chr);
}

private static Class stringClass = new String().getClass();

private static boolean isString(Object o) {
if (o == null) return true;
return (stringClass.isInstance(o));
}
}





This is my plug-in definition in struts-config.xml :









I'm getting the following stack trace:

2008-04-25 15:45:48,580 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/css].[
action]] Servlet.service() for servlet action threw exception

java.lang.NoClassDefFoundError:
org/apache/commons/validator/ValidatorAction
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at
org.apache.commons.validator.ValidatorAction.loadValidationMethod(Valida
torAction.java:600)
at
org.apache.commons.validator.ValidatorAction.executeValidationMethod(Val
idatorAction.java:532)
at
org.apache.commons.validator.Field.validateForRule(Field.java:796)
at org.apache.commons.validator.Field.validate(Field.java:876)
at org.apache.commons.validator.Form.validate(Form.java:288)
at
org.apache.commons.validator.Validator.validate(Validator.java:351)
at
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:11
6)
at
org.apache.struts.chain.commands.servlet.ValidateActionForm.validate(Val
idateActionForm.java:58)
at
org.apache.struts.chain.commands.AbstractValidateActionForm.execute(Abst
ractValidateActionForm.java:120)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommand
Base.java:51)
at
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.jav
a:304)
at
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableReq
uestProcessor.java:283)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
at
org.apache.catalina.core.Applica

Override controller nocache=true

2007-04-10 Thread Greg Dunn
I have the  set in struts-config, but I
have a certain page that streams a PDF file where I need to allow
caching to accommodate IE users.  Is it possible to override the setting
for an individual page?  Maybe by setting the headers for the page
itself to allow caching?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to put an image in a

2006-07-18 Thread Greg Dunn
You can't nest one tag  inside another .

You could use the expression language versionlike so:




-Original Message-
From: A. Lotfi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 2:50 PM
To: Struts Users Mailing List
Subject: RE: How to put an image in a 

Greg Dunn <[EMAIL PROTECTED]> wrote:
  





-Original Message-
From: A. Lotfi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 2:24 PM
To: Struts Users Mailing List
Subject: How to put an image in a 
How to put an image in a button
thank you


-
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to put an image in a

2006-07-18 Thread Greg Dunn






-Original Message-
From: A. Lotfi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 2:24 PM
To: Struts Users Mailing List
Subject: How to put an image in a  button
  thank you


-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Conditionally checking an html:checkbox field

2006-02-01 Thread Greg Dunn
N/M, I found it.  I was creating the form in session in my first action
but pulling it from request in my second.  Duh.

-Original Message-
From: Greg Dunn [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 01, 2006 11:05 AM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field

Still no joy using String instead of Boolean.  I must be doing something
wrong.  What are common mistakes related to checkboxes?

-Original Message-
From: kalpesh modi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 1:11 PM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field

You need to set it to the value that gets submitted when you check a
checkbox and submit the form. 



-
Bring words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.



-Original Message-
From: Greg Dunn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 12:57 PM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field


I need to conditionally set a checkbox field when presented to the user
depending on application configuration settings.  I'm using an Action to
load the form and attempt to set the checkbox field.  No matter what I
do I cannot get the checkbox state to change from its default, whether
that be true, false or no value (shows false). 

I've Google'ed, searched the list archive and various FAQ's to no avail.



In my ValidatorForm bean:  (This particular field is not validated)

private boolean shutoff;

public boolean getShutoff () {
return shutoff;
}

public void setShutoff (boolean shutoff) {
this.shutoff = shutoff;
}

public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.shutoff = boolean.FALSE;
}

In my Action:

if (checkTheBox.equals("yes")) {  //config. option, confirmed
working
regForm.setShutoff(true);
}

[Then it immediately forwards to the form JSP.]



I also tried setting the value of the checkbox via another property in
the form bean.

I appreciate any corrections or suggestions.

Greg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Conditionally checking an html:checkbox field

2006-02-01 Thread Greg Dunn
Still no joy using String instead of Boolean.  I must be doing something
wrong.  What are common mistakes related to checkboxes?

-Original Message-
From: kalpesh modi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 1:11 PM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field

You need to set it to the value that gets submitted when you check a
checkbox and submit the form. 



-
Bring words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.



-Original Message-
From: Greg Dunn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 12:57 PM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field


I need to conditionally set a checkbox field when presented to the user
depending on application configuration settings.  I'm using an Action to
load the form and attempt to set the checkbox field.  No matter what I
do I cannot get the checkbox state to change from its default, whether
that be true, false or no value (shows false). 

I've Google'ed, searched the list archive and various FAQ's to no avail.



In my ValidatorForm bean:  (This particular field is not validated)

private boolean shutoff;

public boolean getShutoff () {
return shutoff;
}

public void setShutoff (boolean shutoff) {
this.shutoff = shutoff;
}

public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.shutoff = boolean.FALSE;
}

In my Action:

if (checkTheBox.equals("yes")) {  //config. option, confirmed
working
regForm.setShutoff(true);
}

[Then it immediately forwards to the form JSP.]



I also tried setting the value of the checkbox via another property in
the form bean.

I appreciate any corrections or suggestions.

Greg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Conditionally checking an html:checkbox field

2006-01-31 Thread Greg Dunn
I'll try that, but this property is a boolean so I'm actually not
getting a string when the checkbox is submitted, it has no value
attribute.  I'm getting and working with the boolean in the ultimate
form submit Action without any problems.  

Do I HAVE to set a String value attribute to get it do what I want?


-Original Message-
From: kalpesh modi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 1:11 PM
To: Struts Users Mailing List
Subject: RE: Conditionally checking an html:checkbox field

You need to set it to the value that gets submitted when you check a
checkbox and submit the form. 



-
Bring words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Conditionally checking an html:checkbox field

2006-01-31 Thread Greg Dunn
I think that's what I'm doing, but it isn't working.

Am I doing this wrong? (from my original post):

In my Action:

if (checkTheBox.equals("yes")) {  //config. option, confirmed
working
regForm.setShutoff(true);
}

[Then it immediately forwards to the JSP.]


-Original Message-
From: kalpesh modi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 12:52 PM
To: Struts Users Mailing List
Subject: Re: Conditionally checking an html:checkbox field

Try the check condition in your action class and set/not set the
checkbox and then forward it to the JSP.

Hope this helps.



-
 
 What are the most popular cars? Find out at Yahoo! Autos 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Conditionally checking an html:checkbox field

2006-01-31 Thread Greg Dunn
I need to conditionally set a checkbox field when presented to the user
depending on application configuration settings.  I'm using an Action to
load the form and attempt to set the checkbox field.  No matter what I
do I cannot get the checkbox state to change from its default, whether
that be true, false or no value (shows false). 

I've Google'ed, searched the list archive and various FAQ's to no avail.



In my ValidatorForm bean:  (This particular field is not validated)

private boolean shutoff;

public boolean getShutoff () {
return shutoff;
}

public void setShutoff (boolean shutoff) {
this.shutoff = shutoff;
}

public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.shutoff = boolean.FALSE;
}

In my Action:

if (checkTheBox.equals("yes")) {  //config. option, confirmed
working
regForm.setShutoff(true);
}

[Then it immediately forwards to the form JSP.]



I also tried setting the value of the checkbox via another property in
the form bean.

I appreciate any corrections or suggestions.

Greg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Conditionally checking an html:checkbox field

2006-01-31 Thread Greg Dunn
I need to conditionally set a checkbox field when presented to the user
depending on application configuration settings.  I'm using an Action to
load the form and attempt to set the checkbox field.  No matter what I
do I cannot get the checkbox state to change from its default, whether
that be true, false or no value (shows false). 

I've Google'ed, searched the list archive and various FAQ's to no avail.



In my ValidatorForm bean:  (This particular field is not validated)

private boolean shutoff;

public boolean getShutoff () {
return shutoff;
}

public void setShutoff (boolean shutoff) {
this.shutoff = shutoff;
}

public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.shutoff = boolean.FALSE;
}

In my Action:

if (checkTheBox.equals("yes")) {  //config. option, confirmed
working
regForm.setShutoff(true);
}

[Then it immediately forwards to the form JSP.]



I also tried setting the value of the checkbox via another property in
the form bean.

I appreciate any corrections or suggestions.

Greg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: installing Struts on JBoss

2005-01-20 Thread Greg Dunn
 
Sorry I confused things.  We had to do this to get our app to load.  In
this case it's deployed as an .ear with a .war packed inside (EJB's for
the Model layer) and using Struts 1.1.

What I believe is happening is that without the setting we get
NoClassDefFoundError because the JBoss tries to load Digester from
somewhere other than Struts and then can't parse struts-config.xml.
These three errors get logged one after the other:

2005-01-20 16:12:05,289 ERROR [org.apache.commons.digester.Digester]
Begin event threw exception
java.lang.reflect.InvocationTargetException

...

Caused by: java.lang.NoClassDefFoundError:
org/apache/struts/action/ActionForm
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at
org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.jav
a:388)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoa
der.java:229)
at
org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(U
nifiedLoaderRepository3.java:217)
at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:130)
at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
ava:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at
java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:575)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1392)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1289)
at
org.apache.struts.config.FormBeanConfig.formBeanClass(FormBeanConfig.jav
a:320)
at
org.apache.struts.config.FormBeanConfig.setType(FormBeanConfig.java:191)
  86 more

... 

2005-01-20 16:12:05,914 ERROR [org.apache.struts.action.ActionServlet]
Parsing error processing resource path 
java.lang.reflect.InvocationTargetException
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:23
83)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:24
09)
at
org.apache.commons.digester.Digester.startElement(Digester.java:1271)

...

2005-01-20 16:12:06,321 ERROR [org.jboss.web.localhost.Engine]
StandardContext[]: Servlet  threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource
path 
at
org.apache.struts.action.ActionServlet.handleConfigException(ActionServl
et.java:1033)

...


Greg 


-Original Message-
From: Pavel Kolesnikov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 20, 2005 4:04 PM
To: Struts Users Mailing List
Subject: Re: installing Struts on JBoss

Greg,

could you please explain this a bit more? I'm curious about it, because
I'm running multiple Struts based application on JBoss without
this setting and I've never encountered any problems with 
mysterious ServletExceptions.

BWT I've just tried to deploy struts-examples on a vanilla JBoss 4.0.1
installation and everything works OK.

Pavel


On Thu, 20 Jan 2005 15:02:46 -0600, Greg Dunn <[EMAIL PROTECTED]> wrote:
> 
> For Struts apps on Jboss you need to make sure you set the
> 'Java2ClassLoadingCompliance' flag to "false" indicating the servlet
2.3
> web container first model should be used over the normal Java2 parent
> first class loading model.
> 
>   false
> 
> In Jboss 4.x this is in the file
> 
> .../deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml
> 
> In Jboss 3.x it's in the file 'tomcat41-service.xml' in .../deploy
> 
> Greg
> 
> 
> -Original Message-
> From: Alex Kravets [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 20, 2005 2:22 PM
> To: Struts Users Mailing List
> Subject: installing Struts on JBoss
> 
> Are there any special requirements to install and run Struts
> applications on JBoss? I istalled JBoss on Tomcat and have been able
to
> run Struts applications w/o any problems. Same application on JBoss
> gives me Servlet Exception.
> I would try mailing lists/forums for JBoss, but I find them not
> especially active.
> 
> thanks,
> Alex
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For addi

RE: installing Struts on JBoss

2005-01-20 Thread Greg Dunn
 
For Struts apps on Jboss you need to make sure you set the
'Java2ClassLoadingCompliance' flag to "false" indicating the servlet 2.3
web container first model should be used over the normal Java2 parent
first class loading model.  

  false

In Jboss 4.x this is in the file  

.../deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml

In Jboss 3.x it's in the file 'tomcat41-service.xml' in .../deploy

Greg 


-Original Message-
From: Alex Kravets [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 20, 2005 2:22 PM
To: Struts Users Mailing List
Subject: installing Struts on JBoss

Are there any special requirements to install and run Struts 
applications on JBoss? I istalled JBoss on Tomcat and have been able to 
run Struts applications w/o any problems. Same application on JBoss 
gives me Servlet Exception.
I would try mailing lists/forums for JBoss, but I find them not 
especially active.

thanks,
Alex


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]