RE: HOW TO: set up a pager with struts

2001-11-14 Thread Chuck Stern

If possible can you post an example to the list.  I've been struggling with
this same problem.

Thanks!

-Original Message-
From: storck [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 5:09 AM
To: 'Struts Users Mailing List'; 'Oleg V Alexeev'
Subject: AW: HOW TO: set up a pager with struts


Could you send me some examples?

Many Thanks!

-Ursprungliche Nachricht-
Von: Oleg V Alexeev [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 14. November 2001 11:23
An: Struts Users Mailing List; [EMAIL PROTECTED]
Betreff: Re: HOW TO: set up a pager with struts


Hello storck,

I can suggest you my way. On base of query parameters, offset and page
length values generate container or array of objects from database and
store total value of records. Container or array you can display with
iterate tag. For purposes of page links generation I can suggest bean
and tag for you - I can send it for you.

Wednesday, November 14, 2001, 1:09:06 PM, you wrote:

s Hi,

s I am developing a webapp with struts and EJB's. In some cases I only have
to
s display a list of Items. The problem is, that I cant show the whole list
...
s sure to big ...
s For retrieving the list I will either use the Fast-Lane Reader Pattern
and
s the Page-by-Page Iterator Pattern. In the Pet Store Demo they
s implemented the Page-by-Page Iterator as a applicationspecific Tag, but
I
s think it should also be possible to implement it with struts (I am
right).
s Now I NEED your HELP. How must I set it up correct?

s Any suggestions and comments are welcome !!!


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



--
Best regards,
 Olegmailto:[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: Nested Beans on form not being updated

2001-06-21 Thread Chuck Stern

Hi Simon,

I struggled with this for quite a while.  The nested beans are being set to
null when you post.  It just seemed logical that these nested beans should
be automatically re-populated from the form.  Basically, I couldn't figure a
way to make struts do it automatically for me, I think it's a limitation of
the populate() method.  There may be a way if you use a BeanInfo class to
describe your nested beans (not sure though, I'm not that familiar with how
BeanInfo classes work).  My work around was to manually re-populate the
beans 'the old fashioned way' in the action classs by getting the form
variables from the request object.

For example, my PersonForm class has an Address bean nested in it.

private int personId;
private String lname;
private String fname;
...
public AddressInfo homeAddress; // Note: this is public so I can call
setters on it


I display the address info just fine on the page with the nested dot
notation:
...
html:text property=homeAddress.address1 size=90 maxlength=100/
html:text property=homeAddress.address2 size=90 maxlength=100/
html:text property=homeAddress.city size=20 maxlength=30/
...


When I post to the action class I have to manually re-populate the
homeAddress bean:

...
PersonForm personForm = (PersonForm)form;
personForm.homeAddress.setAddress1(request.getParameter(homeAddress.address
1));
personForm.homeAddress.setAddress2(request.getParameter(homeAddress.address
2));
personForm.homeAddress.setCity(request.getParameter(homeAddress.city));
...


That's it.  If anyone knows how to do it differently that info would be
appreciated.
hth,
Chuck

-Original Message-
From: Simon Liang [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 8:34 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Nested Beans on form not being updated


Hello:

I am experiencing the same problem. Basically on a post to the form. the
nested beans are set to null. Is this right? Are we doing something wrong or
misunderstanding something here?

!-- here is the code fragment --
html:form
...
html:text name=userprofileForm property=name styleClass=select/
...
html:text name=userprofileForm property=profileWebAddress.mail
styleClass=select/
...
/html:form
!-- end code fragment --

On the post, the object 'profileWebAddress' is null. Is this valid? Can
someone shine some light into this?

Please help.

Simon



-Original Message-
From: Chuck Stern [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 18, 2001 1:24 AM
To: Struts-User
Subject: Nested Beans on form not being updated


Hi,

I have a form with multiple beans on it but the nested beans are not getting
updated when I change the data and submit.  I use dot notation to display
the data from the beans and populate the form, that works great.  After
submitting, the nested beans are set to null.

I've tried putting the form bean in both request and session but get the
same results.  Any ideas?


Thanks,
Chuck



This message is intended only for the use of the Addressee(s) and may
contain information that is PRIVILEGED and CONFIDENTIAL. If you are not
the intended recipient, dissemination of this communication is prohibited.
If you have received this communication in error, please erase all copies
of the message and its attachments and notify [EMAIL PROTECTED]
immediately.




RE: unable to programmatically perform a submit

2001-06-21 Thread Chuck Stern

Hi,

I've spent some time on this problem as well and it is very strange.  I
wasn't using an image map but instead just trying to get a HREF link to
submit.  I tried having an onclick that called a javascript function that
did a submit as well as a submit in the onclick itself.  I tried using
document.forms[0] as well as using the form name.  All of the above examples
WORKED when I didn't use the struts html:form tag.  As soon as I used the
struts html:form tag I'd get an error saying the submit() was invalid.
Ultimately I switched to a html:submit button which worked, although it's
not the presentation I'd prefer.  I don't think this is what you want with
your image map.  I'm still looking into it to see what's going on.

Chuck

-Original Message-
From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 9:23 AM
To: Norman Timmler; [EMAIL PROTECTED]
Subject: Re: unable to programmatically perform a submit


Yes, I am referencing 0 and 1 because I am running both forms on the same
page (simultaneously).
The 0 is for the struts form and the 1 is for the non-struts form.
I can programmatically, submit no problem on the non-struts form but not on
the struts form.

The struts form tag in the generated html looks like this:

form name=personalInfoForm method=POST
action=/LAPS1/VirtualClassroomWAR/editPersonalInfo.do id=form1

the non-struts form looks like this:

form id=f1

Because I can submit the second form using the index 1, this means that the
page recognizes that there is something in position 0, but that it seems
that it has somehow been rendered in such a way that it can't be
programmatically submitted using javascript.

I have also tried using the form name instead of the index and the results
are the same.
What has struts done to my form to make it not work?  I don't know

Has anyone else out there been able to make this work?

Thanks,
Michelle


- Original Message -
From: Norman Timmler [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Michelle Popovits
[EMAIL PROTECTED]
Sent: Thursday, June 21, 2001 4:55 AM
Subject: Re: unable to programmatically perform a submit


 hi michelle,

 i see a main difference between your struts version and your non-struts
 version. on the struts version you have forms[0] referencing your form and
 on the second one you have forms[1].
 the secure way to talk to forms by JavaScript is to reference the form by
 name.

 document.formName.submit();

 or

 document.formName.elementName.value = something;

 hope this will help you.
 norman

 - Original Message -
 From: Michelle Popovits [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, June 20, 2001 11:19 PM
 Subject: unable to programmatically perform a submit


 Hi,

 I am trying to get an image map working that does a submit.
 The image map itself works.
 However, when I click on the image area it complains when trying to
execute
 the submit.

 Error:  object doesn't support this property or method.

 I have tried just performing a submit without the event assignment, like
so:
 MAP NAME=MyMap
   AREA SHAPE=Rect NOHREF COORDS=82,2 163,23
 OnClick=document.forms[0].submit();
 /MAP


 This works in my non-struts form version.


 Here is the html output:

 MAP NAME=MyMap
   AREA SHAPE=Rect NOHREF COORDS=82,2 163,23

OnClick=document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub
 mit();
 /MAP

 img src=/LAPS1/VirtualClassroomWAR/images/tab1a.gif border=0
 usemap=#MyMap

 struts version

 strutshtml:html
 
 strutshtml:form action=editPersonalInfo.do name=personalInfoForm
 type=com.bmo.ifl.laps.forms.PersonalInfoForm
 
 MAP NAME=MyMap
   AREA SHAPE=Rect NOHREF COORDS=82,2 163,23

OnClick=document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub
 mit();
 /MAP

 strutshtml:img usemap=#MyMap  pageKey=page.editPersonalInfo.tabImage
 border=0 /
 ...
 /strutshtml:form

 /strutshtml:html



 non-struts version - this works

 form id=f1
 MAP NAME=MyMap2
   AREA SHAPE=Rect NOHREF COORDS=82,2 163,23
 OnClick=document.forms[1].event.value='SELECT_COURSE';f1.submit();
 /MAP


 img USEMAP=#MyMap2 SRC=%= request.getContextPath()
%/images/tab1a.gif
 BORDER=0 
 input type=text name=event value=UPDATE_PERSONAL_INFO

 /form

 I don't believe the image map is the problem.
 I think that there is just some reason why it will not except a submit()
 programmatically.

 Thanks,
 Michelle




Nested Beans on form not being updated

2001-06-18 Thread Chuck Stern

Hi,

I have a form with multiple beans on it but the nested beans are not getting
updated when I change the data and submit.  I use dot notation to display
the data from the beans and populate the form, that works great.  After
submitting, the nested beans are set to null.

I've tried putting the form bean in both request and session but get the
same results.  Any ideas?


Thanks,
Chuck



Help with define tag

2001-06-11 Thread Chuck Stern

Hi,

I think I'm missing something here.  I have a bean that is available to my
page in the request scope.  Within that I have another bean that has
properties I want to display.  I'm trying to use the define tag to get a
reference to the embedded bean and I'm getting the infamous:
javax.servlet.jsp.JspException: No getter method for property homeAddress of
bean policyHolderInfo

Here's the code -
In my bean policyHolderInfo bean attached to the request obj:

public AddressInfo homeAddress;

public AddressInfo
getHomeAddress(AddressInfo homeAddress)
{
return homeAddress;
}

public void
setHomeAddress( AddressInfo homeAddress)
{
this.homeAddress = homeAddress;
}

My jsp tag is:
bean:define id=policyHolderAddress name=policyHolderInfo
property=homeAddress /

All other getters on the policyHolderInfo bean work just fine.

Am I doing something wrong or is there another way to do this?  Any
suggestions would be appreciated.
Thanks,
Chuck



Anyone have the Struts Validator example working?

2001-06-05 Thread Chuck Stern

Hi,

I would like to try David Winterfeldt's validator for a new project I'm
working on but I can't seem to get it to work with Orion 1.51.  The default
welcome page comes up and I can see the validator initializing.  I get the
following when trying to go to the registration example page:

javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:292)
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at /registration.jsp._jspService(/registration.jsp.java:72) (JSP page line
9)
at com.orionserver[Orion/1.5.1 (build
10410)].http.OrionHttpJspPage.service(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ah._pcd(Unknown Source)
at com.evermind[Orion/1.5.1 (build
10410)].server.http.JSPServlet.service(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._xdd(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._shc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._rzc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._ft(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ip.run(Unknown Source)

Any Ideas?

Thanks,
Chuck



RE: Anyone have the Struts Validator example working?

2001-06-05 Thread Chuck Stern

Thanks, that worked.

chuck

-Original Message-
From: DeVincentiis Giustino [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 7:06 AM
To: [EMAIL PROTECTED]
Subject: RE: Anyone have the Struts Validator example working?


I used the validator with Orion and had a similar behavior, the problem was
in the web.xml.
Check that the load-on-startup values for the ActionServlet and for the
ValidatorServlet are correct.

Hope this help,
Giustino De Vincentiis

-Messaggio originale-
Da: Chuck Stern [mailto:[EMAIL PROTECTED]]
Inviato: martedì 5 giugno 2001 12.26
A: Struts-User
Oggetto: Anyone have the Struts Validator example working?


Hi,

I would like to try David Winterfeldt's validator for a new project I'm
working on but I can't seem to get it to work with Orion 1.51.  The default
welcome page comes up and I can see the validator initializing.  I get the
following when trying to go to the registration example page:

javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at
org.apache.struts.util.RequestUtils.message(RequestUtils.java:292)
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at /registration.jsp._jspService(/registration.jsp.java:72) (JSP
page line
9)
at com.orionserver[Orion/1.5.1 (build
10410)].http.OrionHttpJspPage.service(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ah._pcd(Unknown Source)
at com.evermind[Orion/1.5.1 (build
10410)].server.http.JSPServlet.service(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._xdd(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._shc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._rzc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._ft(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ip.run(Unknown Source)

Any Ideas?

Thanks,
Chuck



RE: Anyone have the Struts Validator example working?

2001-06-05 Thread Chuck Stern

I'm using Orion 1.5.1 and Struts_Validator-20010510.jar.

It worked when I changed the load-on-startup value to 1 (or 0).  A value of
2 caused the mentioned error.  What was weird is that if I moved the
web-app definition for the validator below the strut action servlet
definition in the web.xml file I would get the following error:

java.lang.NullPointerException
at
com.wintecinc.struts.action.ValidatorForm.validate(ValidatorForm.java:123)
at
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:20
98)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:211)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._xdd(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._shc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._rzc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._ft(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ip.run(Unknown Source)

It looks different but it's really the same sore of error that struts was
having, it's just not expecting null though.

Chuck


-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 10:34 AM
To: [EMAIL PROTECTED]
Subject: RE: Anyone have the Struts Validator example working?


What version are you using and what did you change to
make it work.  Maybe I can fix it.  Does Orion only
accept '1' as a valid load-on-startup value?

load-on-startup2/load-on-startup

David

--- Chuck Stern [EMAIL PROTECTED] wrote:
 Thanks, that worked.

 chuck

 -Original Message-
 From: DeVincentiis Giustino
 [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 05, 2001 7:06 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Anyone have the Struts Validator
 example working?


 I used the validator with Orion and had a similar
 behavior, the problem was
 in the web.xml.
 Check that the load-on-startup values for the
 ActionServlet and for the
 ValidatorServlet are correct.

 Hope this help,
 Giustino De Vincentiis

 -Messaggio originale-
 Da: Chuck Stern
 [mailto:[EMAIL PROTECTED]]
 Inviato: martedl 5 giugno 2001 12.26
 A: Struts-User
 Oggetto: Anyone have the Struts Validator example
 working?


 Hi,

 I would like to try David Winterfeldt's validator
 for a new project I'm
 working on but I can't seem to get it to work with
 Orion 1.51.  The default
 welcome page comes up and I can see the validator
 initializing.  I get the
 following when trying to go to the registration
 example page:

 javax.servlet.jsp.JspException: Cannot find message
 resources under key
 org.apache.struts.action.MESSAGE
   at

org.apache.struts.util.RequestUtils.message(RequestUtils.java:292)
   at

org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
   at

/registration.jsp._jspService(/registration.jsp.java:72)
 (JSP
 page line
 9)
   at com.orionserver[Orion/1.5.1 (build
 10410)].http.OrionHttpJspPage.service(Unknown
 Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._ah._pcd(Unknown Source)
   at com.evermind[Orion/1.5.1 (build
 10410)].server.http.JSPServlet.service(Unknown
 Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._cob._xdd(Unknown Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._cob._shc(Unknown Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._iz._rzc(Unknown Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._iz._ft(Unknown Source)
   at com.evermind[Orion/1.5.1 (build
 10410)]._ip.run(Unknown Source)

 Any Ideas?

 Thanks,
 Chuck


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/



RE: Anyone have the Struts Validator example working?

2001-06-05 Thread Chuck Stern

Did you try leaving your load-on-startup value set to 2 on the action
servlet configuration?

Chuck

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 3:32 PM
To: [EMAIL PROTECTED]
Subject: RE: Anyone have the Struts Validator example working?


I still have the following error when I tried to access
http://localhost/share/validator/registration.jsp:

500 Internal Server Error
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at
org.apache.struts.util.RequestUtils.message(RequestUtils.java:292)
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at /registration.jsp._jspService(/registration.jsp.java:72) (JSP
page line 9)
at com.orionserver[Orion/1.5.2 (build
10460)].http.OrionHttpJspPage.service(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._ah._rad(Unknown Source)
at com.evermind[Orion/1.5.2 (build
10460)].server.http.JSPServlet.service(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._cxb._abe(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._cxb._uec(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._io._twc(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._io._gc(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._if.run(Unknown Source)

==
My Settings are as follow:
==
Orion: 1.5.2
[application.xml]
  web-module id=validator
path=../../../../dev/share/struts-validator/validator//
[default-web-site.xml]
  web-app application=default name=validator root=/share/validator/

validator.war: extracted from validator20010510.zip
this war file is extracted and put in directory
../../../../dev/share/struts-validator/validator/

modify web.xml for load-on-startup value to 1 from 2 (already tried 0 too -
same error) as follows:
  !-- Validator Initialization Servlet Configuration --
  servlet
servlet-namevalidator/servlet-name

servlet-classcom.wintecinc.struts.action.ValidatorServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/validation.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

  !-- Action Servlet Configuration --
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name

param-valuecom.wintecinc.struts.example.validator.ApplicationResources/pa
ram-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
init-param
  param-namevalidate/param-name
  param-valuetrue/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

Am I missing sth?

Thanks in advance!

Chris

-Original Message-
From: Chuck Stern [mailto:[EMAIL PROTECTED]]
Sent: June 5, 2001 10:18 AM
To: [EMAIL PROTECTED]
Subject: RE: Anyone have the Struts Validator example working?


I'm using Orion 1.5.1 and Struts_Validator-20010510.jar.

It worked when I changed the load-on-startup value to 1 (or 0).  A value of
2 caused the mentioned error.  What was weird is that if I moved the
web-app definition for the validator below the strut action servlet
definition in the web.xml file I would get the following error:

java.lang.NullPointerException
at
com.wintecinc.struts.action.ValidatorForm.validate(ValidatorForm.java:123)
at
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:20
98)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:211)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._xdd(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._cob._shc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._rzc(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._iz._ft(Unknown Source)
at com.evermind[Orion/1.5.1 (build 10410)]._ip.run(Unknown Source)

It looks different but it's really the same sore of error that struts was
having, it's just not expecting null though.

Chuck


-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 10:34 AM
To: [EMAIL PROTECTED