RE: Problem with loss form (session scope)

2004-02-27 Thread Andrew Hill
Hmm. That does sound rather odd! Like you say, should not be like that. :-(

Only thing I can thing of here is: Is it the same session? (grasping at
straws now!)
Try println/logging the sessionId from the action and see if its still the
same as first time through.


-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 15:39
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Problem with loss form (session scope)


I am sorry.  I only have 1 action map to this form.  So, I guess the name
doesn't matter in this case.  Basically, what I am saying is the first time
I hit this action, the form constrctor will get called but the 2nd time the
action get called, this shouldn't happen, but it does.
Yes, that's what I am planning to do next, download the source code and
stepped through it.

-Betty

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 11:18 PM
To: Struts
Subject: RE: Problem with loss form (session scope)


Ah, but you didnt actually answer my question.

Is it the same name for the form in both actions mappings, and do both these
action mappings specify the scope to be session?

My suspicion is that the problem is that struts is trying to find the form
under a different key in the second action - but is this second action
actually the same action as the first or different as I am assuming?

btw: have you gone and looked at the struts source code for the request
processor and request utils class to see what it is actually doing? (Tracing
through with a debugger can be quite enlightening). One of the common
attitudes in open source is that the source is the best reference and I
certainly found this the case when I was first learning struts :-)



-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 15:10
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Problem with loss form (session scope)


I specify my own name in the struts config.  In my action, I just grabbed
the action form from the execute method.  And I am assumming struts fw get
that from session for me in this case, rather than creating a new one for
this request since my form is in session scope.  Is this right assumption?

-Betty

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 10:59 PM
To: Struts Users Mailing List
Subject: RE: Problem with loss form (session scope)


What attribute did you set the form to be stored under?
If none will default to form name. You are storing under same attribute key
yes? Both actions mapping also defined the scope to be session?

-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 14:51
To: 'Struts Users Mailing List'
Subject: RE: Problem with loss form (session scope)


In struts config's action definition, I set up the action to use a form in
session scope.  What I found out was, somehow the form constructor get
called the 2nd time the action get called.  To my understanding, if you set
up the form in session, the form will only get created once.  Any idea?

-Betty

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 9:06 PM
To: Struts Users Mailing List
Subject: Re: Problem with loss form (session scope)


Without seeing your jsp/struts-config.xml/action its a bit of a guessing
game.

I'm a bit confused by you saying ...at this point, I set up this form bean
as session scope. To me this implies your getting a form not in session
scope (i.e. request) and saving it yourself in session scope. If that is the
case - then maybe thats your problem - if the struts-config.xml says its
request, thats where struts will look for it and, if it doesn't exist, it'll
set a new one up in  request scope (even if you already have one under the
same name in session).

If I've got it wrong, then maybe you could explain further. I'm also not
clear whether your finding out your form has been 'wiped' as soon as you get
into your action and before you set it up as session scope or after that
when you get to your detail screen. Could you clarify that as well please.


Niall
- Original Message -
From: Betty Koon [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:41 AM
Subject: RE: Problem with loss form (session scope)


 Well, sorry for being vague.  It's a very vague problem, that's why
 it's very difficult to explain the details.  This only happen to one
 of my action.  I had a list inside a form.  And one of the column
 render a link
to
 the detail page.  But I need to do some processing before I redirect
 to
the
 detail.  So I wrote the link to do a form post it back to the caller
action.
 In that case, I can collect some information, at this point, I set up
 this form bean as session scope.  But everytime the post 

Exception while deploying

2004-02-27 Thread Parag
Experts,

I am getting following exception while deploying Struts application on
Weblogic8.1 SP2

Caused by: java.lang.NoClassDefFoundError:
org/apache/struts/validator/ValidatorForm

Can any one help...

Regards,
Parag

Listing Exception:

Feb 27, 2004 12:55:29 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=tru
e
Feb 27, 2004 12:55:29 PM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNul
l=true
Feb 27, 2004 12:55:30 PM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Property
Utils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(Property
Utils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.
java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:101
9)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at
org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule
java:259)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at
org.apache.commons.digester.Digester.startElement(Digester.java:1273)

at
weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(Abstrac
tSAXParser.java:459)
at
weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement
(AbstractXMLDocumentParser.java:221)
at
weblogic.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(XMLSch
emaValidator.java:618)
at
weblogic.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XML
NamespaceBinder.java:874)
at
weblogic.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamesp
aceBinder.java:591)
at
weblogic.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDVa
lidator.java:748)
at
weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartE
lement(XMLDocumentFragmentScannerImpl.java:747)
at
weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCo
ntentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
at
weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume
nt(XMLDocumentFragmentScannerImpl.java:329)
at
weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:525)
at
weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:581)
at
weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at
weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar
ser.java:1175)
at
weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at
weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:138)

at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSe
rvlet.java:1006)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet
java:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1070)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:893)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:842)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:782)
at
weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3236)
at
weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3181)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3154)
at
weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5637)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:866)
at
weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
java:2017)
at
weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2058)
at

Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread nicolas De Loof
I've built Struts 1.2.0 from the sources package uising maven 1.0RC1 
without trouble.

When I run maven site, the generated m-target/docs has no index.html 
and faqs, proposals, tiles and userGuide are empty directory. Is 
this a known build problem (waiting for update for an *official* release) ?

Nico.

Martin Cooper a écrit :

The Struts 1.2.0 Test Build is now available here:

http://www.apache.org/~martinc/struts/v1.2.0/

This is the first Struts build being made available following the same
test-and-release process that has been used successfully by the Tomcat
team for some time. It is *not* an official Apache release.
Once feedback has been collected on the stability and general quality of
this build, a determination will be made as to whether it should be
promoted to Alpha status.
--
Martin Cooper
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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


RE: Struts Workflow

2004-02-27 Thread shirishchandra.sakhare
Hi,
I don't think building a real workflow would be that simple.I mean the workflow must 
be built in the framework, the actions being just configured to use it.

And why reinvent the wheel when there is already a solution :-))

Have a look at http://www.livinglogic.de/Struts/

We used it in our project and found that it satisfies most of the requirements.
I am not sure what exactly is your requirement.But the above mentioned extension 
satisfies all workflow requirements.And I am in the process of refactoring it so that 
it provides more extension points for customization.

1.It provides workflow scope.So if you define a group of actions belonging to a 
workflow, they have their own workflow scope.The objects in this scope are available 
only for the duration of the workflow scope.If user jumps out of workflow,the workflow 
scope is cleared.
2.You can define modal dialogue box like screens, where user can be forced to complete 
a workflow/cancel it explicitly before he can jump workflow.

And the best part is,you do not need any code change.All of this is taken care by the 
workflow extension.You only have to configure your action mappings to use workflow.

Have a look at the demo application on the web site.
Also the test application is another replace where you can see how the extension can 
be used in a real world application.

I am in the process of transferring this application to sourceforge.Just transferred 
all source code to sourceforge cvs yesterday :-)).

Have  a look at the extension and let me know if you still have any questions.

HTH.
Regards,
Shirish.



-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 7:58 PM
To: Struts Users Mailing List
Subject: RE: Struts Workflow


No matter what, I would recommend turning off caching on the struts
controller, otherwise you will get anomalies with the back button and
workflows.  Do this early in your development and testing with QA.

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 26, 2004 12:42 PM
To: Struts Users Mailing List
Subject: Re: Struts Workflow

My suggestion is to build your own.  This is fairly simple stuff that must 
be wedded to your own way of coding your site or application that will fit 
your business requirements.  Make it general for use in other 
places.  Create, for example, you own do/undo/redo to work with but 
independent of the workflow.  Also create some token application or use the 
one that comes with struts.

At 10:08 AM 2/26/2004, you wrote:
Does anyone have any great ideas on creating customizable workflows in
Struts?

__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



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

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


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



Re: [OT] RE: Memory usage

2004-02-27 Thread Anand Stephen
+1

What's happening to the struts mailing list?

Of late people have been more than willing to crucify users for any reason.



I remember this mailing list being one of the friendliest mailing lists.



Appreciate your post very much Christian; very well said.



Lets not clutter this list by posting demeaning replies. (My two cents).





(Apologies for reposting a question in the past without giving enough time
for an answer, anxiety got the better of me!)



-anand stephen.




- Original Message - 
From: atta-ur rehman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 12:19 PM
Subject: Re: [OT] RE: Memory usage


 +1

 ATTA

 - Original Message - 
 From: Christian Bollmeyer [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 11:53 AM
 Subject: Re: [OT] RE: Memory usage


  On Thursday 26 February 2004 20:12, Dhaliwal, Pritpal (HQP) wrote:
 
  Now. Still remember when you wrote your first crappy lines
  you proudly called a 'program'? *That* exactly is what we
  all started from, considering me: nearly 23 years ago
  on a little ZX81 box, doing my first steps in Assembler.
  YMMV. And how I was proud. A long time has passed
  since then, and I have seens lots of crappy code in-
  between, but whenever I get proud again about what
  I've done or achieved since then, one millisecond
  before I remember how lousy I started once and
  keep my mouth shut in humility, just in time. This,
  obviously, is still a lesson you have to learn, but
  I can tell you: one of many things that separates
  the good from the possibly-not-so-good is a certain
  difference in attitude. So it would have sufficed
  to politely mention that there are tools for testing
  code efficiency (nowadays) and that this forum
  may not be the best place to ask for answers.
  All the rest is rather irrelevant, including your
  insulting assumptions about code you never
  saw or the people behind it. You think you're
  good or better? I tell you: from this mail alone
  I can tell you have still a long way to go to be
  regarded as a member of the 'Black Team',
  and in your obviously long professional career,
  you certainly have read 'Peopleware' once and
  know what I'm talking about here.
 
  HTH,
  -- Chris.
 
  And never say HTH if you intentionally
  provide a snake when someone asks
  you for a fish.
 
   Viru Bhai,
  
   No,
   You code is not good or optimized. You have problems follwing
   instructions. Your question is not related to struts and you didn't
   put OT in the subject. Even if you put OT in subject, It would still
   be a bad question because that's not what this list is discussing.
  
   Primary reason I believe your code is not good and optimized is
   because you don't have enough knowledge about how to prove it. Most
   likely your code is as good as the question you asked.
  
   You probably want to look at profilers and code coverage tools do you
   proving.
  
   If I was you, I would seriously read a Java book. Maybe a Java
   optimization book too.
  
   Hope This Helps,
   Pritpal Dhaliwal
  
   P.s.  Is it Friday yet?
  
  
   -Original Message-
   From: virupaksha [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, February 25, 2004 2:46 AM
   To: Struts Users Mailing List
   Subject: Memory usage
  
  
   Dear All,
  
   I have a requirement, where i need to stop garbage collection, is
   there any way to implement? Because, I need to  judge our code is
   good and optimized,
  
   I need some ray of hope
  
   Thanks in advance,
  
   Viru
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



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



ArrayList in Form

2004-02-27 Thread Dixit, Shashank (Cognizant)
Hello All

I have a ArrayList in the form which contains a CustomObject TheROw. I iterate thr 
this arraylist to display it by logic:iterate as follows. This row will contain many 
fields such as rate or amount.

logic:iterate id=currentRow name=theForm property=rows 
type=com.custobj.TheRow 
\\ Display all rows
/logic:iterate


PROBLEM : When the form gets submitted with rate or amount changed I expect I will get 
ArrayList back by changed values. But No change happens in the values.

Does that mean that If one uses ArrayList in the form, it can be used for the purpose 
of display only. If User changes some value we will not get those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.


This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. Any unauthorised review, use, disclosure, 
dissemination, forwarding, printing or copying of this email or any action taken in 
reliance on this e-mail is strictly prohibited and may be unlawful.
Visit us at http://www.cognizant.com

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

RE: ArrayList in Form

2004-02-27 Thread Parthasarathy Kesavaraj

I had the same rpoblem and i have used nested tags as suggested by Niall and
it works fine.


http://jakarta.apache.org/struts/userGuide/dev_nested.html

http://www.keyboardmonkey.com/index.jsp


With Regards

Partha


-Original Message-
From: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 2:47 PM
To: [EMAIL PROTECTED]
Subject: ArrayList in Form


Hello All

I have a ArrayList in the form which contains a CustomObject TheROw. I
iterate thr this arraylist to display it by logic:iterate as follows. This
row will contain many fields such as rate or amount.

logic:iterate id=currentRow name=theForm property=rows
type=com.custobj.TheRow 
\\ Display all rows
/logic:iterate


PROBLEM : When the form gets submitted with rate or amount changed I expect
I will get ArrayList back by changed values. But No change happens in the
values.

Does that mean that If one uses ArrayList in the form, it can be used for
the purpose of display only. If User changes some value we will not get
those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



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



RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread Parthasarathy Kesavaraj
Thanks mark , hubert and paul. i removed scope = request and it is working
fine now.

(Temporary fix :-)) i'll try to use lazy list once i finish off my work)


With Regards

Partha


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 8:35 PM
To: Struts Users Mailing List
Subject: Re: Problem in nested tags- Very Urgent - Please Help


Nice one..

For some reason i thought the Factory would involve more than it does,  
so i shied away from it.

Cheers Mark

On 26 Feb 2004, at 15:57, Paul, R. Chip wrote:

 Note: I think this is likely different in current versions of the  
 commons
 collections lib, but this works for the version we are dependent on.

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted

 public class LazyListExampleForm extends ActionForm {
   private List actionList;

   public LazyListExampleForm ()
   {
   Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(),
 factory);
   }

   // Getter/setters for list omitted
 }

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:49 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 wouldn't mind an example of how to use lazy list if you have one.


 On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:

 Or use the Commons Collections LazyList which handles this problem
 automatically.

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:09 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 shirish posted this a few times.

 if you're scoping to request you'll need a while loop in your
 getFoo(int index)  method

 public class OrgManagementForm extends ActionForm {

 private List addressList = new ArrayList();

 public Address getAddress(int index) {
  
  while(index = addressList.size() ) {
  this.addressList.add( new Address() );
  }

  return (Address) addressList.get(index);
 }

 bla bla.

 }

 look like it could be your problem.


 On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:

 I am having an OrganzationVO inside my form-bean.

 The OrganzationVO has a collection of AddressVOs.

 I am using nested tags like this.


 nested:nest property = orgVO

 nested:text property=orgID  size=10 maxlength=10
 styleClass=inputmand  tabindex= /
 
 nested:iterate id=addressid property=addresses indexId=index

 
 nested:text property=company1 size=30 maxlength=30
 styleClass=inputmand tabindex= /
 
 /nested:iterate

 /nested:nest

 while submitting the form I am getting an exception like this.


 2004-02-26 18:17:08,133 [ExecuteThread: '12' for queue:
 'weblogic.kernel.Default'] DEBUG org.apache.
 commons.beanutils.BeanUtils -
 setProperty([EMAIL PROTECTED], orgVO.a
 ddresses[0].company1, [get populated])
 getAddrVOAL--[]
 Feb 26, 2004 6:17:08 PM IST Error HTTP BEA-101017
 [ServletContext(id=1735147,name=gbs,conte
 xt-path=/gbs)] Root cause of ServletException.
 java.lang.ArrayIndexOutOfBoundsException
 at java.lang.reflect.Array.get(Native Method)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert
 y
 U
 tils.
 java:525)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert 
 y
 U
 tils.
 java:428)
 at
 org.apache.commons.beanutils.PropertyUtils.getNestedProperty(Property 
 U
 t
 ils.j
 ava:770)
 at
 org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils. 
 j
 a
 va:80
 1)
 at
 org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java: 
 881)
 at
 org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 at
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 at
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProc 
 e
 s
 sor.j
 ava:821)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja 
 v
 a
 :254)
 at
 com.puma.gbs.action.RequestProcessor.process(RequestProcessor.java:
 133)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:
 1482)
 at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run 
 (
 S
 ervle
 tStubImpl.jav
 a:1053)
 at
 

RE: FormBeans: A question of Style

2004-02-27 Thread Max Cooper
On Thu, 2004-02-26 at 23:01, Pradeep, PK wrote:
 I think whatever you do you can't make JSP and Action Class independent.
 Where are you populating ActionForm Object from the results from service
 layer? In Action class only right? Which you know very well for which
 JSP page it will be applicable.

True, but having one well-defined interface between the two (an
ActionForm) is preferable to having a handful of poorly-defined
interfaces between them (an ActionForm + stuffing a bunch of stuff into
the request).

 
 Also is it easy to populate all what you need in ActionForm? How one can
 populate resultset in action form which will automatically get populated
 in html table..

Yes, call myActionForm.setResults(results) instead of
request.setAttribute(results, results). This may seem like a minor
point (and it is admittedly a simple example), but maintaining complex
pages with a lot of structured data behind them gets difficult when you
have to pull a bunch of stuff out of the request with no structure
defined between the items you are pulling. Using the ActionForm as the
root of your data structure is a simple rule to follow that 'scales up'
(with data structure complexity) much better than request-stuffing.

-Max



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



microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
Hi,

I am trying to use microsoft's jdbc driver with my struts application, but to no 
avail. Here is my datasource definition:

  data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName 
value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url 
value=jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source

I have the required jars located in the WEB-INF/lib of my application which is running 
on Tomcat 4.1.29. When i try to connect to the database using this driver from a test 
class, it connects no problem so i know that the url and driver class name are 
correct. So the problem must be the type of DataSource which I am to use. Does anybody 
know which datasource to use with Microsoft's sqlserver driver? I tried using the 
DataSource that is in the mssqlserver jar but this didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire



Re: microsoft sqlserver driver struts

2004-02-27 Thread Mark Lowe
Does the error get thrown when you attempt to access the data source or  
at startup?

On 27 Feb 2004, at 11:34, Claire Wall wrote:

Hi,

I am trying to use microsoft's jdbc driver with my struts application,  
but to no avail. Here is my datasource definition:

  data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName  
value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url  
value=jdbc:microsoft:sqlserver://SERVERNAME:1433; 
DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source

I have the required jars located in the WEB-INF/lib of my application  
which is running on Tomcat 4.1.29. When i try to connect to the  
database using this driver from a test class, it connects no problem  
so i know that the url and driver class name are correct. So the  
problem must be the type of DataSource which I am to use. Does anybody  
know which datasource to use with Microsoft's sqlserver driver? I  
tried using the DataSource that is in the mssqlserver jar but this  
didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire


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


java.lang.ClassCastException

2004-02-27 Thread Vano Beridze
Hello

I've got
struts 1.1
sun jdk 1.4.2_03
Fedora Core 1
I have a simple application
one action that has two forwards.
One of them I want to costruct dynamically.
I created a plugin and in its init method I do the following

moduleConfig.addForwardConfig(new ForwardConfig(mypath,myurl,true));

when I do in the action
return mapping.findForward(mypath);
it gives me a classcast exception

java.lang.ClassCastException
at
org.apache.struts.action.ActionMapping.findForward(ActionMapping.java:151)
at com.silkroad.srm3.Login.execute(Login.java:42)
When I did some debugging found out that the exception is happening
because of the following code
return ((ActionForward) config);

in org.apache.struts.action.ActionMapping.java line 151

