display tags and large result sets

2003-09-26 Thread Michael Muller
I'd love to use this package, but I often deal with large result sets 
returned from a database.  I'm afraid that I wouldn't be able to support 
many users if I kept sucking the whole table into memory.  I deal with 
this manually by using MySQL's LIMIT and OFFEST syntax.  Clicking on 
column headers changes the ORDER BY of the query.  I gave the docs a 
quick look and didn't see anything that looked like it would support 
something like this.  Did I miss anything?  How hard would it be to 
enhance the tag to support this?

  -- Mike



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


bizzare indexed form bean problem

2003-09-18 Thread Michael Muller
i have a form with an indexed property.  i wasn't able to get any data 
out of the form.  i could see the data in the request parameters, but 
the data wasn't in the form bean.

in an effort to diagnose, i made an action to populate data into the 
form.  not only was i able to populate data into the form, but suddenly 
data started showing up in the form bean after the submit.

now i can't take the action away!  when i do, all the properties of all 
the beans in the indexed property of the form bean are null.

help!  what's going on?!

  -- mike

FROM STRUTS-CONFIG.XML:

form-bean name=shipmentFormBean
  type=org.apache.struts.action.DynaActionForm
form-property name=action type=java.lang.String /
form-property name=shipments
  type=com.interactivate.cachandler.ShipmentFormBean[] size=12 /
/form-bean
action path=/data-upload/Shipments
  forward=shipments.page
  validate=false
  roles=data-upl /
!--
action path=/data-upload/Shipments
  type=com.interactivate.cachandler.Foo
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl
forward name=success path=shipments.page /
/action
--
action path=/data-upload/SubmitShipments
  type=com.interactivate.cachandler.SubmitShipmentsAction
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl /


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


Re: bizzare indexed form bean problem

2003-09-18 Thread Michael Muller
more info:

it turns out that the data i was seeing in the form bean was the data 
that i pre-populated -- data from the form is NOT making in into form 
bean.

or, more accurately, the INDEXED data is not making it into the form 
bean.  the action property is getting set properly.

does anyone have any clues?  troubleshooting ideas?

  -- mike

Michael Muller wrote:

i have a form with an indexed property.  i wasn't able to get any data 
out of the form.  i could see the data in the request parameters, but 
the data wasn't in the form bean.

in an effort to diagnose, i made an action to populate data into the 
form.  not only was i able to populate data into the form, but suddenly 
data started showing up in the form bean after the submit.

now i can't take the action away!  when i do, all the properties of all 
the beans in the indexed property of the form bean are null.

help!  what's going on?!

  -- mike

FROM STRUTS-CONFIG.XML:

form-bean name=shipmentFormBean
  type=org.apache.struts.action.DynaActionForm
form-property name=action type=java.lang.String /
form-property name=shipments
  type=com.interactivate.cachandler.ShipmentFormBean[] size=12 /
/form-bean
action path=/data-upload/Shipments
  forward=shipments.page
  validate=false
  roles=data-upl /
!--
action path=/data-upload/Shipments
  type=com.interactivate.cachandler.Foo
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl
forward name=success path=shipments.page /
/action
--
action path=/data-upload/SubmitShipments
  type=com.interactivate.cachandler.SubmitShipmentsAction
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl /


-
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]


SOLVED: Re: bizzare indexed form bean problem

2003-09-18 Thread Michael Muller
ok, i think i have it:  in the jsp, the id attribute of iterator tag has 
to match the name of the indexed property of the form bean.

  -- mike

Michael Muller wrote:
more info:

it turns out that the data i was seeing in the form bean was the data 
that i pre-populated -- data from the form is NOT making in into form bean.

or, more accurately, the INDEXED data is not making it into the form 
bean.  the action property is getting set properly.

does anyone have any clues?  troubleshooting ideas?

  -- mike

Michael Muller wrote:

i have a form with an indexed property.  i wasn't able to get any data 
out of the form.  i could see the data in the request parameters, but 
the data wasn't in the form bean.

in an effort to diagnose, i made an action to populate data into the 
form.  not only was i able to populate data into the form, but 
suddenly data started showing up in the form bean after the submit.

now i can't take the action away!  when i do, all the properties of 
all the beans in the indexed property of the form bean are null.

help!  what's going on?!

  -- mike

FROM STRUTS-CONFIG.XML:

form-bean name=shipmentFormBean
  type=org.apache.struts.action.DynaActionForm
form-property name=action type=java.lang.String /
form-property name=shipments
  type=com.interactivate.cachandler.ShipmentFormBean[] size=12 /
/form-bean
action path=/data-upload/Shipments
  forward=shipments.page
  validate=false
  roles=data-upl /
!--
action path=/data-upload/Shipments
  type=com.interactivate.cachandler.Foo
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl
forward name=success path=shipments.page /
/action
--
action path=/data-upload/SubmitShipments
  type=com.interactivate.cachandler.SubmitShipmentsAction
  name=shipmentFormBean
  scope=session
  validate=false
  roles=data-upl /


-
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]




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


Re: Multipage JDBC result

2003-09-16 Thread Michael Muller
I read the documentation, but I can't tell what the pager iterates over. 
 I'm assuming it iterates over java collections.

