RE: iterate tag with nested collections?

2002-02-12 Thread MacKellar, Kimberly

If I understand your structure correctly, something like the following
should work



   

  
Insured Name:  
   
 



Kim MacKellar


-Original Message-
From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 3:31 PM
To: Struts-User@Jakarta. Apache. Org (E-mail)
Subject: iterate tag with nested collections?


Hi,

I am trying to add a multi-level report to a struts application.
So the report structure will be like this:

Top Level Details
Level 1 Details .
   Level 2 Details..
   Level 2 Details..
   Level 2 Details..
   Level 2 Details..
Level 1 Details .
   Level 2 Details..
   Level 2 Details..
Level 1 Details .
   Level 2 Details..
   Level 2 Details..
   Level 2 Details..
   Level 2 Details..
Level 1 Details .
   Level 2 Details..
   Level 2 Details..


I have set up my Value objects like so:

ReportVo (top level)
inside the ReportVo I have a collection of Level1Vo value objects
inside each instance of Level1Vo I have a collection of Level2Vo value
objects. 

This info is passed into my struts jsp page.
I am able to show attributes in the top level (ReportVo) and the 1st level
(Level1Vo) value objects just fine.
My problem now is to get the Level2Vo value object attributes to show up.


Here's a hacked sample of the jsp.  What I am trying to figure out is how to
get the nested iterate tag to work.  Each Level1 value object contains a
collection of Level 2 objects.


 

Top Level:
Total Number of Submitted Applications:  
Total Face Amount: 


1st Level



   

  
Insured Name:  
   
 
 



Any thoughts on if this could work using struts tags or do I need to resort
to java code?

Thanks,
Michelle

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Form -> Bean conversion

2002-02-15 Thread MacKellar, Kimberly

I have instances of beans within the ActionForm and then access them with
the name of the bean and the name of the property in the bean when using
them in the JSP.  The only problem is having non-Strings in the bean. You
need to do some sort of conversion within the ActionForm to get around this.

Kimberly MacKellar