config contains a forward defined by me and has type
org.apache.struts.config.ForwardConfig
what should I do?
are there any other ways dinamically defining global forwards?
Thank you
Vano


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


Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
It gets thrown when the application starts, but then more errors occur as
there are several servlets which load upon start-up - the data source is
null at this point (NullPointerException's are being thrown) and so the
errors are thrown when these classes try to access the database.

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:29 AM
Subject: Re: microsoft sqlserver driver  struts


 Does the error get thrown when you attempt to access the data source or
 at startup?


 On 27 Feb 2004, at 11:34, Claire Wall wrote:

  Hi,
 
  I am trying to use microsoft's jdbc driver with my struts application,
  but to no avail. Here is my datasource definition:
 
data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
 set-property property=description value=My SqlServer pool/
 set-property property=driverClassName
  value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
 set-property property=url
  value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
  DatabaseName=DBNAME/
 set-property property=username value=xxx/
 set-property property=password value=xxx/
 set-property property=maxActive value=20/
 set-property property=maxCount value=20/
 set-property property=minCount value=2/
 set-property property=maxWait value=5000/
 set-property property=defaultAutoCommit value=false/
 set-property property=defaultReadOnly value=false/
/data-source
 
  I have the required jars located in the WEB-INF/lib of my application
  which is running on Tomcat 4.1.29. When i try to connect to the
  database using this driver from a test class, it connects no problem
  so i know that the url and driver class name are correct. So the
  problem must be the type of DataSource which I am to use. Does anybody
  know which datasource to use with Microsoft's sqlserver driver? I
  tried using the DataSource that is in the mssqlserver jar but this
  didnt work either.
 
  The error that I get is an Invalid DataSource.
 
  Any help would be really appreciated!
 
  Thanks
  Claire
 


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





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



Re: microsoft sqlserver driver struts

2004-02-27 Thread Mark Lowe
Can i see the bits of code in the servlets (non action servlets) at 
start up that retrieve the datasource? And an example from any actions. 
Also see the load on start up order as i imagine that the struts 
servlet needs to load before your servlets to be able to access the 
datasource.

On 27 Feb 2004, at 12:39, Claire Wall wrote:

It gets thrown when the application starts, but then more errors occur 
as
there are several servlets which load upon start-up - the data source 
is
null at this point (NullPointerException's are being thrown) and so the
errors are thrown when these classes try to access the database.

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:29 AM
Subject: Re: microsoft sqlserver driver  struts

Does the error get thrown when you attempt to access the data source 
or
at startup?

On 27 Feb 2004, at 11:34, Claire Wall wrote:

Hi,

I am trying to use microsoft's jdbc driver with my struts 
application,
but to no avail. Here is my datasource definition:

  data-source key=DB 
type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName
value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url
value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source

I have the required jars located in the WEB-INF/lib of my application
which is running on Tomcat 4.1.29. When i try to connect to the
database using this driver from a test class, it connects no problem
so i know that the url and driver class name are correct. So the
problem must be the type of DataSource which I am to use. Does 
anybody
know which datasource to use with Microsoft's sqlserver driver? I
tried using the DataSource that is in the mssqlserver jar but this
didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire


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



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


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


SV: ArrayList in Form

2004-02-27 Thread Claus Weng Madsen - TELMORE
Hi Shashank 

If I understand you correct, you want to modify the properties in an
object within a Collection

Do like this:

logic:iterate id=rows name=theForm property=rows
type=com.company.TheObject 
html:text name=rows property=firstName indexed=true /   
html:text name=rows property=lastName indexed=true /
/logic:iterate

There are 2 important things to remember:
 1. id attribute in the iterate tag MUST have the same name as the
property attribute in the iterate tag (rows)
 2. you have to set the attribute indexed to true ( indexed=true ) 

Hope this wil help you

Med venlig hilsen

Claus Weng Madsen, Teamleder
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 30242875
www.telmore.dk 


-Oprindelig meddelelse-
Fra: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 10:17
Til: [EMAIL PROTECTED]
Emne: ArrayList in Form


Hello All

I have a ArrayList in the form which contains a CustomObject TheROw. I
iterate thr this arraylist to display it by logic:iterate as follows.
This row will contain many fields such as rate or amount.

logic:iterate id=currentRow name=theForm property=rows
type=com.custobj.TheRow  \\ Display all rows /logic:iterate


PROBLEM : When the form gets submitted with rate or amount changed I
expect I will get ArrayList back by changed values. But No change
happens in the values.

Does that mean that If one uses ArrayList in the form, it can be used
for the purpose of display only. If User changes some value we will not
get those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



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



Re: java.lang.ClassCastException

2004-02-27 Thread Max Cooper
I am not sure this will be a complete solution to your problem, but try:

moduleConfig.addForwardConfig(new ActionForward(mypath,myurl,true));

ActionForm extends ForwardConfig, not the other way around.

-Max

On Fri, 2004-02-27 at 03:22, Vano Beridze wrote:
 Hello
 
 I've got
 struts 1.1
 sun jdk 1.4.2_03
 Fedora Core 1
 
 I have a simple application
 one action that has two forwards.
 One of them I want to costruct dynamically.
 
 I created a plugin and in its init method I do the following
 
 moduleConfig.addForwardConfig(new ForwardConfig(mypath,myurl,true));
 
 when I do in the action
 return mapping.findForward(mypath);
 
 it gives me a classcast exception
 
 java.lang.ClassCastException
   at
 org.apache.struts.action.ActionMapping.findForward(ActionMapping.java:151)
   at com.silkroad.srm3.Login.execute(Login.java:42)
 
 When I did some debugging found out that the exception is happening
 because of the following code
 
 return ((ActionForward) config);
 
 in org.apache.struts.action.ActionMapping.java line 151
 
 config contains a forward defined by me and has type
 org.apache.struts.config.ForwardConfig
 
 what should I do?
 are there any other ways dinamically defining global forwards?
 
 Thank you
 Vano
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
Mark,

My problem is that I'm switching JDBC drivers - before I was using
weblogic's JDBC driver for SQL Server and I've been using that for a long
time now and never had any problems. Now I'm trying to ditch the weblogic
driver and in its place use Microsoft's JDBC driver for SQLServer. Sorry,
should've mentioned that before. I'm not sure that showing the code for
getting the datasource is going to help because I'm assuming that this is
not the problem - the problem is surely to do with the type of datasource.

I had a similiarish problem trying to use an Oracle database - in the end
the type of datasource was the problem and not how I retrieved it in my
actions.

Have you used Microsoft's SQL Server 2000 JDBC driver with struts before,
and if so, what type of datasource do we use? Can't find anywhere that says
anything about it. Cant be too difficult..

Thanks
Claire

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:43 AM
Subject: Re: microsoft sqlserver driver  struts



 Can i see the bits of code in the servlets (non action servlets) at
 start up that retrieve the datasource? And an example from any actions.
 Also see the load on start up order as i imagine that the struts
 servlet needs to load before your servlets to be able to access the
 datasource.


 On 27 Feb 2004, at 12:39, Claire Wall wrote:

  It gets thrown when the application starts, but then more errors occur
  as
  there are several servlets which load upon start-up - the data source
  is
  null at this point (NullPointerException's are being thrown) and so the
  errors are thrown when these classes try to access the database.
 
  - Original Message -
  From: Mark Lowe [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, February 27, 2004 11:29 AM
  Subject: Re: microsoft sqlserver driver  struts
 
 
  Does the error get thrown when you attempt to access the data source
  or
  at startup?
 
 
  On 27 Feb 2004, at 11:34, Claire Wall wrote:
 
  Hi,
 
  I am trying to use microsoft's jdbc driver with my struts
  application,
  but to no avail. Here is my datasource definition:
 
data-source key=DB
  type=org.apache.commons.dbcp.BasicDataSource
 set-property property=description value=My SqlServer pool/
 set-property property=driverClassName
  value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
 set-property property=url
  value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
  DatabaseName=DBNAME/
 set-property property=username value=xxx/
 set-property property=password value=xxx/
 set-property property=maxActive value=20/
 set-property property=maxCount value=20/
 set-property property=minCount value=2/
 set-property property=maxWait value=5000/
 set-property property=defaultAutoCommit value=false/
 set-property property=defaultReadOnly value=false/
/data-source
 
  I have the required jars located in the WEB-INF/lib of my application
  which is running on Tomcat 4.1.29. When i try to connect to the
  database using this driver from a test class, it connects no problem
  so i know that the url and driver class name are correct. So the
  problem must be the type of DataSource which I am to use. Does
  anybody
  know which datasource to use with Microsoft's sqlserver driver? I
  tried using the DataSource that is in the mssqlserver jar but this
  didnt work either.
 
  The error that I get is an Invalid DataSource.
 
  Any help would be really appreciated!
 
  Thanks
  Claire
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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




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



Bean:message in attribute causes non-matching extension tags error

2004-02-27 Thread Abhishek Srivastava
Hello All,

I am trying to have text from my property file appear into one of the
attributes of an html select element. The code which I have written is

html:select property=destinationType onchange=
javascript:fnLocationBlur(); fnChangeZoomImage()
onfocus=fnSetFocus('0');window.status ='bean:message
key=select.destination.type/'; return true  value =
'%=destinationType%' 
html:option value=citycity/html:option
  html:option value=statestate/html:option
  html:option value=countrycountry/html:option
/html:select

However when invoke the jsp I get an exception

/jsp/WcNoNc/Query.jsp(575): Non-matching extension tags //[ null; Line:
575]
probably occurred due to an error in /jsp/WcNoNc/Query.jsp line 575:
/html:select

What am I doing wrong? How can I get the text from my property file into one
of the html attributes?

Thanks for your help in advance.

Regards,
Abhishek.

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



Re: microsoft sqlserver driver struts

2004-02-27 Thread Mark Lowe
Ah okay.. If you've had the same stuff running with another database  
i'm tree-barking. No I've never used and hope never to use M$ sql  
server. Postgres, mysql and oracle so I'm signing off this thread.

but before i go try this.

jdbc:microsoft:sqlserver://SERVERNAME:1433;SelectMethod=cursor



On 27 Feb 2004, at 12:56, Claire Wall wrote:

Mark,

My problem is that I'm switching JDBC drivers - before I was using
weblogic's JDBC driver for SQL Server and I've been using that for a  
long
time now and never had any problems. Now I'm trying to ditch the  
weblogic
driver and in its place use Microsoft's JDBC driver for SQLServer.  
Sorry,
should've mentioned that before. I'm not sure that showing the code for
getting the datasource is going to help because I'm assuming that this  
is
not the problem - the problem is surely to do with the type of  
datasource.

I had a similiarish problem trying to use an Oracle database - in the  
end
the type of datasource was the problem and not how I retrieved it in my
actions.

Have you used Microsoft's SQL Server 2000 JDBC driver with struts  
before,
and if so, what type of datasource do we use? Can't find anywhere that  
says
anything about it. Cant be too difficult..

Thanks
Claire
- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:43 AM
Subject: Re: microsoft sqlserver driver  struts

Can i see the bits of code in the servlets (non action servlets) at
start up that retrieve the datasource? And an example from any  
actions.
Also see the load on start up order as i imagine that the struts
servlet needs to load before your servlets to be able to access the
datasource.

On 27 Feb 2004, at 12:39, Claire Wall wrote:

It gets thrown when the application starts, but then more errors  
occur
as
there are several servlets which load upon start-up - the data source
is
null at this point (NullPointerException's are being thrown) and so  
the
errors are thrown when these classes try to access the database.

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:29 AM
Subject: Re: microsoft sqlserver driver  struts

Does the error get thrown when you attempt to access the data source
or
at startup?
On 27 Feb 2004, at 11:34, Claire Wall wrote:

Hi,

I am trying to use microsoft's jdbc driver with my struts
application,
but to no avail. Here is my datasource definition:
  data-source key=DB
type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName
value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url
value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source
I have the required jars located in the WEB-INF/lib of my  
application
which is running on Tomcat 4.1.29. When i try to connect to the
database using this driver from a test class, it connects no  
problem
so i know that the url and driver class name are correct. So the
problem must be the type of DataSource which I am to use. Does
anybody
know which datasource to use with Microsoft's sqlserver driver? I
tried using the DataSource that is in the mssqlserver jar but this
didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire


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




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


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


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


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


RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread McCormack, Chris
i'll try to use lazy list once i finish off my work

Eugh... We have all done it, but that is how botches get in to production code. People 
usually get too busy to apply the 'proper' code, or something more important that 
needs attention comes along. 

2 years later someone comes along and has to rewrite a major part of the application 
to compensate for the temporary fix :P

Welcome to the Software Industry.

btw that is not a personal slight on you :) just an observation of the industry as a 
whole.

-Original Message-
From: Parthasarathy Kesavaraj [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 09:45
To: 'Struts Users Mailing List'
Subject: RE: Problem in nested tags- Very Urgent - Please Help


Thanks mark , hubert and paul. i removed scope = request and it is working
fine now.

(Temporary fix :-)) i'll try to use lazy list once i finish off my work)


With Regards

Partha


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 8:35 PM
To: Struts Users Mailing List
Subject: Re: Problem in nested tags- Very Urgent - Please Help


Nice one..

For some reason i thought the Factory would involve more than it does,  
so i shied away from it.

Cheers Mark

On 26 Feb 2004, at 15:57, Paul, R. Chip wrote:

 Note: I think this is likely different in current versions of the  
 commons
 collections lib, but this works for the version we are dependent on.

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted

 public class LazyListExampleForm extends ActionForm {
   private List actionList;

   public LazyListExampleForm ()
   {
   Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(),
 factory);
   }

   // Getter/setters for list omitted
 }

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:49 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 wouldn't mind an example of how to use lazy list if you have one.


 On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:

 Or use the Commons Collections LazyList which handles this problem
 automatically.

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:09 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 shirish posted this a few times.

 if you're scoping to request you'll need a while loop in your
 getFoo(int index)  method

 public class OrgManagementForm extends ActionForm {

 private List addressList = new ArrayList();

 public Address getAddress(int index) {
  
  while(index = addressList.size() ) {
  this.addressList.add( new Address() );
  }

  return (Address) addressList.get(index);
 }

 bla bla.

 }

 look like it could be your problem.


 On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:

 I am having an OrganzationVO inside my form-bean.

 The OrganzationVO has a collection of AddressVOs.

 I am using nested tags like this.


 nested:nest property = orgVO

 nested:text property=orgID  size=10 maxlength=10
 styleClass=inputmand  tabindex= /
 
 nested:iterate id=addressid property=addresses indexId=index

 
 nested:text property=company1 size=30 maxlength=30
 styleClass=inputmand tabindex= /
 
 /nested:iterate

 /nested:nest

 while submitting the form I am getting an exception like this.


 2004-02-26 18:17:08,133 [ExecuteThread: '12' for queue:
 'weblogic.kernel.Default'] DEBUG org.apache.
 commons.beanutils.BeanUtils -
 setProperty([EMAIL PROTECTED], orgVO.a
 ddresses[0].company1, [get populated])
 getAddrVOAL--[]
 Feb 26, 2004 6:17:08 PM IST Error HTTP BEA-101017
 [ServletContext(id=1735147,name=gbs,conte
 xt-path=/gbs)] Root cause of ServletException.
 java.lang.ArrayIndexOutOfBoundsException
 at java.lang.reflect.Array.get(Native Method)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert
 y
 U
 tils.
 java:525)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert 
 y
 U
 tils.
 java:428)
 at
 org.apache.commons.beanutils.PropertyUtils.getNestedProperty(Property 
 U
 t
 ils.j
 ava:770)
 at
 org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils. 
 j
 a
 va:80
 1)
 at
 org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java: 
 881)
 at
 org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 at
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 at
 

Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
nope, that didnt work either :(

Anybody else out there use SQL Server and connects to it via Microsoft's SQL
Server JDBC driver? there must be somebody

Thanks
Claire

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 12:14 PM
Subject: Re: microsoft sqlserver driver  struts


 Ah okay.. If you've had the same stuff running with another database
 i'm tree-barking. No I've never used and hope never to use M$ sql
 server. Postgres, mysql and oracle so I'm signing off this thread.

 but before i go try this.

 jdbc:microsoft:sqlserver://SERVERNAME:1433;SelectMethod=cursor



 On 27 Feb 2004, at 12:56, Claire Wall wrote:

  Mark,
 
  My problem is that I'm switching JDBC drivers - before I was using
  weblogic's JDBC driver for SQL Server and I've been using that for a
  long
  time now and never had any problems. Now I'm trying to ditch the
  weblogic
  driver and in its place use Microsoft's JDBC driver for SQLServer.
  Sorry,
  should've mentioned that before. I'm not sure that showing the code for
  getting the datasource is going to help because I'm assuming that this
  is
  not the problem - the problem is surely to do with the type of
  datasource.
 
  I had a similiarish problem trying to use an Oracle database - in the
  end
  the type of datasource was the problem and not how I retrieved it in my
  actions.
 
  Have you used Microsoft's SQL Server 2000 JDBC driver with struts
  before,
  and if so, what type of datasource do we use? Can't find anywhere that
  says
  anything about it. Cant be too difficult..
 
  Thanks
  Claire
 
  - Original Message -
  From: Mark Lowe [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, February 27, 2004 11:43 AM
  Subject: Re: microsoft sqlserver driver  struts
 
 
 
  Can i see the bits of code in the servlets (non action servlets) at
  start up that retrieve the datasource? And an example from any
  actions.
  Also see the load on start up order as i imagine that the struts
  servlet needs to load before your servlets to be able to access the
  datasource.
 
 
  On 27 Feb 2004, at 12:39, Claire Wall wrote:
 
  It gets thrown when the application starts, but then more errors
  occur
  as
  there are several servlets which load upon start-up - the data source
  is
  null at this point (NullPointerException's are being thrown) and so
  the
  errors are thrown when these classes try to access the database.
 
  - Original Message -
  From: Mark Lowe [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, February 27, 2004 11:29 AM
  Subject: Re: microsoft sqlserver driver  struts
 
 
  Does the error get thrown when you attempt to access the data source
  or
  at startup?
 
 
  On 27 Feb 2004, at 11:34, Claire Wall wrote:
 
  Hi,
 
  I am trying to use microsoft's jdbc driver with my struts
  application,
  but to no avail. Here is my datasource definition:
 
data-source key=DB
  type=org.apache.commons.dbcp.BasicDataSource
 set-property property=description value=My SqlServer pool/
 set-property property=driverClassName
  value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
 set-property property=url
  value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
  DatabaseName=DBNAME/
 set-property property=username value=xxx/
 set-property property=password value=xxx/
 set-property property=maxActive value=20/
 set-property property=maxCount value=20/
 set-property property=minCount value=2/
 set-property property=maxWait value=5000/
 set-property property=defaultAutoCommit value=false/
 set-property property=defaultReadOnly value=false/
/data-source
 
  I have the required jars located in the WEB-INF/lib of my
  application
  which is running on Tomcat 4.1.29. When i try to connect to the
  database using this driver from a test class, it connects no
  problem
  so i know that the url and driver class name are correct. So the
  problem must be the type of DataSource which I am to use. Does
  anybody
  know which datasource to use with Microsoft's sqlserver driver? I
  tried using the DataSource that is in the mssqlserver jar but this
  didnt work either.
 
  The error that I get is an Invalid DataSource.
 
  Any help would be really appreciated!
 
  Thanks
  Claire
 
 
 
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  

RE: ArrayList in Form

2004-02-27 Thread Dixit, Shashank (Cognizant)
Hi Claus

I am getting following exception if I do indexed = true

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:508)
at java.util.ArrayList.get(ArrayList.java:320)
at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:521)
at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at 
com.jpmorgan.ib.bcs.servlet.BCSActionServlet.doPost(BCSActionServlet.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:536)





Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



-Original Message-
From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] 
Sent: Friday, 27 February 2004 10:48 PM
To: Struts Users Mailing List
Subject: SV: ArrayList in Form


Hi Shashank 

If I understand you correct, you want to modify the properties in an object within a 
Collection

Do like this:

logic:iterate id=rows name=theForm property=rows type=com.company.TheObject 
html:text name=rows property=firstName indexed=true /   
html:text name=rows property=lastName 

RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread shirishchandra.sakhare
But using lazy initialization is simple...

See my earlier post...

I am resending my earlier mail to another user.Go through the sample code
and
ask me if u dont understand something.

The important portions are commented.Especially look at the jsps property
how
it is set and also the form bean.The property syntax i have used was for struts 1.0 
..But with struts 1.1 , you can have a better cleaner syntax using nested tags.But I 
have not used it...This works for 1.1 as well..



//Form Class

import java.util.ArrayList;

import java.util.List;

import org.apache.struts.action.ActionForm;

public class ExampleListForm extends ActionForm {

//A list of Emp beans

private List beanList = new ArrayList();

public List getBeanList(){

return beanList;

}

public void setBeanList(List list){

beanList = list;

}

//very imp.

//give indexed access to the beans

public Employee getEmployee(int index){

//very imp

//when a jsp is submited , then while auto populating the form,this will
ensure
that

// the  form is populated properly.

while(index = beanList.size()){

beanList.add(new Employee());

}

return (Employee)beanList.get(index);

}

public void setEmployee(int index,Employee emp){

beanList.set(index,emp);

}

}

***

Bean class

public class Employee {

private String name;

private String salary;

/**

* Returns the name.

* @return String

*/

public String getName() {

return name;

}

/**

* Returns the salary.

* @return String

*/

public String getSalary() {

return salary;

}

/**

* Sets the name.

* @param name The name to set

*/

public void setName(String name) {

this.name = name;

}

/**

* Sets the salary.

* @param salary The salary to set

*/

public void setSalary(String salary) {

this.salary = salary;

}

}



JSP

%@ page language=java%

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

html:html

html:form action=/ 

logic:iterate id=bean name=exampleListForm property=beanList
indexId=i/

html:text name=exampleListForm  property=%=\employee[\ + i
\].name\%

html:text name=exampleListForm  property=%=\employee[\ + i
\].salary\%

/logic:iterate

/html:form

/html:html

Explanation:

See how the property is constructed.

html:text name=exampleListForm  property=%=\employee[\ + i
\].name\%

So this will result in a parameter name employee[i].name in the http
request.So
when the jsp is rendered, this will be interpreted as

getEmployee[i].getName().And when the jsp is submitted , the same will be
interpreted as getEmployee[i].setName().And this will result in auto
population
of data in the form as u can see.

So check the indexed properties on the form as well.(Especially the
getEmployee(index i) proeprty with while loop.)

Hope this helps.



regards,

Shirish.

-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 1:21 PM
To: Struts Users Mailing List
Subject: RE: Problem in nested tags- Very Urgent - Please Help


i'll try to use lazy list once i finish off my work

Eugh... We have all done it, but that is how botches get in to production code. People 
usually get too busy to apply the 'proper' code, or something more important that 
needs attention comes along. 

2 years later someone comes along and has to rewrite a major part of the application 
to compensate for the temporary fix :P

Welcome to the Software Industry.

btw that is not a personal slight on you :) just an observation of the industry as a 
whole.

-Original Message-
From: Parthasarathy Kesavaraj [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 09:45
To: 'Struts Users Mailing List'
Subject: RE: Problem in nested tags- Very Urgent - Please Help


Thanks mark , hubert and paul. i removed scope = request and it is working
fine now.

(Temporary fix :-)) i'll try to use lazy list once i finish off my work)


With Regards

Partha


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 8:35 PM
To: Struts Users Mailing List
Subject: Re: Problem in nested tags- Very Urgent - Please Help


Nice one..

For some reason i thought the Factory would involve more than it does,  
so i shied away from it.

Cheers Mark

On 26 Feb 2004, at 15:57, Paul, R. Chip wrote:

 Note: I think this is likely different in current versions of the  
 commons
 collections lib, but this works for the version we are dependent on.

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted

 public class LazyListExampleForm extends ActionForm {
   private List actionList;

   public LazyListExampleForm ()
   {
   Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
 

[OT] JSP or Velocity

2004-02-27 Thread A.White
Howdy
 
I am starting to develop an application using struts and have been
looking round the rest of the Jakarta project and came across the
Velocity project.
 
I was interested to see which which people recommended for a relative
newbie
 
Cheers
 
Andrew


Re: [OT] JSP or Velocity

2004-02-27 Thread John Ferguson Smart
For my part, I tried Velocity with Struts and found it quite cool, but 
had trouble with some more tricky needs (dynamic includes) which where 
easier to do with Tiles and Taglibs (JSP 2.0-style taglibs, that is...)

Just my 2 cents...

A.White wrote:

Howdy

I am starting to develop an application using struts and have been
looking round the rest of the Jakarta project and came across the
Velocity project.
I was interested to see which which people recommended for a relative
newbie
Cheers

Andrew

 

--
John Ferguson Smart, PhD
Directeur de Projet
Département informatique Communicante 
AACOM
email : [EMAIL PROTECTED]

-
AACOM - L'Informatique communicante
120 rue du Marin Blanc - Z.I. des Paluds
13685 Aubagne Cedex
tel : 04.42.72.65.69 - fax : 04.42.72.65.68
Web : http://www.aacom.fr
-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: servlet filters and authentication

2004-02-27 Thread David Evans
Hi,

I checked out SecurityFilter yesterday, after Robert Taylors
recommendation, and have looked through a good bit of the source.
I'm probably going to use your package once i get this thing closer to
its final state. It looks like a great program.

I like to write my own lite versions of packages i use, if possible,
just to feel that i really know whats going on. I even did this with
struts, believe it or not. I wrote a struts lite that uses a controller,
action forms and actions, and an xml config file. I used it for a couple
of small projects, and now that i've got a handle on the basic idea, i
feel i can use the real Struts with more confidence. Right now
concentrating on becoming very familier with Struts, once i get that
down, in a couple of weeks i'll pop your Security Filter in.

dave

On Fri, 2004-02-27 at 01:31, Max Cooper wrote:
 I'm the primary author of the SecurityFilter project, and the filter
 logic is a bit more complicated than the code that was posted. Even if
 you decide not to use SecurityFilter, it is probably worth a look at the
 doFilter() method.
 
 Some issues that you will/may have to deal with:
 1. Filter getting executed on forwards (depends on your container).
 2. Sending the user back to the page they requested when the login
 sequence was initiated (a key feature, IMO).
 3. Keeping request parameters (both GET and POST) across the login
 event.
 4. Sending the user to an error page when the login fails.
 5. Allowing login form and error page requests to be processed without
 invoking the login sequence.
 6. Knowing what to do / where to send the user if they authenticate
 spontaneously (i.e. when they weren't sent to the login form by your
 filter).
 
 Basically, there's a lot of stuff to deal with even though it seems
 simple at first. :-) If you can use container-managed security or
 SecurityFilter, you'll probably save yourself some time that would
 otherwise be spent dealing with these issues. It is worth investigating
 the existing solutions before rolling your own.
 
 -Max
 
 On Thu, 2004-02-26 at 09:20, Robert Taylor wrote:
  You may want to see if this supports your requirements:
  
  https://sourceforge.net/projects/securityfilter/
  
  
  robert
  
  
   -Original Message-
   From: David Evans [mailto:[EMAIL PROTECTED]
   Sent: Thursday, February 26, 2004 12:07 PM
   To: Struts Users Mailing List
   Subject: servlet filters and authentication
   
   
   Hello,
   
   I'm configuring the skeleton of a multi module struts application, and i
   would like use a filter for the authentication. 
   
   here is psuedojava (for easier reading) of the filter:
   
   public final class AuthFilter implements Filter {
   
public void doFilter(request, response, chain)
 
session = request.getSession();
auth = session.getAttribute(authenticated);
 if (auth == true) {
 chain.doFilter(request,  response);
 return;
   }
 else {
 dispatcher = 
   request.getRequestDispatcher(/WEB-INF/jsp/security/login.jsp);
 dispatcher.forward (request, response);
 return;
 }
   }
   }
   
   
   I've seen this skeleton suggested in several places on the web. 
   The question i have is this: After the user submits the login form, 
   the request will come through the filter, and since it has not yet 
   been authenticated,  it will again forward to the login.jsp. 
   I've thought of a couple of ways to deal with this and 
   would like to get input on these and any other approaches. 
   
   1) set the mapping of the filter in web.xml in such a way that it
   allows the login action through. maybe set all actions to have an
   extension of .do except the login action, which has an extension of
   .auth.  I don't think this will work for me, because the multi module 
   support of Struts requires extension mapping. I guess i could write a
   small serlvet that is not in the struts mapping but is in the same context
   and have it mapped to *.auth
   
   2) check within the above filter to see if the request is for the login
   action, and if so allow it through. so the if statement above would be: 
   if (auth == true || req.getPath().equals(login.do))  
   
   Any comments on these ideas or approaches i haven't listed would be 
   greatly appreciated.
   
   dave
   
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: [OT] JSP or Velocity

2004-02-27 Thread Andrew Hill
Havent used velocity myself , but from what Ive seen it is very good.
(Theres also a very good introduction for newbies in Teds Struts in Action
book where hes given a chapter to using velocity with Struts)

That said, if you learn JSP its probably a much more portable skillset that
will stand you in good stead for future projects and jobs, and theres a lot
of freely available taglibs out there you can utilise. Much more support on
the list too for any problems you may come across, and of course theres the
Tiles stuff which (again Ive not used!) is really very very cool and
powerful!

My own personal opinion of JSP otoh is rather low. I just dont like the
whole 'vibe' of it! Suffice it to say Im not a big fan of serial rendering
mechanisms - especially where the page layout and rendering instructions are
combined in the same file - and also much prefer a mechanism where I can
render to any part of the view at any part of my rendering process (Im using
a homebrew library for this that revolves around using a tree of decorator
classes to modify xhtml DOM templates - there are some open source libraries
for DOM based rendering available too such as XMLC which you might want to
look at if you have time). Of course that power comes at a cost in terms of
performance and memory usage, but for the type of apps Im working on its not
really an issue.

But weighing up the arguments for your case, Id say the best advice I can
give is that nobody got sacked for choosing JSP and its the one with the
most mindshare despite its flaws, so you wont go wrong going with it for
your project even if it can be a pain to work with sometimes!



-Original Message-
From: A.White [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 20:45
To: [EMAIL PROTECTED]
Subject: [OT] JSP or Velocity


Howdy

I am starting to develop an application using struts and have been
looking round the rest of the Jakarta project and came across the
Velocity project.

I was interested to see which which people recommended for a relative
newbie

Cheers

Andrew


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



RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread Parthasarathy Kesavaraj
Thx chris for pointing to this...

With Regards

Partha


-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 5:51 PM
To: Struts Users Mailing List
Subject: RE: Problem in nested tags- Very Urgent - Please Help


i'll try to use lazy list once i finish off my work

Eugh... We have all done it, but that is how botches get in to production
code. People usually get too busy to apply the 'proper' code, or something
more important that needs attention comes along. 

2 years later someone comes along and has to rewrite a major part of the
application to compensate for the temporary fix :P

Welcome to the Software Industry.

btw that is not a personal slight on you :) just an observation of the
industry as a whole.

-Original Message-
From: Parthasarathy Kesavaraj [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 09:45
To: 'Struts Users Mailing List'
Subject: RE: Problem in nested tags- Very Urgent - Please Help


Thanks mark , hubert and paul. i removed scope = request and it is working
fine now.

(Temporary fix :-)) i'll try to use lazy list once i finish off my work)


With Regards

Partha


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 8:35 PM
To: Struts Users Mailing List
Subject: Re: Problem in nested tags- Very Urgent - Please Help


Nice one..

For some reason i thought the Factory would involve more than it does,  
so i shied away from it.

Cheers Mark

On 26 Feb 2004, at 15:57, Paul, R. Chip wrote:

 Note: I think this is likely different in current versions of the  
 commons
 collections lib, but this works for the version we are dependent on.

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted

 public class LazyListExampleForm extends ActionForm {
   private List actionList;

   public LazyListExampleForm ()
   {
   Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(),
 factory);
   }

   // Getter/setters for list omitted
 }

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:49 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 wouldn't mind an example of how to use lazy list if you have one.


 On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:

 Or use the Commons Collections LazyList which handles this problem
 automatically.

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 8:09 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help


 shirish posted this a few times.

 if you're scoping to request you'll need a while loop in your
 getFoo(int index)  method

 public class OrgManagementForm extends ActionForm {

 private List addressList = new ArrayList();

 public Address getAddress(int index) {
  
  while(index = addressList.size() ) {
  this.addressList.add( new Address() );
  }

  return (Address) addressList.get(index);
 }

 bla bla.

 }

 look like it could be your problem.


 On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:

 I am having an OrganzationVO inside my form-bean.

 The OrganzationVO has a collection of AddressVOs.

 I am using nested tags like this.


 nested:nest property = orgVO

 nested:text property=orgID  size=10 maxlength=10
 styleClass=inputmand  tabindex= /
 
 nested:iterate id=addressid property=addresses indexId=index

 
 nested:text property=company1 size=30 maxlength=30
 styleClass=inputmand tabindex= /
 
 /nested:iterate

 /nested:nest

 while submitting the form I am getting an exception like this.


 2004-02-26 18:17:08,133 [ExecuteThread: '12' for queue:
 'weblogic.kernel.Default'] DEBUG org.apache.
 commons.beanutils.BeanUtils -
 setProperty([EMAIL PROTECTED], orgVO.a
 ddresses[0].company1, [get populated])
 getAddrVOAL--[]
 Feb 26, 2004 6:17:08 PM IST Error HTTP BEA-101017
 [ServletContext(id=1735147,name=gbs,conte
 xt-path=/gbs)] Root cause of ServletException.
 java.lang.ArrayIndexOutOfBoundsException
 at java.lang.reflect.Array.get(Native Method)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert
 y
 U
 tils.
 java:525)
 at
 org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert 
 y
 U
 tils.
 java:428)
 at
 org.apache.commons.beanutils.PropertyUtils.getNestedProperty(Property 
 U
 t
 ils.j
 ava:770)
 at
 org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils. 
 j
 a
 va:80
 1)
 at
 

RE: [OT] JSP or Velocity

2004-02-27 Thread McCormack, Chris
Having your JSP built using tiles, each (if necessary) having its own dynamic 
Tileaction is excellent. 
It offers so much flexibility, especially when its combined with JSTL.

The only gripe I have is with JSTL and not having the ability to get map sizes. Its 
easy
to code around this, but it would have been nice out of the box :P

If you ask the JSP or velocity question on a list that has a good mix of both sets of 
users,
then you are going to get a few biased opinions for either side. 
Try and figure out the requirements of what you want your application to do and would 
like it to be able
to do in the future. Then see if either does not or, is unable to offer this feature 
list. That should make your decision 
a bit easier.

Chris

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 12:59
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Havent used velocity myself , but from what Ive seen it is very good.
(Theres also a very good introduction for newbies in Teds Struts in Action
book where hes given a chapter to using velocity with Struts)

That said, if you learn JSP its probably a much more portable skillset that
will stand you in good stead for future projects and jobs, and theres a lot
of freely available taglibs out there you can utilise. Much more support on
the list too for any problems you may come across, and of course theres the
Tiles stuff which (again Ive not used!) is really very very cool and
powerful!

My own personal opinion of JSP otoh is rather low. I just dont like the
whole 'vibe' of it! Suffice it to say Im not a big fan of serial rendering
mechanisms - especially where the page layout and rendering instructions are
combined in the same file - and also much prefer a mechanism where I can
render to any part of the view at any part of my rendering process (Im using
a homebrew library for this that revolves around using a tree of decorator
classes to modify xhtml DOM templates - there are some open source libraries
for DOM based rendering available too such as XMLC which you might want to
look at if you have time). Of course that power comes at a cost in terms of
performance and memory usage, but for the type of apps Im working on its not
really an issue.

But weighing up the arguments for your case, Id say the best advice I can
give is that nobody got sacked for choosing JSP and its the one with the
most mindshare despite its flaws, so you wont go wrong going with it for
your project even if it can be a pain to work with sometimes!



-Original Message-
From: A.White [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 20:45
To: [EMAIL PROTECTED]
Subject: [OT] JSP or Velocity


Howdy

I am starting to develop an application using struts and have been
looking round the rest of the Jakarta project and came across the
Velocity project.

I was interested to see which which people recommended for a relative
newbie

Cheers

Andrew


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


***
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.



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



RE: microsoft sqlserver driver struts

2004-02-27 Thread Srikanth Gubba
Hi, 

I am using the same datasource configuration as you do:
data-source type=org.apache.commons.dbcp.BasicDataSource key=BkEdDbFls
set-property property=driverClassName
  value=com.microsoft.jdbc.sqlserver.SQLServerDriver /
set-property  property=url
 
value=jdbc:microsoft:sqlserver://**.***.***.***:1433;DatabaseName=tesstdb
/
set-property property=username
  value=*** /
set-property property=password
  value=*** /
set-property property=maxActive
  value=10 /
set-property property=maxWait
  value=5000 /
set-property property=defaultAutoCommit
  value=true /
set-property property=defaultReadOnly
  value=false /
/data-source

and in the code , 
DataSource dataSource = (DataSource)
context.getAttribute(BkEdDbFls);

Hope this helps. Can u give me what error message u r receiving.

Srikanth.

-Original Message-
From: Claire Wall [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 5:34 AM
To: Struts Users Mailing List
Subject: microsoft sqlserver driver  struts


Hi,

I am trying to use microsoft's jdbc driver with my struts application, but
to no avail. Here is my datasource definition:

  data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName
value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url
value=jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source

I have the required jars located in the WEB-INF/lib of my application which
is running on Tomcat 4.1.29. When i try to connect to the database using
this driver from a test class, it connects no problem so i know that the url
and driver class name are correct. So the problem must be the type of
DataSource which I am to use. Does anybody know which datasource to use with
Microsoft's sqlserver driver? I tried using the DataSource that is in the
mssqlserver jar but this didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire


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



Re: [OT] JSP or Velocity

2004-02-27 Thread Larry Meadors
 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.
 
 I was interested to see which which people recommended for a relative
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over
jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination
does not.
The only difference is that velocity is a bit more terse (if/else/end
instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in 
tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study
was cleary biased towards velocity and had never even considered JSTL
(which 
in all fairness may not have been available at that time). Looking at
the code 
(both the velocity and jstl versions are below) I think that velocity
clearly had 
an influence on the jsp2/jstl constructs.

The first thing I noticed was that the two pages do not do the same
thing. 
The jsp turns off the session (the vm does not). The jsp stores
variables that 
are never used which were factored out in the vm version. The vm version

is missing required code (for example, the repCode and urlEvent
variables 
are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need 
to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you
will not ever 
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller 
does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you
cannot have things like if/else/end because they are unbalanced, but
other than
that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we
get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i
   
   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   br${meeting.meetingId}:${repId}br
   /td
   /tr
/table
===
The velocity version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: $meeting.getTopic()/b/ip

   #foreach( $event in $meeting.getStoredEventsIterator() )
   #set( $yapper =
$meeting.getParticipation($event.getFromId()) )
   
   #if( $event.getClass().getName().equals($urlEvent) )
   
   #if( $repRole.equals($yapper.getRole()) )
   #set( $repId = $yapper.getParticipantId() )
   font
color=$blkb$yapper.getName()/b/font
   
   #else
   font
color=$blub$yapper.getName()/b/font
   #end
   
   a
href=$event.getStoredData()$event.getStoredData()/a br
   
   #elseif( $event.getClass().getName().equals($chatEvent) )
   
   #if($repRole.equals($yapper.getRole()) )
   #set( $repId = $yapper.getParticipantId() )
   font
color=$blkb$yapper.getName()/b/font
   
   #else
  

Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
here's the error i'm getting:

javax.servlet.UnavailableException: Initializing application data source
DBNAME
 at
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j
ava:1091)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
5)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3420)
 at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2567)
 at
org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:802)
 at
org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServlet.ja
va:501)
 at
org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServlet.jav
a:151)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:551)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
 at java.lang.Thread.run(Thread.java:536)

then from thereafter it says that i have an Invalid DataSource. Where do you
have your mssqlserver jars? i have mine in WEB-INF/lib. and there are three
of them - mssqlserver.jar, msbase.jar, msutil.jar.

claire

- Original Message -
From: Srikanth Gubba [EMAIL PROTECTED]
To: 'Claire Wall' [EMAIL PROTECTED]; Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 1:18 PM
Subject: RE: microsoft sqlserver driver  struts


 Hi,

 I am using the same datasource configuration as you do:
 data-source type=org.apache.commons.dbcp.BasicDataSource
key=BkEdDbFls
 set-property property=driverClassName
   value=com.microsoft.jdbc.sqlserver.SQLServerDriver /
 set-property  property=url


value=jdbc:microsoft:sqlserver://**.***.***.***:1433;DatabaseName=tesstdb
 /
 set-property property=username
   value=*** /
 set-property property=password
   value=*** /
 set-property property=maxActive
   value=10 /
 set-property property=maxWait
   value=5000 /
 set-property property=defaultAutoCommit
   value=true /
 set-property property=defaultReadOnly
   value=false /
 /data-source

 

RE: [OT] JSP or Velocity

2004-02-27 Thread Andrew Hill
Yes, Velocity has been around for quite awhile now, and it was intended to
address many of the problems inherent in (older versions of) JSP.

Nowdays JSP (especially JSP2) coding techniques and technologies have rather
caught up with velocity. Your assesment that it doesnt add much value over
the EL capabilities in JSP2 is pretty much on the mark. Of course it wasnt
always this way and for a long time velocity was much nicer. (Still looks
nicer ;-)

I reckon you are also correct in believing that velocity design provided a
lot of the inspiration for the jstl stuff.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.

 I was interested to see which which people recommended for a relative
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over
jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination
does not.
The only difference is that velocity is a bit more terse (if/else/end
instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in
tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study
was cleary biased towards velocity and had never even considered JSTL
(which
in all fairness may not have been available at that time). Looking at
the code
(both the velocity and jstl versions are below) I think that velocity
clearly had
an influence on the jsp2/jstl constructs.

The first thing I noticed was that the two pages do not do the same
thing.
The jsp turns off the session (the vm does not). The jsp stores
variables that
are never used which were factored out in the vm version. The vm version

is missing required code (for example, the repCode and urlEvent
variables
are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need
to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you
will not ever
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller
does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you
cannot have things like if/else/end because they are unbalanced, but
other than
that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we
get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i

   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   br${meeting.meetingId}:${repId}br
   /td
   /tr
/table
===
The velocity version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: $meeting.getTopic()/b/ip

   #foreach( $event in $meeting.getStoredEventsIterator() )
   #set( $yapper =
$meeting.getParticipation($event.getFromId()) )

   #if( $event.getClass().getName().equals($urlEvent) )

   #if( $repRole.equals($yapper.getRole()) )
   #set( $repId = 

RE: [OT] JSP or Velocity

2004-02-27 Thread A.White
Thanks for your answers, they are all greatly appreciated

I think I'll be using JSP and JTSL then.  However I have tried to look
for some good tutorials for JTSL but have failed to find any that have
addressed the basics.  

Any pointers to resources (apart from www.google.com ;-) ) will receive
huge karma and gratitude in their next life

Andrew



-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2004 13:35
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Yes, Velocity has been around for quite awhile now, and it was intended
to address many of the problems inherent in (older versions of) JSP.

Nowdays JSP (especially JSP2) coding techniques and technologies have
rather caught up with velocity. Your assesment that it doesnt add much
value over the EL capabilities in JSP2 is pretty much on the mark. Of
course it wasnt always this way and for a long time velocity was much
nicer. (Still looks nicer ;-)

I reckon you are also correct in believing that velocity design provided
a lot of the inspiration for the jstl stuff.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been 
 looking round the rest of the Jakarta project and came across the 
 Velocity project.

 I was interested to see which which people recommended for a relative 
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl
combination does not. The only difference is that velocity is a bit more
terse (if/else/end instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study was cleary biased towards velocity and had never even
considered JSTL (which in all fairness may not have been available at
that time). Looking at the code (both the velocity and jstl versions are
below) I think that velocity clearly had an influence on the jsp2/jstl
constructs.

The first thing I noticed was that the two pages do not do the same
thing. The jsp turns off the session (the vm does not). The jsp stores
variables that are never used which were factored out in the vm version.
The vm version

is missing required code (for example, the repCode and urlEvent
variables are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need to use scriptlets in jsp1/jstl pages, and I suspect with
jsp2/jstl, you will not ever
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you cannot have things like if/else/end because they are unbalanced,
but other than that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i

   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   

Re: [OT] JSP or Velocity

2004-02-27 Thread Markus
Hi,
I've used JSTL and velocity. Velocity is fast and a smart way to generate
dynamic pages but  it is not as comfortable as JSTL is. You have to implement
many things which exist in JSTL and other taglibs already. If you use the
macro stuff it will be easier but still a lot work to do.
Kind regards,

Markus
 Howdy
  
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.
  
 I was interested to see which which people recommended for a relative
 newbie
  
 Cheers
  
 Andrew
 


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



Re: [OT] JSP or Velocity

2004-02-27 Thread John Ferguson Smart
Probably been there already, but the Sun J2EE Tutorial isn't too bad. 
JSTL In Action (Shawn Bayern) is pretty good as well.

A.White wrote:

Thanks for your answers, they are all greatly appreciated

I think I'll be using JSP and JTSL then.  However I have tried to look
for some good tutorials for JTSL but have failed to find any that have
addressed the basics.  

Any pointers to resources (apart from www.google.com ;-) ) will receive
huge karma and gratitude in their next life
Andrew



-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2004 13:35
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity

Yes, Velocity has been around for quite awhile now, and it was intended
to address many of the problems inherent in (older versions of) JSP.
Nowdays JSP (especially JSP2) coding techniques and technologies have
rather caught up with velocity. Your assesment that it doesnt add much
value over the EL capabilities in JSP2 is pretty much on the mark. Of
course it wasnt always this way and for a long time velocity was much
nicer. (Still looks nicer ;-)
I reckon you are also correct in believing that velocity design provided
a lot of the inspiration for the jstl stuff.
-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity
 

[EMAIL PROTECTED] 02/27/04 5:44 AM 
   

I am starting to develop an application using struts and have been 
looking round the rest of the Jakarta project and came across the 
Velocity project.

I was interested to see which which people recommended for a relative 
newbie
   

After looking at velocity, I am certainly of the opinion that it adds no
value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl
combination does not. The only difference is that velocity is a bit more
terse (if/else/end instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .
It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in tomcat 4.
A while back I looked in detail at the jsp/velocity comparison on the
velocity site.
There are several issues with the comparison. The person writing the
case study was cleary biased towards velocity and had never even
considered JSTL (which in all fairness may not have been available at
that time). Looking at the code (both the velocity and jstl versions are
below) I think that velocity clearly had an influence on the jsp2/jstl
constructs.
The first thing I noticed was that the two pages do not do the same
thing. The jsp turns off the session (the vm does not). The jsp stores
variables that are never used which were factored out in the vm version.
The vm version
is missing required code (for example, the repCode and urlEvent
variables are never defined).
The jsp page is also *very* poorly written using scriptlets. You should
rarely need to use scriptlets in jsp1/jstl pages, and I suspect with
jsp2/jstl, you will not ever
*need* to.
With struts, you do not need to use jsp:useBean tags either because
the controller does that for you.
The jsp2/jstl version is a bit more verbose because it is based on xml
so you cannot have things like if/else/end because they are unbalanced,
but other than that, there are no significant differences.
After converting the page to use JSTL and eliminating ALL of the % %
stuff, we get something more like this:
===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
  bgcolor=white
  tr
  td
  ibTopic: ${meeting.topic}/b/i
  c:forEach list=${meeting.storedEventsIterator}
var=event
  c:set var=yapper
value=${meeting.participation[event.fromId]} /
  c:choose
  c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
  c:choose
  c:when test=${yapper.role eq 'R'}
  c:set var=repId
value=${yapper.participantId} /
  font
color=#00b${yapper.name}:/b/font
  /c:when
  c:otherwise
  font
color=#f0b${yapper.name}:/b/font
  /c:otherwise
  /c:choose
  a
href=${event.storedData}${event.storedData}/a br
  /c:when
  c:when test=${event.class.name eq
'fqcn.ChatEvent'}
  c:choose
  c:when test=${yapper.role eq 'R'}
  font
color=#00b${yapper.name}:/b/font
  c:set var=repId
value=${yapper.participantId} /
  /c:when
  c:otherwise
  font
color=#f0b${yapper.name}:/b/font
  /c:otherwise
  /c:choose
  a
href=${event.storedData}${event.storedData}/a br
 

RE: [OT] JSP or Velocity

2004-02-27 Thread Kris Schneider
Starting points:

http://java.sun.com/products/jsp/jstl/reference/docs/index.html

http://java.sun.com/products/jsp/jstl/reference/techart/index.html

Quoting A.White [EMAIL PROTECTED]:

 Thanks for your answers, they are all greatly appreciated
 
 I think I'll be using JSP and JTSL then.  However I have tried to look
 for some good tutorials for JTSL but have failed to find any that have
 addressed the basics.  
 
 Any pointers to resources (apart from www.google.com ;-) ) will receive
 huge karma and gratitude in their next life
 
 Andrew

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread Joe Germuska
At 9:34 AM +0100 2/27/04, nicolas De Loof wrote:
I've built Struts 1.2.0 from the sources package uising maven 1.0RC1 
without trouble.

When I run maven site, the generated m-target/docs has no 
index.html and faqs, proposals, tiles and userGuide are 
empty directory. Is this a known build problem (waiting for update 
for an *official* release) ?
The energy for applying Maven to Struts has been focused on the 
build.  I think a few people have looked at making it build the docs, 
but no one has really focused on it.  I've also been pleased to be 
able to extend the main project.xml for struts-chain and struts-el to 
quickly bring Maven support to those.

Maven is not the official build mechanism for Struts, and there's no 
guarantee that it will become such in the 1.x line.  On the other 
hand, if folks make Maven do everything the current Ant build does, 
it might.  Of course, the fact that Maven still hasn't seen a full 
1.0 release does lend some support with keeping Ant the official way.

For the docs, the main thing would be to eliminate any need to 
maintain dual documentation while the Ant build is still the official 
build.  I think all current efforts have cloned the docs dir, and 
I've never tried to get maven:site to work against anything but the 
xdocs directory.  If anyone knows the trick, patches are always 
happily accepted!

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining.
-- Jef Raskin

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


Manipulate page validation for ValidatorForm

2004-02-27 Thread Mikael Wikblom
Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks



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


RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread Martin Sturzenegger
hi,
i'm trying to use hubert's (and shirish's) approach on request-scope, and as long as 
the amount of rows are fixed it works well.
BUT now i have an additional feature on my page and that gives me headaches. 
actionOne gets the rows from the dto-bean and initializes the jsp. 
on the jsp-page with the form over the rows, i have an additional form where the user 
can toggle through different versions of my db.
this form submits to actionOne where the action is supposed to fetch another set of 
rows, according to the parameter given. 
let's say: choose february 12th there are 12 rows to display, choose february 15th 
there are 15 different rows, choose the next day there are 10 rows.
with this approach, starting with february 12th i get 12 rows. changing to february 
15th i get the old 12 rows and the new 15 rows added to, going back to feb 12th i get 
the old 27 rows and again the 12 rows from feb.12 added to and so on and on
is there a way to reinitialize the autopopulation method or even to temporarily 
disable autopopulation on lists with nested properties?
any adwise or code snippets are warmly welcomed
take care
martin



-- Urspruengliche Nachricht --
Von: Hubert Rabago [EMAIL PROTECTED]
Antworten an: Struts Users Mailing List [EMAIL PROTECTED]
Datum:  Thu, 26 Feb 2004 07:01:54 -0800 (PST)

IIRC, you also need it in reset():

public class LazyListExampleForm extends ActionForm {
private List actionList;
 
public LazyListExampleForm () {
initLists();
}

public void reset(ActionMapping mapping, 
  HttpServletRequest request) {
super.reset(mapping, request);
initLists();
}
 
private void initLists() {
Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(), factory);
}

// Getter/setters for list omitted
}

- Hubert

--- Paul, R. Chip [EMAIL PROTECTED] wrote:
 Note: I think this is likely different in current versions of the commons
 collections lib, but this works for the version we are dependent on.
 
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted
 
 public class LazyListExampleForm extends ActionForm {
  private List actionList;
 
  public LazyListExampleForm ()
  {
  Factory factory = new Factory() {
   public Object create() {
   return new ActionListBean();
   }
   };
   this.actionList = ListUtils.lazyList(new ArrayList(),
 factory);
  }
 
  // Getter/setters for list omitted
 }
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, February 26, 2004 8:49 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help
 
 
 wouldn't mind an example of how to use lazy list if you have one.
 
 
 On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:
 
  Or use the Commons Collections LazyList which handles this problem 
  automatically.
 
  -Original Message-
  From: Mark Lowe [mailto:[EMAIL PROTECTED]
  Sent: Thursday, February 26, 2004 8:09 AM
  To: Struts Users Mailing List
  Subject: Re: Problem in nested tags- Very Urgent - Please Help
 
 
  shirish posted this a few times.
 
  if you're scoping to request you'll need a while loop in your 
  getFoo(int index)  method
 
  public class OrgManagementForm extends ActionForm {
 
  private List addressList = new ArrayList();
 
  public Address getAddress(int index) {
 
 while(index = addressList.size() ) {
 this.addressList.add( new Address() );
 }
 
 return (Address) addressList.get(index);
  }
 
  bla bla.
 
  }
 
  look like it could be your problem.
 
 
  On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:
 
  I am having an OrganzationVO inside my form-bean.
 
  The OrganzationVO has a collection of AddressVOs.
 
  I am using nested tags like this.
 
 
  nested:nest property = orgVO
 
nested:text property=orgID  size=10 maxlength=10
  styleClass=inputmandtabindex= /

nested:iterate id=addressid property=addresses indexId=index
 

  nested:text property=company1 size=30 maxlength=30 
  styleClass=inputmand tabindex= /

/nested:iterate
 
  /nested:nest
 
  while submitting the form I am getting an exception like this.
 
 
  2004-02-26 18:17:08,133 [ExecuteThread: '12' for queue: 
  'weblogic.kernel.Default'] DEBUG org.apache. 
  commons.beanutils.BeanUtils - 
  setProperty([EMAIL PROTECTED], orgVO.a 
  ddresses[0].company1, [get populated])
  getAddrVOAL--[]
  Feb 26, 2004 6:17:08 PM IST Error HTTP BEA-101017 
  [ServletContext(id=1735147,name=gbs,conte
  xt-path=/gbs)] Root cause of ServletException. 
  

[OT] JSP or Velocity

2004-02-27 Thread Leonardo Francalanci
take a look at freemarker
http://www.freemarker.org/index.html

It is very similar to Velocity, but you can use JSP
tags in freemarker templates.

(You can use JSP custom tag libraries in templates. 
from http://freemarker.org/fmVsVel.html)

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



RE: Manipulate page validation for ValidatorForm

2004-02-27 Thread Hookom, Jacob
We had to do this for our last project; I had an ActionForm for each page
with validator bindings to validate input on each page.  In the Actions, I
used the page's form to update a transaction bean in the session which I
in turn called a commit method on it to execute business logic (validate
product inventory/medical information/etc). The commit method then could
throw business exceptions which I bound to exception handlers.

I referred to it as conflict-resolution where your goal is a successful
commit of the transaction, but for any conflict, you resolve with a UI
page and separate action form to validate user's data.  Any input validation
would be taken care of by each page's ActionForm.


ActionForward execute(..) throws Exception
{
TransactionSession tx = getTransaction(httpSession);
tx.setQuantity(new Integer(form.getQuantity()));
tx.commit()
return mapping.findForward(SUCCESS);
}

-Jacob

-Original Message-
From: Mikael Wikblom [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 8:22 AM
To: [EMAIL PROTECTED]
Subject: Manipulate page validation for ValidatorForm

Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks




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

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



RE: [OT] JSP or Velocity

2004-02-27 Thread Navjot Singh
Basically, i use velocity only for email templates and sometimes to generate
other kind of templates from one template where the use of XSLT is not
appropriate.
For web templates, that have more complex requirements, i prefer to use
taglibs. besides el makes life as easy as we may talk in velocity. In
velocity, to comprehend taglibs, you may have have to write lots of
velocimacro.

you may ask for another opinion on velocity-user list as well.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.

 I was interested to see which which people recommended for a relative
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over
jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination
does not.
The only difference is that velocity is a bit more terse (if/else/end
instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in
tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study
was cleary biased towards velocity and had never even considered JSTL
(which
in all fairness may not have been available at that time). Looking at
the code
(both the velocity and jstl versions are below) I think that velocity
clearly had
an influence on the jsp2/jstl constructs.

The first thing I noticed was that the two pages do not do the same
thing.
The jsp turns off the session (the vm does not). The jsp stores
variables that
are never used which were factored out in the vm version. The vm version

is missing required code (for example, the repCode and urlEvent
variables
are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need
to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you
will not ever
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller
does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you
cannot have things like if/else/end because they are unbalanced, but
other than
that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we
get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i

   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   br${meeting.meetingId}:${repId}br
   /td
   /tr
/table
===
The velocity version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: $meeting.getTopic()/b/ip

   #foreach( $event in $meeting.getStoredEventsIterator() )
   #set( $yapper =
$meeting.getParticipation($event.getFromId()) )

   #if( $event.getClass().getName().equals($urlEvent) )

   #if( $repRole.equals($yapper.getRole()) )
   #set( $repId = $yapper.getParticipantId() )
   font
color=$blkb$yapper.getName()/b/font

   #else
 

RE: Why can't I name a form using html:form?

2004-02-27 Thread Leticia Golubov
Thanks Mark,

I stumbled upon the answer to my question by accident, yesterday, which made
me quite happy (must get out more)... :)

cheers

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: 24 February 2004 12:41
To: Struts Users Mailing List
Subject: Re: Why can't I name a form using html:form?


styleId will give you a hook if you need have a way of drilling to
something. But i'm guessing what your needs are.


On 24 Feb 2004, at 13:38, Mark Lowe wrote:

 the name of the form will be whatever you called it in struts config.
 There was a name attribute in 1.0 but this became deprecated and now
 must have been removed.

 I imagine that something will be done in newer releases (perhaps
 already) to support strict xhtml and thus do away with rendering
 name= and use id= instead or as well as name=.

 If you're trying to drill to the form in javascript best use

 onclick=alert( this.form.elements['myproperty'].value ) ..

 I you look at the rendered html you'll see that the name attribute is
 rendered.


 On 24 Feb 2004, at 13:30, Leticia Golubov wrote:

 This is really winding me up...

 why does html:form method=post action=/scopeAction  work

 but html:form method=post action=/scopeAction
  name=deleteForm
  type=org.apache.struts.action.DynaActionForm 
 
 doesn't?

 Why can't I name my forms?  I've looked at the documentation and the
 'name'
 field doesn't even seem to exist, which leads me to believe I can't
 name
 forms using the html:form tag?!

 Is this a bug in Struts or have I missed something fundamental here?

 regards

 Leticia


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



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



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


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



RE: Problem with tags and overloaded methods

2004-02-27 Thread Slattery, Tim - BLS
  I reiterate, I believe it's a bad idea to use the same 
 method name for 
  two different property mappings.  If you can find some 
 documentation 
  that recommends you do that, I'd like to see it.
 
 I believe Tim is referring to what is defined in section 
 8.3.3 of the JavaBeans spec, Indexed properties, which states:
 
 -
 Thus an indexed property foo might be represented by four accessor
 methods:
 
 public Bah[] getFoo();
 public void setFoo(Bah a[]);
 public Bah getFoo(int a);
 public void setFoo(int a, Bah b);

That's exactly what I'm thinking about. The functions that failed didn't
look *exactly* like that though, their signatures looked like this:

public ArrayList getFoo();
public void setFoo(ArrayList a);
public Bah getFoo(int a);
public void setFoo(int a, Bah b);

The unindexed getter and setter used an ArrayList instead of an array of the
base objects. On the page that worked, the unindexed getters and setters did
use an array of base objects. I can only guess that the property inspector
in 1.3.1_10 is so extraordinarily picky that it won't accept the ArrayList
but will accept an array of base objects.

I guess I could use the toArray method of ArrayList. I seem to remember
having trouble with that method in the past, though.


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: microsoft sqlserver driver struts

2004-02-27 Thread ian_d_stewart
Hi Claire,

We are successfully connecting to a Microsoft SQL Server 2000 using the
type 4 JDBC drivers.  However, we do not use DBCP, but rather the
DataSource implementation provided by Microsoft.  Here is the configuration
we use (this is taken from an internal configuration file that we use to
create the DataSource's from an AXIS handler for our web services, not
struts-config.xml, but the same properties should work)

datasource name=peregrine type
=com.microsoft.jdbcx.sqlserver.SQLServerDataSource
 serverNameXXX/serverName
 databaseNamePeregrine/databaseName
 portNumber1433/portNumber
 loginTimeout60/loginTimeout
 userXXX/user
 passwordXXX/password
/datasource

Also, if you need to connect to the same database across multiple web apps,
you want to look into using JNDI instead of the struts-config.xml file.


HTH,
Ian



   
  
Claire Wall  
  
[EMAIL PROTECTED]   To: Struts Users Mailing List 
[EMAIL PROTECTED]  
tosys.com cc: 
  
   Subject: microsoft sqlserver driver  
struts  
02/27/2004 05:34   
  
AM 
  
Please respond 
  
to Struts Users   
  
Mailing List  
  
   
  
   
  




Hi,

I am trying to use microsoft's jdbc driver with my struts application, but
to no avail. Here is my datasource definition:

  data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
   set-property property=description value=My SqlServer pool/
   set-property property=driverClassName value
=com.microsoft.jdbc.sqlserver.SQLServerDriver/
   set-property property=url value
=jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME/
   set-property property=username value=xxx/
   set-property property=password value=xxx/
   set-property property=maxActive value=20/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
   set-property property=maxWait value=5000/
   set-property property=defaultAutoCommit value=false/
   set-property property=defaultReadOnly value=false/
  /data-source

I have the required jars located in the WEB-INF/lib of my application which
is running on Tomcat 4.1.29. When i try to connect to the database using
this driver from a test class, it connects no problem so i know that the
url and driver class name are correct. So the problem must be the type of
DataSource which I am to use. Does anybody know which datasource to use
with Microsoft's sqlserver driver? I tried using the DataSource that is in
the mssqlserver jar but this didnt work either.

The error that I get is an Invalid DataSource.

Any help would be really appreciated!

Thanks
Claire







This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
If you received this transmission in error, please immediately contact the sender and 
destroy the material in its entirety, whether in electronic or hard copy format. Thank 
you.


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



Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
Ian,

This is the way I tried first as it seemed most logical to use the
SQLServerDataSource type from the mssqlserver.jar but this doesnt work for
me. The only one that made some progress was the
com.microsoft.jdbcx.base.BaseDataSource but then this threw some strange
error which said:

java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
 at com.microsoft.jdbcx.base.BaseDataSource.setLogWriter(Unknown Source)

I've had a look into this but I don't see why this error should be occuring.
Maybe there's something wrong I have done with where I've put the jars.. I
have three jars: mssqlserver.jar, msbase.jar and msutil.jar. the last two
look to be pretty similiar with regards to what they contain. I was
wondering whether this could be causing conflicts or something.

As I said, i can connect fine to the datasource from a test class but going
via struts is causing this Invalid DataSource problem.

Claire

- Original Message -
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:02 PM
Subject: Re: microsoft sqlserver driver  struts


 Hi Claire,

 We are successfully connecting to a Microsoft SQL Server 2000 using the
 type 4 JDBC drivers.  However, we do not use DBCP, but rather the
 DataSource implementation provided by Microsoft.  Here is the
configuration
 we use (this is taken from an internal configuration file that we use to
 create the DataSource's from an AXIS handler for our web services, not
 struts-config.xml, but the same properties should work)

 datasource name=peregrine type
 =com.microsoft.jdbcx.sqlserver.SQLServerDataSource
  serverNameXXX/serverName
  databaseNamePeregrine/databaseName
  portNumber1433/portNumber
  loginTimeout60/loginTimeout
  userXXX/user
  passwordXXX/password
 /datasource

 Also, if you need to connect to the same database across multiple web
apps,
 you want to look into using JNDI instead of the struts-config.xml file.


 HTH,
 Ian




 Claire Wall
 [EMAIL PROTECTED]   To: Struts Users Mailing
List [EMAIL PROTECTED]
 tosys.com cc:
Subject: microsoft
sqlserver driver  struts
 02/27/2004 05:34
 AM
 Please respond
 to Struts Users
 Mailing List






 Hi,

 I am trying to use microsoft's jdbc driver with my struts application, but
 to no avail. Here is my datasource definition:

   data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
set-property property=description value=My SqlServer pool/
set-property property=driverClassName value
 =com.microsoft.jdbc.sqlserver.SQLServerDriver/
set-property property=url value
 =jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME/
set-property property=username value=xxx/
set-property property=password value=xxx/
set-property property=maxActive value=20/
set-property property=maxCount value=20/
set-property property=minCount value=2/
set-property property=maxWait value=5000/
set-property property=defaultAutoCommit value=false/
set-property property=defaultReadOnly value=false/
   /data-source

 I have the required jars located in the WEB-INF/lib of my application
which
 is running on Tomcat 4.1.29. When i try to connect to the database using
 this driver from a test class, it connects no problem so i know that the
 url and driver class name are correct. So the problem must be the type of
 DataSource which I am to use. Does anybody know which datasource to use
 with Microsoft's sqlserver driver? I tried using the DataSource that is in
 the mssqlserver jar but this didnt work either.

 The error that I get is an Invalid DataSource.

 Any help would be really appreciated!

 Thanks
 Claire







 This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this transmission
in error, please immediately contact the sender and destroy the material in
its entirety, whether in electronic or hard copy format. Thank you.


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





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



Re: Manipulate page validation for ValidatorForm

2004-02-27 Thread Mikael Wikblom
Hi Jacob,

yes it is possible to solve this in a number of ways. I just wanted to 
know if the is an easy way of doing it. I've looked at the 
struts/validatior implemtentation, it would only mean changing one line 
of code ( a = to a =  ) to have my desired behaviour. It would not be 
hard to make this an attribute of the ValidatiorForm. I mean making the 
assumption that the pages always are ordered is not the most generic 
approach ;)

Thanks anyway!

Hookom, Jacob wrote:

We had to do this for our last project; I had an ActionForm for each page
with validator bindings to validate input on each page.  In the Actions, I
used the page's form to update a transaction bean in the session which I
in turn called a commit method on it to execute business logic (validate
product inventory/medical information/etc). The commit method then could
throw business exceptions which I bound to exception handlers.
I referred to it as conflict-resolution where your goal is a successful
commit of the transaction, but for any conflict, you resolve with a UI
page and separate action form to validate user's data.  Any input validation
would be taken care of by each page's ActionForm.
ActionForward execute(..) throws Exception
{
TransactionSession tx = getTransaction(httpSession);
tx.setQuantity(new Integer(form.getQuantity()));
tx.commit()
return mapping.findForward(SUCCESS);
}
-Jacob

-Original Message-
From: Mikael Wikblom [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 8:22 AM
To: [EMAIL PROTECTED]
Subject: Manipulate page validation for ValidatorForm

Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks



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



--
+-+
Mikael Wikblommailto:[EMAIL PROTECTED]
Senior Software Engineer  MoS in Computer Sci. and Eng., LiTH
AdNovum Informatik AG http://www.adnovum.ch  phone: +41 (0)1 272 6111
Roentgenstrasse 22, CH-8005 Zuerich  fax:   +41 (0)1 272 6312
+-+
AdNovum Software Inc. San Mateo, CA 94404phone: +1 (650) 525 9322
1400 Fashion Island Boulevard, Suite 309 fax:   +1 (650) 525 9324
+-+


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


RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread shirishchandra.sakhare
I have not understood your problem completely.

But this looks like more a problem of resetting the list in form than anything else.

Firstly, if you are using request scoped form, then why going from page 1 to page 2 
will apend the beans to form?

Are you sure you are using request scoped forms?

If the form is session scoped, make sure you reset the list to empty properly.

HTH.
regards,
Shirish

-Original Message-
From: Martin Sturzenegger [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:28 PM
To: Struts Users Mailing List
Subject: RE: Problem in nested tags- Very Urgent - Please Help


hi,
i'm trying to use hubert's (and shirish's) approach on request-scope, and as long as 
the amount of rows are fixed it works well.
BUT now i have an additional feature on my page and that gives me headaches. 
actionOne gets the rows from the dto-bean and initializes the jsp. 
on the jsp-page with the form over the rows, i have an additional form where the user 
can toggle through different versions of my db.
this form submits to actionOne where the action is supposed to fetch another set of 
rows, according to the parameter given. 
let's say: choose february 12th there are 12 rows to display, choose february 15th 
there are 15 different rows, choose the next day there are 10 rows.
with this approach, starting with february 12th i get 12 rows. changing to february 
15th i get the old 12 rows and the new 15 rows added to, going back to feb 12th i get 
the old 27 rows and again the 12 rows from feb.12 added to and so on and on
is there a way to reinitialize the autopopulation method or even to temporarily 
disable autopopulation on lists with nested properties?
any adwise or code snippets are warmly welcomed
take care
martin



-- Urspruengliche Nachricht --
Von: Hubert Rabago [EMAIL PROTECTED]
Antworten an: Struts Users Mailing List [EMAIL PROTECTED]
Datum:  Thu, 26 Feb 2004 07:01:54 -0800 (PST)

IIRC, you also need it in reset():

public class LazyListExampleForm extends ActionForm {
private List actionList;
 
public LazyListExampleForm () {
initLists();
}

public void reset(ActionMapping mapping, 
  HttpServletRequest request) {
super.reset(mapping, request);
initLists();
}
 
private void initLists() {
Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(), factory);
}

// Getter/setters for list omitted
}

- Hubert

--- Paul, R. Chip [EMAIL PROTECTED] wrote:
 Note: I think this is likely different in current versions of the commons
 collections lib, but this works for the version we are dependent on.
 
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections.Factory;
 import org.apache.commons.collections.ListUtils;
 // Nonrelevant imports ommitted
 
 public class LazyListExampleForm extends ActionForm {
  private List actionList;
 
  public LazyListExampleForm ()
  {
  Factory factory = new Factory() {
   public Object create() {
   return new ActionListBean();
   }
   };
   this.actionList = ListUtils.lazyList(new ArrayList(),
 factory);
  }
 
  // Getter/setters for list omitted
 }
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, February 26, 2004 8:49 AM
 To: Struts Users Mailing List
 Subject: Re: Problem in nested tags- Very Urgent - Please Help
 
 
 wouldn't mind an example of how to use lazy list if you have one.
 
 
 On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:
 
  Or use the Commons Collections LazyList which handles this problem 
  automatically.
 
  -Original Message-
  From: Mark Lowe [mailto:[EMAIL PROTECTED]
  Sent: Thursday, February 26, 2004 8:09 AM
  To: Struts Users Mailing List
  Subject: Re: Problem in nested tags- Very Urgent - Please Help
 
 
  shirish posted this a few times.
 
  if you're scoping to request you'll need a while loop in your 
  getFoo(int index)  method
 
  public class OrgManagementForm extends ActionForm {
 
  private List addressList = new ArrayList();
 
  public Address getAddress(int index) {
 
 while(index = addressList.size() ) {
 this.addressList.add( new Address() );
 }
 
 return (Address) addressList.get(index);
  }
 
  bla bla.
 
  }
 
  look like it could be your problem.
 
 
  On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:
 
  I am having an OrganzationVO inside my form-bean.
 
  The OrganzationVO has a collection of AddressVOs.
 
  I am using nested tags like this.
 
 
  nested:nest property = orgVO
 
nested:text property=orgID  size=10 maxlength=10
  styleClass=inputmandtabindex= /

nested:iterate id=addressid 

Re: Problem with loss form (session scope)

2004-02-27 Thread rick
Perhaps your form implements reset()?

Rick DeBay

On Fri, 27 Feb 2004 05:06 , Niall Pemberton [EMAIL PROTECTED] sent:

Without seeing your jsp/struts-config.xml/action its a bit of a guessing
game.

I'm a bit confused by you saying ...at this point, I set up this form bean
as session scope. To me this implies your getting a form not in session
scope (i.e. request) and saving it yourself in session scope. If that is the
case - then maybe thats your problem - if the struts-config.xml says its
request, thats where struts will look for it and, if it doesn't exist, it'll
set a new one up in  request scope (even if you already have one under the
same name in session).

If I've got it wrong, then maybe you could explain further. I'm also not
clear whether your finding out your form has been 'wiped' as soon as you get
into your action and before you set it up as session scope or after that
when you get to your detail screen. Could you clarify that as well please.


Niall
- Original Message - 
From: Betty Koon [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:41 AM
Subject: RE: Problem with loss form (session scope)


 Well, sorry for being vague.  It's a very vague problem, that's why it's
 very difficult to explain the details.  This only happen to one of my
 action.  I had a list inside a form.  And one of the column render a link
to
 the detail page.  But I need to do some processing before I redirect to
the
 detail.  So I wrote the link to do a form post it back to the caller
action.
 In that case, I can collect some information, at this point, I set up this
 form bean as session scope.  But everytime the post happened, it seems
like
 the form content got wiped out.

 -Betty



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







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



Re: microsoft sqlserver driver struts

2004-02-27 Thread Claire Wall
ok i've manager to connect to the datasource! What I did was to move my jars
into common/lib.

Now I have another problem though. For some reason this driver does not like
my queries - more specifically it does not like table names used on their
own but only likes them when the database name and database user is inserted
before it like 'dbname.dbo.user_table'. Why is this? I cannot change all my
queries (and there are alot of them) so that they have this prefix as it
will cause many problems if the application has to be ported to another
database. Is this an SQL Server database setting, or something to do with
the driver itself?

I know I'm getting off the struts issue now but any help would be great! :)



- Original Message -
From: Claire Wall [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:19 PM
Subject: Re: microsoft sqlserver driver  struts


 Ian,

 This is the way I tried first as it seemed most logical to use the
 SQLServerDataSource type from the mssqlserver.jar but this doesnt work for
 me. The only one that made some progress was the
 com.microsoft.jdbcx.base.BaseDataSource but then this threw some strange
 error which said:

 java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
  at com.microsoft.jdbcx.base.BaseDataSource.setLogWriter(Unknown Source)

 I've had a look into this but I don't see why this error should be
occuring.
 Maybe there's something wrong I have done with where I've put the jars.. I
 have three jars: mssqlserver.jar, msbase.jar and msutil.jar. the last two
 look to be pretty similiar with regards to what they contain. I was
 wondering whether this could be causing conflicts or something.

 As I said, i can connect fine to the datasource from a test class but
going
 via struts is causing this Invalid DataSource problem.

 Claire

 - Original Message -
 From: [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 3:02 PM
 Subject: Re: microsoft sqlserver driver  struts


  Hi Claire,
 
  We are successfully connecting to a Microsoft SQL Server 2000 using the
  type 4 JDBC drivers.  However, we do not use DBCP, but rather the
  DataSource implementation provided by Microsoft.  Here is the
 configuration
  we use (this is taken from an internal configuration file that we use to
  create the DataSource's from an AXIS handler for our web services, not
  struts-config.xml, but the same properties should work)
 
  datasource name=peregrine type
  =com.microsoft.jdbcx.sqlserver.SQLServerDataSource
   serverNameXXX/serverName
   databaseNamePeregrine/databaseName
   portNumber1433/portNumber
   loginTimeout60/loginTimeout
   userXXX/user
   passwordXXX/password
  /datasource
 
  Also, if you need to connect to the same database across multiple web
 apps,
  you want to look into using JNDI instead of the struts-config.xml file.
 
 
  HTH,
  Ian
 
 
 
 
  Claire Wall
  [EMAIL PROTECTED]   To: Struts Users Mailing
 List [EMAIL PROTECTED]
  tosys.com cc:
 Subject: microsoft
 sqlserver driver  struts
  02/27/2004 05:34
  AM
  Please respond
  to Struts Users
  Mailing List
 
 
 
 
 
 
  Hi,
 
  I am trying to use microsoft's jdbc driver with my struts application,
but
  to no avail. Here is my datasource definition:
 
data-source key=DB type=org.apache.commons.dbcp.BasicDataSource
 set-property property=description value=My SqlServer pool/
 set-property property=driverClassName value
  =com.microsoft.jdbc.sqlserver.SQLServerDriver/
 set-property property=url value
  =jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME/
 set-property property=username value=xxx/
 set-property property=password value=xxx/
 set-property property=maxActive value=20/
 set-property property=maxCount value=20/
 set-property property=minCount value=2/
 set-property property=maxWait value=5000/
 set-property property=defaultAutoCommit value=false/
 set-property property=defaultReadOnly value=false/
/data-source
 
  I have the required jars located in the WEB-INF/lib of my application
 which
  is running on Tomcat 4.1.29. When i try to connect to the database using
  this driver from a test class, it connects no problem so i know that the
  url and driver class name are correct. So the problem must be the type
of
  DataSource which I am to use. Does anybody know which datasource to use
  with Microsoft's sqlserver driver? I tried using the DataSource that is
in
  the mssqlserver jar but this didnt work either.
 
  The error that I get is an Invalid DataSource.
 
  Any help would be really appreciated!
 
  Thanks
  Claire
 
 
 
 
 
 
 
  This transmission may contain information that is 

html:link action - how to append query string

2004-02-27 Thread Leticia Golubov
I have a simple question, for a change... :)

Given

% String value=some Value %

and

html:link action='/scopeAction?row=???'

how do I append the java var 'value' to the end of the action?

If I hardcode it, it works and the behaviour is as expected, i.e.:

html:link action='/scopeAction?row=3'

Note I have tried the following and failed:
html:link action='/scopeAction?row==value'
html:link action='/scopeAction?row==value'
html:link action=/scopeAction?row='=value'

Also searched on internet but didn't find anything as yet...

regards

NOTE: I don't want to use html:hidden property=row value=%=value/ in
this instance...


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



RE: html:link action - how to append query string

2004-02-27 Thread Tomeu Vizoso
I would recommend using the html-el tag library, in which case the code
should look like that:

html:link action='/scopeAction?row={$value}'

See here for an explanation on how to utilize the EL (expression
language):

http://javaboutique.internet.com/tutorials/Struts_EL/


Regards,

Tomeu

-Mensagem original-
De: Leticia Golubov [mailto:[EMAIL PROTECTED] 
Enviada: sexta-feira, 27 de Fevereiro de 2004 15:50
Para: Struts User Mailing List
Assunto: html:link action - how to append query string


I have a simple question, for a change... :)

Given

% String value=some Value %

and

html:link action='/scopeAction?row=???'

how do I append the java var 'value' to the end of the action?

If I hardcode it, it works and the behaviour is as expected, i.e.:

html:link action='/scopeAction?row=3'

Note I have tried the following and failed:
html:link action='/scopeAction?row==value'
html:link action='/scopeAction?row==value'
html:link action=/scopeAction?row='=value'

Also searched on internet but didn't find anything as yet...

regards

NOTE: I don't want to use html:hidden property=row
value=%=value/ in this instance...


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


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



RE: html:link action - how to append query string

2004-02-27 Thread Paul, R. Chip
You have I think three choices, in preferred order:

1.  Use the paramName, paramScope, and paramProperty attributes of
html:link
(see
http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
This may not work with the page scoped variable defined the way you've
done it, I don't know.

2.  Use Struts-EL and add ${value} into your link string

3.   html:link page='/scopeAction.do?row=% =value %'

I think your core problem is to pass an variable without the param
attributes you need to contstuct and send a URL, not the name of an action?



-Original Message-
From: Leticia Golubov [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 9:50 AM
To: Struts User Mailing List
Subject: html:link action - how to append query string


I have a simple question, for a change... :)

Given

% String value=some Value %

and

html:link action='/scopeAction?row=???'

how do I append the java var 'value' to the end of the action?

If I hardcode it, it works and the behaviour is as expected, i.e.:

html:link action='/scopeAction?row=3'

Note I have tried the following and failed:
html:link action='/scopeAction?row==value'
html:link action='/scopeAction?row==value'
html:link action=/scopeAction?row='=value'

Also searched on internet but didn't find anything as yet...

regards

NOTE: I don't want to use html:hidden property=row value=%=value/ in
this instance...


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

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



RE: ArrayList in Form

2004-02-27 Thread Julio Cesar De Salvo
I' m in a similar situation but when I use the type element to cast the
object in the ArrayList throws an ClassCastException.

Any ideas?

Thanks, Julio



-Mensaje original-
De: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] 
Enviado el: Viernes, 27 de Febrero de 2004 08:48 a.m.
Para: Struts Users Mailing List
Asunto: SV: ArrayList in Form

Hi Shashank 

If I understand you correct, you want to modify the properties in an
object within a Collection

Do like this:

logic:iterate id=rows name=theForm property=rows
type=com.company.TheObject 
html:text name=rows property=firstName indexed=true /   
html:text name=rows property=lastName indexed=true /
/logic:iterate

There are 2 important things to remember:
 1. id attribute in the iterate tag MUST have the same name as the
property attribute in the iterate tag (rows)
 2. you have to set the attribute indexed to true ( indexed=true ) 

Hope this wil help you

Med venlig hilsen

Claus Weng Madsen, Teamleder
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 30242875
www.telmore.dk 


-Oprindelig meddelelse-
Fra: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 10:17
Til: [EMAIL PROTECTED]
Emne: ArrayList in Form


Hello All

I have a ArrayList in the form which contains a CustomObject TheROw. I
iterate thr this arraylist to display it by logic:iterate as follows.
This row will contain many fields such as rate or amount.

logic:iterate id=currentRow name=theForm property=rows
type=com.custobj.TheRow  \\ Display all rows /logic:iterate


PROBLEM : When the form gets submitted with rate or amount changed I
expect I will get ArrayList back by changed values. But No change
happens in the values.

Does that mean that If one uses ArrayList in the form, it can be used
for the purpose of display only. If User changes some value we will not
get those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



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


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



action errors and resource bundles

2004-02-27 Thread David Adelson


I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.

Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?

thanks

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



Re: microsoft sqlserver driver struts

2004-02-27 Thread rick
If you're switching JDBC drivers, take a look at JSQLConnect from J-netdirect. 
We found it performed MUCH better than the driver from Microsoft.

Rick DeBay

On Fri, 27 Feb 2004 11:56 , Claire Wall [EMAIL PROTECTED] sent:

Mark,

My problem is that I'm switching JDBC drivers - before I was using
weblogic's JDBC driver for SQL Server and I've been using that for a long
time now and never had any problems. Now I'm trying to ditch the weblogic
driver and in its place use Microsoft's JDBC driver for SQLServer. Sorry,
should've mentioned that before. I'm not sure that showing the code for
getting the datasource is going to help because I'm assuming that this is
not the problem - the problem is surely to do with the type of datasource.

I had a similiarish problem trying to use an Oracle database - in the end
the type of datasource was the problem and not how I retrieved it in my
actions.

Have you used Microsoft's SQL Server 2000 JDBC driver with struts before,
and if so, what type of datasource do we use? Can't find anywhere that says
anything about it. Cant be too difficult..

Thanks
Claire

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:43 AM
Subject: Re: microsoft sqlserver driver  struts



 Can i see the bits of code in the servlets (non action servlets) at
 start up that retrieve the datasource? And an example from any actions.
 Also see the load on start up order as i imagine that the struts
 servlet needs to load before your servlets to be able to access the
 datasource.


 On 27 Feb 2004, at 12:39, Claire Wall wrote:

  It gets thrown when the application starts, but then more errors occur
  as
  there are several servlets which load upon start-up - the data source
  is
  null at this point (NullPointerException's are being thrown) and so the
  errors are thrown when these classes try to access the database.
 
  - Original Message -
  From: Mark Lowe [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, February 27, 2004 11:29 AM
  Subject: Re: microsoft sqlserver driver  struts
 
 
  Does the error get thrown when you attempt to access the data source
  or
  at startup?
 
 
  On 27 Feb 2004, at 11:34, Claire Wall wrote:
 
  Hi,
 
  I am trying to use microsoft's jdbc driver with my struts
  application,
  but to no avail. Here is my datasource definition:
 

  type=org.apache.commons.dbcp.BasicDataSource
 
 
  value=com.microsoft.jdbc.sqlserver.SQLServerDriver/
 
  value=jdbc:microsoft:sqlserver://SERVERNAME:1433;
  DatabaseName=DBNAME/
 
 
 
 
 
 
 
 

 
  I have the required jars located in the WEB-INF/lib of my application
  which is running on Tomcat 4.1.29. When i try to connect to the
  database using this driver from a test class, it connects no problem
  so i know that the url and driver class name are correct. So the
  problem must be the type of DataSource which I am to use. Does
  anybody
  know which datasource to use with Microsoft's sqlserver driver? I
  tried using the DataSource that is in the mssqlserver jar but this
  didnt work either.
 
  The error that I get is an Invalid DataSource.
 
  Any help would be really appreciated!
 
  Thanks
  Claire
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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




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







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



RE: [OT] JSP or Velocity

2004-02-27 Thread rick
JSTL in Action
http://www.manning.com/bayern/
Rick DeBay

On Fri, 27 Feb 2004 13:45 , A.White [EMAIL PROTECTED] sent:

Thanks for your answers, they are all greatly appreciated

I think I'll be using JSP and JTSL then.  However I have tried to look
for some good tutorials for JTSL but have failed to find any that have
addressed the basics.  

Any pointers to resources (apart from www.google.com ;-) ) will receive
huge karma and gratitude in their next life

Andrew



-Original Message-
From: Andrew Hill
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED] 
Sent: 27 February 2004 13:35
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Yes, Velocity has been around for quite awhile now, and it was intended
to address many of the problems inherent in (older versions of) JSP.

Nowdays JSP (especially JSP2) coding techniques and technologies have
rather caught up with velocity. Your assesment that it doesnt add much
value over the EL capabilities in JSP2 is pretty much on the mark. Of
course it wasnt always this way and for a long time velocity was much
nicer. (Still looks nicer ;-)

I reckon you are also correct in believing that velocity design provided
a lot of the inspiration for the jstl stuff.

-Original Message-
From: Larry Meadors
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been 
 looking round the rest of the Jakarta project and came across the 
 Velocity project.

 I was interested to see which which people recommended for a relative 
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl
combination does not. The only difference is that velocity is a bit more
terse (if/else/end instead of
//) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study was cleary biased towards velocity and had never even
considered JSTL (which in all fairness may not have been available at
that time). Looking at the code (both the velocity and jstl versions are
below) I think that velocity clearly had an influence on the jsp2/jstl
constructs.

The first thing I noticed was that the two pages do not do the same
thing. The jsp turns off the session (the vm does not). The jsp stores
variables that are never used which were factored out in the vm version.
The vm version

is missing required code (for example, the repCode and urlEvent
variables are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need to use scriptlets in jsp1/jstl pages, and I suspect with
jsp2/jstl, you will not ever
*need* to.

With struts, you do not need to use  tags either because
the controller does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you cannot have things like if/else/end because they are unbalanced,
but other than that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the 
stuff, we get something more like this:

===
The JSP version:
===

   bgcolor=white
   
   
   Topic: ${meeting.topic}

   
var=event
   
value=${meeting.participation[event.fromId]} /
   
   
'fqcn.URLPushedEvent'}
   
   
   
value=${yapper.participantId} /
   
color=#00${yapper.name}:
   
   
   
color=#f0${yapper.name}:
   
   
   
href=${event.storedData}${event.storedData} 
   
   
'fqcn.ChatEvent'}
   
   
   
color=#00${yapper.name}:
   
value=${yapper.participantId} /
   
   
   
color=#f0${yapper.name}:
   
   
   
href=${event.storedData}${event.storedData} 
   
   
   
   
   ${meeting.meetingId}:${repId}
   
   

===
The velocity version:
===

   bgcolor=white
   
   
   Topic: $meeting.getTopic()

   #foreach( $event in $meeting.getStoredEventsIterator() )
   #set( $yapper =
$meeting.getParticipation($event.getFromId()) )

   #if( $event.getClass().getName().equals($urlEvent) )


Re: action errors and resource bundles

2004-02-27 Thread Adam Hardy
On 02/27/2004 05:04 PM David Adelson wrote:
I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.
Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?
LOoking at the javadoc for ActionMessages, I would say no, it must be 
hard-coded to get it from the default bundle.

Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: action errors and resource bundles

2004-02-27 Thread David Adelson
thanks for the reply.
I was all excited about splitting up my properties files
for common, module1, and module2.

But now it appears that all the errors we use all
have to be in one properties file.

bummer.



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:15 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles


On 02/27/2004 05:04 PM David Adelson wrote:
 
 I have numerous property files for storing
 my resources (applicationresources.properties).
 Each one has a bundle name identified in struts-config.
 
 Is there a way for ActionError or ActionMessage to 
 get data from a particular bundle?

LOoking at the javadoc for ActionMessages, I would say no, it must be 
hard-coded to get it from the default bundle.

Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



RE: html:link action - how to append query string

2004-02-27 Thread Leticia Golubov
Yes, I've been trying solution number 3, but that doesn't work at all. The
browser doesn't like and renders the link incorrectly.

I'm now trying solution 1, as suggested, as below:

html:link action='/scopeAction'
  paramId='%=value%'
  paramName='scopeForm'
paramProperty='row' 
...
/html:link

I've tried different permutations to set the value for the row property, but
had no success...  I read the link but that wasn't helpful at all.  What I
mean is, it's not clear to me how to set the value...  In the case above,
the row is not being set.

-Original Message-
From: Paul, R. Chip [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 15:59
To: 'Struts Users Mailing List'
Subject: RE: html:link action - how to append query string


You have I think three choices, in preferred order:

1.  Use the paramName, paramScope, and paramProperty attributes of
html:link
(see
http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
This may not work with the page scoped variable defined the way you've
done it, I don't know.

2.  Use Struts-EL and add ${value} into your link string

3.   html:link page='/scopeAction.do?row=% =value %'

I think your core problem is to pass an variable without the param
attributes you need to contstuct and send a URL, not the name of an action?



-Original Message-
From: Leticia Golubov [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 9:50 AM
To: Struts User Mailing List
Subject: html:link action - how to append query string


I have a simple question, for a change... :)

Given

% String value=some Value %

and

html:link action='/scopeAction?row=???'

how do I append the java var 'value' to the end of the action?

If I hardcode it, it works and the behaviour is as expected, i.e.:

html:link action='/scopeAction?row=3'

Note I have tried the following and failed:
html:link action='/scopeAction?row==value'
html:link action='/scopeAction?row==value'
html:link action=/scopeAction?row='=value'

Also searched on internet but didn't find anything as yet...

regards

NOTE: I don't want to use html:hidden property=row value=%=value/ in
this instance...


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

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


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



how to set selectedIndex at html:select

2004-02-27 Thread Daniel
How can change the selectedIndex of dropdown values



obrigado
Daniel S.

RE: [OT] JSP or Velocity

2004-02-27 Thread Hookom, Jacob
Go to java.sun.com and search for JSTL pdf



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: None
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity

JSTL in Action
http://www.manning.com/bayern/
Rick DeBay

On Fri, 27 Feb 2004 13:45 , A.White [EMAIL PROTECTED] sent:

Thanks for your answers, they are all greatly appreciated

I think I'll be using JSP and JTSL then.  However I have tried to look
for some good tutorials for JTSL but have failed to find any that have
addressed the basics.  

Any pointers to resources (apart from www.google.com ;-) ) will receive
huge karma and gratitude in their next life

Andrew



-Original Message-
From: Andrew Hill
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED] 
Sent: 27 February 2004 13:35
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Yes, Velocity has been around for quite awhile now, and it was intended
to address many of the problems inherent in (older versions of) JSP.

Nowdays JSP (especially JSP2) coding techniques and technologies have
rather caught up with velocity. Your assesment that it doesnt add much
value over the EL capabilities in JSP2 is pretty much on the mark. Of
course it wasnt always this way and for a long time velocity was much
nicer. (Still looks nicer ;-)

I reckon you are also correct in believing that velocity design provided
a lot of the inspiration for the jstl stuff.

-Original Message-
From: Larry Meadors
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been 
 looking round the rest of the Jakarta project and came across the 
 Velocity project.

 I was interested to see which which people recommended for a relative 
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl
combination does not. The only difference is that velocity is a bit more
terse (if/else/end instead of
//) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study was cleary biased towards velocity and had never even
considered JSTL (which in all fairness may not have been available at
that time). Looking at the code (both the velocity and jstl versions are
below) I think that velocity clearly had an influence on the jsp2/jstl
constructs.

The first thing I noticed was that the two pages do not do the same
thing. The jsp turns off the session (the vm does not). The jsp stores
variables that are never used which were factored out in the vm version.
The vm version

is missing required code (for example, the repCode and urlEvent
variables are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need to use scriptlets in jsp1/jstl pages, and I suspect with
jsp2/jstl, you will not ever
*need* to.

With struts, you do not need to use  tags either because
the controller does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you cannot have things like if/else/end because they are unbalanced,
but other than that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the 
stuff, we get something more like this:

===
The JSP version:
===

   bgcolor=white
   
   
   Topic: ${meeting.topic}

   
var=event
   
value=${meeting.participation[event.fromId]} /
   
   
'fqcn.URLPushedEvent'}
   
   
   
value=${yapper.participantId} /
   
color=#00${yapper.name}:
   
   
   
color=#f0${yapper.name}:
   
   
   
href=${event.storedData}${event.storedData} 
   
   
'fqcn.ChatEvent'}
   
   
   
color=#00${yapper.name}:
   
value=${yapper.participantId} /
   
   
   
color=#f0${yapper.name}:
   
   
   
href=${event.storedData}${event.storedData} 
   
   
   
   
   ${meeting.meetingId}:${repId}
   
   

===
The velocity version:
===

   bgcolor=white
   
   
   Topic: $meeting.getTopic()

   #foreach( $event in 

Re: action errors and resource bundles

2004-02-27 Thread Adam Hardy
Er, hold on a moment. If you use modules, then you can specify a 
different properties file in each struts-config.

On 02/27/2004 05:21 PM David Adelson wrote:
thanks for the reply.
I was all excited about splitting up my properties files
for common, module1, and module2.
But now it appears that all the errors we use all
have to be in one properties file.
bummer.



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:15 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles
On 02/27/2004 05:04 PM David Adelson wrote:

I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.
Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?


LOoking at the javadoc for ActionMessages, I would say no, it must be 
hard-coded to get it from the default bundle.

Adam


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


MockStrutsTestCase problem

2004-02-27 Thread John Fitzpatrick
I'm having a problem setting up tests where errors are created during
validation by a DynaActionForm using MockStrutsTestCase. Here's my code:

The DynaActionForm:
===
package test;

import javax.servlet.http.*;

import org.apache.struts.action.*;

public class BogusForm extends org.apache.struts.action.DynaActionForm {
ActionErrors errors = new ActionErrors ();

   public ActionErrors validate ( ActionMapping mapping,
HttpServletRequest request ) {

errors.add ( error, new ActionError ( error.message ) );
return errors;
   }
}

The Action:
===
package test;

import javax.servlet.http.*;

import org.apache.struts.action.*;

/**
 * @struts.action
 *name=BogusForm
 *input=.doActivity
 *path=/Bogus
 * @struts.action-forward
 *name=doActivity
 *path=.doActivity
 */
public class BogusAction extends org.apache.struts.action.Action {
   public ActionForward execute ( ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception {

  return mapping.findForward ( doActivity );
   }
}

The MockStrutsTestCase:
===
package test;

import javax.servlet.*;
import servletunit.struts.*;

public class TestBogusAction extends MockStrutsTestCase {
   public void testFormPassed () {
  setRequestPathInfo ( /Bogus );
  actionPerform ();
  verifyNoActionErrors ();
   }
   public void testFormFailed () {
  setRequestPathInfo ( /Bogus );
  actionPerform ();
  verifyActionErrors( new String [] { error.message } );
   }
}

The result:
===
test:
[junit] Running mori.web.controller.registry.test.TestBogusAction
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 2.435 sec
[junit] Testsuite: mori.web.controller.registry.test.TestBogusAction
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 2.435 sec

[junit] Testcase: testFormPassed took 1.875 sec
[junit] Testcase: testFormFailed took 0.547 sec
[junit] FAILED
[junit] was expecting some error messages, but received none.
[junit] junit.framework.AssertionFailedError: was expecting some
error messages, but received none.
[junit] at 
servletunit.struts.Common.verifyActionMessages(Common.java:84)
[junit] at 
servletunit.struts.MockStrutsTestCase.verifyActionErrors(MockStrutsTestCase.
java:765)
[junit] at 
mori.web.controller.registry.test.TestBogusAction.testFormFailed(TestBogusAc
tion.java:17)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
[junit] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
[junit] TEST mori.web.controller.registry.test.TestBogusAction FAILED



Since the Form just creates an error, I should get exactly the opposite test
results from what I'm getting, right? It seems as though the
MockStrutsTestCase cannot see the errors generated by the DynaActionForm
even though the source says it should do exactly that. Any help appreciated.

John



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



RE: html:link action - how to append query string

2004-02-27 Thread Leticia Golubov
I just don't understand why the 3rd option doesn't work for me...

I've tried all possible variations of it but I just can't seem to be able to
parse
%value% to the query string... does anybody know why?

so html:link page=/scopeAction.do?row=%= value % doesn't work nor does
html:link page=/scopeAction.do?row='%= value %' and so on...

regards

-Original Message-
From: Paul, R. Chip [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 15:59
To: 'Struts Users Mailing List'
Subject: RE: html:link action - how to append query string


You have I think three choices, in preferred order:

1.  Use the paramName, paramScope, and paramProperty attributes of
html:link
(see
http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
This may not work with the page scoped variable defined the way you've
done it, I don't know.

2.  Use Struts-EL and add ${value} into your link string

3.   html:link page='/scopeAction.do?row=% =value %'

I think your core problem is to pass an variable without the param
attributes you need to contstuct and send a URL, not the name of an action?



-Original Message-
From: Leticia Golubov [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 9:50 AM
To: Struts User Mailing List
Subject: html:link action - how to append query string


I have a simple question, for a change... :)

Given

% String value=some Value %

and

html:link action='/scopeAction?row=???'

how do I append the java var 'value' to the end of the action?

If I hardcode it, it works and the behaviour is as expected, i.e.:

html:link action='/scopeAction?row=3'

Note I have tried the following and failed:
html:link action='/scopeAction?row==value'
html:link action='/scopeAction?row==value'
html:link action=/scopeAction?row='=value'

Also searched on internet but didn't find anything as yet...

regards

NOTE: I don't want to use html:hidden property=row value=%=value/ in
this instance...


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

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


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



RE: action errors and resource bundles

2004-02-27 Thread David Adelson
Thanks. I am doing this.
This is why I am having trouble.
I have seperated my files and each is named
in struts-config.

If I want a property from the correct resource using
bean:message I just do,
bean:message bundle=BundleNameInStrutsConfig key=whatever

BUT, actionerrors will not do it:
ActionErrors errors = new ActionErrors();
errors.add(name, new ActionError(keyinpropertiesfile));

IE, there is no way to tell it which bundle (file) to use.

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:42 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles


Er, hold on a moment. If you use modules, then you can specify a 
different properties file in each struts-config.

On 02/27/2004 05:21 PM David Adelson wrote:
 thanks for the reply.
 I was all excited about splitting up my properties files
 for common, module1, and module2.
 
 But now it appears that all the errors we use all
 have to be in one properties file.
 
 bummer.
 
 
 
 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 11:15 AM
 To: Struts Users Mailing List
 Subject: Re: action errors and resource bundles
 
 
 On 02/27/2004 05:04 PM David Adelson wrote:
 
I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.

Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?
 
 
 LOoking at the javadoc for ActionMessages, I would say no, it must be 
 hard-coded to get it from the default bundle.
 
 Adam


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



RE: html:link action - how to append query string

2004-02-27 Thread Hubert Rabago
Have you tried
html:link page=%= /scopeAction.do?row= + value % 
?

--- Leticia Golubov [EMAIL PROTECTED] wrote:
 I just don't understand why the 3rd option doesn't work for me...
 
 I've tried all possible variations of it but I just can't seem to be able
 to
 parse
 %value% to the query string... does anybody know why?
 
 so html:link page=/scopeAction.do?row=%= value % doesn't work nor
 does
 html:link page=/scopeAction.do?row='%= value %' and so on...
 
 regards
 
 -Original Message-
 From: Paul, R. Chip [mailto:[EMAIL PROTECTED]
 Sent: 27 February 2004 15:59
 To: 'Struts Users Mailing List'
 Subject: RE: html:link action - how to append query string
 
 
 You have I think three choices, in preferred order:
 
 1.  Use the paramName, paramScope, and paramProperty attributes of
 html:link
   (see
 http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
 This may not work with the page scoped variable defined the way you've
 done it, I don't know.
 
 2.  Use Struts-EL and add ${value} into your link string
 
 3.   html:link page='/scopeAction.do?row=% =value %'
 
 I think your core problem is to pass an variable without the param
 attributes you need to contstuct and send a URL, not the name of an action?
 
 
 
 -Original Message-
 From: Leticia Golubov [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 9:50 AM
 To: Struts User Mailing List
 Subject: html:link action - how to append query string
 
 
 I have a simple question, for a change... :)
 
 Given
 
 % String value=some Value %
 
 and
 
 html:link action='/scopeAction?row=???'
 
 how do I append the java var 'value' to the end of the action?
 
 If I hardcode it, it works and the behaviour is as expected, i.e.:
 
 html:link action='/scopeAction?row=3'
 
 Note I have tried the following and failed:
 html:link action='/scopeAction?row==value'
 html:link action='/scopeAction?row==value'
 html:link action=/scopeAction?row='=value'
 
 Also searched on internet but didn't find anything as yet...
 
 regards
 
 NOTE: I don't want to use html:hidden property=row value=%=value/
 in
 this instance...
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



RE: html:link action - how to append query string

2004-02-27 Thread Leticia Golubov
No!! But it worked! You're a star!  I owe you a beer or a tea (if you're
not a drinker) :)

thanks :)

-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 16:52
To: Struts Users Mailing List
Subject: RE: html:link action - how to append query string


Have you tried
html:link page=%= /scopeAction.do?row= + value %
?

--- Leticia Golubov [EMAIL PROTECTED] wrote:
 I just don't understand why the 3rd option doesn't work for me...

 I've tried all possible variations of it but I just can't seem to be able
 to
 parse
 %value% to the query string... does anybody know why?

 so html:link page=/scopeAction.do?row=%= value % doesn't work nor
 does
 html:link page=/scopeAction.do?row='%= value %' and so on...

 regards

 -Original Message-
 From: Paul, R. Chip [mailto:[EMAIL PROTECTED]
 Sent: 27 February 2004 15:59
 To: 'Struts Users Mailing List'
 Subject: RE: html:link action - how to append query string


 You have I think three choices, in preferred order:

 1.  Use the paramName, paramScope, and paramProperty attributes of
 html:link
   (see
 http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
 This may not work with the page scoped variable defined the way you've
 done it, I don't know.

 2.  Use Struts-EL and add ${value} into your link string

 3.   html:link page='/scopeAction.do?row=% =value %'

 I think your core problem is to pass an variable without the param
 attributes you need to contstuct and send a URL, not the name of an
action?



 -Original Message-
 From: Leticia Golubov [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 9:50 AM
 To: Struts User Mailing List
 Subject: html:link action - how to append query string


 I have a simple question, for a change... :)

 Given

 % String value=some Value %

 and

 html:link action='/scopeAction?row=???'

 how do I append the java var 'value' to the end of the action?

 If I hardcode it, it works and the behaviour is as expected, i.e.:

 html:link action='/scopeAction?row=3'

 Note I have tried the following and failed:
 html:link action='/scopeAction?row==value'
 html:link action='/scopeAction?row==value'
 html:link action=/scopeAction?row='=value'

 Also searched on internet but didn't find anything as yet...

 regards

 NOTE: I don't want to use html:hidden property=row value=%=value/
 in
 this instance...


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

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


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



__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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


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



Re: Problem with tags and overloaded methods

2004-02-27 Thread Martin Cooper

Slattery, Tim - BLS [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
   I reiterate, I believe it's a bad idea to use the same
  method name for
   two different property mappings.  If you can find some
  documentation
   that recommends you do that, I'd like to see it.
 
  I believe Tim is referring to what is defined in section
  8.3.3 of the JavaBeans spec, Indexed properties, which states:
 
  -
  Thus an indexed property foo might be represented by four accessor
  methods:
 
  public Bah[] getFoo();
  public void setFoo(Bah a[]);
  public Bah getFoo(int a);
  public void setFoo(int a, Bah b);

 That's exactly what I'm thinking about. The functions that failed didn't
 look *exactly* like that though, their signatures looked like this:

 public ArrayList getFoo();
 public void setFoo(ArrayList a);
 public Bah getFoo(int a);
 public void setFoo(int a, Bah b);

 The unindexed getter and setter used an ArrayList instead of an array of
the
 base objects. On the page that worked, the unindexed getters and setters
did
 use an array of base objects. I can only guess that the property inspector
 in 1.3.1_10 is so extraordinarily picky that it won't accept the ArrayList
 but will accept an array of base objects.

Well, it's not supposed to work with anything other than an array, so if it
ever worked with an ArrayList, then I guess you were lucky - or is that
unlucky? ;-)


 I guess I could use the toArray method of ArrayList. I seem to remember
 having trouble with that method in the past, though.

Shouldn't be a problem - I've used it for exactly this purpose (although I'm
using JDK 1.4.2, not 1.3.1).

--
Martin Cooper




 --
 Tim Slattery
 [EMAIL PROTECTED]




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



Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread Martin Cooper

Andrew Hill [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Ah I see.
 Its just the jars, tlds, dtds necessary for a struts app, sans docs.

Yup, that's it exactly. We've actually been releasing a 'lib' version for a
while now, for people who don't want to have to download the entire binary
version, since the latter is getting a bit big. The description of that does
seem to have fallen off the Acquiring page in the docs, though. ;-(

Also, it's worth noting that, due to some great work from Ted, the 1.2.0
binary download is about 25% smaller than the 1.1 equivalent, since several
of the sample web apps have been merged into one, thus demonstrating modules
as well.

--
Martin Cooper



 -Original Message-
 From: Andrew Hill [mailto:[EMAIL PROTECTED]
 Sent: Friday, 27 February 2004 13:52
 To: Struts Users Mailing List
 Subject: RE: [ANNOUNCE] Struts 1.2.0 Test Build available


 Cool bananas!

 Many thanks to the struts team for all the work they have put into this
 build. :-)

 Whats the lib archive for?

 -Original Message-
 From: Martin Cooper [mailto:[EMAIL PROTECTED]
 Sent: Friday, 27 February 2004 13:48
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [ANNOUNCE] Struts 1.2.0 Test Build available


 The Struts 1.2.0 Test Build is now available here:

 http://www.apache.org/~martinc/struts/v1.2.0/

 This is the first Struts build being made available following the same
 test-and-release process that has been used successfully by the Tomcat
 team for some time. It is *not* an official Apache release.

 Once feedback has been collected on the stability and general quality of
 this build, a determination will be made as to whether it should be
 promoted to Alpha status.

 --
 Martin Cooper

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



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




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



Re: action errors and resource bundles

2004-02-27 Thread Adam Hardy
But surely you have name them in each struts-config.xml files 
differently? In which case there should be no need to specify the bundle 
in the bean:message taglib. That's the way I understood it - I don't 
actually use modules.

On 02/27/2004 05:53 PM David Adelson wrote:
Thanks. I am doing this.
This is why I am having trouble.
I have seperated my files and each is named
in struts-config.
If I want a property from the correct resource using
bean:message I just do,
bean:message bundle=BundleNameInStrutsConfig key=whatever
BUT, actionerrors will not do it:
ActionErrors errors = new ActionErrors();
errors.add(name, new ActionError(keyinpropertiesfile));
IE, there is no way to tell it which bundle (file) to use.

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:42 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles
Er, hold on a moment. If you use modules, then you can specify a 
different properties file in each struts-config.

On 02/27/2004 05:21 PM David Adelson wrote:

thanks for the reply.
I was all excited about splitting up my properties files
for common, module1, and module2.
But now it appears that all the errors we use all
have to be in one properties file.
bummer.



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:15 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles
On 02/27/2004 05:04 PM David Adelson wrote:


I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.
Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?


LOoking at the javadoc for ActionMessages, I would say no, it must be 
hard-coded to get it from the default bundle.

Adam





--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread Martin Cooper

nicolas De Loof [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I've built Struts 1.2.0 from the sources package uising maven 1.0RC1
 without trouble.

 When I run maven site, the generated m-target/docs has no index.html
 and faqs, proposals, tiles and userGuide are empty directory. Is
 this a known build problem (waiting for update for an *official* release)
?

As Joe has already mentioned, the use of Maven to build various parts of
Struts is an ongoing activity. All of the builds you see distributed from
Jakarta (nightly, release, and this test build) are still built using Ant.

Given that Maven still hasn't reached an official 1.0 release in almost 3
years of development, and given how stable and well-developed the Struts Ant
build system is (it's just as capable as Maven of building the entire
release, including docs, by issuing one command to a shell), I'm personally
in no great rush to switch. ;-)

That said, there are some intrepid Maven fans who are working on getting the
Maven build for Struts to the same point as the Ant build system, so don't
be surprised to see the issues you mention taken to heart and addressed
before an official release of Maven!

--
Martin Cooper



 Nico.

 Martin Cooper a écrit :

 The Struts 1.2.0 Test Build is now available here:
 
 http://www.apache.org/~martinc/struts/v1.2.0/
 
 This is the first Struts build being made available following the same
 test-and-release process that has been used successfully by the Tomcat
 team for some time. It is *not* an official Apache release.
 
 Once feedback has been collected on the stability and general quality of
 this build, a determination will be made as to whether it should be
 promoted to Alpha status.
 
 --
 Martin Cooper
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 




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



Re: how to set selectedIndex at html:select

2004-02-27 Thread Mark Lowe
set the value of the form property that you wish to select.

On 27 Feb 2004, at 17:40, Daniel wrote:

How can change the selectedIndex of dropdown values



obrigado
Daniel S.


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


RE: action errors and resource bundles

2004-02-27 Thread David Adelson
You may have something there.
I think I may have done something wrong.

Thanks, I'll let you know how it goes

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 12:27 PM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles


But surely you have name them in each struts-config.xml files 
differently? In which case there should be no need to specify the bundle 
in the bean:message taglib. That's the way I understood it - I don't 
actually use modules.

On 02/27/2004 05:53 PM David Adelson wrote:
 Thanks. I am doing this.
 This is why I am having trouble.
 I have seperated my files and each is named
 in struts-config.
 
 If I want a property from the correct resource using
 bean:message I just do,
 bean:message bundle=BundleNameInStrutsConfig key=whatever
 
 BUT, actionerrors will not do it:
 ActionErrors errors = new ActionErrors();
 errors.add(name, new ActionError(keyinpropertiesfile));
 
 IE, there is no way to tell it which bundle (file) to use.
 
 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 11:42 AM
 To: Struts Users Mailing List
 Subject: Re: action errors and resource bundles
 
 
 Er, hold on a moment. If you use modules, then you can specify a 
 different properties file in each struts-config.
 
 On 02/27/2004 05:21 PM David Adelson wrote:
 
thanks for the reply.
I was all excited about splitting up my properties files
for common, module1, and module2.

But now it appears that all the errors we use all
have to be in one properties file.

bummer.



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 11:15 AM
To: Struts Users Mailing List
Subject: Re: action errors and resource bundles


On 02/27/2004 05:04 PM David Adelson wrote:


I have numerous property files for storing
my resources (applicationresources.properties).
Each one has a bundle name identified in struts-config.

Is there a way for ActionError or ActionMessage to 
get data from a particular bundle?


LOoking at the javadoc for ActionMessages, I would say no, it must be 
hard-coded to get it from the default bundle.

Adam
 
 
 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread Martin Cooper

Oswald Campesato [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]


 Martin Cooper [EMAIL PROTECTED] wrote:
 The Struts 1.2.0 Test Build is now available here:
 Excellent:)
 http://www.apache.org/~martinc/struts/v1.2.0/

 This is the first Struts build being made available following the same
 test-and-release process that has been used successfully by the Tomcat
 team for some time. It is *not* an official Apache release.

 Once feedback has been collected on the stability and general quality of
 this build, a determination will be made as to whether it should be
 promoted to Alpha status.


 Is there a web page that describes the process by which feedback
 is collected?

Just the usual mechanisms:

* Bug reports: http://jakarta.apache.org/struts/using.html#Bugs
* Feedback on the mailing lists.

The former is preferred if you are sure there is a bug; the latter is where
to speculate and ask questions.

--
Martin Cooper



 Thanks,

 Oswald


 --
 Martin Cooper

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




 -
 Do you Yahoo!?
 Get better spam protection with Yahoo! Mail




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



Re: [ANNOUNCE] Struts 1.2.0 Test Build available

2004-02-27 Thread Joe Germuska
Given that Maven still hasn't reached an official 1.0 release in almost 3
years of development.
hey, now...  Struts 1.1 took a darn long time!  I bet they're in the 
same boat.  Plenty of people who don't really track version numbers 
are using it happily, so the urge to actually cut a release is not 
too strong.

That said, there are some intrepid Maven fans who are working on getting the
Maven build for Struts to the same point as the Ant build system
My enthusiasm for Maven is all about lowering the barrier to entry. 
I think long-time Ant/Struts builders forget how tedious it is to set 
up the build.properties file.  And that's just to compile; if you use 
an IDE you have another headache getting a Struts project set up.

Anyway, no need to proselytize...

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining.
-- Jef Raskin

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


Re: [OT] JSP or Velocity

2004-02-27 Thread Martin Cooper
There is one *huge* gripe I have about JSP that many people probably don't
care about. But if you do care about it, it can be pretty much of a
showstopper, and drive you to use Velocity instead.

The problem is that JSP *must* be invoked in a servlet request / response
environment. Why is this a problem? Here are a couple of examples:

1) You decide to use JSP to build an application in which customers may want
to modify (some of) your pages to develop their own look and feel. JSP is a
great choice, because it's standard and well known. Everybody is happy. Now
you add HTML mail notifications to your application. Customers may also want
to customise these, just as they did the web pages. But since these
notifications are not created during processing of a web request, there's no
request / response environment in which to invoke a JSP page. You have a
couple of choices - use a different templating language for mail
notifications, or make a URL request to a separate servlet that's there just
to invoke the JSP page. In the latter case, you'll likely want to add
security constraints so that external requests for that servlet can't be
made. Yuk.

2) You have a reporting web application that displays awesome reports and
charts to interactive users. Now you need to add the capability to generate
these reports in the background, because they may take a long time to
generate, and you want to be pro-active and cache them for the user.
Effectively, you're now back in the same scenario as (1), where you either
have to jump through hoops to be able to invoke a JSP page outside a request
/ response, or you need to choose a different templating language.

3) You have an application that is sufficiently dynamic that you need to be
able to generate page templates on the fly, and then invoke them. In a JSP
environment, you are now going to have to deploy the JDK, rather than just
the JRE, in a production environment, which will make a lot of IT people
very uncomfortable (if they allow it at all). In addition, you're going to
have to solve the interesting problem of where you can write the JSP files
to the disk such that the container will actually invoke them for you as JSP
pages. This is especially interesting if you need to do it in a portable
manner.

Don't get me wrong - I think JSP is great, especially in its 2.0 flavour, or
with JSTL. However, it has some serious limitations in certain application
scenarios. Most of its competitors, Velocity included, do not suffer from
these same kinds of issues.

--
Martin Cooper


A.White [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Howdy

I am starting to develop an application using struts and have been
looking round the rest of the Jakarta project and came across the
Velocity project.

I was interested to see which which people recommended for a relative
newbie

Cheers

Andrew




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



struts-faces doesn't update pages correctly when using tiles

2004-02-27 Thread Diego Louzán Martínez
I'm refactoring a Struts+JSTL application to use JSF too, and I have a
problem when using the struts-faces library. Everything works ok until I
use a ForwardAction to navigate to an action like this:

action path=/MainPage
  type=org.apache.struts.actions.ForwardAction
  parameter=.mainPage/

.mainPage is a Tiles page defined like this:

definition name=.base page=/faces/DefaultLayout.jsp
  put name=title value=/DefaultTitle.jsp/
  put name=headerSpecific value=/Blank.jsp/
  put name=content value=/Blank.jsp/
  put name=footer value=/DefaultFooter.jsp/
/definition
definition name=.mainPage extends=.base
  put name=headerSpecific value=/MainPageHeaderSpecific.jsp/
  put name=content value=/MainPageContent.jsp/
/definition

I'm using my own RequestProcessor registered on the config file of
struts:

controller  
processorClass=es.udc.fbellas.j2ee.miniportal.http.controller.frontcontroller.MiniPortalRequestProcessor/

The mapping works fine except for I have to load the browser url twice.
When I first load the page, it gives the following exception:


org.apache.jasper.JasperException: Duplicate component ID 'title' found
in view.
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at
com.sun.faces.context.ExternalContextImpl.dispatchMessage(ExternalContextImpl.java:287)
at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:144)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:89)
at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:209)
at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:196)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
at org.apache.jsp.Index_jsp._jspService(Index_jsp.java:42)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 

RE: [OT] RE: Memory usage

2004-02-27 Thread Dhaliwal, Pritpal (HQP)
+1

I agree with everyone who has responded. We should not clutter this very
friendly mailing list with things that don't belong here, that includes not
so nice responses. I haven't been on many, but this is by far my favorite
list, even though I am mainly a spectator. 

I lashed out because this question clearly didn't belong here. If the person
had followed anything in http://www.catb.org/~esr/faqs/smart-questions.html,
it must that they were polite. They certainly didn't do much investigation
outside on the internet. The little bit of unfriendliness, I dunno why it
came out. Unprofessional, it shouldn't have came out.


What's happening to the struts mailing list?

Of late people have been more than willing to crucify users for any reason.

I think its because sometimes(or more recently) people ask/ed questions that
clearly don't belong on this list. On top of that, it shows that they have
not put in any effort to get the answer, before asking the question here. In
this case, I am sure there are tons of people on this mailing list who would
love to talk about java gc, but question just wasn't asked right, at the
right place.

And Christian, thanks a lot for those words of wisdom, knocking my senses
back in. I am proud of the first helloworld I wrote,and stuff I have
written, be it good or bad. I give my best to what I do. I am probably not
close to being part of the Black Team , and don't know what peopleware(but
will check google) is, I think I have long ways to go.

My next would-be not so nice reply would be a nice one. Well done
Christian.

Regards,
Pritpal Dhaliwal



-Original Message-
From: Anand Stephen [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 1:20 AM
To: Struts Users Mailing List
Subject: Re: [OT] RE: Memory usage


+1

What's happening to the struts mailing list?

Of late people have been more than willing to crucify users for any reason.



I remember this mailing list being one of the friendliest mailing lists.



Appreciate your post very much Christian; very well said.



Lets not clutter this list by posting demeaning replies. (My two cents).





(Apologies for reposting a question in the past without giving enough time
for an answer, anxiety got the better of me!)



-anand stephen.




- Original Message - 
From: atta-ur rehman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 12:19 PM
Subject: Re: [OT] RE: Memory usage


 +1

 ATTA

 - Original Message -
 From: Christian Bollmeyer [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Thursday, February 26, 2004 11:53 AM
 Subject: Re: [OT] RE: Memory usage


  On Thursday 26 February 2004 20:12, Dhaliwal, Pritpal (HQP) wrote:
 
  Now. Still remember when you wrote your first crappy lines you 
  proudly called a 'program'? *That* exactly is what we all started 
  from, considering me: nearly 23 years ago on a little ZX81 box, 
  doing my first steps in Assembler. YMMV. And how I was proud. A long 
  time has passed since then, and I have seens lots of crappy code in-
  between, but whenever I get proud again about what
  I've done or achieved since then, one millisecond
  before I remember how lousy I started once and
  keep my mouth shut in humility, just in time. This,
  obviously, is still a lesson you have to learn, but
  I can tell you: one of many things that separates
  the good from the possibly-not-so-good is a certain
  difference in attitude. So it would have sufficed
  to politely mention that there are tools for testing
  code efficiency (nowadays) and that this forum
  may not be the best place to ask for answers.
  All the rest is rather irrelevant, including your
  insulting assumptions about code you never
  saw or the people behind it. You think you're
  good or better? I tell you: from this mail alone
  I can tell you have still a long way to go to be
  regarded as a member of the 'Black Team',
  and in your obviously long professional career,
  you certainly have read 'Peopleware' once and
  know what I'm talking about here.
 
  HTH,
  -- Chris.
 
  And never say HTH if you intentionally
  provide a snake when someone asks
  you for a fish.
 
   Viru Bhai,
  
   No,
   You code is not good or optimized. You have problems follwing 
   instructions. Your question is not related to struts and you 
   didn't put OT in the subject. Even if you put OT in subject, It 
   would still be a bad question because that's not what this list is 
   discussing.
  
   Primary reason I believe your code is not good and optimized is 
   because you don't have enough knowledge about how to prove it. 
   Most likely your code is as good as the question you asked.
  
   You probably want to look at profilers and code coverage tools do 
   you proving.
  
   If I was you, I would seriously read a Java book. Maybe a Java 
   optimization book too.
  
   Hope This Helps,
   Pritpal Dhaliwal
  
   P.s.  Is it Friday yet?
  
  
   

[OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available)

2004-02-27 Thread Martin Cooper

Joe Germuska [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Given that Maven still hasn't reached an official 1.0 release in almost 3
 years of development.

 hey, now...  Struts 1.1 took a darn long time!  I bet they're in the
 same boat.  Plenty of people who don't really track version numbers
 are using it happily, so the urge to actually cut a release is not
 too strong.

I'm not claiming we're angels, but we're doing a lot better than Maven is.
;-) From Struts 1.0.2 Final to Struts 1.1 Final took 1 year, 4 months.
During that time, people still had a Final release to work with. Maven has
been in development for almost *3* years, with *no* Final release to work
with...


 That said, there are some intrepid Maven fans who are working on getting
the
 Maven build for Struts to the same point as the Ant build system

 My enthusiasm for Maven is all about lowering the barrier to entry.

I used to share that enthusiasm. It has faded over time, however, as it
became apparent to me that, once you get past the easy part, writing preGoal
and postGoal scripts isn't much different from writing Ant scripts. Oh, and
Maven changing the way it does things didn't help either. ;-)

 I think long-time Ant/Struts builders forget how tedious it is to set
 up the build.properties file.  And that's just to compile; if you use
 an IDE you have another headache getting a Struts project set up.

That is certainly true. One of the things Maven does for you, to ease the
build process, is decide where the dependencies are going to come from. If
we did that in the Ant build files, it would make it almost as simple as
Mave, but then, because they're Ant build files, people would complain that
they were not sufficiently flexible. That makes it hard to win. ;-)

(When it comes to IDEs, though, most of them know about Ant, but don't yet
know about Maven at all, so there's not so much of a case for Maven there,
IMHO.)

--
Martin Cooper



 Anyway, no need to proselytize...

 Joe
 -- 
 Joe Germuska
 [EMAIL PROTECTED]
 http://blog.germuska.com
Imagine if every Thursday your shoes exploded if you tied them
 the usual way.  This happens to us all the time with computers, and
 nobody thinks of complaining.
  -- Jef Raskin




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



struts-actions.xml

2004-02-27 Thread as as
I tried adding Xdoclet tags into my struts action classes so that it can generate 
struts action mappings etc stuff automatically into my output struts-config.xml file. 
It doesnt do so...unless I add manually a file called struts-actions.cml into my 
project merger directory.please indicate a solution for thus
 
Thanks,
Samy


-
Do you Yahoo!?
Get better spam protection with Yahoo! Mail

java.lang.reflect.InvocationTargetException when using Indexed properties

2004-02-27 Thread Julio Cesar De Salvo
Hi, 
 
I get this error when sending the parameters to action that saves the
information in tha database, the creation of the form is successfull.
 
I guess that might be something related with the getters/setters in the
ActionForm as when I change this methods names the exception changes to
NullException.
 
Any ideas, about how to name the getters/setters for the indexed
properties (in my case is a bean with Strings).
 
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt
ils.java:493)
 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt
ils.java:428)
 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti
ls.java:770)
 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav
a:801)
 
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
 
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
or.java:821)
 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
254)
 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 
 
Thanks, julio


RE: html:text works, bean:write fails [Resolved]

2004-02-27 Thread rcdunn
Well the following fixed it:

bean:write name=reportForm property=totalInventory/

The problem was the case in the reportForm. The form bean was named
ReportForm and I did not realize the case was changed when set in the
session.

I used the following snippet of code to help in the debugging (I sure wish I
had tried this earlier) and placed it in my failing jsp page:

  %
HttpSession ses = request.getSession();
String test;
if (ses == null) {
test = nosession;
} else {
java.util.Enumeration en = ses.getAttributeNames();
StringBuffer buf = new StringBuffer();
while (en.hasMoreElements()) {
   buf.append(en.nextElement());
   buf.append(br);
}
test = buf.toString();
}
  %
  %=
test
  %

Thanks everyone for the input. But I guess I'm still a Doofus on this one.
:-)

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



Re: [OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available)

2004-02-27 Thread Joe Germuska
At 11:19 AM -0800 2/27/04, Martin Cooper wrote:
(When it comes to IDEs, though, most of them know about Ant, but don't yet
know about Maven at all, so there's not so much of a case for Maven there,
IMHO.)
Since you added the OT to the subject line, I feel ok about dragging 
this on... the beauty of Maven and IDEs is that Maven generates the 
project for you, for JBuilder, Eclipse, or IDEA.  Let's see your Ant 
do that!  :-)

Just kidding.  Ant is great, and actually, I think the fact that 
extending Maven is basically like writing Ant is a feature, not a bug.

Oh yeah, also I can't go back from having versioned JAR in my lib 
directories.  I suspect that's a matter of taste too, but I'll take 
the overhead of pruning old JARs when new versions are deployed over 
the mystery of knowing which versions your apps depend on any day...

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining.
-- Jef Raskin

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


Action class calling other Action class

2004-02-27 Thread Ramadoss Chinnakuzhandai
Hi,
  
I hv ActionClassA ==Display JSP of ActionClassA having a link to Edit JSP of 
ActionClassB==ActionClassB=Edit JSP of 
ActionClassB==ActionClassB(Update records)=dispatch control over to 
ActionClassA.


My question is that  Can I forward my control to ActionClassA from ActionClassB? or is 
there any better approach/alternative??

Tnx in advance,

-Ramadoss





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



Re: struts-actions.xml

2004-02-27 Thread Mark Lowe
do your source files contained in the same directory structure as you 
package path?

e.g.
package com.sparrow.struts;
..
/src/com/sparrow/struts/*.java
You might have more luck on the xdoclet list. I use xdoclet but not for 
action classes as struts console helps me cross that bridge.

On 27 Feb 2004, at 20:19, as as wrote:

I tried adding Xdoclet tags into my struts action classes so that it 
can generate struts action mappings etc stuff automatically into my 
output struts-config.xml file. It doesnt do so...unless I add manually 
a file called struts-actions.cml into my project merger 
directory.please indicate a solution for thus

Thanks,
Samy
-
Do you Yahoo!?
Get better spam protection with Yahoo! Mail


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


Iterate of List - need to test if list is null

2004-02-27 Thread sean jones


I have an object named Wizard in the request. 

Wizard has a property defined as

pubic Class Wizard {
  private List progressBar = null;
  public Wizard() {}
  public List getProgressBar() { return progressBar; }
}

in JSP i do this

logic:iterate name=wizard property=progressBar
/logic:iterate

how can i test if the progressBar is null before i start the iterate.

right now i get an error, cant find collection.  

i tried to used logic:notEmpty but i am not using struts 1.1




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



RE: Iterate of List - need to test if list is null

2004-02-27 Thread Slattery, Tim - BLS
 I have an object named Wizard in the request. 
 
 Wizard has a property defined as
 
 pubic Class Wizard {
   private List progressBar = null;
   public Wizard() {}
   public List getProgressBar() { return progressBar; }
 }
 
 in JSP i do this
 
 logic:iterate name=wizard property=progressBar /logic:iterate
 
 how can i test if the progressBar is null before i start the iterate.

Use JSTL:

c: if test=${!empty wizard.progressBar}
logic iterate name=wizard property=pregressBar/logic:iterate
/c:test


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: Iterate of List - need to test if list is null

2004-02-27 Thread sean jones


Thanks Tim,

Hopefully the heads of state won't balk at the JSTL code. 

thanks again.





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



bean:define ???

2004-02-27 Thread Mauricio T. Ferraz
Anybody knows how can I define a script variable with bean define tag or
another, for the first element of a collection???

for example:

%
 ArrayList users = (ArrayList)pageContext.getAttribute(users);
 User user = users.get(0);
%

How I do it with tags???

Because I want to get the firt element of a collection, e define it!

Thanks


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



RE: bean:define ???

2004-02-27 Thread Glenn Wilson
Mauricio,

I think this is what you'd be looking for:

%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
c:set var=users value=${pageContext.users} /
c:set var=user value=${users[0]} /

I'm pretty sure that arraylists (being that they are collections) in the c: taglib 
will take brackets...
HTH,
Glenn

-Original Message-
From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 28, 2004 11:02 AM
To: Struts Users Mailing List
Subject: bean:define ???


Anybody knows how can I define a script variable with bean define tag or
another, for the first element of a collection???

for example:

%
 ArrayList users = (ArrayList)pageContext.getAttribute(users);
 User user = users.get(0);
%

How I do it with tags???

Because I want to get the firt element of a collection, e define it!

Thanks


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


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



RE: bean:define ???

2004-02-27 Thread Slattery, Tim - BLS
 Anybody knows how can I define a script variable with bean 
 define tag or another, for the first element of a collection???
 
 for example:
 
 %
  ArrayList users = (ArrayList)pageContext.getAttribute(users);
  User user = users.get(0);
 %

c:set target=user value=${users[0]}/

Not sure exactly how pageContext translates, but I think this will do it.


--
Tim Slattery
[EMAIL PROTECTED]


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



[OT] Gays and computing

2004-02-27 Thread Melvin Kurzchen
Fellow Struts Users,
 
Sorry this is so off topic. But, i know that a large portion of you are of a good 
humanitarian heart. So, i wanted to share this with you. 
 
I read the following article and was shocked at these industry statistics. I am 
thinking of putting together a petition to defend our fellow gay co-workers. After 
reading this article if you would like to help me in this effort please send me an 
email expressing your desire to help.
 
Article: http://www.albinoblacksheep.com/flash/you.html
 
Melvin Kurzchen


-
Do you Yahoo!?
Get better spam protection with Yahoo! Mail

Re: [OT] RE: Memory usage

2004-02-27 Thread Christian Bollmeyer
On Friday 27 February 2004 19:53, Dhaliwal, Pritpal (HQP) wrote:

Ah, you're welcome. Everybody makes mistakes, me too,
as did Viru possibly. I certainly did a lot more mistakes
in this direction when I was younger. Still, Viru had a
problem and searched for 'rays of hope' here. Now, it
might well have been the wrong forum, but it's still
a problem everyone might be confronted with over
time: you have an app and it behaves unsatisfactorily
somehow. Then you're just at the wrong end of the
gun; I know the feelings one has in such a situation.
Well, the list may be about Struts in the first place,
but most of us are experienced developers who
don't do only Struts, but have a much more wide-
spread focus, so if we can be of help, we should
forget about formal directions and just use our
experience to help those facing an infavorable
situation to 'save their faces' if we can. Each of
us could be in a situation like this one day, too.

Alas. Your current post shows you have the
courage to recognize mistakes and stand to
your deeds. Well, not everybody would have
done that. IMHO this clearly deserves respect.

Now. A final end to all these sad things and
back to work. Well, 'Peopleware' is a famous
book about common mistakes in software
development, with the first version released
in 1989, but things obviously have stayed
more or less the same over time. There
are many interesting things in this book,
and most of them I found to be just correct
when compared to my personal experiences
over time. IMHO a book everyone who is
responsible (in any role) for IT projects
should have read once, at least. Basically,
it just says your goal should be to form
'jelled' teams and treat them in a human
way. Plus, you have to provide the en-
vironment for that. The 'Black Team',
which existed in reality, is an example
of how good developers working to-
gether can make a team become
something bigger than the sum of
its parts. They customarily wore
black, hence the term 'Black Team',
and were considered 'Gurus' other-
wise, but kept humble still, being
just proud to be part of this special
team. A certain attitude and a diffe-
rence in stance. Then, if someone
is good, respect will come automa-
tically. You don't have to make a
fuss about it. That's the difference.
Real gurus don't talk or judge,
they just do. 

-- Chris.

But as I get the chance here to
add something to my recent posts:
Well, I was focused on execution
times. The same is true, of course,
in case of memory consumption.
There is no way to 'switch off'
GC. But there typically are 
'hotspots' in terms of memory
consumption, i.e. where a lot
of Objects are created. Then,
trace your code and check if
it retains unneeded strong
references which hinder GC
from reclaiming their memory
space. There are certain pitfalls,
in particular when dealing with
arrays or Collections, but the
overall matter is too complex
to lay it out in full here. 

-- CLIP
 

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



RE: [OT] Gays and computing

2004-02-27 Thread Joshi, Naveen
NEVER GO THERE!!! Melvin SUCKS!!!


-Original Message-
From: Melvin Kurzchen [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 4:39 PM
To: [EMAIL PROTECTED]
Subject: [OT] Gays and computing


Fellow Struts Users,
 
Sorry this is so off topic. But, i know that a large portion of you are of a
good humanitarian heart. So, i wanted to share this with you. 
 
I read the following article and was shocked at these industry statistics. I
am thinking of putting together a petition to defend our fellow gay
co-workers. After reading this article if you would like to help me in this
effort please send me an email expressing your desire to help.
 
Article: http://www.albinoblacksheep.com/flash/you.html
 
Melvin Kurzchen


-
Do you Yahoo!?
Get better spam protection with Yahoo! Mail

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



Re: [OT] Gays and computing

2004-02-27 Thread Rick Reumann
On Friday 27 February 2004 4:39 pm, Melvin Kurzchen wrote:
 
 Article: http://www.albinoblacksheep.com/flash/you.html


Good article but does it have to use all that nude pictures to make his point?

-- 
Rick


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



RE: Problem with loss form (session scope)

2004-02-27 Thread Betty Koon
One thing I found out that the reset method was getting called everytime if
there is no error return from validation.  This could cause the form to be
reset to the original state.

-betty

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 12:07 AM
To: Struts
Subject: RE: Problem with loss form (session scope)


Hmm. That does sound rather odd! Like you say, should not be like that. :-(

Only thing I can thing of here is: Is it the same session? (grasping at
straws now!) Try println/logging the sessionId from the action and see if
its still the same as first time through.


-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 15:39
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Problem with loss form (session scope)


I am sorry.  I only have 1 action map to this form.  So, I guess the name
doesn't matter in this case.  Basically, what I am saying is the first time
I hit this action, the form constrctor will get called but the 2nd time the
action get called, this shouldn't happen, but it does. Yes, that's what I am
planning to do next, download the source code and stepped through it.

-Betty

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 11:18 PM
To: Struts
Subject: RE: Problem with loss form (session scope)


Ah, but you didnt actually answer my question.

Is it the same name for the form in both actions mappings, and do both these
action mappings specify the scope to be session?

My suspicion is that the problem is that struts is trying to find the form
under a different key in the second action - but is this second action
actually the same action as the first or different as I am assuming?

btw: have you gone and looked at the struts source code for the request
processor and request utils class to see what it is actually doing? (Tracing
through with a debugger can be quite enlightening). One of the common
attitudes in open source is that the source is the best reference and I
certainly found this the case when I was first learning struts :-)



-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 15:10
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Problem with loss form (session scope)


I specify my own name in the struts config.  In my action, I just grabbed
the action form from the execute method.  And I am assumming struts fw get
that from session for me in this case, rather than creating a new one for
this request since my form is in session scope.  Is this right assumption?

-Betty

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 10:59 PM
To: Struts Users Mailing List
Subject: RE: Problem with loss form (session scope)


What attribute did you set the form to be stored under?
If none will default to form name. You are storing under same attribute key
yes? Both actions mapping also defined the scope to be session?

-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 14:51
To: 'Struts Users Mailing List'
Subject: RE: Problem with loss form (session scope)


In struts config's action definition, I set up the action to use a form in
session scope.  What I found out was, somehow the form constructor get
called the 2nd time the action get called.  To my understanding, if you set
up the form in session, the form will only get created once.  Any idea?

-Betty

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 9:06 PM
To: Struts Users Mailing List
Subject: Re: Problem with loss form (session scope)


Without seeing your jsp/struts-config.xml/action its a bit of a guessing
game.

I'm a bit confused by you saying ...at this point, I set up this form bean
as session scope. To me this implies your getting a form not in session
scope (i.e. request) and saving it yourself in session scope. If that is the
case - then maybe thats your problem - if the struts-config.xml says its
request, thats where struts will look for it and, if it doesn't exist, it'll
set a new one up in  request scope (even if you already have one under the
same name in session).

If I've got it wrong, then maybe you could explain further. I'm also not
clear whether your finding out your form has been 'wiped' as soon as you get
into your action and before you set it up as session scope or after that
when you get to your detail screen. Could you clarify that as well please.


Niall
- Original Message -
From: Betty Koon [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:41 AM
Subject: RE: Problem with loss form (session scope)


 Well, sorry for being vague.  It's a very vague problem, that's why 
 it's very difficult to explain the details.  This only happen to one 
 

RE: [OT] JSP or Velocity

2004-02-27 Thread David Friedman
Navjot,

Though I haven't tried Velocity, I like the idea that my stub-pages can be
easily edited in HTML editors.  How do your manage letting your designers
alter the JSP layouts?  Do you have them use some (and if so, what is it)
HTML editor which is (Stuts JSP  EL) aware?

Regards,
David

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 9:31 AM
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Basically, i use velocity only for email templates and sometimes to generate
other kind of templates from one template where the use of XSLT is not
appropriate.
For web templates, that have more complex requirements, i prefer to use
taglibs. besides el makes life as easy as we may talk in velocity. In
velocity, to comprehend taglibs, you may have have to write lots of
velocimacro.

you may ask for another opinion on velocity-user list as well.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.

 I was interested to see which which people recommended for a relative
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over
jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination
does not.
The only difference is that velocity is a bit more terse (if/else/end
instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in
tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study
was cleary biased towards velocity and had never even considered JSTL
(which
in all fairness may not have been available at that time). Looking at
the code
(both the velocity and jstl versions are below) I think that velocity
clearly had
an influence on the jsp2/jstl constructs.

The first thing I noticed was that the two pages do not do the same
thing.
The jsp turns off the session (the vm does not). The jsp stores
variables that
are never used which were factored out in the vm version. The vm version

is missing required code (for example, the repCode and urlEvent
variables
are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need
to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you
will not ever
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller
does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you
cannot have things like if/else/end because they are unbalanced, but
other than
that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we
get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i

   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   br${meeting.meetingId}:${repId}br
   /td
   /tr
/table
===
The velocity version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   

RE: Action class calling other Action class

2004-02-27 Thread Gopalakrishnan, Jayesh
You could do this by just forwarding to an action mapping entry for
ActionClassB.

In you action mapping for ActionClassA, have multiple forwards.
And the logic in ActionClassA would forward to whichever, with 1 of them
being ActionClassB.

action path=/actionA 
type=ActionClassA
name=form
scope=request
forward name=SUCCESS  path=/do/actionB
/
forward name=FAILURE  path=/test.jsp /
forward name=CANCEL  path=whatever /
/action   

action path=actionB
type=ActionClassB
name=form
scope=request
set-property property=secure value=true
/
forward name=SUCCESS  path=/any.jsp /
forward name=FAILURE
path=/anyOther.jsp /
/action


hth
-jayash

-Original Message-
From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 12:29 PM
To: [EMAIL PROTECTED]
Subject: Action class calling other Action class


Hi,
  
I hv ActionClassA ==Display JSP of ActionClassA having a link to Edit
JSP of ActionClassB==ActionClassB=Edit JSP of
ActionClassB==ActionClassB(Update records)=dispatch control over
to ActionClassA.


My question is that  Can I forward my control to ActionClassA from
ActionClassB? or is there any better approach/alternative??

Tnx in advance,

-Ramadoss





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

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



  1   2   >