This could be a problem if you have a huge result set.  Another option 
would be to use database features like mysql's select * from foo limit 
50 offset 250 syntax.  It's still a lotta work for the database if 
there's a huge result set, but a lot easier on the web app.

  -- Mike

Andrew Kuzmin wrote:

Hi,

see this link 
   http://jakarta.apache.org/struts/faqs/newbie.html#pager

--
Andrew Kuzmin
http://www.java201.com
- Original Message - 
From: Jonathan Hawkins [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 3:39 PM
Subject: Multipage JDBC result



Howdy,
Any tips as to where I can find code examples of how to break down a 
large JDBC result
into say 25 rows per page?

Jon Hawkins

-
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]




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


[resend] indexed properties without setFoo(foo, index)

2003-09-09 Thread Michael Muller
The following article seems to differ in approach from how the posters
to this forum implement indexed properties in struts:
http://www.developer.com/java/other/article.php/2233591

In this article, the author uses a DynaActionForm which automatically
builds an array of normal beans.  By normal, I mean that the beans
have methods like this:
String getFoo()
void setFoo(String foo)
rather than this, as is often advocated in this forum:

String getFoo(int index)
void setFoo(String foo, int index)
I prefer the former approach except for one minor factor: it doesn't
seem to work.   :(
Struts seems to be creating me a valid form.  I say this becuase I have
an iterator on my form that displays the right number of rows of text
boxes, and they all have names like mybean[0].foo.  Furthermore, if I
change the property attribute of my html:text tag to bar, I get an
exception when I render the page that there is no bar property.
So things seem to be working well, up to this point, but in the
implementation of the action, my form bean doesn't have any values set.
 They're not even blank; they're null.  I stuck a println in a setter
method -- it's not even being called.
I can, however, see the values in the request parameters if I print them
out in the implementation of the action.
Help!  Actual code follows.

Thanks in advance,

-- Mike

STRUTS-CONFIG.XML

form-bean name=shipmentFormBean
   type=org.apache.struts.action.DynaActionForm
  form-property name=action
type=java.lang.String /
  form-property name=shipments
type=com.interactivate.cachandler.ShipmentFormBean[]
size=12 /
/form-bean
action path=/data-upload/Shipments
name=shipmentFormBean
forward=shipments.page
scope=request
validate=false
roles=data-upl /
action path=/data-upload/SubmitShipments
type=com.interactivate.cachandler.SubmitShipmentsAction
name=shipmentFormBean
scope=request
validate=true
input=shipments.page
roles=data-upl /
SHIPMENTFORMBEAN.JAVA --

public class ShipmentFormBean
{
private String mDestination;
private String mSize;
private String mVariety;
private String mQuantity;
private String mPrice;
private String mZipCode;
// YANKED A BUNCH OF GETTERS/SETTERS

public String getSize()
{
return mSize;
}
public void setSize(String size)
{
System.out.println(### setting size to  + size);
mSize = size;
}
}
SHIPMENTS.JSP

html:form action=/data-upload/SubmitShipments.do
  logic:iterate
id=shipment
name=shipmentFormBean
property=shipments
%-- lots of jsp code and html yanked --%
html:select
  name=shipment
  property=size
  indexed=true
  option value=70 70 /option
  option value=84 84 /option
/html:select
html:select
  name=shipment
  property=destination
  indexed=true
  option value= selectedSelect a city/option
  option value=- /option
  jsp:include page=destinations.jsp /
/html:select
html:text
  name=shipment
  property=zipCode
  indexed=true
  size=10
  maxlength=5 /
  /logic:iterate
/html:form




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


indexed properties

2003-09-08 Thread Michael Muller
The following article seems to differ in approach from how the posters 
to this forum implement indexed properties in struts:

http://www.developer.com/java/other/article.php/2233591

In this article, the author uses a DynaActionForm which automatically 
builds an array of normal beans.  By normal, I mean that the beans 
have methods like this:

String getFoo()
void setFoo(String foo)
rather than this, as is often advocated in this forum:

String getFoo(int index)
void setFoo(String foo, int index)
I prefer the former approach except for one minor factor: it doesn't 
seem to work.   :(

Struts seems to be creating me a valid form.  I say this becuase I have 
an iterator on my form that displays the right number of rows of text 
boxes, and they all have names like mybean[0].foo.  Furthermore, if I 
change the property attribute of my html:text tag to bar, I get an 
exception when I render the page that there is no bar property.

So things seem to be working well, up to this point, but in the 
implementation of the action, my form bean doesn't have any values set. 
 They're not even blank; they're null.  I stuck a println in a setter 
method -- it's not even being called.

I can, however, see the values in the request parameters if I print them 
out in the implementation of the action.

Help!  Actual code follows.

Thanks in advance,

-- Mike

STRUTS-CONFIG.XML

form-bean name=shipmentFormBean
   type=org.apache.struts.action.DynaActionForm
  form-property name=action
type=java.lang.String /
  form-property name=shipments
type=com.interactivate.cachandler.ShipmentFormBean[]
size=12 /
/form-bean
action path=/data-upload/Shipments
name=shipmentFormBean
forward=shipments.page
scope=request
validate=false
roles=data-upl /
action path=/data-upload/SubmitShipments
type=com.interactivate.cachandler.SubmitShipmentsAction
name=shipmentFormBean
scope=request
validate=true
input=shipments.page
roles=data-upl /
SHIPMENTFORMBEAN.JAVA --

public class ShipmentFormBean
{
private String mDestination;
private String mSize;
private String mVariety;
private String mQuantity;
private String mPrice;
private String mZipCode;
// YANKED A BUNCH OF GETTERS/SETTERS

public String getSize()
{
return mSize;
}
public void setSize(String size)
{
System.out.println(### setting size to  + size);
mSize = size;
}
}
SHIPMENTS.JSP

html:form action=/data-upload/SubmitShipments.do
  logic:iterate
id=shipment
name=shipmentFormBean
property=shipments
%-- lots of jsp code and html yanked --%
html:select
  name=shipment
  property=size
  indexed=true
  option value=70 70 /option
  option value=84 84 /option
/html:select
html:select
  name=shipment
  property=destination
  indexed=true
  option value= selectedSelect a city/option
  option value=- /option
  jsp:include page=destinations.jsp /
/html:select
html:text
  name=shipment
  property=zipCode
  indexed=true
  size=10
  maxlength=5 /
  /logic:iterate
/html:form




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


included xml can not be resolved without a base URI?

2003-08-15 Thread Michael Muller
I'm trying to break by tiles defs into smaller files, but I'm getting 
the following error at tomcat startup:

SEVERE: Parse Fatal Error at line 6 column -1: Relative URI 
community-conf/demo/GrassyKnoll-tiles.xml; can not be resolved without 
a base URI.

My tiles-defs.xml looks like this:

!DOCTYPE tiles-definitions PUBLIC
   -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN
   http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd; [
   !ENTITY GrassyKnoll-tiles SYSTEM 
community-conf/demo/GrassyKnoll-tiles.xml
   ]

What am I doing wrong?  I'm using struts 1.1, tomcat 4.1, and jdb 1.4.2.

Thanks!

  -- Mike



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


how to access my datasource from a securityfilter realm?

2003-07-21 Thread Michael Muller
I found a reference to the SecurityFilter project on this mailing list. 
 I just hooked it up, and it seems to work pretty well.

I do have a question, though.  Is there any way for the realm to use 
same datasource as struts?  I'm not passed anything useful.  Is there 
something static somewhere that I can access?

I could pass the connection information in as parameters to the realm, 
but then I've got the same config information in two places and I'm not 
using whatever nifty pooling is provided by struts' datasource.

Thanks,

  -- Mike



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


mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller
In Cavaness's book Programming Jakarta Struts, there is a code sample
on page 188 that contains a line I don't understand.
In the execute method of an implementation of an Action class, is
the following line of code:
return mapping.findForward( mapping.getInput() );

Doesn't the input have to be an Action?  The DTD says action or other
resource.  What other resource?  Could I put the name of a tile in
there?  I tried putting the name of a forward in there, but the
validation framework complained that it didn't start with a /.
Thanks,

  -- Mike







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


Re: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller
1) You can use mapping.getInputForward() - more straightforward.
so would you say cavaness's example broken?  is there any way to 
configure struts such that it would work?

2) Yes, the forward can point to any resource, from a tiles definition to a jsp or an action url (I'm talking about the value you put in the forward name=myforward path=?/ bit).
but you can't stick in a forward, correct?  this is very confusing, that 
you say forward= and then you can give it almost anything EXCEPT a 
forward.  :(

  -- mike



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


Re: mapping.getInputForward returning null

2003-07-15 Thread Michael Muller
do you override the constructor and now call super()?

Jerry Jalenak wrote:

For some reason when I am calling mapping.getInputForward() I'm getting a
null value.
struts-config snip
action

className=com.labone.membersolutions.struts.BaseActionMapping
input=membersolutions.changepassword
name=ChangePasswordBean
path=/ChangePassword
scope=request

type=com.labone.membersolutions.framework.web.action.ChangePasswordAction
unknown=false
validate=true
set-property
property=secureAction
value=false/
set-property
property=removeFormBean
value=true/
/action
/struts-config snip
My BaseActionMapping extends ActionMapping so I can include a couple of
extra set-property/ statements (see above).  Everything seems to work OK -
my action is being called, the form bean is being instantiated, etc.  The
first thing I do in my action is to set my default forward - 

snip
public ActionForward executeAction(BaseActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse response,
ActionErrors errors)
{
System.out.println( mapping.getInputForward is  +
mapping.getInputForward());
ActionForward forward = (ActionForward)
mapping.getInputForward();

/snip
The value I'm getting in forward is NULL.  Is there something I missed when
I extended ActionMapping?
TIA!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]

This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED]



-
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: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller

I'm not saying anything about Cavaness' book. I haven't read it so I cannot comment :-) I'm just saying you can get the Input forward easily this way.
well, i'm not looking for a critique of the book, i'm just saying this 
code looks broken.

return mapping.findForward( mapping.getInput() );

as you point out below, findForward takes as an argument the name of a 
forward.  the input attrubute on an action mapping, however, is a page.

2) Yes, the forward can point to any resource, from a tiles definition to a jsp or an action url (I'm talking about the value you put in the forward name=myforward path=?/ bit).
but you can't stick in a forward, correct?  this is very confusing, that 
you say forward= and then you can give it almost anything EXCEPT a 
forward.  :(


Well the thing is that tag is *defining* a forward, so if you're trying to put another forward in the path= property then you're doing something wrong, cause if that other forward is accessible from this action, then you don't need to define it again!!
i just think the attribute name is unfortunate.  forwardTo might be 
better, for instance.

  -- mike



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


best way to build a wizard

2003-07-10 Thread Michael Muller
My app has a bunch of wizard-style forms.  I have one NextPageAction 
Action class, and an separate mapping for each page.  The mappings all 
bind to the same form bean (a DynaValidatorForm) and invoke the 
NextPageAction.

I was hoping to have only one action mapping, with a whole bunch of 
forwards for page1, page2, etc.  The problem that prevents me from 
having one action mapping is validation:  I need the input attribute 
to redirect me to the correct wizard screen.

So I went back to having lots of mappings.  No big deal.  Until...

I factored the next and back buttons into the template.  With those 
buttons, wend the closing html:form tag.  Makes sense to move the 
opening html:form tag into the template, too, right?  Oops, my action 
is in there.

What do I do?

I could leave the closing tag in the template and the opening tag in the 
inserted body.  Gross.

I could try and pass the action into the template through my tiles-defs. 
 That's kinda kludgy, too.

I'm back to thinking I should have one action mapping.  But I don't know 
how to accomplish this.

Suggestions?

Thanks,

Mike



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


Re: best way to build a wizard

2003-07-10 Thread Michael Muller
It turns out that I can't pass the action into the html:form tag using 
tiles; that would involve nesting JSP tags.  Grr.

I guess my only recourse is to have the open html:form tag in the 
inserted body and the close html:form tag in the template.  Ick.

So now I'm trying to figure out a way to have one one action mapping. 
Any ideas?  Or alternative approaches?

  -- Mike

Michael Muller wrote:
My app has a bunch of wizard-style forms.  I have one NextPageAction 
Action class, and an separate mapping for each page.  The mappings all 
bind to the same form bean (a DynaValidatorForm) and invoke the 
NextPageAction.

I was hoping to have only one action mapping, with a whole bunch of 
forwards for page1, page2, etc.  The problem that prevents me from 
having one action mapping is validation:  I need the input attribute 
to redirect me to the correct wizard screen.

So I went back to having lots of mappings.  No big deal.  Until...

I factored the next and back buttons into the template.  With those 
buttons, wend the closing html:form tag.  Makes sense to move the 
opening html:form tag into the template, too, right?  Oops, my action 
is in there.

What do I do?

I could leave the closing tag in the template and the opening tag in the 
inserted body.  Gross.

I could try and pass the action into the template through my tiles-defs. 
 That's kinda kludgy, too.

I'm back to thinking I should have one action mapping.  But I don't know 
how to accomplish this.

Suggestions?

Thanks,

Mike



-
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: best way to build a wizard

2003-07-10 Thread Michael Muller
I'm not sure that really solves my problem.  What do I put as the 
input for this action?  I can't use the same action; whatever 
attribute I used to indicate that I want to move to the next page would 
still be in the system, so validation failures would bring me to the 
next page rather than the same page.

I'm pondering an approach with two actions, a next page action which 
has a same page action as its input.

  -- Mike

Rodney Paul wrote:

Check out the lookupDispatchAction classes.
These classes were designed specifically for Actions which require more
than one execute method (in this instance a method for back and next).
That is what I have used, and is perfect for use when developing wizard applications.
Cheers
Rodney
-Original Message-
From: Michael Muller [mailto:[EMAIL PROTECTED]
Sent: Friday, 11 July 2003 8:41 AM
To: Struts Users Mailing List
Subject: Re: best way to build a wizard


It turns out that I can't pass the action into the html:form tag using 
tiles; that would involve nesting JSP tags.  Grr.

I guess my only recourse is to have the open html:form tag in the 
inserted body and the close html:form tag in the template.  Ick.

So now I'm trying to figure out a way to have one one action mapping. 
Any ideas?  Or alternative approaches?

   -- Mike

Michael Muller wrote:

My app has a bunch of wizard-style forms.  I have one NextPageAction 
Action class, and an separate mapping for each page.  The mappings all 
bind to the same form bean (a DynaValidatorForm) and invoke the 
NextPageAction.

I was hoping to have only one action mapping, with a whole bunch of 
forwards for page1, page2, etc.  The problem that prevents me from 
having one action mapping is validation:  I need the input attribute 
to redirect me to the correct wizard screen.

So I went back to having lots of mappings.  No big deal.  Until...

I factored the next and back buttons into the template.  With those 
buttons, wend the closing html:form tag.  Makes sense to move the 
opening html:form tag into the template, too, right?  Oops, my action 
is in there.

What do I do?

I could leave the closing tag in the template and the opening tag in the 
inserted body.  Gross.

I could try and pass the action into the template through my tiles-defs. 
That's kinda kludgy, too.

I'm back to thinking I should have one action mapping.  But I don't know 
how to accomplish this.

Suggestions?

Thanks,

Mike



-
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]
-
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: how to access tiles defs in inserted jsp ?

2003-07-09 Thread Michael Muller
After another evening of flailing, I managed to make this work in a 
rather inelegant way:

In myPageTemplate.jsp, I added this tag:

tiles:importAttribute name=foo scope=request/

and I changed myBodyImpl.jsp to say:

foo = %= request.getAttribute(foo) %

This works, but I'mnot very happy with it.  Does anyone have a better 
solution?

  -- Mike

Michael Muller wrote:

i tried this, and got the following error in my jsp:

Error - tag.getAsString : attribute 'foo' not found in context. Check 
tag syntax'

I had to change the tag to say

tiles:getAsString name=foo /

since attribute is not an attribute of getAsString.

  -- Mike

Hibbs, David wrote:

Sneaky little issue on this one.  Try the following...

in tiles-defs.xml change
definition name=myTilesPageDef path=myPageTemplate.jsp
to
definition name=myTilesPageDef template=myPageTemplate.jsp
and in myBodyImpl.jsp change
foo = tiles:insert attribute=foo /
to
foo = tiles:getAsString attribute=foo /
David Hibbs
Staff Programmer / Analyst
Distributed Applications Development and Support
American National Insurance Company

-Original Message-
From: Michael Muller [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2003 11:11 PM
To: Struts Users Mailing List
Subject: how to access tiles defs in inserted jsp ?


How do I access the value of a tiles setting from a JSP that is 
inserted into a template?  For instance, in the following scenario, I 
want a rendering of myTilesPageDef to say bfoo = bar/b, but 
it just says bfoo = /b.  I've tried some ugly hacks, which in 
addition to be ugly, didn't work.

Help!

Thanks,

  -- Mike

tiles-defs.xml:

  definition name=myTilesPageDef path=myPageTemplate.jsp
put name=body value=myBodyImpl.jsp /
put name=foo value=bar type=string /
  /definition
myPageTemplate.jsp:

  btiles:insert attribute=body //b

myBodyImpl.jsp:

  foo = tiles:insert attribute=foo /







**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**




-
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: ClassCastException using the DynaValidatorForm

2003-07-08 Thread Michael Muller
i don't know what's in 'instance', i'm just guessing it's not a DynaBean 
because of the exception i'm getting.

i have discovered that if, instead of renaming the forms, i change the 
name of the form in the action mapping, validation works.

so now i have a form named foo.  :(

not very elegant.  my php-centric coworkers will mock me.  i'll be the 
laughingstock of the company.

  -- mike

Adam Hardy wrote:

I missed your second post. My mailer didn't thread it. So what is struts 
putting in 'instance' if it's not a dynabean?

I don't suppose it would be so simple as the wrong form specified in the 
action mapping?

Michael Muller wrote:

Here's the struts source that's throwing the exception:

// Can we recycle the existing form bean instance (if there is one)?
if (instance != null) {
if (config.getDynamic()) {
String className = ((DynaBean) 
instance).getDynaClass().getName();
if (className.equals(config.getName())) {

Apparently, instance is not a DynaBean.  It would appear that 
something other than a DynaBean is being stored where struts expects 
to find a DynaBean.

Does this help anyone figure out what I'm doing wrong?

  -- Mike

Adam Hardy wrote:

I got ClassCast exceptions, but not necessarily this one, because I 
was using field class types other than Strings in my DynaActionForm. 
DynaValidator will only validate strings, btw.

Adam

Michael Muller wrote:

I've got the validation framework working for me using my own form 
bean which is derived from ValidatorForm.  I changed the form bean 
to be a DynaValidatorForm, and now I get a ClassCastException, the 
guts of which is appended below.

What gives?  Am I using the wrong validator form class?  Did I 
neglect to make some other configuration change?

I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1.

  -- Mike



java.lang.ClassCastException
at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783) 

at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) 

at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386) 

at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt

Re: ClassCastException using the DynaValidatorForm

2003-07-08 Thread Michael Muller
originally, i had a custom form bean with the name myForm and an 
action with the same name.

i set up validation, and all was well.  my form has oodles of fields, 
however, so i figured i could save myself a load of development and 
maintenance by using the dyna-form beans.

so, i created another form bean (a DynaValidatorForm) in my 
struts-config. i named it myForm, and re-named the old myForm to be 
foo so that i wouldn't have two forms with the same name.

this resulted in the ClassCastException i described earlier, despite 
reloading the webapp and even restarting tomcat.

so i switched and renamed the dyna-bean foo and the custom form bean 
myForm.  things started working again.

THEN, i changed the name of the form bean used by the action to foo 
(which is now the name of the dynamic from bean).  to my surprise, that 
works!  and that's where i am now.  functional, but confused.

i can hear the PHP guys snickering.  :(

  -- mike

Adam Hardy wrote:

Sorry, no comprendo. What are you changing in the action mapping? Do 
your mappings  form names  validator xml correspond?

I appreciate your concern about your PHP colleagues :)

Michael Muller wrote:

i don't know what's in 'instance', i'm just guessing it's not a 
DynaBean because of the exception i'm getting.

i have discovered that if, instead of renaming the forms, i change the 
name of the form in the action mapping, validation works.

so now i have a form named foo.  :(

not very elegant.  my php-centric coworkers will mock me.  i'll be the 
laughingstock of the company.

  -- mike

Adam Hardy wrote:

I missed your second post. My mailer didn't thread it. So what is 
struts putting in 'instance' if it's not a dynabean?

I don't suppose it would be so simple as the wrong form specified in 
the action mapping?

Michael Muller wrote:

Here's the struts source that's throwing the exception:

// Can we recycle the existing form bean instance (if there is one)?
if (instance != null) {
if (config.getDynamic()) {
String className = ((DynaBean) 
instance).getDynaClass().getName();
if (className.equals(config.getName())) {

Apparently, instance is not a DynaBean.  It would appear that 
something other than a DynaBean is being stored where struts expects 
to find a DynaBean.

Does this help anyone figure out what I'm doing wrong?

  -- Mike

Adam Hardy wrote:

I got ClassCast exceptions, but not necessarily this one, because I 
was using field class types other than Strings in my 
DynaActionForm. DynaValidator will only validate strings, btw.

Adam

Michael Muller wrote:

I've got the validation framework working for me using my own form 
bean which is derived from ValidatorForm.  I changed the form bean 
to be a DynaValidatorForm, and now I get a ClassCastException, the 
guts of which is appended below.

What gives?  Am I using the wrong validator form class?  Did I 
neglect to make some other configuration change?

I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1.

  -- Mike



java.lang.ClassCastException
at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783) 

at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) 

at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170

Re: ClassCastException using the DynaValidatorForm

2003-07-08 Thread Michael Muller
That would explain it.  The struts-config got re-loaded telling it that 
myForm was a dyna bean, but the re-serialized bean in the session was 
still one of my custom beans.

Thank you!  I had no idea that Tomcat serialized the session data when 
it shut down.

  -- Mike

Wendy Smoak wrote:

this resulted in the ClassCastException i described earlier, despite 
reloading the webapp and even restarting tomcat.


Did you also close the browser window you were using to test?  IIRC, Tomcat
serializes session data when you shut it down.  Just a guess, but I think
you had a session sitting around with the old form bean, and since the
name was the same, it got used.  If you had changed the name from the
beginning (myForm2) you likely never would have seen this.




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


Re: how to access tiles defs in inserted jsp ?

2003-07-08 Thread Michael Muller
i tried this, and got the following error in my jsp:

Error - tag.getAsString : attribute 'foo' not found in context. Check 
tag syntax'

I had to change the tag to say

tiles:getAsString name=foo /

since attribute is not an attribute of getAsString.

  -- Mike

Hibbs, David wrote:

Sneaky little issue on this one.  Try the following...

in tiles-defs.xml change
definition name=myTilesPageDef path=myPageTemplate.jsp
to
definition name=myTilesPageDef template=myPageTemplate.jsp
and in myBodyImpl.jsp change
foo = tiles:insert attribute=foo /
to
foo = tiles:getAsString attribute=foo /
David Hibbs
Staff Programmer / Analyst
Distributed Applications Development and Support
American National Insurance Company

-Original Message-
From: Michael Muller [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2003 11:11 PM
To: Struts Users Mailing List
Subject: how to access tiles defs in inserted jsp ?


How do I access the value of a tiles setting from a JSP that 
is inserted 
into a template?  For instance, in the following scenario, I want a 
rendering of myTilesPageDef to say bfoo = bar/b, but it just 
says bfoo = /b.  I've tried some ugly hacks, which in 
addition to 
be ugly, didn't work.

Help!

Thanks,

  -- Mike

tiles-defs.xml:

  definition name=myTilesPageDef path=myPageTemplate.jsp
put name=body value=myBodyImpl.jsp /
put name=foo value=bar type=string /
  /definition
myPageTemplate.jsp:

  btiles:insert attribute=body //b

myBodyImpl.jsp:

  foo = tiles:insert attribute=foo /







**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**




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


Where is GenericDataSource?

2003-07-07 Thread Michael Muller
I assume I need to copy another jar file to by WEB-INF/lib dir...  So 
where *is* the GenericDataSource packaged now?

Steve Raeburn wrote:
The short answer is that GenericDataSource was originally deprecated in
favour of Commons DBCP.
Unfortunately, problems with DBCP that could not be fixed in time for the
1.1 release meant that DBCP was removed and 1.1 reverted back to Generic
DataSource.
This is only a temporary measure so GenericDataSource was packaged
separately from the main struts jar.
Steve


-Original Message-
From: David Bolsover [mailto:[EMAIL PROTECTED]
Sent: July 4, 2003 4:04 AM
To: Struts User
Subject: GenericDataSource


Can someone explain why GenericDataSource was moved to lagacy?

I have been using it successfully as a JINI DataSourse - have
others experienced
problems? - if so, what problems?
db

-
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]




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


Re: Where is GenericDataSource?

2003-07-07 Thread Michael Muller
To answer my own question: in struts-legacy.jar

Michael Muller wrote:

I assume I need to copy another jar file to by WEB-INF/lib dir...  So 
where *is* the GenericDataSource packaged now?

Steve Raeburn wrote:

The short answer is that GenericDataSource was originally deprecated in
favour of Commons DBCP.
Unfortunately, problems with DBCP that could not be fixed in time for the
1.1 release meant that DBCP was removed and 1.1 reverted back to Generic
DataSource.
This is only a temporary measure so GenericDataSource was packaged
separately from the main struts jar.
Steve


-Original Message-
From: David Bolsover [mailto:[EMAIL PROTECTED]
Sent: July 4, 2003 4:04 AM
To: Struts User
Subject: GenericDataSource


Can someone explain why GenericDataSource was moved to lagacy?

I have been using it successfully as a JINI DataSourse - have
others experienced
problems? - if so, what problems?
db

-
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]




-
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]


ClassCastException using the DynaValidatorForm

2003-07-07 Thread Michael Muller
I've got the validation framework working for me using my own form bean 
which is derived from ValidatorForm.  I changed the form bean to be a 
DynaValidatorForm, and now I get a ClassCastException, the guts of which 
is appended below.

What gives?  Am I using the wrong validator form class?  Did I neglect 
to make some other configuration change?

I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1.

  -- Mike



java.lang.ClassCastException
	at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783)
	at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364)
	at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
	at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
	at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
	at java.lang.Thread.run(Thread.java:536)



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


Re: ClassCastException using the DynaValidatorForm

2003-07-07 Thread Michael Muller
All my fields are strings.

Here's some of my struts-config.xml:

form-bean name=foo type=org.apache.struts.validator.DynaValidatorForm
  form-property name=pbTitle type=java.lang.String /
  form-property name=pbAge type=java.lang.String /
  form-property name=pbFirstName type=java.lang.String /
  form-property name=pbLastName type=java.lang.String /
...
/form-bean
Adam Hardy wrote:
I got ClassCast exceptions, but not necessarily this one, because I was 
using field class types other than Strings in my DynaActionForm. 
DynaValidator will only validate strings, btw.

Adam

Michael Muller wrote:

I've got the validation framework working for me using my own form 
bean which is derived from ValidatorForm.  I changed the form bean to 
be a DynaValidatorForm, and now I get a ClassCastException, the guts 
of which is appended below.

What gives?  Am I using the wrong validator form class?  Did I neglect 
to make some other configuration change?

I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1.

  -- Mike



java.lang.ClassCastException
at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783) 

at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) 

at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386) 

at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) 

at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 

at java.lang.Thread.run(Thread.java:536)



-
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]




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


Re: ClassCastException using the DynaValidatorForm

2003-07-07 Thread Michael Muller
Here's the struts source that's throwing the exception:

// Can we recycle the existing form bean instance (if there is one)?
if (instance != null) {
if (config.getDynamic()) {
String className = ((DynaBean) instance).getDynaClass().getName();
if (className.equals(config.getName())) {
Apparently, instance is not a DynaBean.  It would appear that 
something other than a DynaBean is being stored where struts expects to 
find a DynaBean.

Does this help anyone figure out what I'm doing wrong?

  -- Mike

Adam Hardy wrote:

I got ClassCast exceptions, but not necessarily this one, because I was 
using field class types other than Strings in my DynaActionForm. 
DynaValidator will only validate strings, btw.

Adam

Michael Muller wrote:

I've got the validation framework working for me using my own form 
bean which is derived from ValidatorForm.  I changed the form bean to 
be a DynaValidatorForm, and now I get a ClassCastException, the guts 
of which is appended below.

What gives?  Am I using the wrong validator form class?  Did I neglect 
to make some other configuration change?

I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1.

  -- Mike



java.lang.ClassCastException
at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783) 

at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 

at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) 

at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386) 

at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) 