-Original Message-
From: John M. Corro [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:53 PM
To: [EMAIL PROTECTED]
Subject: Form -> Bean conversion


We have a bunch of existing beans that we'd like to use w/ ActionForms.  For
each bean we'll need to obviously expose the getters/setters in the
corresponding ActionForm.  The ideal scenario we'd like to see happen is
prevent the ActionForms from having all the corresponding getters/setters
hardcoded into it.  We're ok w/ coding the validate() method for each class
by hand, but we'd like to avoid having to code each ActionForm w/ a
getter/setter (even if it is templated out for us by a Struts plug in or
even a custom written batch file).  

Has anyone implemented something like this?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Form -> Bean conversion

2002-02-15 Thread MacKellar, Kimberly

You will have a getter and setter for the bean. Then in the jsp you will
access the bean something like


Kim

-Original Message-
From: John M. Corro [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:18 PM
To: Struts Users Mailing List
Subject: Re: Form -> Bean conversion


Unless I'm misunderstanding, I'm not sure if that will do what we're hoping
for

When you use the html:form tag (and corresponding input tags from the html
tag lib) on a JSP page there's error checking to make sure you have a
corresponding get/set method in the ActionForm.  If we have the original
bean as an instance variable in the ActionForm and have no other
getters/setters hardcoded into the ActionForm, won't that cause a
compile-time error on the JSP?

- Original Message -
From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 2:54 PM
Subject: RE: Form -> Bean conversion


> I have instances of beans within the ActionForm and then access them with
> the name of the bean and the name of the property in the bean when using
> them in the JSP.  The only problem is having non-Strings in the bean. You
> need to do some sort of conversion within the ActionForm to get around
this.
>
> Kimberly MacKellar
>
> -Original Message-
> From: John M. Corro [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 2:53 PM
> To: [EMAIL PROTECTED]
> Subject: Form -> Bean conversion
>
>
> We have a bunch of existing beans that we'd like to use w/ ActionForms.
For
> each bean we'll need to obviously expose the getters/setters in the
> corresponding ActionForm.  The ideal scenario we'd like to see happen is
> prevent the ActionForms from having all the corresponding getters/setters
> hardcoded into it.  We're ok w/ coding the validate() method for each
class
> by hand, but we'd like to avoid having to code each ActionForm w/ a
> getter/setter (even if it is templated out for us by a Struts plug in or
> even a custom written batch file).
>
> Has anyone implemented something like this?
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>


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

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




RE: Form -> Bean conversion

2002-02-15 Thread MacKellar, Kimberly

propertyOfBean is a protected member of the bean and is exposed with a
public get method.  The struts tag calls the get method of the property.

Kim

-Original Message-
From: John M. Corro [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:37 PM
To: Struts Users Mailing List
Subject: Re: Form -> Bean conversion


Very interesting

So in your example is 'propertyOfBean' exposed in 'nameOfBean' via a public
get method or simply as a public data member?  In other words, if I were
just accessing the value via a scriptlet would I say
"nameOfBean.getPropertyOfBean()" or "nameOfBean.propertyOfBean"

----- Original Message -
From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 3:22 PM
Subject: RE: Form -> Bean conversion


> You will have a getter and setter for the bean. Then in the jsp you will
> access the bean something like
> 
>
> Kim
>
> -Original Message-
> From: John M. Corro [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 3:18 PM
> To: Struts Users Mailing List
> Subject: Re: Form -> Bean conversion
>
>
> Unless I'm misunderstanding, I'm not sure if that will do what we're
hoping
> for
>
> When you use the html:form tag (and corresponding input tags from the html
> tag lib) on a JSP page there's error checking to make sure you have a
> corresponding get/set method in the ActionForm.  If we have the original
> bean as an instance variable in the ActionForm and have no other
> getters/setters hardcoded into the ActionForm, won't that cause a
> compile-time error on the JSP?
>
> - Original Message -
> From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Friday, February 15, 2002 2:54 PM
> Subject: RE: Form -> Bean conversion
>
>
> > I have instances of beans within the ActionForm and then access them
with
> > the name of the bean and the name of the property in the bean when using
> > them in the JSP.  The only problem is having non-Strings in the bean.
You
> > need to do some sort of conversion within the ActionForm to get around
> this.
> >
> > Kimberly MacKellar
> >
> > -Original Message-
> > From: John M. Corro [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 2:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: Form -> Bean conversion
> >
> >
> > We have a bunch of existing beans that we'd like to use w/ ActionForms.
> For
> > each bean we'll need to obviously expose the getters/setters in the
> > corresponding ActionForm.  The ideal scenario we'd like to see happen is
> > prevent the ActionForms from having all the corresponding
getters/setters
> > hardcoded into it.  We're ok w/ coding the validate() method for each
> class
> > by hand, but we'd like to avoid having to code each ActionForm w/ a
> > getter/setter (even if it is templated out for us by a Struts plug in or
> > even a custom written batch file).
> >
> > Has anyone implemented something like this?
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>


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

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




RE: Form -> Bean conversion

2002-02-15 Thread MacKellar, Kimberly

I wrote conversion methods for nonString properties of the bean within the
ActionForm to do the conversion.  There is probably an easier way but that
was the simplest I came up with.

Kim

-Original Message-
From: John M. Corro [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:39 PM
To: Struts Users Mailing List
Subject: Re: Form -> Bean conversion


Also, forgot to askif "propertyOfBean" were of type 'java.util.Date' (or
any other non-string data type) have you found situations where you ran into
any conversion problems?

- Original Message -
From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 3:22 PM
Subject: RE: Form -> Bean conversion


> You will have a getter and setter for the bean. Then in the jsp you will
> access the bean something like
> 
>
> Kim
>
> -Original Message-
> From: John M. Corro [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 3:18 PM
> To: Struts Users Mailing List
> Subject: Re: Form -> Bean conversion
>
>
> Unless I'm misunderstanding, I'm not sure if that will do what we're
hoping
> for
>
> When you use the html:form tag (and corresponding input tags from the html
> tag lib) on a JSP page there's error checking to make sure you have a
> corresponding get/set method in the ActionForm.  If we have the original
> bean as an instance variable in the ActionForm and have no other
> getters/setters hardcoded into the ActionForm, won't that cause a
> compile-time error on the JSP?
>
> - Original Message -
> From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Friday, February 15, 2002 2:54 PM
> Subject: RE: Form -> Bean conversion
>
>
> > I have instances of beans within the ActionForm and then access them
with
> > the name of the bean and the name of the property in the bean when using
> > them in the JSP.  The only problem is having non-Strings in the bean.
You
> > need to do some sort of conversion within the ActionForm to get around
> this.
> >
> > Kimberly MacKellar
> >
> > -Original Message-
> > From: John M. Corro [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 2:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: Form -> Bean conversion
> >
> >
> > We have a bunch of existing beans that we'd like to use w/ ActionForms.
> For
> > each bean we'll need to obviously expose the getters/setters in the
> > corresponding ActionForm.  The ideal scenario we'd like to see happen is
> > prevent the ActionForms from having all the corresponding
getters/setters
> > hardcoded into it.  We're ok w/ coding the validate() method for each
> class
> > by hand, but we'd like to avoid having to code each ActionForm w/ a
> > getter/setter (even if it is templated out for us by a Struts plug in or
> > even a custom written batch file).
> >
> > Has anyone implemented something like this?
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>


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

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




New Release

2001-08-08 Thread MacKellar, Kimberly

When is the new release of struts coming out (I really would like to use the
logic:notEmpty tag)?  What happened to PropertyUtils in the nightly builds?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]



RE: New Release

2001-08-09 Thread MacKellar, Kimberly

Well if I move the jar file to the correct directory, it all seems to
work... Amazing :">

-Original Message-
From: MacKellar, Kimberly 
Sent: Thursday, August 09, 2001 10:39 AM
To: '[EMAIL PROTECTED]'
Subject: RE: New Release


Chris,
This isn't exactly struts related...  How did you add back-port the
tags?  I ran jar uf struts.jar org\apache\struts\taglib\logic\EmptyTag.class
and the same for NotEmpty.class.  I also copied over the struts-logic.tld to
my WEB-INF directory.  When I restart Tomcat and try to access a page that
uses the notEmpty tag I get "Unable to load class
org.apache.struts.taglib.logic.NotEmptyTag".  Do I need to add the class
files to the manifest of my struts.jar or is it something else?

Kim

-Original Message-
From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 7:55 AM
To: '[EMAIL PROTECTED]'
Subject: RE: New Release


Just to confirm what Craig said, back-porting them to 1.0 appears to be 100%
problem-free. Once I saw those tags and was informed they were in the
nightly build, I grabbed them (along with TLD stuff, etc.) and dropped them
in our existing struts.jar (1.0); the tags work flawlessly and are quite
useful. :-) 

Chris

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 9:09 PM
To: Struts-User (E-mail)
Subject: Re: New Release




On Wed, 8 Aug 2001, MacKellar, Kimberly wrote:

> When is the new release of struts coming out (I really would like to use
the
> logic:notEmpty tag)?

If you're planning on waiting for a 1.1 release, we haven't really talked
about it yet.  I know there's quite a bit of stuff yet to integrate - in
the mean time, you could either use a 1.1 nightly build, or back-port
 and   What happened to PropertyUtils in the nightly builds?
> 

This class (and the digester stuff) now uses the packages from
jakarta-commons for this.  They have the same functionality but different
package names.  (The classes are in the commons-*.jar files).

> Kimberly MacKellar
> Thomson Financial Publishing
> [EMAIL PROTECTED]
> 

Craig



Iterate with offset=parameter

2001-08-09 Thread MacKellar, Kimberly

I am trying to iterate over a Vector using the logic:iterate tag.
Everything works fine until I try to set an offset. 
The offset for where I need to start iterating from is passed in as a
parameter to the page and I retrieve it using 


when I try to use fromRecord in the iterate tag 
  

I get the following on the page
javax.servlet.ServletException: java.lang.String

This makes sense since fromRecord is of type String and offset is expecting
an int or Integer.

So I then tried to make the offset a variable using
<% int fromRec = Integer.parseInt(fromRecord); %>   and
  

This doesn't throw an error but doesn't set the correct offset and is always
starting from 0.  

How can I retrieve the parameter and use it in the iterator?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]




RE: findForward and Errors

2001-08-14 Thread MacKellar, Kimberly

This doesn't work unless e.getMessage() returns a String that is an entry in
your ApplicationResources.properties file.  I did something similar but
added an entry in the ApplicationResources.properties file like 
error.exception = "Exception: {0}". 
 
Then when I create the error I use 
catch (Exception e) {
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.exception", e.getMessage()));
saveErrors(request, errors);
return mapping.findForward("failure");
}

And you need to save the errors.

Kim MacKellar

-Original Message-
From: Shawn Sohl [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 12:52 PM
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: findForward and Errors


In my Action class I catch errors if they occur.  What I want to know is can
I create an "ActionErrors" object within my Action class and add an error to
it like I do in a Form class.  Basically what I want to do is shown in the
code below.  My .jsp page that "failure" points to has the ""
tag within it but it isnt picking up the error.  I know I can create and set
an attribute within the response object and pass the error that way but I
thought I could use something like I'm trying to do below.

 catch(Exception e)
{
ActionErrors errors = new ActionErrors();
errors.add("error",new ActionError(e.getMessage());
return mapping.findForward("failure");
}

Thanks
  



FormFile

2001-08-15 Thread MacKellar, Kimberly

I am trying to upload an image to my local tomcat server.  I have created a
bean called ImageUploadForm that contains 
FormFile imageFile;

public void setImageFile(FormFile imageFile)
{
this.imageFile = imageFile;
}

public FormFile getImageFile()
{
return imageFile;
}

and a JSP file that contains 


When I submit the JSP page the appropriate form is attempting to be
populated but I get the error
java.lang.IllegalArgumentException: argument type mismatch
in the browser

I changed the imageFile to be of type Object and printed out
imageFile.getClass().getName() to see what was acutally getting passed to
the form and it turns out to be a String!  Does anyone know what might be
causing this?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]
(847) 933-8005




Multipart Request

2001-08-16 Thread MacKellar, Kimberly

I have a form that submits a file to an action (UploadImageAction).  After
the action has finished processing the file it forwards to another Action
that retrieves data to display a page.  When the forward is invoked in
UploadImageAction I get the following error
javax.servlet.ServletException: MultipartIterator: no multipart request data
sent at
org.apache.struts.upload.MultipartIterator.parseRequest(MultipartIterator.ja
va:341) at
org.apache.struts.upload.MultipartIterator.(MultipartIterator.java:152) 


Is there a way to reset something in the request to prevent this from
happening?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]
(847) 933-8005




Link Tag Parameters

2001-08-17 Thread MacKellar, Kimberly

I have a bean that is being stored in the Session which contains a caseId
and a HashMap of related items.  In my JSP page I print the caseId and then
iterate over the HashMap and print out its key and value Object.  During
this iteration I need to be able to print out a link tag that will go to an
action with the caseId and the key of the HashMap.  I know I can't use the
paramId/paramName/paramValue because I need more than one argument added to
the query string.  But I also can't create a Map for the query parameters
because the Map is changing with each iteration and the HashMap doesn't have
a reference to the caseId.  How can I create a Map that will change with the
iterations?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]




RE: Back Button in Struts

2001-08-20 Thread MacKellar, Kimberly

Where do you need to set these header values (Action, ActionServlet...)?  I
added them to my Action classes and it doesn't seem to do anything.

Kim MacKellar

-Original Message-
From: Pete Gordon [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 20, 2001 11:56 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Back Button in Struts


You can also look at putting in the Expires HTTP Header parameter to force
the client to hit the server each time.  This forces the back button to go
back to the webserver.

//These Response Headers prevent Client side cache of web pages
//response.setHeader("Cache-Control", "no-cache");  // don't do
this -- prevents back button
//response.setHeader("Pragma", "no-cache"); //
don't do this -- prevents back button
response.setHeader("Expires", "0");


Pete Gordon

-Original Message-
From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 20, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Back Button in Struts


You can't really use the javascript:history.back() function to hit the
Action class as the history.back does not even hit the webserver.  It is an
internal "client" operation, like most javascript is.

One solution you might want to try is to create a stack object for each
session to track what "actions" they have run.  Then you can implement a
fairly decent "back" button.

Haven't done this myself, but know of another project that has.



-Original Message-
From: Larry Maturo [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 20, 2001 9:11 AM
To: [EMAIL PROTECTED]
Subject: Back Button in Struts


How do you implement a generic back button in 
struts such that it hits the Action Class?  When  
you use something like:
Back

You go back to the jsp, but miss the Action Class,
which is often a bad thing.

-- Larry Maturo



RE: Back Button in Struts

2001-08-20 Thread MacKellar, Kimberly

Well... I removed the calls from my Actions and added it to the
configuration of my ActionServlet.

  nocache
  true


When I hit the back button its getting the pages from the client cache
instead of from the server.

Kim MacKellar

-Original Message-
From: MacKellar, Kimberly 
Sent: Monday, August 20, 2001 5:01 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Back Button in Struts


Where do you need to set these header values (Action, ActionServlet...)?  I
added them to my Action classes and it doesn't seem to do anything.

Kim MacKellar

-Original Message-
From: Pete Gordon [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 20, 2001 11:56 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Back Button in Struts


You can also look at putting in the Expires HTTP Header parameter to force
the client to hit the server each time.  This forces the back button to go
back to the webserver.

//These Response Headers prevent Client side cache of web pages
//response.setHeader("Cache-Control", "no-cache");  // don't do
this -- prevents back button
//response.setHeader("Pragma", "no-cache"); //
don't do this -- prevents back button
response.setHeader("Expires", "0");


Pete Gordon

-Original Message-
From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 20, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Back Button in Struts


You can't really use the javascript:history.back() function to hit the
Action class as the history.back does not even hit the webserver.  It is an
internal "client" operation, like most javascript is.

One solution you might want to try is to create a stack object for each
session to track what "actions" they have run.  Then you can implement a
fairly decent "back" button.

Haven't done this myself, but know of another project that has.



-Original Message-
From: Larry Maturo [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 20, 2001 9:11 AM
To: [EMAIL PROTECTED]
Subject: Back Button in Struts


How do you implement a generic back button in 
struts such that it hits the Action Class?  When  
you use something like:
Back

You go back to the jsp, but miss the Action Class,
which is often a bad thing.

-- Larry Maturo



RE: Does not work proper?

2001-09-10 Thread MacKellar, Kimberly

Are all of your errors defined in the ApplicationResources.properties?

Kim MacKellar

-Original Message-
From: Marcel Andres [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 10:06 AM
To: struts-user
Subject: Does  not work proper?


Hi there

Like most of you, I am using the -tag to show errors on the JSP
page. My problem is, that I don't get any message on the JSP page. I do the
following check before I return to the form:

if (!errors.empty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}

When I check the values, "errors.empty()" it is set to false, and the value
for "errors.size()" is 1.

On the JSP, I am using a template with header, main, and footer. In the
header I declared this:

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





 
  
   
  
 



Any comments would be appreciated.

Marcel



RE: How to mapping to a action class instead of a JSP file ?

2001-09-13 Thread MacKellar, Kimberly

In your struts-config.xml put


  


Kim

-Original Message-
From: Julia Yang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 13, 2001 4:20 PM
To: [EMAIL PROTECTED]
Subject: How to mapping to a action class instead of a JSP file ?


Hi, 
Does any one know how mapping to a action class instead of a JSP file in
your Action class. In other word, when you return 

return (mapping.findForward("success")); 

how do you set success is another xxxAction class instead of a xxx.jsp
file

Thanks

Julia



RE: Application scope objects

2001-09-13 Thread MacKellar, Kimberly

I created a servlet that is loaded at server initialization by including the
following in web.xml

  
Initialization
com.tfp.fraudban.InitializationServlet
1
  

and in the init method of InitializationServlet I make a call like

getServletContext().setAttribute("returnTypes", list);

which saves an ArrayList list into the attribute returnTypes in the
servlet's context.  list is being populated by some calls to the database.

Kim
-Original Message-
From: Debasish Ghosh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 13, 2001 4:24 PM
To: [EMAIL PROTECTED]
Subject: Application scope objects


Hi All -

In my application, I would like to cache some of the
objects at the application scope in order to reduce
database access. What is the most recommended way of
achieving this in Struts ? Should I make them members
of OurActionServlet, which is derived from
ActionServlet ?

Please suggest.

Regards.

- Debasish

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/



RE: REPOST: A hint how to do the following with a bean.

2001-10-04 Thread MacKellar, Kimberly

To get the first element of the Vector set the length=1 in the iterate tag
for example:


 
 
 
 
 



Then to read the rest of the entries in the vector set the offset of the
iterate to such as:

 
 
 
 
 



Kimberly MacKellar

-Original Message-
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 04, 2001 7:17 AM
To: Struts
Subject: REPOST: A hint how to do the following with a bean.


Hi,

Need a hint on how to do the following:

I have a bean which is a vector of items. Each item object has a name,
description price etc. When the user selects an item I create this vector
and pass it to a page which iterates through the vector and creates a table.
Something like:

name desc price storeroombuyer

The table I get has the same data for the first two rows. I want to take out
those first two rows and place them into the table caption. Without
iterating through the vector how can I get the name and desc property of the
first item. That data is going to be the same for all the other items in the
vector.

Thanks for any help.

Alex



Form Beans and Data Beans

2001-10-18 Thread MacKellar, Kimberly

I have a few classes that extend FormBean that have as an instance variable
of type Adjustment which is a bean with all the getters/setters.  The
Adjustment bean contains members of type float.  When I use the nested
notation in the JSP to access a value in the Adjustment which hasn't been
populated yet I get 0.0.  I want to make the member variables in the
FormBeans of type String so this doesn't happen.  What is the best solution
for this so that I can reuse the Adjustment bean in these FormBeans?  I've
seen mention of helper methods to do this but can someone give me a concrete
example?

TIA,

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]





RE: porb:

2001-10-19 Thread MacKellar, Kimberly



-Original Message-
From: Dua, Amit [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 19, 2001 12:24 PM
To: '[EMAIL PROTECTED]'
Subject: porb:


how to write equivalent of <%=variable1%> in stuts



Iterate and add Link

2001-10-24 Thread MacKellar, Kimberly

I have an iterate tag and the body of this tag prints out a link to forward.
I need to pass multiple parameters to the link one of which is a property of
the current bean in the iteration.  
I tried doing the following :

<%
java.util.HashMap args = new java.util.HashMap(2); 
args.put("adjType", "send");
%>
  

<% 
args.put("adjId",
((com.tfp.adjustments.search.AdjustmentSummaryBean)result).getAdjid());
%>
 >  
     
 


I get the error:
javax.servlet.ServletException: Cannot find bean args in scope page 


How can I make the HashMap accessible to the link tag or is there a better
way to do this?


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]




multiple params on link

2001-10-25 Thread MacKellar, Kimberly

I have an iterate tag and the body of this tag prints out a link to forward.
I need to pass multiple parameters to the link one of which is a property of
the current bean in the iteration.  
I tried doing the following :

<%
java.util.HashMap args = new java.util.HashMap(2); 
args.put("adjType", "send");
%>
  

<% 
args.put("adjId",
((com.tfp.adjustments.search.AdjustmentSummaryBean)result).getAdjid());
%>
 >  
     
 


I get the error:
javax.servlet.ServletException: Cannot find bean args in scope page 


How can I make the HashMap accessible to the link tag or is there a better
way to do this?


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]





RE: Sorting at client side

2001-10-31 Thread MacKellar, Kimberly

How are you storing the information in the columns?  

Kim

-Original Message-
From: Rajeshwar Rao V [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31, 2001 2:05 PM
To: Struts Users Mailing List
Subject: Sorting at client side


Hi ,

We are displaying data in tabular form in a JSP. I want to sort it
on column name. How can i do it at JSP level?
we are using "Struts" in our application.Please help if anybody worked on
same kinda stuff.

Thnaks in advance
raj

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Help-URGENT!!

2001-11-15 Thread MacKellar, Kimberly

You can do a  to the size of the vector.
Then do a .  
I think this should work but haven't tried it.

-Original Message-
From: Francois Duchaussoy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 4:13 PM
To: 'Struts Users Mailing List'
Subject: RE: Help-URGENT!!


Have a look to Struts Logic Tag 

-Original Message-
From: Ashoka Murthy [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 11:17 AM
To: [EMAIL PROTECTED]
Subject: Help-URGENT!!


I have a vector object available in request. Now I want to check in the JSP 
whether its size is 0 or more, if it is 0 I want to print a message "No Data

available" in the jsp. I want to know how to do this in Struts framework?

Thanks
Ashoka Murthy

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




multiple select

2001-11-15 Thread MacKellar, Kimberly

Hi All,
I have a JSP that contains 
  
  

 

  

notAssociated is an ArrayList of LabelValueBeans

when i submit the form containing this snippet it gets sent to an action
that contains  the following code
...
EditAssociationsForm assocForm = (EditAssociationsForm)form;
String[] blah = assocForm.getNewAssociations();
if(blah == null) {
cat.debug("blah is null");
}
else {
cat.debug("blah length=" + blah.length);
for(int x=0; x" which means reset is being called then the value is being set.  I
don't see any other print outs from this code to indicate reset is being
called again.

and my struts config contains
...

  

...

Does anyone see why the reset appears to be getting called or why the length
of the array is always being set to 0?  

My head is starting to hurt from banging it against the wall...


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: multiple select

2001-11-16 Thread MacKellar, Kimberly

Maybe I should've just gone home

public void setNewAssociations(String[] newAssociations) {
System.out.println("newAssociations=" + newAssociations.length);
newAssociations = newAssociations;
}

!= 

public void setNewAssociations(String[] newAssociations) {
System.out.println("newAssociations=" + newAssociations.length);
this.newAssociations = newAssociations;
}

Kim MacKellar

-Original Message-
From: MacKellar, Kimberly 
Sent: Thursday, November 15, 2001 5:09 PM
To: Struts-User (E-mail)
Subject: multiple select


Hi All,
I have a JSP that contains 
  
  

 

  

notAssociated is an ArrayList of LabelValueBeans

when i submit the form containing this snippet it gets sent to an action
that contains  the following code
...
EditAssociationsForm assocForm = (EditAssociationsForm)form;
String[] blah = assocForm.getNewAssociations();
if(blah == null) {
cat.debug("blah is null");
}
else {
cat.debug("blah length=" + blah.length);
for(int x=0; x" which means reset is being called then the value is being set.  I
don't see any other print outs from this code to indicate reset is being
called again.

and my struts config contains
...

  

...

Does anyone see why the reset appears to be getting called or why the length
of the array is always being set to 0?  

My head is starting to hurt from banging it against the wall...


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]


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

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




RE: Question Regarding Cookies

2001-11-16 Thread MacKellar, Kimberly

Could you do the following?








Kimberly MacKellar

-Original Message-
From: Juan Alvarado [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 3:35 PM
To: Struts
Subject: Question Regarding Cookies


Hello:

I am using the following code to handle some cookies in a page:

<%
Cookie[] cookies = request.getCookies();
pageContext.setAttribute("cookies", cookies);
%>




What I'd like to know is if it is possible to lose the scriptlet above and
replace it with some struts specific tag and still keep the basic
functionality of the code.

Thanks in advance from a struts beginner.

**
Juan Alvarado
Internet Developer -- Manduca Management
(786)552-0504
[EMAIL PROTECTED]
AOL Instant Messenger: [EMAIL PROTECTED]


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Use Request Attribute in message tag

2001-11-16 Thread MacKellar, Kimberly

Is it because of the typo?

"/>

Kimberly MacKellar

-Original Message-
From: Rooms, Christoph [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 9:03 AM
To: 'Struts Users Mailing List'
Subject: Use Request Attribute in message tag


Hi, 

I'm using Struts 1.0.

I want to put a localized message on the error.jsp. Therefor when I have an
error in my action, I will fill up an attribute in the request with the
locale key. And then use this tag in my error.jsp ...


")"/>


But ... It doesn't work ... 

Anyone knows how do this ?

Thanks! 

Christoph Rooms


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Logic:empty

2001-11-19 Thread MacKellar, Kimberly

This may be one of the tags that is in the nightly builds so if you are
using the release build it won't be there...

Kimberly MacKellar

-Original Message-
From: Ines [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 19, 2001 4:30 PM
To: [EMAIL PROTECTED]
Subject: Logic:empty


I can´t find the empty tag. 
The documentation presents it but I could not find the class.

The problem i have is that I want to check if a bean is null. In that case i
have to print some data

Is there any tag that could help me with this problem?

Thanks a lot!

Ines Pederiva.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Mutliple lines of Form Fields from Iteration

2001-11-29 Thread MacKellar, Kimberly

I have a class called Tags which contains 5 fields each of which is a
String.  In an action form, I have a Vector of Tags.  I need to be able to
iterate over the vector to print out the values contained in tags as form
fields that will then be submitted and hopefully put back into the Vector of
Tags.  I know how to print out the vector of tags but I'm wondering if I
specify that the form field is indexed, how does that information look to
the form?  Does it get put into the vector as tag values or something else?
Is indexing only in the nightly builds?

Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: embed html tags in the javabeans.

2001-12-18 Thread MacKellar, Kimberly

Set the filter attribute of  to false.

Kimberly MacKellar

-Original Message-
From: John Ng [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 1:25 PM
To: Struts Users Mailing List
Subject: embed html tags in the javabeans.


Hi, I have a javabean with one method returning a
string containing HTML tags.  However, it seems that
the when I use  to write out the string,
those html tags got printed on the screen instead of
got interpreted by the brower.  

What should I do if I want a get method in a bean to
return a string containg HTML tags which later gets
interpreted by the browser?

Thanks
John


__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Poolman question

2001-12-18 Thread MacKellar, Kimberly

I know this is off subject but I can't find a poolman mailing list and I
know there are people on this list using Poolman...
I'm running struts-1.0 on a windowNT machine with tomcat-3.2.3.  I have
multiple webapps running under the same server.  I just set up a new webapp
that uses poolman.  The problem is that when I try to access the datasource
I've configured in the new webapp, poolman appears to be looking in other
webapps' WEB-INF/classes directory for the poolman.xml file and isn't
finding the data source for the new webapp.  Has anyone else seen this or
know how to fix it?  
Also when I try to call conn.close() (conn is of type Connection) I get the
following exception:
java.lang.NullPointerException
at java.util.Hashtable.containsKey(Hashtable.java:299)
at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown
Source)
at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source)
at com.codestudio.util.JDBCPool.closeStatement(Unknown Source)
at com.codestudio.sql.PoolManConnection.clean(Unknown Source)
at com.codestudio.util.JDBCPool.returnConnection(Unknown Source)
at com.codestudio.util.JDBCPool.connectionClosed(Unknown Source)
at com.codestudio.sql.PoolManConnection.sendCloseEvent(Unknown
Source)
at com.codestudio.sql.PoolManConnectionHandle.close(Unknown Source)
at
com.tfp.admintool.database.FileTypeDatabase.getFieldList(FileTypeDatabase.ja
va:256)
at
com.tfp.admintool.fileType.EditTagListAction.performAction(EditTagListAction
.java:56)
at
com.tfp.admintool.ValidatedAction.perform(ValidatedAction.java:40)
at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1786)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
2)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]
(847) 933-8005


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Poolman question

2001-12-18 Thread MacKellar, Kimberly

I'm not sure how my connection could be null at the point I try to close it.
Following is one of the methods where I'm having this problem.  If I
uncomment the conn.close() in the try block, I get the exception I sent
earlier.
public static Vector getFileTypeIdList() {
Vector results = new Vector();

Connection conn = null;

try {
conn = Database.getConnection();

CallableStatement stmt =
conn.prepareCall(GET_FILE_TYPE_ID_LIST);

stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.execute();
ResultSet rs = (ResultSet)stmt.getObject(1);

while(rs.next()) {
 
results.add(rs.getString(FieldMappingsFileType.FILE_TYPE_ID));
}

//conn.close();
//conn = null;
}
catch (SQLException sqle) {
cat.error("getFileTypeIdList: " + sqle.getMessage());
try {
if(!conn.isClosed()) {
//conn.close();
//conn = null;
}
}
catch(SQLException sqle1) {
cat.fatal("getFileTypeIdList: " + sqle1.getMessage());
}
}

if(results.size() > 0) {
return results;
}
else {
return null;
}
}

-Original Message-
From: Nathan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 4:35 PM
To: Struts Users Mailing List
Subject: RE: Poolman question


When you call "conn.close()" it can throw an SQLException so you should put
it in a try catch block with an empty catch.  But this is not the problem
you have.  In your case conn is already null.  So you should have something
like this:

try {
if (resultSet!=null) resultSet.close();
if (statement!=null) statement.close();
if (connection!=null) connection.close();
} catch (SQLException sqle) { }

Hope that helps :)

Nathan Anderson



-Original Message-
From: MacKellar, Kimberly [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 2:16 PM
To: Struts-User (E-mail)
Subject: Poolman question


I know this is off subject but I can't find a poolman mailing list and I
know there are people on this list using Poolman...
I'm running struts-1.0 on a windowNT machine with tomcat-3.2.3.  I have
multiple webapps running under the same server.  I just set up a new webapp
that uses poolman.  The problem is that when I try to access the datasource
I've configured in the new webapp, poolman appears to be looking in other
webapps' WEB-INF/classes directory for the poolman.xml file and isn't
finding the data source for the new webapp.  Has anyone else seen this or
know how to fix it?
Also when I try to call conn.close() (conn is of type Connection) I get the
following exception:
java.lang.NullPointerException
at java.util.Hashtable.containsKey(Hashtable.java:299)
at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown
Source)
at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source)
at com.codestudio.util.JDBCPool.closeStatement(Unknown Source)
at com.codestudio.sql.PoolManConnection.clean(Unknown Source)
at com.codestudio.util.JDBCPool.returnConnection(Unknown Source)
at com.codestudio.util.JDBCPool.connectionClosed(Unknown Source)
at com.codestudio.sql.PoolManConnection.sendCloseEvent(Unknown
Source)
at com.codestudio.sql.PoolManConnectionHandle.close(Unknown Source)
at
com.tfp.admintool.database.FileTypeDatabase.getFieldList(FileTypeDatabase.ja
va:256)
at
com.tfp.admintool.fileType.EditTagListAction.performAction(EditTagListAction
.java:56)
at
com.tfp.admintool.ValidatedAction.perform(ValidatedAction.java:40)
at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1786)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
2)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat

RE: Poolman question

2001-12-18 Thread MacKellar, Kimberly

This design looks good.  I'm going to add the finally.
I don't mean to harp on the point but how is it that the connection would be
null if I'm never setting it to null.  I see some problems which appear to
be related to connections not getting closed and I'm worried that the
problem I'm having with closing the connection is causing this.

Kim

-Original Message-
From: Robert Parker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 5:23 PM
To: Struts Users Mailing List
Subject: Re: Poolman question


Whilst we're on the exception handling design, you could consider the
following design...
The point is that under all circumstances, you want to close your resources,
so consider putting them in a finally block. That way you don't have to
duplicate your close statements...

try
{
...
}
catch(SQLException e)
{
...
}
finally
{
try
{
 if (null != conn)
 {
  conn.close();
 }
 ...
 }
 catch(Exception)
 {

 }
}

- Original Message -
From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 19, 2001 9:57 AM
Subject: RE: Poolman question


> I'm not sure how my connection could be null at the point I try to close
it.
> Following is one of the methods where I'm having this problem.  If I
> uncomment the conn.close() in the try block, I get the exception I sent
> earlier.
> public static Vector getFileTypeIdList() {
> Vector results = new Vector();
>
> Connection conn = null;
>
> try {
> conn = Database.getConnection();
>
> CallableStatement stmt =
> conn.prepareCall(GET_FILE_TYPE_ID_LIST);
>
> stmt.registerOutParameter(1, OracleTypes.CURSOR);
> stmt.execute();
> ResultSet rs = (ResultSet)stmt.getObject(1);
>
> while(rs.next()) {
>
> results.add(rs.getString(FieldMappingsFileType.FILE_TYPE_ID));
> }
>
> //conn.close();
> //conn = null;
> }
> catch (SQLException sqle) {
> cat.error("getFileTypeIdList: " + sqle.getMessage());
> try {
> if(!conn.isClosed()) {
> //conn.close();
> //conn = null;
> }
> }
> catch(SQLException sqle1) {
> cat.fatal("getFileTypeIdList: " + sqle1.getMessage());
> }
> }
>
> if(results.size() > 0) {
> return results;
> }
> else {
> return null;
> }
> }
>
> -Original Message-
> From: Nathan Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 4:35 PM
> To: Struts Users Mailing List
> Subject: RE: Poolman question
>
>
> When you call "conn.close()" it can throw an SQLException so you should
put
> it in a try catch block with an empty catch.  But this is not the problem
> you have.  In your case conn is already null.  So you should have
something
> like this:
>
> try {
> if (resultSet!=null) resultSet.close();
> if (statement!=null) statement.close();
> if (connection!=null) connection.close();
> } catch (SQLException sqle) { }
>
> Hope that helps :)
>
> Nathan Anderson
>
>
>
> -Original Message-
> From: MacKellar, Kimberly [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 2:16 PM
> To: Struts-User (E-mail)
> Subject: Poolman question
>
>
> I know this is off subject but I can't find a poolman mailing list and I
> know there are people on this list using Poolman...
> I'm running struts-1.0 on a windowNT machine with tomcat-3.2.3.  I have
> multiple webapps running under the same server.  I just set up a new
webapp
> that uses poolman.  The problem is that when I try to access the
datasource
> I've configured in the new webapp, poolman appears to be looking in other
> webapps' WEB-INF/classes directory for the poolman.xml file and isn't
> finding the data source for the new webapp.  Has anyone else seen this or
> know how to fix it?
> Also when I try to call conn.close() (conn is of type Connection) I get
the
> following exception:
> java.lang.NullPointerException
> at java.util.Hashtable.containsKey(Hashtable.java:299)
> at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown
> Source)
> at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source)
> at com.codestudio.util.JDBCPool.closeStatement(Unknown Source)
> at com.codestudio.sql.PoolManConnection.clean(Unknown Source)
&g

RE: Poolman question

2001-12-18 Thread MacKellar, Kimberly

Thanks for the info.  I'll try that version.

Kim

-Original Message-
From: Justin Piper [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 5:41 PM
To: 'Struts Users Mailing List'
Subject: RE: Poolman question


I ran into this problem with Poolman 2.1b, as well.  The problem isn't that
the connection is null, it's a particular String variable that's apparently
used to identify pooled SQL statements.  I only took a cursory glance at the
code, so I don't know offhand why it's null.  Disabling prepared statement
pooling in poolman.xml got rid of the NullPointerExceptions, however it
caused another even weirder problem.  After making my first stored procedure
call, all subsequent calls would act as though they were executing properly,
but no changes would actually be made to the database.  I got fed up and
switched my project over to use version 2.0.4 instead, which thus far seems
to work much better.

-----Original Message-
From: MacKellar, Kimberly [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 18, 2001 5:28 PM
To: 'Struts Users Mailing List'
Subject: RE: Poolman question


This design looks good.  I'm going to add the finally.
I don't mean to harp on the point but how is it that the connection would be
null if I'm never setting it to null.  I see some problems which appear to
be related to connections not getting closed and I'm worried that the
problem I'm having with closing the connection is causing this.

Kim

-Original Message-
From: Robert Parker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 5:23 PM
To: Struts Users Mailing List
Subject: Re: Poolman question


Whilst we're on the exception handling design, you could consider the
following design...
The point is that under all circumstances, you want to close your resources,
so consider putting them in a finally block. That way you don't have to
duplicate your close statements...

try
{
...
}
catch(SQLException e)
{
...
}
finally
{
try
{
 if (null != conn)
 {
  conn.close();
 }
 ...
 }
     catch(Exception)
 {

 }
}

- Original Message -
From: "MacKellar, Kimberly" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 19, 2001 9:57 AM
Subject: RE: Poolman question


> I'm not sure how my connection could be null at the point I try to close
it.
> Following is one of the methods where I'm having this problem.  If I
> uncomment the conn.close() in the try block, I get the exception I sent
> earlier.
> public static Vector getFileTypeIdList() {
> Vector results = new Vector();
>
> Connection conn = null;
>
> try {
> conn = Database.getConnection();
>
> CallableStatement stmt =
> conn.prepareCall(GET_FILE_TYPE_ID_LIST);
>
> stmt.registerOutParameter(1, OracleTypes.CURSOR);
> stmt.execute();
> ResultSet rs = (ResultSet)stmt.getObject(1);
>
> while(rs.next()) {
>
> results.add(rs.getString(FieldMappingsFileType.FILE_TYPE_ID));
> }
>
> //conn.close();
> //conn = null;
> }
> catch (SQLException sqle) {
> cat.error("getFileTypeIdList: " + sqle.getMessage());
> try {
> if(!conn.isClosed()) {
> //conn.close();
> //conn = null;
> }
> }
> catch(SQLException sqle1) {
> cat.fatal("getFileTypeIdList: " + sqle1.getMessage());
> }
> }
>
> if(results.size() > 0) {
> return results;
> }
> else {
> return null;
> }
> }
>
> -Original Message-
> From: Nathan Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 4:35 PM
> To: Struts Users Mailing List
> Subject: RE: Poolman question
>
>
> When you call "conn.close()" it can throw an SQLException so you should
put
> it in a try catch block with an empty catch.  But this is not the problem
> you have.  In your case conn is already null.  So you should have
something
> like this:
>
> try {
> if (resultSet!=null) resultSet.close();
> if (statement!=null) statement.close();
> if (connection!=null) connection.close();
> } catch (SQLException sqle) { }
>
> Hope that helps :)
>
> Nathan Anderson
>
>
>
> -Original Message-
> From: MacKellar, Kimberly [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 2:16 PM
> To: Struts-User (E-mail)
> Subject: Poolman questi

RE: How to Forward from one action to another action

2001-12-19 Thread MacKellar, Kimberly

You need to add your object to the request or the session. 
Try adding 
if ("request".equals(mapping.getScope()))
 request.setAttribute(mapping.getAttribute(), oForm);
else
 session.setAttribute(mapping.getAttribute(), oForm);

Where your struts-config.xml contains something like

  


-Original Message-
From: Leena [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 12:14 AM
To: [EMAIL PROTECTED]
Subject: How to Forward from one action to another action


Hi All,

Here is the code which i've written in my action class.

 ABCustomerInfo[] oCustInfo = remote.searchAddressBookByCriteria
(iPartnerId,iBusinessId,data,true);
 System.out.println("Number of Customers "+oCustInfo.length);
 oForm.setCustomers(oCustInfo);
 ActionForward forward = mapping.findForward("browse");
 return (forward);

   Here it gets the data from the remote object. But when i go to the
forwarded browse file, i am getting customerinfo object as null. It says it
is not set. Can anyone help me to fix this?

Thanks and Regards

Leena


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with bean:define?

2001-12-19 Thread MacKellar, Kimberly

This is happening because when you click submit and go to validate(...) in
your form class a new form is created and populated with the request
parameters from the JSP page.  So if you don't have postDate as a hidden
field or put the form in session the value will be lost.  Ted posted a
message on this topic not too long ago about how to handle this situation.

Kimberly MacKellar

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 9:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Problem with bean:define?


Well, I did a test and bean:write displays the date the first time thru, but
then displays nothing when I return to the page to display validation
errors?  Why would this value be getting cleared in my form?  I null out all
my fields in the reset method including this 'postDate' property.  Any
ideas?   

-Original Message-
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 7:15 AM
To: Struts Users Mailing List
Subject: RE: Problem with bean:define?


are you saying your jsp is getting null pointer excp
in setAttribute() in the 


Keith. (not much use I suspect - try my best!).

--- "Siggelkow, Bill" <[EMAIL PROTECTED]>
wrote:
> Specifically, I am trying to use the define tag to
> define a variable based
> on a property of the FormBean as follows: (the
> getLocalDate is my own tag
> for rendering dates.
> 
>  property="postDate"
> type="java.util.Date"/>
>  style="long"/>
> 
> -Original Message-
> From: Siggelkow, Bill
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 11:33 AM
> To: '[EMAIL PROTECTED]'
> Subject: Problem with bean:define?
> 
> 
> I am using the bean:define tag to make a variable
> available ... he's the
> wierd part ... it works the "first time" I enter the
> form ... but if I
> return to the form because of a validation error ...
> it fails with a
> NullPointerException in the pageContext.setAttribute
> method ... it seems to
> me the second time around it is not finding the
> value for some reason ...
> any ideas?
> 
> Bill Siggelkow
> eBusiness Lead Developer
> 678.579.6458
> Mirant
> http://www.mirant.com
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to achieve but with an image?

2002-01-09 Thread MacKellar, Kimberly



-Original Message-
From: Cutrell, George [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 4:45 PM
To: 'Struts Users Mailing List'
Subject: How to achieve  but with an image?


Is there a way to achieve  characteristics with an 
image?  I'd like to call isCancelled() in my perform() method when a cancel
image is pressed.  Does the HTML tag library support that?

Thanks,
George Cutrell 
Technical Manager, Wireless Applications Development 
Nextel Communications, Inc. 
Desk:  703.433.8868 
Mobile:   703.926.7851 



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: