RE: getting ArrayList elements as objects

2002-03-07 Thread Domen, Ken

I was hoping by reflection that my sub-object would be re-created
automatically.  This was not the case.
I had to take all the attributes and recreate the sub-object in the
ActionClass and then attach it to the
parent class.

So the jsp code stays "clean" and struts-like

***







***

But in the UpdateMaterialAction class, there's a bit of work:

***
//2.  Grab request params from Bean.  Use this same bean to
repopulate
MaterialBean myForm = (MaterialBean)form;

//3.  Create the Material Object along w/ child Substances Objects
and
// then call business logic in EJB 
try
{
BusinessFacadeHome bhome = this.getBusinessFacadeHome();
BusinessFacade facade = bhome.create();

//1.  This is the parent object w/ parent attributes
Material m = new Material();
m.setMaterialID(myForm.getMaterialID());
m.setSupplierMaterialName(myForm.getSupplierMaterialName());
m.setNikeMaterialName(myForm.getNikeMaterialName());
m.setSupplierProductID(myForm.getSupplierProductID());
m.setNikeProductID(myForm.getNikeProductID());
m.setMaterialDescription(myForm.getMaterialDescription());
 
m.setFinalProductApplication(myForm.getFinalProductApplication());
m.setRemarks(myForm.getRemarks());
m.setMaterialStatus(myForm.getMaterialStatus());
m.setLastUserUpdate(myForm.getLastUserUpdate());
m.setConfirmingUser(myForm.getConfirmingUser());
if (myForm.getExceedsSubstanceLimit()) {
m.setExceedsSubstanceLimit("1"); }
else { m.setExceedsSubstanceLimit("0"); }

//2.  Struts does not automatically re-create sub-objects for
you from the jsp-- this doesn't work
ArrayList list = myForm.getSubstances();
System.out.println("list.size(): " + list.size());
Iterator i = list.iterator();
while (i.hasNext())
{
Substance s = (Substance)i.next();
System.out.println("s.getCasNumber(): " + s.getCasNumber());
}

//3.  So we have to reconstruct the sub-object and attach it to
the parent node-- this works.
String[] substanceNames =
request.getParameterValues("substanceName");
String[] casNumbers = request.getParameterValues("casNumber");
for (int j=0;jmailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 3:14 PM
To: '[EMAIL PROTECTED]'
Subject: getting ArrayList elements as objects


I want to be able to get (after a submit) the values of the iterator
as an ArrayList of objects in the action class.  Currently, substances is
an ArrayList in bean Material.  

How do people achieve this?  Or is there a work around?













--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




getting ArrayList elements as objects

2002-03-07 Thread Domen, Ken

I want to be able to get (after a submit) the values of the iterator
as an ArrayList of objects in the action class.  Currently, substances is
an ArrayList in bean Material.  

How do people achieve this?  Or is there a work around?













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




RE: getting a list in Action class

2002-03-07 Thread Domen, Ken

Here's my problem:

During a display of the page, I use:








But I also want to update the values.   
The html then becomes:





















So now, the bean doesn't find any getSubstanaces(ArrayList), it only sees a
bunch
of casNumbers and substanceNames.  If I say, getCasNumber() in the bean, it
only
gets the first one.

How do people deal with this in struts?

ken




-Original Message-
From: keithBacon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 3:06 AM
To: Struts Users Mailing List
Subject: Re: getting a list in Action class


tricky!
does
   myForm.getSubstances();
return a list? is it the correct size?
I would have thought putting enough debug messages would highlight the
problem.
I'd guess it's not even executing your debug code because you'd get a null
pointer exception from list.iterator() if the list was missing &
CalssCastExp
if you got the wrong list. 
Intriguing! (Most likely something really obvious... bit I can't see it.)
Keith.


--- "Domen, Ken" <[EMAIL PROTECTED]> wrote:
> If my jsp has the following:
> 
> 
> 
> 
> 
> 
> 
> Why won't my receiving Action class get these elements with:
> 
> ArrayList list = myForm.getSubstances();
> Iterator i = list.iterator();
> while (i.hasNext()) {
> Substance s = (Substance)i.next();
> System.out.println("s.getCasNumber(): " + s.getCasNumber());
> }


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
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: cannot resolve '/tags/struts-template.tld duringweblogic.jsp c

2002-03-07 Thread Domen, Ken

Do I need more than what's specified below to be in the classpath in order
for jspc to work?
 
if "" == "%JAVA_HOME%" set JAVA_HOME=\java
if "" == "%WL_HOME%" set WL_HOME=\weblogic
if "" == "%MY_HOME%" set MY_HOME=C:\viewstore\KDOMEN_view\ads\apps\ms3
set MYSERVER=%WL_HOME%\myserver
set
MYCLASSPATH=.;%MY_HOME%;%JAVA_HOME%\lib\classes.zip;%WL_HOME%\classes;%WL_HO
ME%\lib\weblogicaux.jar;%MYSERVER%\clientclasses;%MY_HOME%\lib\struts-1.0.ja
r;%MY_HOME%\classes;%MY_HOME%\lib\struts-templated.tld;%MY_HOME%\lib\struts-
bean.tld;%MY_HOME%\lib\struts.tld
 

java -classpath %MYCLASSPATH% -Dweblogic.home=%WL_HOME% weblogic.jspc
-docroot %MY_HOME% ms3\*.jsp
 
 
I tried putting all the tld's under WEB-INF
and also changed the web.xml taglib uri & location to /WEB-INF

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 5:03 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: cannot resolve '/tags/struts-template.tld during weblogic.jsp c



yes that's true, try to check whether the web.xml file is well formed or not
as well as check if the web.xml is valid(i mean check against the DTD
mentioned on top of the web.xml file).

I ran into the same problem once, first time it was uri issue next time I
had the DTD part on top of web.xml wrong. 
hope that helps 
Regards, 
RG 

-Original Message- 
From: Domen, Ken [ mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] 
Sent: Wednesday, March 06, 2002 5:03 PM 
To: 'Struts Users Mailing List' 
Subject: RE: cannot resolve '/tags/struts-template.tld during 
weblogic.jsp c 


Here's my web.xml: 

 
/tags/struts-html.tld 
/WEB-INF/lib/struts-html.tld 
   


I know that the uri & the location doesn't match but struts-html.tld is 
physically located 
at /WEB-INF/lib/struts-html.tld 

I tried changing it so that it would match up but it still failed w/ the 
following: 

C:\viewstore\KDOMEN_view\ads\apps>java -classpath 
.;C:\viewstore\KDOMEN_view\ads 
\apps\ms3;c:\jdk1.2.2\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\we

blog 
icaux.jar;c:\weblogic\myserver\clientclasses;C:\viewstore\KDOMEN_view\ads\ap

ps\m 
s3\lib\struts-1.0.jar;C:\viewstore\KDOMEN_view\ads\apps\ms3\classes;C:\views

tore 
\KDOMEN_view\ads\apps\ms3\lib\struts-templated.tld;;C:\viewstore\KDOMEN_view

\ads 
\apps\ms3\lib\struts-bean.tld;C:\viewstore\KDOMEN_view\ads\apps\ms3\lib\stru

ts.t 
ld -Dweblogic.home=c:\weblogic weblogic.jspc -docroot 
C:\viewstore\KDOMEN_view\a 
ds\apps\ms3 ms3\*.jsp 
nested IOException: java.io.IOException: cannot resolve 
'/tags/struts-html.tld' 
into a valid tag library 

-Original Message- 
From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ] 
Sent: Wednesday, March 06, 2002 8:36 AM 
To: [EMAIL PROTECTED] 
Subject: RE: cannot resolve '/tags/struts-template.tld during 
weblogic.jsp c 


I am not familiar with WLS5.1, but in WLS6.1 

if the web.xml file has the following taglib declaration 
 
/WEB-INF/struts-template.tld 
/WEB-INF/struts-template.tld 
   

it expects the struts-template.tld under the WEB-INF directory, check if you

have the struts-template.tld in the right directory. 

-Original Message- 
From: Domen, Ken [ mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] 
Sent: Wednesday, March 06, 2002 7:54 AM 
To: '[EMAIL PROTECTED]' 
Subject: cannot resolve '/tags/struts-template.tld during weblogic.jspc 


I'm just trying to precompile my jsp's using weblogic.jspc on WLS5.1sp10 

and I get the following error: 
nested IOException: java.io.IOException: cannot resolve 
'/tags/struts-template.tld' into a valid tag library 






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


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




RE: cannot resolve '/tags/struts-template.tld duringweblogic.jsp c

2002-03-06 Thread Domen, Ken

Here's my web.xml:


/tags/struts-html.tld
/WEB-INF/lib/struts-html.tld
  


I know that the uri & the location doesn't match but struts-html.tld is
physically located
at /WEB-INF/lib/struts-html.tld

I tried changing it so that it would match up but it still failed w/ the
following:

C:\viewstore\KDOMEN_view\ads\apps>java -classpath
.;C:\viewstore\KDOMEN_view\ads
\apps\ms3;c:\jdk1.2.2\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\we
blog
icaux.jar;c:\weblogic\myserver\clientclasses;C:\viewstore\KDOMEN_view\ads\ap
ps\m
s3\lib\struts-1.0.jar;C:\viewstore\KDOMEN_view\ads\apps\ms3\classes;C:\views
tore
\KDOMEN_view\ads\apps\ms3\lib\struts-templated.tld;;C:\viewstore\KDOMEN_view
\ads
\apps\ms3\lib\struts-bean.tld;C:\viewstore\KDOMEN_view\ads\apps\ms3\lib\stru
ts.t
ld -Dweblogic.home=c:\weblogic weblogic.jspc -docroot
C:\viewstore\KDOMEN_view\a
ds\apps\ms3 ms3\*.jsp
nested IOException: java.io.IOException: cannot resolve
'/tags/struts-html.tld'
into a valid tag library

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 8:36 AM
To: [EMAIL PROTECTED]
Subject: RE: cannot resolve '/tags/struts-template.tld during
weblogic.jsp c


I am not familiar with WLS5.1, but in WLS6.1

if the web.xml file has the following taglib declaration

/WEB-INF/struts-template.tld
/WEB-INF/struts-template.tld
  

it expects the struts-template.tld under the WEB-INF directory, check if you
have the struts-template.tld in the right directory. 

-Original Message-
From: Domen, Ken [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 7:54 AM
To: '[EMAIL PROTECTED]'
Subject: cannot resolve '/tags/struts-template.tld during weblogic.jspc


I'm just trying to precompile my jsp's using weblogic.jspc on WLS5.1sp10

and I get the following error:
nested IOException: java.io.IOException: cannot resolve
'/tags/struts-template.tld' into a valid tag library






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




getting a list in Action class

2002-03-06 Thread Domen, Ken

If my jsp has the following:








Why won't my receiving Action class get these elements with:

ArrayList list = myForm.getSubstances();
Iterator i = list.iterator();
while (i.hasNext())
{
Substance s = (Substance)i.next();
System.out.println("s.getCasNumber(): " + s.getCasNumber());
}


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




cannot resolve '/tags/struts-template.tld during weblogic.jspc

2002-03-06 Thread Domen, Ken

I'm just trying to precompile my jsp's using weblogic.jspc on WLS5.1sp10

and I get the following error:
nested IOException: java.io.IOException: cannot resolve
'/tags/struts-template.tld' into a valid tag library






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




how to decide how many beans to use?

2002-02-20 Thread Domen, Ken

I'm running into a problem.  

I started out with one FormBean.  It's basically a flattened domain object.
I'm using the Dave W. Validation package and in the validation.xml, you
define
that for a particular FormBean you validate certain fields.  Different pages
need validation on different fields so using only 1 FormBean won't work.

So do you create a new FormBean for each page that needs different
validations?

thanks.
ken



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




SSL error on weblogic5.1.0sp10

2002-02-15 Thread Domen, Ken

I'm not sure if this is a weblogic or struts error but when I turn SSL on
in weblogic, an intermittent runtime error gets thrown.  

weblogic.utils.AssertionError:  *** ASSERTION FAILED ***[
Attempt to invoke 0 byte request ]
at java.lang.Throwable...
 Connection failure

Most of the time, the app runs fine but once in awhile, it will cause it a
page not to show up.

If I turn SSL off, this error goes away.

Any ideas?

thanks.
ken



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




simple text field value display

2002-02-15 Thread Domen, Ken

I'm trying to do something simple-- to render the value of a bean in a
textfield.

" />

when the documentation says use the bean property tags to get the value,
what does
it mean?

thanks.
ken


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




struts & security

2002-01-17 Thread Domen, Ken

In general, do people mostly use the webtier & ejb security
provided by J2EE?  Or is there another layer of security that
struts provides?

thanks.
ken



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




tag for authentication

2002-01-16 Thread Domen, Ken

Is there a struts tag library that does basic authentication?

ken


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




using upload

2002-01-11 Thread Domen, Ken

Is there a better way to create an uploaded document on the server using
FormFile in the Action class?

if (formFile != null)
{
File file = new File("/apps/dev/weblogic/weblogic/myserver/ms3/"
+ formFile.getFileName());
RandomAccessFile ras = new RandomAccessFile(file, "rw");
ras.write(formFile.getFileData());
}




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




RE: upload fails

2002-01-11 Thread Domen, Ken

Thanks-- adding the "enctype-multipart/form-data" did make it work.
I'm just not sure where the actual uploaded doc goes.  Does anyone know?

ken

-Original Message-
From: Bryant, Doug [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 8:01 AM
To: 'Struts Users Mailing List'
Subject: RE: upload fails


make sure your form tag sets the encoding type to multi-part

   


Hope this helps.

Doug

-Original Message-
From: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 10:58 AM
To: 'Struts Users Mailing List'
Subject: RE: upload fails


Ken,

Do you have a corresponding ActionForm containing these methods:

public FormFile getFormFile();
public void setFormFile(FormFile file);

-----Original Message-
From: Domen, Ken [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 08, 2002 12:20 PM
To: '[EMAIL PROTECTED]'
Subject: upload fails


I'm trying to do a simple file upload and my jsp has this snippet:




When I submit, I get the error:
IllegalArgumentException: Argument Type Mismatch

Am I missing something?

thanks.


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




can content be dynamic in JSP templating

2002-01-08 Thread Domen, Ken

Do we have to create a separate content.jsp for every content that's
different?
Doesn't that mean that you have to create 2 jsp's for every page that's
different?

Is there a way to make the content dynamic so that I don't have to create an
extra JSP page per content change?

  

Can the above be:










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




upload fails

2002-01-08 Thread Domen, Ken

I'm trying to do a simple file upload and my jsp has this snippet:




When I submit, I get the error:
IllegalArgumentException: Argument Type Mismatch

Am I missing something?

thanks.


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




javascript functions for required()

2002-01-03 Thread Domen, Ken

I'm wondering where the source for the client-side validation
is for required(), integer().

thanks.
ken



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




Field.getKey() not found

2002-01-03 Thread Domen, Ken

I'm writing my own Validator class and in it, I have the following line:

errors.add(field.getKey(), ValidatorUtil.getActionError(application,
request, va, field));

but my compiler complains that there is no such method:  Field.getKey()

1.  has this been deprecated?  If so, what property do I put in there?  I'm
assuming
its the field name but I don't want to put it in there statically.

I'm using:  struts-validator-200102072.jar

thanks!
ken



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




pluggable validator not working

2002-01-03 Thread Domen, Ken

I'm trying to use my own pluggable validator.
It gets called but the return to false doesn't make the
error processing take place.  Instead, it performs as though it
succeeded.

Here's the code snippet:

public static boolean myTestValidate(Object bean, 
   ValidatorAction va, 
   Field field, 
   ActionErrors errors, 
   HttpServletRequest request, 
   ServletContext application) 
{
   String value = null;
   value = ValidatorUtil.getValueAsString(bean, field.getProperty());
   System.out.println("value: " + value);
   if (value.equals("test"))
   {
System.out.println("in value equals test...");
return false;
   }
   return false;
}


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