at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 

at java.lang.Thread.run(Thread.java:536)



-
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]




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


getConnection loop shutting down

2003-07-07 Thread Michael Muller


i start tomcat, make one database call (that throws an uncaught
exception), and then shut tomcat down.
when i shut down tomcat, it goes into a loop connecting to the database. 
 some of the log is attached.

i have also seen it go into a different loop, one where it's waiting for 
(i assume) the DB connections to be freed.

  -- mike

Jul 7, 2003 6:08:44 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Jul 7, 2003 6:08:44 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 7, 2003 6:08:45 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/90  config=C:\Program
Files\jakarta-tomcat-4.1.18-LE-jdk14\bin\..\conf\jk2.properties
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing,
config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
Jul 7, 2003 6:09:26 PM org.apache.struts.tiles.TilesRequestProcessor
initDefinitionsMapping
INFO: Tiles definition factory found for request processor ''.
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=0
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Found available connection
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Return allocated connection, activeCount=1, useCount=1
Jul 7, 2003 6:09:29 PM org.apache.struts.action.RequestProcessor
processException
WARNING: Unhandled Exception thrown: class java.sql.SQLException
Stopping service Tomcat-Standalone
Jul 7, 2003 6:11:06 PM org.apache.struts.tiles.TilesRequestProcessor
initDefinitionsMapping
INFO: Tiles definition factory found for request processor ''.
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=1
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Return new connection, activeCount=2, useCount=2
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=2
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection




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


Re: getConnection loop shutting down

2003-07-07 Thread Michael Muller
My apologies, pilot error.  I wasn't closing my db connections in a 
finally block.

Odd failure mode on Tomcat's part, though.

  -- Mike

Michael Muller wrote:



i start tomcat, make one database call (that throws an uncaught
exception), and then shut tomcat down.
when i shut down tomcat, it goes into a loop connecting to the database. 
 some of the log is attached.

i have also seen it go into a different loop, one where it's waiting for 
(i assume) the DB connections to be freed.

  -- mike

Jul 7, 2003 6:08:44 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Jul 7, 2003 6:08:44 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 7, 2003 6:08:45 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/90  config=C:\Program
Files\jakarta-tomcat-4.1.18-LE-jdk14\bin\..\conf\jk2.properties
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing,
config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
Jul 7, 2003 6:09:26 PM org.apache.struts.tiles.TilesRequestProcessor
initDefinitionsMapping
INFO: Tiles definition factory found for request processor ''.
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true
Jul 7, 2003 6:09:26 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=0
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Found available connection
Jul 7, 2003 6:09:29 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Return allocated connection, activeCount=1, useCount=1
Jul 7, 2003 6:09:29 PM org.apache.struts.action.RequestProcessor
processException
WARNING: Unhandled Exception thrown: class java.sql.SQLException
Stopping service Tomcat-Standalone
Jul 7, 2003 6:11:06 PM org.apache.struts.tiles.TilesRequestProcessor
initDefinitionsMapping
INFO: Tiles definition factory found for request processor ''.
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=1
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Return new connection, activeCount=2, useCount=2
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=1, useCount=2
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jul 7, 2003 6:11:06 PM org.apache.struts.legacy.GenericDataSource
getConnection




-
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]


how to access tiles defs in inserted jsp ?

2003-07-07 Thread Michael Muller
How do I access the value of a tiles setting from a JSP that is inserted 
into a template?  For instance, in the following scenario, I want a 
rendering of myTilesPageDef to say bfoo = bar/b, but it just 
says bfoo = /b.  I've tried some ugly hacks, which in addition to 
be ugly, didn't work.

Help!

Thanks,

  -- Mike

tiles-defs.xml:

  definition name=myTilesPageDef path=myPageTemplate.jsp
put name=body value=myBodyImpl.jsp /
put name=foo value=bar type=string /
  /definition
myPageTemplate.jsp:

  btiles:insert attribute=body //b

myBodyImpl.jsp:

  foo = tiles:insert attribute=foo /





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


validation doesn't validate

2003-07-03 Thread Michael Muller
I can't get the validation framework to do anything. 

I'm speculating that the validation.xml file isn't being read; I tried 
putting a rule that doesn't exist and then some arbitrary syntactically 
incorrect text in the file, and I didn't get an error anywhere I could 
find.  On the other hand, there is a message like this:

INFO: Loading validation rules file from '/WEB-INF/validation.xml'

in the console log.  And no errors.  No errors in the localhost_log, 
either.  So maybe it *is* reading the validation file.

My form bean name matches my validation form name, which matches the 
name in my action mapping.  I have validate=true in my action mapping.  
I have a validation rule defined for a field on the form.  (Two, 
actually: required and integer.)  Nothing. 

I'm using a DynaValidatorActionForm, in case that matters.  Oh, and this 
is RC1 of 1.1 running in tomcat 4.1.

Help!  I'm sure this is a common problem, and I'll be embarassed when I 
learn what it is, but I'm stuck.

Thanks,

 -- Mike



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


Re: validation doesn't validate

2003-07-03 Thread Michael Muller
OK, so I switched to the DynaValidatorForm.  Still no joy.  There is 
something I can't explain, though.  I stuck this in my action code:

DynaValidatorForm  f  = (DynaValidatorForm)form;
System.out.println(?? + f.getClass().getName());
And it prints out org.apache.struts.validator.DynaValidatorActionForm.

I double-checked my form-bean in my struts-config, and I definitely have 
 the DynaValidatorForm in there.  I reloaded the app.  It still says 
DynaValidatorActionForm.  I tried stopping tomcat and restarting it.  I 
tried changing the form bean to some bogus class, and it exploded when I 
 loaded that page (as I expected).  I changed the class back to 
DynaValidatorForm, but STILL the action says it's being passes a 
DynaValidatorActionForm.

Thanks,

Mike

David Graham wrote:

--- Michael Muller [EMAIL PROTECTED] wrote:

I can't get the validation framework to do anything. 

I'm speculating that the validation.xml file isn't being read; I tried 
putting a rule that doesn't exist and then some arbitrary syntactically 
incorrect text in the file, and I didn't get an error anywhere I could 
find.  On the other hand, there is a message like this:


Currently, commons-validator doesn't validate your xml file against the
DTD so you won't see a syntax error.

INFO: Loading validation rules file from '/WEB-INF/validation.xml'

in the console log.  And no errors.  No errors in the localhost_log, 
either.  So maybe it *is* reading the validation file.

My form bean name matches my validation form name, which matches the 
name in my action mapping.  I have validate=true in my action mapping.  
I have a validation rule defined for a field on the form.  (Two, 
actually: required and integer.)  Nothing. 

I'm using a DynaValidatorActionForm, in case that matters.  


You need to use DynaValidatorForm.

David


Oh, and this

is RC1 of 1.1 running in tomcat 4.1.

Help!  I'm sure this is a common problem, and I'll be embarassed when I 
learn what it is, but I'm stuck.

Thanks,

 -- Mike



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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
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]