RE: I have the same question but about Forms.

2003-02-11 Thread shirishchandra . sakhare
I think this issue is very well explained by Ted in his book Struts In Action..
As he says,Forms sghould be just treated as carriers of data till the data is 
validated and hold the data till in case same is required to be returned to the 
user.
So we should not waste too much time to design form classes but add attributes 
as and when required.

SO depending on u r system,U have to decide.
But what i have found works best is have a base form for all Aplication which 
has common properties (Like UserName,Company id etct etc which is required for 
each user..)And then extend forms per functionality(Like one super class form 
for 4 or 5 OrderFunctions ).
And also as u said, i also had to add common attributes at the module level.But 
this works best.

Hope this helps.
regards,
Shirish

-Original Message-
From: pantichd [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 5:06 PM
To: struts-user
Cc: pantichd
Subject: I have the same question but about Forms.



Hello,

Not sure if this deserves another thread or if I can attach it to this one.
I'm new to mailing lists so please be kind.  :  )

I'm working on a struts project now and going back and forth on whether to
just have one form for the whole system or have many forms.

In our case we put the common fields in a base form and created other forms
to extend that one. Each of those forms correspond to a specific section in
the system. The problem we're running into now is that we're finding more
and more common items and having to move them into the base form. Which
lead me to think about just having one form and not bothering with the
others.

Comments?






  "Taylor Cowan"

 
  net> cc:   (bcc: David Z. 
Pantich/OE/FirstEnergy) 
   Subject:  Opionions: fine or 
course grained actions  
  02/07/2003 09:19  

  AM

  Please respond to 

  "Struts Users 

  Mailing List" 









I wanted to see what others in the struts community think about Action
granularity.  I've coded apps that are -extremely- fine grained, having one
Action per user event, like createPreferencesAction,
deletePreferencesAction, update...etc.  The fine grained approach yields
more than one action per screen, and contention for the struts config file
during development.  In the middle are apps that basically have one action
per screen that handles all the button clicks with a switch if/else block.
That's the moderate approach.  The last style is -extremely- coarse grained
in that there might only be one action for the entire app.  Coarse grained
has worked best for XML/XSLT type work flows and in some other situations.

What do you think about Action granularity, should it be very fine and thus
more "HTTP" like in nature, or more coarse grained having fewer URL's?

Taylor


-
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: Re: What should and should not be in an Action class.

2003-02-06 Thread shirishchandra . sakhare
go through the struts documentation carefully..It will help u clarify lot of 
doubts..:-))
It specifically says Action classes are multithreaded..Means same action 
instance is used for all the requests..so thats why u have to be careful not to 
have any attributes in the action...So long as they are not really global.

-Original Message-
From: kelly [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 12:32 PM
To: struts-user
Cc: kelly
Subject: Re: What should and should not be in an Action class.


Sweet.   That's just what I was planning to do.  Thanks for the
verification.

I have only one question about it though.  When the Action class is called
by more than one user, is it instansiated more than once by struts or will
struts use the same instance?

Cheers, and Thanks again,

Simon

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 06, 2003 12:27 PM
Subject: RE: What should and should not be in an Action class.


> U will have some thing like following ..
>
> The action classes are handlers...So when u need to get some data to the
> screen,U will call the action class and the action class will then call a
> Busines Layer class to perform the database access logic and return the
> result.And action will then put the result in required scope(mostly in
request
> scope ) and forward to jsp.The jsp will then use this data,usually a java
bean
> ,to render result.
> (Lets take an example...To get EmkployeeDetails,u will call
> GetEmployeeDetailsAction from jsp by passing the employee id.
> In GetEmployeeDetailsAction action , u will have some thing lie this.
>
> EmployeeService empService = new EmpService();//u can use servuice factory
> here...
> EmployeeDetailsBean empDetailBean = empService.getEmployeeDetails(empId);
> EmpDetailForm empDetailForm = (EmpDetailForm )form;
> empDetailForm .setEmpDetails(empDetailBean );
>
> return mappig.FindForward("success");// successs points to empDetails.jsp
which
> access the empDetailForm  to render the page...
>
> hope this helps,
> regards,
> Shirish
>
>
>
> -Original Message-
> From: kelly [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 06, 2003 11:20 AM
> To: struts-user
> Cc: kelly
> Subject: What should and should not be in an Action class.
>
>
> Hi All,
>
> I'm just trying to work out where I need to put all of my database access
> code within the struts architecture.  If I'm reading Craigs comments on
the
> Action class correctly and have got the MVC set up right, all the action
> class should do is gather any necessary information, add it to the form
and
> then forward it on.  But if I need to get data from the db and put it in
the
> form, should I do it in the action class or pass it to the business logic
> and make the business logic forward it to the output servlet?
>
> I'm getting a bit confused with all this so sorry if the question's a bit
> simple.
>
> Regards
>
> Simon
>
> Institut fuer
> Prozessdatenverarbeitung
> und Elektronik,
> Forschungszentrum Karlsruhe GmbH,
> Postfach 3640,
> D-76021 Karlsruhe,
> Germany.
>
> Tel: (+49)/7247 82-4042
> 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: What should and should not be in an Action class.

2003-02-06 Thread shirishchandra . sakhare
U will have some thing like following ..

The action classes are handlers...So when u need to get some data to the 
screen,U will call the action class and the action class will then call a 
Busines Layer class to perform the database access logic and return the 
result.And action will then put the result in required scope(mostly in request 
scope ) and forward to jsp.The jsp will then use this data,usually a java bean 
,to render result.
(Lets take an example...To get EmkployeeDetails,u will call 
GetEmployeeDetailsAction from jsp by passing the employee id.
In GetEmployeeDetailsAction action , u will have some thing lie this.

EmployeeService empService = new EmpService();//u can use servuice factory 
here...
EmployeeDetailsBean empDetailBean = empService.getEmployeeDetails(empId);
EmpDetailForm empDetailForm = (EmpDetailForm )form;
empDetailForm .setEmpDetails(empDetailBean );

return mappig.FindForward("success");// successs points to empDetails.jsp which 
access the empDetailForm  to render the page...

hope this helps,
regards,
Shirish



-Original Message-
From: kelly [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 11:20 AM
To: struts-user
Cc: kelly
Subject: What should and should not be in an Action class.


Hi All,

I'm just trying to work out where I need to put all of my database access
code within the struts architecture.  If I'm reading Craigs comments on the
Action class correctly and have got the MVC set up right, all the action
class should do is gather any necessary information, add it to the form and
then forward it on.  But if I need to get data from the db and put it in the
form, should I do it in the action class or pass it to the business logic
and make the business logic forward it to the output servlet?

I'm getting a bit confused with all this so sorry if the question's a bit
simple.

Regards

Simon

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


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



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




RE: Where should database select go for select dropdown

2003-02-04 Thread shirishchandra . sakhare
I think what u need is a good primer on MVC architecture...
Search on google..U will find plenty..Or more specifically go to suns site and 
u will find the information...

Then struts doc will be easy to follow..

-Original Message-
From: jadestone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 7:22 PM
To: struts-user
Cc: jadestone
Subject: Where should database select go for select dropdown


Sorry if this is trivial - but I'm new to the framework and I'm finding the
documentation confusing.
Just want to create an html select object with options set to the contents
of a database table - i.e. visualise
a  lookup table. So when the form is first displayed the dropdown appears
with data from a database table.
I'm confused where the database access should go - in the JSP or the
FormBean. Is there an example which
someone could point me to

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: Values not populated correctly from JSP

2003-02-03 Thread shirishchandra . sakhare
can u please elaborate?

-Original Message-
From: Sangeetha.Nagarjunan [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 03, 2003 2:23 PM
To: struts-user
Subject: Values not populated correctly from JSP



Hi,
 Values from my JSP are not getting initialized properyt to my Form
bean.
Is there any place which could go wrong>
The values are wrong at tht Action level itself.
please help me through this
Thanks
regards
Sangeetha


-
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: design question about action chainning(As quoted in :Struts in action...by Ted Husted et al..)

2003-02-03 Thread shirishchandra . sakhare
Hi Ted,
This explanatation has set to rest most of my doubts about action 
chainning..And I think the way Most of us use actions(One action to serve the 
request like save action)and another to display the page (like getAccountsList 
Action )is not action chainning but action relay which is perfectly alright.
Also I have understood what u mean by actions becoming API rather than being 
distinations..And this has really helped me to find some of trouble spots in 
our application...

Thanks very very much...For all others as well who have contributed to this 
discussion and helped me (and hopefully a couple others )to better understand 
the very core of struts architecture..

regards,
Shirish

-Original Message-
From: husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 7:07 PM
To: struts-user
Cc: husted
Subject: design question about action chainning(As quoted in :Struts in
action...by Ted Husted et al..)


The best example of waht I'm calling an Action relay is how Struts 
handles validation. If validation fails, the request is forwarded to the 
input property, which could be another Action. This is done to complete 
the response, rather than continue with processing the action.

This same technique is often used after a lookup, where one Action does 
the lookup but another Action is used to complete the response, usually 
to setup any tools the page might need to render.

In an Action chain, control is not forwarded simply to complete the 
response but to continue processing. One action doesn't "do" some 
similar activity because that's the another actions "job". The 
request/response transaction begins to be distributed between several 
Action, and this is where Action stop being destinations and start 
becoming an API.

Most often, whatever processing the Action in a chain are supposed to be 
doing can be refactored into base actions or utility classes, so the 
funcationality can be reused using standard object-orientated techniques.

-Ted.


-- 
Ted Husted,
Struts in Action 


-
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: design question about action chainning(As quoted in :Struts in action...by Ted Husted et al..)

2003-01-31 Thread shirishchandra . sakhare
Hi,
Does this mean that using action forwards To point another action is not action 
chainning?So we can call this action relay and its in line with Struts design 
principles?
 And as u said,We have really abstracted away all error handling etc to 
Abstract Action class.But the point is if we go withoput action chainning(or if 
we call it action relay),then to get the same page from different work flows,U 
may need to copy the same code to call service in muiltiple action classes.

my question  is what is the real disadvantage of using Atomic actions , if the 
are designed proper struts way(USing struts techniques so that they are not 
dealing with HTTP but directly getting objects from form beans..As u rightly 
said...)And then forward from one atomic action to another to complete a work 
flow..

regards
Shirish

-Original Message-
From: husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 12:34 PM
To: struts-user
Cc: husted
Subject: RE: design question about action chainning(As quoted in :Struts
in action...by Ted Husted et al..)


Derek Richardson writes:

 >But you still have to duplicate code in the actions, right? Even if
 >that code is as simple as:
 >
 >Service service = Service.getService(SERVICE_KEY);
 >Foo[] foos = service.getFoos();
 >request.setAttribute(FOO_KEY, foos);
 >
 >Action chaining allows this code to be written once and used many 
 >times. Thus you get reuse of presentation code, not just business
 >logic.

Personally, I would put utility code like this in a super class and make 
it available to whatever Action wanted to call it. Actions are 
instantiated once, and there is no performance penalty for have a deep 
hierarchy.

So there would be something like

setService(request)

that any Action could call.

The BaseAction in Scaffold makes good use of this technique for error 
handling and such.

What happens with true Action chaining (not to be confused with a simple 
Action relay) is that instead of using Java calls to create our 
presentation API, we start to use HTTP to make the API calls instead. 
IMHO, this is a step backward. The point of Struts is to get us up and 
out of HTTP and into an object-orientated domain, where we can write 
proper programs. (Rather than an endless chain of kludges.)

-Ted.



-- 
Ted Husted,
Struts in Action 


-
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: design question about action chainning(As quoted in :Struts in action...by Ted Husted et al..)

2003-01-31 Thread shirishchandra . sakhare
Hi,
I agree with u that u can have another layer of abstraction(like helper beans) 
between action and Service layer.So that same code ecan be reused.
But this some disadvangates.
Firstly U are then not really using the power of Struts Configuration file 
which allows you to use logical mappings in Action classes And to change the 
Flow,U can just change the config file (So long as all required parametzers are 
being passed in new flow  as well..).Because in our project, we had this 
requirement many a times.After we had done one release, the business gusy will 
come up with a suggestion some thing like, After AccountDetails PAge, can we go 
to AccountList üpage instead of Summary page etc etc .And because of Reusable 
actions, this was just a matter of changing the struts config file and in one 
of cases may be make the new caller pass a few more parameters.But there was no 
code duplication.

So as i said in my original mail,If your services are not tied to actions, then 
in that case I don't see any problem in action chainning.ANd it seems to me the 
best thing to really harness the power of Struts..Or is there any other 
preformance or design issue which i have missed?

Any comments:-))??


regards,
Shirish

-Original Message-
From: batien.duong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 PM
To: struts-user
Subject: Re: design question about action chainning(As quoted in :Struts
in action...by Ted Husted et al..)


We achieve what you describe as a chain of actions for re-use with helper
beans and follow Struts design principal as Ted described. The helper beans
can be ready in cache or service pool for reuse. Look at
http://myportal.myb2cb2b.com/com.dbgroups.ppf/model/web/dao.html

Hope this may help.
BaTien

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 3:34 AM
Subject: design question about action chainning(As quoted in :Struts in
action...by Ted Husted et al..)


> Hi All,
> I have a very basic design question about struts action design..We have
been
> developing a fairly large and complex web application involving struts and
> struts has proved to be a great help :-))  But after reading the book by
Mr.
> Husted et al., "Struts in action",I have some basic questions about the
way we
> have done our project and the way it is described in the book.
> TO quote Mr. Husted...(Section 8.4 Chaining Actions .Note at the end of
> Section8.4.1. Starting fresh..)
> 
> Speaking  as a Software architect,chainning actions in any way is not
something
> that I like to do.Ideally you should be able to call the business objects
from
> any Action where they are needed.Wanting to forward control to another
action
> implies that the Business  object my be too tightly coupled.Or it may
imply
> that the actions should descend from a common super class with hotspots
that
> sub classes should overrideThere are occasions when chainning actions
makes
> sense-for example if the other action is being used to render the response
in
> lieu of a presentation page.But valid use cases are rare.The best general
> practice is to stay with one-request ,one action regimen.
> *
>
>
> And also after searching the  archives for action chainnign , I found
another
> reply from Mr. Husted which says..
> 
> Wanting to chain actions is a warning sign that there is too much business
> logic is creeping into the Actions and they are becoming the API, rather
than
> an adaptor for the API. (Struts should not *be* your application, it
should be
> a gateway *to* your application.)
>


> *
>
>
> I have a high regard for Mr. Ted Husted and that's why I would like to
clarify
> some of my doubts about the design strategy he has advocated in his book
from
> the exüperienced users of this list and Mr Husted himself if possible.
> I dont understand what is the disadvantage in Chainning actions?HAs it
some
> thing to do with performance?I totally agree that the business objects
shuld
> not be tightly coupled with actions and should be callable from any where
.But
> even after following this principal, most of the time you will end up
chainning
> actions if u really want reusable actions.Example can be loging process of
a
> user.So the request for loging form a user can result in 2 actions being
> called.1:CheckLogin(which checks user credentials) It forwards control to
> 2:getUserAccountList which gets the list of accounts for the user.
>
> So now the getUserAccountList  action I can call from any where else by
passing
> right params and it becomes reusable.But if i had done all of this(check
log in
> and then get accunts)in login action, i need to write another action to
g

RE: log4j problem

2003-01-30 Thread shirishchandra . sakhare
.U can specify log level per logger as well.SO if u want to exclude logging for 
some packages,U specify a higher log level for that..some thing like

log4j.logger.org.apache.struts=ERROR

So for all loggers whose name starts with org.apache.struts , only errors wil 
be logged..For other named hirarchies, it will still not change

-Original Message-
From: gourav.pani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:24 PM
To: struts-user
Subject: RE: log4j problem


i was under the impression that you do exclusion by inclusion.  in other
words, if you specify the package you want logged, it excludes everything
else.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 8:22 AM
To: 'Struts Users Mailing List'
Subject: RE: log4j problem


Yes I know the originating class that produces logs, it's RequestProcessor.
But I didn't know that log4j could exclude class from the logs. Is it
configurable in the log4j conf file ?
I will look into it, thanks.


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:18
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


Can you see the originating class for all those struts loggings messages in
the 
logged messages?
I mean in log4j ,u can disable the logging per class or package level..And
if 
struts is using log4j, then it must be creating those log4j loggers which 
generally have the class name...So may be u can specify that disable logging

for all loggers of struts classes ..If u can send a few entries from the log

file, I may be able to help..

regards,
Shirish

-Original Message-
From: jdecesco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:15 PM
To: struts-user
Cc: jdecesco
Subject: RE: log4j problem


ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like "RequestProcessor Processing a POST
request for path url" are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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

-
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: log4j problem

2003-01-30 Thread shirishchandra . sakhare
Can you see the originating class for all those struts loggings messages in the 
logged messages?
I mean in log4j ,u can disable the logging per class or package level..And if 
struts is using log4j, then it must be creating those log4j loggers which 
generally have the class name...So may be u can specify that disable logging 
for all loggers of struts classes ..If u can send a few entries from the log 
file, I may be able to help..

regards,
Shirish

-Original Message-
From: jdecesco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:15 PM
To: struts-user
Cc: jdecesco
Subject: RE: log4j problem


ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like "RequestProcessor Processing a POST
request for path url" are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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




design question about action chainning(As quoted in :Struts in action...by Ted Husted et al..)

2003-01-30 Thread shirishchandra . sakhare
Hi All,
I have a very basic design question about struts action design..We have been 
developing a fairly large and complex web application involving struts and 
struts has proved to be a great help :-))  But after reading the book by Mr. 
Husted et al., "Struts in action",I have some basic questions about the way we 
have done our project and the way it is described in the book.
TO quote Mr. Husted...(Section 8.4 Chaining Actions .Note at the end of 
Section8.4.1. Starting fresh..)

Speaking  as a Software architect,chainning actions in any way is not something 
that I like to do.Ideally you should be able to call the business objects from 
any Action where they are needed.Wanting to forward control to another action 
implies that the Business  object my be too tightly coupled.Or it may imply 
that the actions should descend from a common super class with hotspots that 
sub classes should overrideThere are occasions when chainning actions makes 
sense-for example if the other action is being used to render the response in 
lieu of a presentation page.But valid use cases are rare.The best general 
practice is to stay with one-request ,one action regimen.
*


And also after searching the  archives for action chainnign , I found another 
reply from Mr. Husted which says..

Wanting to chain actions is a warning sign that there is too much business 
logic is creeping into the Actions and they are becoming the API, rather than 
an adaptor for the API. (Struts should not *be* your application, it should be 
a gateway *to* your application.)

*


I have a high regard for Mr. Ted Husted and that's why I would like to clarify 
some of my doubts about the design strategy he has advocated in his book from 
the exüperienced users of this list and Mr Husted himself if possible.
I dont understand what is the disadvantage in Chainning actions?HAs it some 
thing to do with performance?I totally agree that the business objects shuld 
not be tightly coupled with actions and should be callable from any where .But 
even after following this principal, most of the time you will end up chainning 
actions if u really want reusable actions.Example can be loging process of a 
user.So the request for loging form a user can result in 2 actions being 
called.1:CheckLogin(which checks user credentials) It forwards control to 
2:getUserAccountList which gets the list of accounts for the user. 

So now the getUserAccountList  action I can call from any where else by passing 
right params and it becomes reusable.But if i had done all of this(check log in 
and then get accunts)in login action, i need to write another action to get 
account for another page.And I am using calls to different 
services(LoginService and AccountService..)which are still reusable from any 
action here..
So the chainning of actions this way has perfectly solved all the 
problems...And instead of this being a rare iuse case, most of the time , this 
is the pattern u will have for any use case.(Update some thing and get some 
data to screen...)So what is the advantage of following  one-request ,one 
action regimen?

Also I didnt understand what he means by (Struts should not *be* your 
application, it should be a gateway *to* your application.)As I see it,the 
service layer handles the business logic .But Ultimately the actions end up 
delegating the requests to service and so doing error handling as well as 
handling flow control(Some thing like if this error, go to page 1, for that 
request go to page 2..)So they are very much part of the application...Infact 
they handle the application flow.Is this right or Am i missing some thing very 
bascic here?
This is important as We have the next phase of development starting next week 
and we are in the process of evaluating our architecture and finding any 
flaws..So any help will be highly appreciated...

Sory for being tooo verbose.But i couldn't have exlained it any other way.

regards,
Shirish

Shirish Sakhare
Application Developer
(CEFS PROJECT)
(CEFS) Corporate Employee Financial Services

UBS AG
Stauffacherstrasse 41
P.O. Box, CH-8004 Zürich
Tel: +41-1-235 56 31
Fax: +41-1-235 54 21
Personal Mail Id:[EMAIL PROTECTED]
 


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




RE: Tiles Portal

2003-01-30 Thread shirishchandra . sakhare
Hi,
I am not exactly clear about u r requirement.But we have achieved some thing 
similar in one of my previous project.We had a protal where employees of 
different companies will be logging in and the information about the company 
will be provided in the http header.and we were required to provide company 
specific logo and other things to each user, even though the same web app was 
serving all the requests.
What we had done was that keep the information about users company in 
UserContext object in session and then use the same to dynamicaly generate link 
to company specific logo and conect to company specific database.

But the layout or colours were same for all users.SO about that point I am not 
sure how to do that..

Hope this helps ,
regards,
Shirish

-Original Message-
From: sciz09 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 10:01 PM
To: struts-user
Cc: sciz09
Subject: Tiles Portal


Ive been looking into using struts and tiles for an
upcoming project.  I need to be able to change the
look and feel of the website based on the url the site
was entered from.  For example, if a user enters from
company1.foo.com then show their company colors and
logo. if a user enteres from company2.foo.com then use
different color scheme and logos... and so on.  Is
this something tiles should be used for?  Has anyone
acomplished such a project? Thanks.  Jay.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



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




RE: Design Patterns/Examples

2003-01-30 Thread shirishchandra . sakhare
Hi All,
I received quite a few mails asking me for sample code for the code generation 
of DAO layer..I would love to share the same ..But as the code is too tightly 
coupled with some of project classes and directory structure (it has evolved 
over a period of time...) and will not be useful as such,I need to clean it a 
bit first and write some simple ant tasks as well so that the code generation 
can work right out of box for any body.
I plan to do this some this week end or latest by next week.So will send a link 
to the sample code as soon as I am finished with that...

regards,
Shirish

-Original Message-
From: pat.quinn2009 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 4:37 PM
To: Sakhare, Shirishchandra
Subject: RE: Design Patterns/Examples


Hi shirish,

Can you send on your sample code. Cheers for all the detail it really does 
help...

Thanks

Pat






>From: [EMAIL PROTECTED]
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: RE: Design Patterns/Examples
>Date: Wed, 29 Jan 2003 09:48:06 +0100
>
>Hi,
>We have used folowing approach..
>
>To access db , we use DAO pattern(refer to Sun's blue prints for more
>details).The DAOs return value objects And all calls to the DAO must go 
>through
>service layer..
>
>So in action classes u get Instance of appropriate service from service 
>factory
>and call the corresponding method..So all the data base access logic  and
>conversion of result set to u r value beans is in service layer.(We have 
>used
>converter classer for the same..One converter per Value bean...)
>Also as service factory is used, u can pretty much change ur servie
>implementation with out afecting the struts layer.
>
>So on struts side ,the action clsses are pretty much simple .They just 
>delegate
>the request.
>In action, we get the data from request.And validate the data and if any
>validation errors, send back to the user.Each form contains value beans as
>thier attributes.So the data from jsps is automatically populated in the 
>form
>beans and the action just has to cast the form bean to appropiate type and 
>call
>getBean or beanList as the case may be..
>
>And as u said, the most important part is how we handle conversion of data 
>from
>primitives to string and vice versa.On form bean, all beans are
>StringBeans...So for each ValueBean we have a corresdpondign String 
>bean..And
>the StringBEan has a method getBean which returns the corresponding 
>valueBean
>after performing the conversions from String to primitive type.Similarly on
>each ValueBEan we have a getStringBEan which performs the conversion from
>primitive to String type.And we have a Utility class ParsingUtils which has 
>all
>the conversion methods...
>
>The most important part is we use CodeGeneration using XSLT to create the 
>value
>BEans,DAOs,COnverters for value beans and the String beans.And for the code
>generation , we use an XML which describes which StroedProc is caled and 
>the
>field names etc etc.So all this conversion methods (getStringBean and
>getBean)are also auto generated.And as we have utility methoda in
>PArsingUtils,this is nto at all difficult.So we dont spend any time at all
>coding data conversion or data access layer.All we need to do is write jsps 
>and
>action classes to delegate...
>
>Hope this is not too lengthy or confusing...I know there are some issues 
>like
>too many Objects are  created(for each bean, a correspondign string bean is
>created etc etc..)but we have found a satisfactory performance for our load
>tests...
>
>If any body s interrested, i can give sample code for code generation as 
>well..
>
>hope this helps,
>regards,
>Shirish
>
>-Original Message-
>From: pat.quinn2009 [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 28, 2003 9:21 PM
>To: struts-user
>Subject: Design Patterns/Examples
>
>
>
>Hi Guys,
>
>Any one know of some design patterns or examples i could use with struts. I
>want to access a database(Value Objects) allow the user to change the VO
>data, perform some business validation and update the database. I’d like
>some pointers also when working with form beans and vo object whats the 
>best
>way to transfer data between them... should i use vo’s as instance variable
>instead form bean... if so how will i handle java primitives like double’s
>etc..
>
>
>I'm not looking for the answers to all the above but i'd like to review a
>pattern or example which demonstrates the best approach for the above.
>
>
>I have my own ideas but would like to look over some design
>patterns/examples before commencing this work.
>
>Cheers,
>
>Guys
>
>
>
>
>
>
>_
>Add photos to your messages with MSN 8. Get 2 months FREE*.
>http://join.msn.com/?page=features/featuredemail
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>
>
>
>
>-

RE: what does RT Expr mean

2003-01-29 Thread shirishchandra . sakhare
It means Runtime expression...

So for example for bean write tag the message attribute is marked as RT, u can 
write somethign like this..



regards,
Shirish

-Original Message-
From: sundar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 3:27 PM
To: struts-user
Cc: sundar
Subject: what does RT Expr mean


In the bottom of the documentation on the attributes of several tags I
see [RT Expr].. what does that mean? Is it documented anywhere?

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: Design Patterns/Examples

2003-01-29 Thread shirishchandra . sakhare
Hi,
We have used folowing approach..

To access db , we use DAO pattern(refer to Sun's blue prints for more 
details).The DAOs return value objects And all calls to the DAO must go through 
service layer..

So in action classes u get Instance of appropriate service from service factory 
and call the corresponding method..So all the data base access logic  and 
conversion of result set to u r value beans is in service layer.(We have used 
converter classer for the same..One converter per Value bean...)
Also as service factory is used, u can pretty much change ur servie 
implementation with out afecting the struts layer.

So on struts side ,the action clsses are pretty much simple .They just delegate 
the request.
In action, we get the data from request.And validate the data and if any 
validation errors, send back to the user.Each form contains value beans as 
thier attributes.So the data from jsps is automatically populated in the form 
beans and the action just has to cast the form bean to appropiate type and call 
getBean or beanList as the case may be..

And as u said, the most important part is how we handle conversion of data from 
primitives to string and vice versa.On form bean, all beans are 
StringBeans...So for each ValueBean we have a corresdpondign String bean..And 
the StringBEan has a method getBean which returns the corresponding valueBean 
after performing the conversions from String to primitive type.Similarly on 
each ValueBEan we have a getStringBEan which performs the conversion from 
primitive to String type.And we have a Utility class ParsingUtils which has all 
the conversion methods...

The most important part is we use CodeGeneration using XSLT to create the value 
BEans,DAOs,COnverters for value beans and the String beans.And for the code 
generation , we use an XML which describes which StroedProc is caled and the 
field names etc etc.So all this conversion methods (getStringBean and 
getBean)are also auto generated.And as we have utility methoda in 
PArsingUtils,this is nto at all difficult.So we dont spend any time at all 
coding data conversion or data access layer.All we need to do is write jsps and 
action classes to delegate...

Hope this is not too lengthy or confusing...I know there are some issues like 
too many Objects are  created(for each bean, a correspondign string bean is 
created etc etc..)but we have found a satisfactory performance for our load 
tests...

If any body s interrested, i can give sample code for code generation as well..

hope this helps,
regards,
Shirish

-Original Message-
From: pat.quinn2009 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 9:21 PM
To: struts-user
Subject: Design Patterns/Examples



Hi Guys,

Any one know of some design patterns or examples i could use with struts. I 
want to access a database(Value Objects) allow the user to change the VO 
data, perform some business validation and update the database. I’d like 
some pointers also when working with form beans and vo object whats the best 
way to transfer data between them... should i use vo’s as instance variable 
instead form bean... if so how will i handle java primitives like double’s 
etc..


I'm not looking for the answers to all the above but i'd like to review a 
pattern or example which demonstrates the best approach for the above.


I have my own ideas but would like to look over some design 
patterns/examples before commencing this work.

Cheers,

Guys






_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



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




RE: with Parameter

2003-01-29 Thread shirishchandra . sakhare
a bit out of context but after looking at u r jsp it seems that u are packing 
too much logic in u r jsp..cant u prepare the link parameers in u r action and 
set them on the form...

and then in the jsp just acces that property of form...

-Original Message-
From: modena [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 9:16 AM
To: struts-user
Cc: modena
Subject:  with Parameter


Good day!
I'm new to struts and i need to help..my problem is:


   
<%=CorsoSId%>
<%=CorsoSName%>
<%=CorsoSFacolta%>
<%=CorsoSCrediti%>

<%
String url = "corsiIA.do?IDFacolta="+request.getParameter("IDFacolta")
+"&CorsoSId="+CorsoSId;
%>
Vis. Corsi Insegn.

   


where corsoSIter is an customtag that i create for iterate on DB.Now i need to 
pass to action the CorsoSId and the IDFacolta(this is another parameter from 
another controller).I tryed to pas an HashMap:

HashMap mappaOld=(HashMap)request.getAttribute("mappa");

   
<%=CorsoSId%>
<%=CorsoSName%>
<%=CorsoSFacolta%>
<%=CorsoSCrediti%>

<%
HashMap mappa = new HashMap();
mappa.putAll(mappaOld);
mappa.put(CorsoSId);
pageContext.setAttribute(mappa);
%>
Vis. Insegn.

   


This is corectly,but i'd like using only one HashMap..it's very heavy using 
more HashMap for each page in my WebApplication...
Plese help me..is very important.
Tanks Alessio.



-
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 call more than one Struts Action for a given HTTP request

2003-01-27 Thread shirishchandra . sakhare
No..Not at all...I think this is the way struts application is supposed to 
work..Define actions as pure handlers..And then call them from any context by 
just using different mappings...

I think action chainning as referred to on this list referes to using one 
action inside another action by any mechanism other than standard struts 
forward/include mechanism..e.g. caling methods on action A inside actiion B...

-Original Message-
From: brian.a.lee [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 3:15 PM
To: andrew.david.hill; struts-user
Cc: brian.a.lee
Subject: RE: how to call more than one Struts Action for a given HTTP
request


I have a question about action chaining in theory.

I'm not sure what you mean by action chaining, but I tend to want to make my 
actions as generic as possible so that they can be called multiple times.

For example, I worked on an app that did a lot of session work. So I would 
make a LoaderAction and a DoerAction. The loader would load an object into 
session and the doer would display or edit or delete or whatever.

I would end up with a struts-config.xml that looked something like:




And there would be one entry in struts-config.xml for each different kind of 
load and forward. So there might be LoaderActionForDelete, 
LoaderActionForEdit, etc etc.

This has made things easier for me and others on my team as we don't need to 
modify any code or to create a new action class to load up an object, etc 
etc.

Are you saying this is bad?

BAL

>From: "Andrew Hill" <[EMAIL PROTECTED]>
>Reply-To: <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: how to call more than one Struts Action for a given HTTP 
>request
>Date: Mon, 27 Jan 2003 20:25:04 +0800
>
>You are referring to Action chaining?
>This is discouraged as it leads to all sorts of problems...
>
>...but wheres the fun in that eh?
>
>If you want to chain actions you can have the first actions actionForward
>point at the next, etc...
>Be aware that the RequestProcessor will repopulate the form from the 
>request
>for each action you forward to. (You can of course modify this behaviour by
>overridding the RequestProcessor - which is pluggable - with you own
>subclass of it).
>
>However, as I mentioned, action chaining generally tends to be a bad idea,
>and a perceived need for it can often indicate a flaw in your design.
>
>-Original Message-
>From: Souravmay Das [mailto:[EMAIL PROTECTED]]
>Sent: Monday, 27 January 2003 20:14
>To: [EMAIL PROTECTED]
>Subject: how to call more than one Struts Action for a given HTTP
>request
>
>
>Hi All,
> I have a question can we call more than one Struts action for 
>a
>HTTP Request. Do you have any idea how to do it. The basic idea of having
>more than one Struts actions, is for getting more fine grained reusable
>component.
>
>With regards,
>Sourav Das
>
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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



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




RE: how to call more than one Struts Action for a given HTTP request

2003-01-27 Thread shirishchandra . sakhare
Hi,
If i understand u right u are saying that same request will be handled by more 
than one action..
e.g. Some thing like if user logs in, check his login credentials and then give 
him the list of his accounts in a banjking app.So u wil like to have a 
LoginAction(which just checks login) and a getAccountsAction(which just fetches 
accounts for a given user..)So that they can be reused in other context...
I think this is how u will design a struts application..And u just need to do 
the following..

>From the jsp, call the first action(LofinAction.do in our case),In the first 
action ,do the work(check login in our case)and do the necessary forward(in our 
case maping.findFroward("success") or  maping.findFroward("failure")) at the 
end.And when defining the Actons mapping for LoginAction, define the 2 forwards 
success and failure.The success will point to the mappinfg for the next action 
which is getAccountsAction in our case..

Hope this helps,
regards,
Shirish

-Original Message-
From: Souravmay.Das [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 1:14 PM
To: struts-user
Subject: how to call more than one Struts Action for a given HTTP
request


Hi All,
I have a question can we call more than one Struts action for a
HTTP Request. Do you have any idea how to do it. The basic idea of having
more than one Struts actions, is for getting more fine grained reusable
component.
 
With regards,
Sourav Das
 


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




RE: forward to same page

2003-01-23 Thread shirishchandra . sakhare
Hi,
We have implemented some thing similar using a custome tag(NLS tag..)The 
approach we have used is we have a  abstract action..And in abstract action , 
we strore the last action called url...So every time the last action called is 
in the session...along with the request uri ...

So when user clicks on the NLS link,his local is changed in the session and 
same action is called again using the valuse stored in session

Hope this helps,
regards,
Shirish

-Original Message-
From: hbuch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 11:47 AM
To: struts-user
Cc: hbuch
Subject: forward to same page



Hi,

Is there a way to set the "forward" page to be the same page that originated
the request?

I want to enable users to change locale with a button. But I don't
want them to go anywhere else after submitting their form.

Here is an example to illustrate what I want to do (obviously, I know 
"path=thesamepage" won't work :-)).

   



Thanks,

Heather Buch


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



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




RE: loading configuration on startup

2003-01-22 Thread shirishchandra . sakhare
Hi ,
The general solution that we have used in our web application is to srite a 
BootStrap Servlet...And load all the configurations in the init method of this 
servlet...

Also in web.xml, U speciry the highest priority for this servlet  Using the 
load on startup
element..

Example:
  
InitializationServlet
InitializationServlet
urPackage.InitializationServlet
1

This ensures that this will be the first servlet to be initialised..

regards,
Shirish

-Original Message-
From: gourav.pani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 2:21 PM
To: struts-user
Subject: RE: loading configuration on startup


write a Log4JInit servlet which loads on startup based on your web.xml.  you
can find sample code on the web.

-Original Message-
From: Softwareentwicklung Hauschel
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 7:00 AM
To: Struts Users Mailing List
Subject: AW: loading configuration on startup


But my log4j.properties are a log4j.xml file.
That doesn't work in classpath ;-(
In addition there are mor configurations i need for the whole applikation.

thanks and best regards
Fredy

-Ursprüngliche Nachricht-
Von: Gemes Tibor [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 22. Januar 2003 12:51
An: Struts Users Mailing List
Betreff: Re: loading configuration on startup


2003. január 22. 12:42 dátummal Softwareentwicklung Hauschel ezt írtad:
> Hey all,
> were did i load my own configuration on startup ?
>
> for example the log4j configuration.

It is loaded automagically supposing that the log4j.properties resides on
your
CLASSPATH.

Tib

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:


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



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




RE: XML to PDF(IE problem...)

2003-01-22 Thread shirishchandra . sakhare
Hi,
I had faced similar problem.And as U said, soem versions of IE give preference 
to file extension over content type it seems.But the following works..

response.addHeader("Content-Disposition", "attachment;filename="+ fileName 
+".pdf"); 
where file name is any name u want the save as dialogue box to be given if user 
chooses to save file instead of open it.This works for all versions of IE i 
tried..

So i think the action name has nothing to do with this...And u can leave it as 
it is..Hope this helps..

regards,
Shirish

-Original Message-
From: jerome.jacobsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 9:28 PM
To: struts-user
Subject: RE: XML to PDF


I think you can name your action with a .pdf extension, something like
http://localhost/xmltopdf.do.pdf.  Not sure what you'd have to do with the
action mappings to allow this to work.  Some versions of IE seem to use the
URL 'document' extension and the client systems extension to application
mapping over using the content type set in the HTTP response header.

> -Original Message-
> From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 21, 2003 3:14 PM
> To: 'Struts Users Mailing List'
> Subject: RE: XML to PDF
>
>
> Speaking of FOP, has anyone successfully streamed PDF to IE using FOP?  I
> keep getting a blank screen, but mozilla works fine.  And yes, I
> have tried
> streaming to a ByteArrayOutputStream first, so that I could set
> response.contentLength, but that didn't help...
>
> -Original Message-
> From: Raible, Matt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 21, 2003 2:12 PM
> To: 'Struts Users Mailing List'
> Subject: RE: XML to PDF
>
>
> Check out FOP from Apache's XML project:
>
> http://xml.apache.org/fop/index.html
>
>
> > -Original Message-
> > From: Yan, Charlene [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 21, 2003 1:07 PM
> > To: Struts Users Mailing List
> > Subject: XML to PDF
> >
> >
> > Hello all,
> >
> > I just got assigned to convert XML to pdf to do reports.  Is
> > any of you working on it?  Any insights where I should get
> > started my research?  I am looking at xmlmil and aparche xml
> > home right now.
> >
> > Thanks in advance for your help!
> >
> > Charlene
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>


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



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




RE: XML to PDF(need sample servlet code...)

2003-01-22 Thread shirishchandra . sakhare
Hi,
Do u have any sample code of a servlet that does the same?I tried to use the 
FOP servlet given with FOP distribution..But i keep on getting null pointer 
exceptions...

Any help will be appreciated..

regards,
Shirish.

-Original Message-
From: madhavan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 12:45 AM
To: struts-user
Cc: madhavan
Subject: [OT}RE: XML to PDF


Hi

I used Apache FOP and XSLT to convert XML to pdf.

Regards
Madhavan

-Original Message-
From: V. Cekvenich [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 2:27 PM
To: [EMAIL PROTECTED]
Subject: Re: XML to PDF


Yet another alternative:
JasperReports and iText.

Yan, Charlene wrote:
> Hello all,
> 
> I just got assigned to convert XML to pdf to do reports.  Is any of you 
working on it?  Any insights where I should get started my research?  I am 
looking at xmlmil and aparche xml home right now.
> 
> Thanks in advance for your help!
> 
> Charlene



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


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



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




RE: Help:: Indexed properties and form

2003-01-10 Thread shirishchandra . sakhare
just change u r indexed method getPermissionLanguage as follows...

public PermissionLanguageData getPermissionLanguage(int index) {
   while(index >=records().size() ){
this.records.add(new PermissionLanguageData());
}
  return (PermissionLanguageData) records.get(index);
   }

regards,
Shirish
-Original Message-
From: jot [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 12:29 PM
To: struts-user
Cc: jot
Subject: Help:: Indexed properties and form


Hi,

I have successfully created a JSP to output a collection that looks like
this:

   
   
  










%%%
Which will in turn generate:



Italiano










English








%%%
and my form class looks something like:

public final class PermissionForm extends ValidatorForm {

/**
 * The Collection to hold all of the PermissionLanguageData objects
 */
private ArrayList records = null;


/**
 * Standard constructor.
 */
public PermissionForm() {
}


   /**
* Get a specific row from the records  ArrayList, based on index
*
* @param   index The index of the row to retrieve
*/
   public PermissionLanguageData getPermissionLanguage(int index) {
   // a a bit of test code
   System.out.println("index = " + index);
   System.out.println("records.size() = " + records.size());
  return (PermissionLanguageData) records.get(index);
   }

/**
 * Copies the data from the EJB into the form.
 *
 * @param value The Collection of PermissionLanguageData
 */
public void copyFrom( Collection value ) {
records = new ArrayList(value);
this.permission = ((PermissionLanguageData)
records.get(1)).getPermission();
}

/**
 * Returns a Collection of PermissionLanguageData
 *
 * @return The Collection of PermissionLanguageData object
 */
public Collection getPermissionLanguageData() {
return this.records;
}
}

%%%
This part is just what I wanted as it "should" allow me to edit my
recordHowever, I thought that this would work without a problem but I now
have the problem that when I submit my form, the Collection (it's an
ArrayList) that I am trying to populate/edit is empty. How do I ensure that
the ArrayList in my form class that I am submitting to contains the
Collection of objects that I am trying to edit? I am not sure how this would
be done because the form class gets called before the action class. All I
can think of is to add a couple of lines to add a new row into the ArrayList
in the getPermissionLanguage() method.

The error that I am getting is caused by a
java.lang.IndexOutOfBoundsException

Any suggestions that anyone may have would be greatly appreciated as I have
been stuffing around with this for some time now.

thanks

Jordan

p.s. here is the whole stack trace


%
javax.servlet.ServletException: BeanUtils.populate
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:798)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
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(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:260)
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.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipe

RE: html:link tag

2003-01-10 Thread shirishchandra . sakhare
Easiest way to pass multiple parameters on a html link.


Use the standard anchor tag.


eg:

"/>&salary
nce="/>">

Here the myForm should have indexed getters for empBean

Clas MyForm(){
List empList = new ArrayList();
getEmp(int index){
while(empList.size< index){
empList.add(new EmpBean());
}
return (EmpBean)empList.get(index);
}
}




Very, very ugly but works just fine!

I think the struts way(using map)is not very easy alwqys...


-Original Message-
From: garyd [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 3:44 AM
To: struts-user
Cc: garyd
Subject: html:link tag


Anyone know if/how to add multiple query parameters using this tag?

ie: www.myserver.com/foo.jsp?id=1&bar=2...

Thanks,
Gary

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



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




RE: What is the best way to convert a given set of data(Value bea n List ) in PDF format...??

2003-01-09 Thread shirishchandra . sakhare
Thanks Oliver for the reply..I did look into this and as u said, this is the 
way...But I have another question..

Is there any way to directly convert from HTML or JSP to pdf?I mean why do i 
have to write xsl again just to create the page layout when I do already have 
the page layout created  in jsps or generated html?And I dont have any special 
formatting requiremants...

So is there any such API / product available?

regards,
Shirish

-Original Message-
From: olivier.rossel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 3:30 PM
To: struts-user
Subject: RE: What is the best way to convert a given set of data(Value
bea n List ) in PDF format...??


> Hi all,
> I have following requirement in our struts application.
> .After user does a query on database,a set of records is 
> returned to him on 
> screen in a table format.He can then ask the same data to be 
> given in PDF 
> format so that he can print it.
> My question is what is the best way to do this?
> Right now,after the user does the query, the actions get a 
> ValueBean list from 
> Model layer and the same is displayed using struts html tags 
> in on the page.So 
> my idea was to use Cacoon FOP ..Which i think needs me to 
> convert the value 
> objects to Xml format first which can then be converted in 
> pdf using xsl...
> 
> Any suggestions...Experiences about the same are welcome.I am 
> sure many people 
> must be doing this in thier struts app. already...So i just 
> dont want to follow 
> the best practice.

FOP is a XSL-FO formatter.
So you need to provide a well-formed XSL-FO document.
You can transform your beans into XML (probably Castor can do that for you)
then you will have to write a XSL stylesheet to transform your source XML
into XSL-FO. Then FOP will transform that in PDF.

Did I mention Cocoon do that VERY easily :-)
(thanks to its CastorGenerator and its FOPserializer)

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

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



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




What is the best way to convert a given set of data(Value bean List ) in PDF format...??

2003-01-08 Thread shirishchandra . sakhare
Hi all,
I have following requirement in our struts application.
.After user does a query on database,a set of records is returned to him on 
screen in a table format.He can then ask the same data to be given in PDF 
format so that he can print it.
My question is what is the best way to do this?
Right now,after the user does the query, the actions get a ValueBean list from 
Model layer and the same is displayed using struts html tags in on the page.So 
my idea was to use Cacoon FOP ..Which i think needs me to convert the value 
objects to Xml format first which can then be converted in pdf using xsl...

Any suggestions...Experiences about the same are welcome.I am sure many people 
must be doing this in thier struts app. already...So i just dont want to follow 
the best practice.

regards,
Shirish





Working software is the primary measure of project success. 

Shirish Sakhare
Application Developer
(CEFS PROJECT)
(CEFS) Corporate Employee Financial Services

UBS AG
Stauffacherstrasse 41
P.O. Box, CH-8004 Zürich
Tel: +41-1-235 56 31
Fax: +41-1-235 54 21

 


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




RE: HttpSession in ActionForm

2003-01-06 Thread shirishchandra . sakhare
Hi Amit,
The clear way of doing this would be in the action class.So the action class 
should retrieve the data from session and set it on the beanThe bean itself 
should not have the logic of retrieving the data


-Original Message-
From: amit [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 10:46 AM
To: struts-user
Cc: amit
Subject: HttpSession in ActionForm


Hi All,

is there any way to get HttpSession object in the bean class that extends 
ActionForm.

I am not using any of reset() or validate() etc. My bean class is having some 
business methods and some get and set methods.

My requirement is to get some attribute from session object.

Any help will be appreciated.




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




RE: Problems with Eclipse and Struts

2002-12-24 Thread shirishchandra . sakhare
HI,
>From the stack trace it seems that it is not finding the core classes for 
catalina...I had similar problems with my laptop and I solved it somehow..I 
dont remember exactly but vaguely this is what i did.(But i am using tomcat 
4.1.12 and Eclipse 2.0 )
Go to wnodow->preferences->plugin development->targetPlatform.There is a list 
of plug ins that u can include in the classpath(Actually I am not very sure 
what this setup does as the text is not clear to me atleast...)And check the 
plug in that is giving problems...In your case i thnik it should be 
com.sysdeo.eclipse.tomcatAnd restart eclipse and see if the plugin works...

regards,
Shirish.

-Original Message-
From: Oliver.Adolph [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 24, 2002 10:11 AM
To: struts-user
Subject: Problems with Eclipse and Struts


Hi,

I hope anybody can help me with this issue. 
I have a web application, which runs under Tomcat 4.1.18. It uses Struts
1.1B2. I also use Eclipse 2.0.2 with the Lomboz and the Sysdeo plugins.

Now I run into the following problem:
When I try to start Tomcat through one of the plugins to debug the
application I always get the following error 

24.12.2002 09:57:38 org.apache.commons.digester.Digester startElement
SCHWERWIEGEND: Begin event threw exception
java.lang.ClassNotFoundException: org.apache.catalina.core.StandardServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252
)
at
org.apache.commons.digester.Digester.startElement(Digester.java:1237)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:459)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.ja
va:572)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java
:727)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:759)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElem
entHook(XMLDocumentScannerImpl.java:957)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(XMLDocumentFragmentScannerImpl.java:1544)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.java:329)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:117
5)
at org.apache.commons.digester.Digester.parse(Digester.java:1495)
at org.apache.catalina.startup.Catalina.start(Catalina.java:449)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.start: java.lang.ClassNotFoundException:
org.apache.catalina.core.StandardServer
java.lang.ClassNotFoundException: org.apache.catalina.core.StandardServer
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2312)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2332)
at
org.apache.commons.digester.Digester.startElement(Digester.java:1240)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:459)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.ja
va:572)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java
:727)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:759)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElem
entHook(XMLDocumentScannerImpl.java:957)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(XMLDocumentFragmentScannerImpl.java:1544)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.jav

RE: Access external file from web application

2002-12-23 Thread shirishchandra . sakhare
use html:image tag...

And generate the path dynamically something like...

<%!String imagePath=""; %>

<%imagePath=session.getAttribute("path");//can be any logic u have to generate 
the image path...Better if u can put this logic in action and put just the path 
attribute on form:-))  ...%>



regards,
Shirish

-Original Message-
From: amit [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 10:16 AM
To: struts-user
Cc: amit
Subject: Access external file from web application


Hi All,

Is there any way to access a file(image,..etc) from the web application. the 
path of the image is dynamically generated.

The requirement is that we have to upload a image file and store it to 
somewhere on server at dynamically generated path. Now, Problem is how I should 
refer this file from the application, As the application don't know the path at 
the time of implementation(application).

Please help. 


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




RE: Validator (newbie)

2002-12-19 Thread shirishchandra . sakhare
yes..the form bean which was submitted contains the previous data..But the data 
which u are going to put on screen will not necessarily be in same form 
bean(mostly in another form bean)and also will be rendered by another 
actionso the data processing action and data populating action are 
different here using different form beans...Didn,t u get my earlier post about 
the same ?or am i replying the same mail again :-((

-Original Message-
From: suresh.addagalla [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:17 PM
To: Sakhare, Shirishchandra; struts-user
Subject: RE: Validator (newbie)


Hi,

Using request scope instead of session makes sense.

One question on your suggestion. Usually the form bean represents the
form data of the "previous" page. The data, which is required to be put
in the view (JSP), most probably would not be present in the form bean.
So, how can we say that using the form bean is the best idea. In the
scenario which I described, what can be the alternative and best
practise?

Thanks,
Suresh

>-Original Message-
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, December 18, 2002 4:37 PM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: RE: Validator (newbie)
>
>
>U r first Q ,I dont know ...But abt 2nd may be i have some 
>suggestion form my 
>experience with struts ..
2. What is the standard way to pass data from Action 
>objects to the JSP
>(view)? Should the data be sent as a) Session properties, b) Some bean
>objects, or c) Data members of the Action object?
>
>GEnerally u should try to avoid using session variables.So the 
>standard way is 
>to pass the data in request scope.So if the data u want to use 
>in jsp is 
>attribute of the formBean,then as the form bean is available 
>to the jsp , u can 
>use it there...I think this keeps the design clean as the form 
>bean actually 
>represents the form data..So u dont have to look at the action 
>class to see 
>what u are trying to put on jsp..The form bean is the place... 
>
>-Original Message-
>From: suresh.addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 18, 2002 12:02 PM
>To: struts-user
>Subject: Validator (newbie)
>
>
>Hi,
>
>I have a couple of basic questions.
>
>1. If we use ActionForm, the ActionServlet first executes the 
>validate()
>method before calling execute() on the corresponding Action. 
>If I switch
>from ActionForms to Struts Validator (that is, use 
>ValidatorForm instead
>of ActionForm), do things work the same way? Is it that in this case
>also, ActionServlet calls the validate() just before calling the
>execute()?
>
>2. What is the standard way to pass data from Action objects to the JSP
>(view)? Should the data be sent as a) Session properties, b) Some bean
>objects, or c) Data members of the Action object?
>
>Thanks,
>Suresh
>
>



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




RE: html tablib

2002-12-19 Thread shirishchandra . sakhare
there are some example jsps with struts 1.0.2 download..It has examples of 
usage of most of the tags including texttag..

regards,
shirish.

-Original Message-
From: usha [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 7:01 AM
To: struts-user
Cc: usha
Subject: html tablib


Hi

can anybody tell me how the struts-html tld's text tag works.especially 
setting the property attribute for the texttag.

thanks
usha


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



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




RE: Re: question

2002-12-18 Thread shirishchandra . sakhare
This need not be action class.But any where before adding error to the 
collection, u can check if there are any errors for the same key(which should 
be generally a property.)So this will work in your case only if u are doing 
validation only in one place.I mean U have already not added the action errors 
object previous to calling this code.

Any way as i have not used dynaActionForm, i cant tell anyy thing about 
that.But the code demonstrates how u can check for duplication of errors.So in 
your case, if u dont want to add the error for compulsory fields more than 3 
times, before adding the error each time u can check how many errors for the 
same key(e.g. error.field.missing) are there and then decide if u want to add 
or not.

And if u can take away this logic in a utility method,changing this tomorrow to 
have e.g. 5 errors will be easy.

regards,
Shirish


-Original Message-
From: vasilenko [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 4:47 PM
To: struts-user
Cc: vasilenko
Subject: Re:  question


As I understand this is for Action class.
In my sample i use DynaValidatorForm and
I must cath error in the jsp page.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 18, 2002 3:04 PM
Subject: RE:  question


> do some thing like...
> public static void logErrorOnce(ActionErrors errors, String errorKey) {
> if (errors.get(errorKey).hasNext() == false) {
> logError(errors, errorKey);
> }
> }
>
> -Original Message-
> From: vasilenko [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 1:52 PM
> To: struts-user
> Cc: vasilenko
> Subject:  question
>
>
>
> Dear,
>
> Describe:
> I have for example 10 form field (with validaton required). I see in the
> jsp() 10 errors when I try to inut ntohing.
>
> Question:
> I  want to see in the jsp only for example 3 errors.
>
>
> Best regards,
> Dmitry.
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



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



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




RE: question

2002-12-18 Thread shirishchandra . sakhare
do some thing like...
public static void logErrorOnce(ActionErrors errors, String errorKey) {
if (errors.get(errorKey).hasNext() == false) {
logError(errors, errorKey);
}
}

-Original Message-
From: vasilenko [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 1:52 PM
To: struts-user
Cc: vasilenko
Subject:  question



Dear,

Describe:
I have for example 10 form field (with validaton required). I see in the
jsp() 10 errors when I try to inut ntohing.

Question:
I  want to see in the jsp only for example 3 errors.


Best regards,
Dmitry.


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



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




RE: how to give form name in struts?

2002-12-18 Thread shirishchandra . sakhare
check documentation for html:form tag...

-Original Message-
From: Mohammed.Rafeeq [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 1:44 PM
To: struts-user
Subject: how to give form name in struts?


hi all ,
i'm a newbie.

how to give the form name when using  struts-html.tld




i want to submit the form on click of a link, i thought of calling
javascript:document.formname.submit() onclick of the link


but in struts syntax is there provision to specify the form name?


-rafeeq


** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**

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



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




RE: AW: Struts user archive

2002-12-18 Thread shirishchandra . sakhare
aabe breakpoint set hoto ka bagh bare ..tomcat cha source code aahe ka?

mi pan baghato ethe kahi milate ka te..

-Ojava.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:329)
at
org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:502)
at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:264)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:401)
at org.apache.commons.digester.Digester.(Digester.java:345)
at
org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:280)rigin
al Message-
From: Juraj.Lenharcik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 10:04 AM
To: struts-user
Subject: AW: Struts user archive


http://www.servlets.com/archive/servlet/SearchList?listName=struts-user&by=t
hread helps you perhaps




-Ursprüngliche Nachricht-
Von: Heligon Sandra [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Dezember 2002 10:03
An: '[EMAIL PROTECTED]'
Betreff: Struts user archive



Is there an order which makes it possible to find in the Struts user
archive all the messages andanswers associated according to the
name with the transmitter ?
Thanks
Sandra


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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



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




RE: Validator (newbie)

2002-12-18 Thread shirishchandra . sakhare
U r first Q ,I dont know ...But abt 2nd may be i have some suggestion form my 
experience with struts ..
>>>2. What is the standard way to pass data from Action objects to the JSP
(view)? Should the data be sent as a) Session properties, b) Some bean
objects, or c) Data members of the Action object?

GEnerally u should try to avoid using session variables.So the standard way is 
to pass the data in request scope.So if the data u want to use in jsp is 
attribute of the formBean,then as the form bean is available to the jsp , u can 
use it there...I think this keeps the design clean as the form bean actually 
represents the form data..So u dont have to look at the action class to see 
what u are trying to put on jsp..The form bean is the place...  

-Original Message-
From: suresh.addagalla [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:02 PM
To: struts-user
Subject: Validator (newbie)


Hi,

I have a couple of basic questions.

1. If we use ActionForm, the ActionServlet first executes the validate()
method before calling execute() on the corresponding Action. If I switch
from ActionForms to Struts Validator (that is, use ValidatorForm instead
of ActionForm), do things work the same way? Is it that in this case
also, ActionServlet calls the validate() just before calling the
execute()?

2. What is the standard way to pass data from Action objects to the JSP
(view)? Should the data be sent as a) Session properties, b) Some bean
objects, or c) Data members of the Action object?

Thanks,
Suresh



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




RE: Re: Struts and session

2002-12-17 Thread shirishchandra . sakhare
Hi Doug/Justin,
Actually we had similar problem..We wanted to use a global forward if the user 
is not logegd in so that he can be thrown to login page or any other page which 
is configurable..And that is the reason we choose to include the login check in 
our applications abstract action as you have access to ActionMApping object 
there...

regards,
Shirish

-Original Message-
From: justin-struts [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 5:16 PM
To: struts-user
Cc: justin-struts
Subject: Re: Struts and session


Hi Doug,

The filter does work with Struts - it just doesn't make use of it.  Your
request goes through the filter even before the Struts ActionServlet is
invoked, so all of this happens before Struts comes into the picture in a
request.  You really don't need struts for this - you are basically just
getting a session attribute and if it comes back null you forward to a login
page, using a RequestDispatcher.  Having to hard-code (or config file) the
login page URL is the only thing that Struts would be able to help with
here, but as far as I've seen Struts doesn't provide any help in Filters.

If anybody knows of a way to take advantage of a global forward from the
struts-config.xml file in a Filter, that would be very useful information.

Thanks,

Justin

- Original Message -
From: "Doug Ogateter" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 17, 2002 11:04 AM
Subject: Re: Struts and session


>
> Justin:
>
> Thank you for reply.
> That's a good idea. One more question, can filter works with struts?
> Doug
>  Justin Ashworth <[EMAIL PROTECTED]> wrote:Hi Doug,
>
> We use a javax.servlet.Filter to check for an expired session. I found
this
> idea on some website or in the Struts-User archives and it makes the most
> sense to me. All requests go through the filter before they hit the
> servlet, so this is the perfect place to check for whether or not a user
is
> logged in - it's hidden away and it's executed before anything else. Just
> create a class that implements javax.servlet.Filter. There are three
> methods to implement in this class, but the real work will be done in the
> doFilter() method. In doFilter() you can call
> request.getSession().getAttribute("someAttribute") on an attribute that
> should always be there if the session is valid, and if it's not there
> forward them to the login screen (this will be a
RequestDispatcher.forward()
> and not a Struts ActionForward). Your doFilter() method will be specific
to
> your application, but the other two methods you need to implement,
> getFilterConfig() and setFilterConfig() are just a basic getter and setter
> for a FilterConfig member variable. Also, it is good practice that if you
> aren't forwarding back to the login page in your doFilter method, you call
> filterChain.doFilter(request, response). filterChain is a parameter to
this
> method and represents a chain of filters you have configured in your
web.xml
> file. See the JavaDoc for more info. Your entry for the filter in your
> web.xml file will look something like this:
>
>
> LoginFilter
> com.d.p.w.LoginFilter
>
>
>
> LoginFilter
> *.do
>
>
> If you plan well you should also be able to figure out which page the user
> was heading to when their session timed out and pass that back to the
login
> screen so that they go directly to it after login. I can't give an example
> of this because we haven't implemented it yet.
>
> HTH,
>
> Justin
>
> - Original Message -
> From: "Doug Ogateter"
> To: "Struts Users Mailing List"
> Sent: Tuesday, December 17, 2002 9:26 AM
> Subject: Struts and session
>
>
> >
> > Greetings:
> >
> > I am using struts1.1b2 to implement a web application. I have a
> > question regarding to implementing session timeout. When session is
> > invalidated, user who has logged in the system should be forwarded to
> login page.
> > I am not clear about the followings, and hope someone can help me out.
> >
> > 1. Should I use request.getSession(false) to check if session is
> > timeout? If so, that means for every request, it will check if session
is
> > invaildate. Will it cause performance problem? If not, which methods
> > should I call to check it?
> >
> > 2. If I should use request.getSession(false) to check session timeout,
> > where should I write the code? Should I write the code in every action
> > class?
> >
> > 3. There are many methods related to session, such as getCreationTime,
> > getLastAccessedTime,..Where and how should I use them in the
> > implementation?
> >
> > 4.From my understanding, I can set timeout in web.xml or use
> > setMaxInactiveIterval(int ..). Usually which way should be use?
> >
> > 5. After user login, I want to forward the user to the page where he
> > was when session timeout. Where should I save the information(with the
> > information, I know where I should forward the user to)?
> >
> > I searched the archive. However, it seems that I can't 

RE: Struts and session

2002-12-17 Thread shirishchandra . sakhare
>>Should I use request.getSession(false) to check if session is 
timeout? If so, that means for every request, it will check if session is 
invaildate. Will it cause performance problem? If not, which methods 
should I call to check it?

That is the only way to know if the session is invalid..(or similarly u can do 
request.getSession(true) and check isNew on session)And yes for every request u 
have to do this...SO typically some where in your applications abstract action 
class U will have this as a preprocessing before the perform is called...

>>4.From my understanding, I can set timeout in web.xml or use 
setMaxInactiveIterval(int ..). Usually which way should be use?
I think the web.xml is better place as it becomes declarative instead of 
hardcoded.So just to check the time out, u dont need a next build.

>>5. After user login, I want to forward the user to the page where he 
was when session timeout. Where should I save the information(with the 
information, I know where I should forward the user to)?
I think one of teh ways to do this might be using cookies ..Check teh 
documentation for more details as i aslo dont know exactly how to do this.But u 
can use cookies to store user info.And in his case, as session is already timed 
out, i think this is the easiest way to save the information about the last 
action..

regards,
Shirish

-Original Message-
From: hinbsls [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 3:27 PM
To: struts-user
Cc: hinbsls
Subject: Struts and session



Greetings:

I am using struts1.1b2 to implement a web application. I have a 
question regarding to implementing session timeout. When session is 
invalidated, user who has logged in the system should be forwarded to login 
page. 
I am not clear about the followings, and hope someone can help me out.

1. Should I use request.getSession(false) to check if session is 
timeout? If so, that means for every request, it will check if session is 
invaildate. Will it cause performance problem? If not, which methods 
should I call to check it?

2. If I should use request.getSession(false) to check session timeout, 
where should I write the code? Should I write the code in every action 
class?

3. There are many methods related to session, such as getCreationTime, 
getLastAccessedTime,..Where and how should I use them in the 
implementation?

4.From my understanding, I can set timeout in web.xml or use 
setMaxInactiveIterval(int ..). Usually which way should be use?

5. After user login, I want to forward the user to the page where he 
was when session timeout. Where should I save the information(with the 
information, I know where I should forward the user to)?

I searched the archive. However, it seems that I can't find the 
specific info.

Your help is highly appreicated.

Doug




-
Post your free ad now! Yahoo! Canada Personals


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




RE: Re: Lifecycle of a request object

2002-12-16 Thread shirishchandra . sakhare
no..The request object is no0t modified in any way apart from the fact that the 
errors object is kept in the request object so that it can be resued laeter by 
errors tag



-Original Message-
From: jrgermany [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 5:57 PM
To: struts-user
Cc: jrgermany
Subject: Re: Lifecycle of a request object


I miscommunicated what I was trying to say. The request object isn't
null, but an attribute in the request object doesn't look like it's ever
set.  This is a bean attribute inside the request object.  I guess the
real question I need answered is, when a form fails validation, is a new
request object being created and sent to the original jsp?

[EMAIL PROTECTED] wrote:
> 
> >>Cannot find bean null in request scope
> Where do u get this message?Do u mean when the validation fails u get this
> message after forwarding to the jsp?
> >> In using System.out.printlns() to debug the application, the validate
> receives
> >>the ActionMapping object and HttpServletRequest objects as arguments. If
> >>I do a printout of the one of the request attributes in this method, the
> >>request is already null coming to the method.
> I think there is some minunderstaing..The request object can never be null.Do 
U
> mean to say the attribute is not there?And BTW, U should be looking for the
> parameter and not attribut if u are checking for the presence of some values
> being passed form a jspUnless ua re explicitely doing some thing like
> request.setAttribute() in the jsp...
> 
> -Original Message-
> From: jrgermany [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 16, 2002 5:17 PM
> To: struts-user
> Cc: jrgermany
> Subject: Re: Lifecycle of a request object
> 
> Thanks for the response.  What I'm trying to do is validate the page
> using the struts validate method which I have overridden. In using
> System.out.printlns() to debug the application, the validate receives
> the ActionMapping object and HttpServletRequest objects as arguments. If
> I do a printout of the one of the request attributes in this method, the
> request is already null coming to the method.  Thus, I get a "Cannot
> find bean null in request scope" in my logs.  So I was wondering at what
> point is the request object losing scope after going from the .jsp page
> to the form's validate method.
> 
> Thanks,
> Randy
> 
> [EMAIL PROTECTED] wrote:
> >
> > Hi,
> > Struts uses HTTpRequest object as it is.So it behaves exactly the same like 
a
> > httpRequest(VAlid for one http transaction...Available form the time the
> client
> > sends a request to the server till the response is commited).Also it will be
> > available if u do any forwards etc.
> >
> > What is it exactly u want to know?
> >
> > -Original Message-
> > From: jrgermany [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, December 16, 2002 4:28 PM
> > To: struts-user
> > Cc: jrgermany
> > Subject: Lifecycle of a request object
> >
> > Can someone tell me where to find documentation on the lifecycle of a
> > request object within the struts framework?  I've been looking through
> > the documentation but haven't come across this reading as of yet.
> >
> > --
> > To unsubscribe, e-mail:   

> > For additional commands, e-mail: 

> >
> > --
> > To unsubscribe, e-mail:   

> > For additional commands, e-mail: 

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



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




RE: Re: Lifecycle of a request object

2002-12-16 Thread shirishchandra . sakhare
>>Cannot find bean null in request scope
Where do u get this message?Do u mean when the validation fails u get this 
message after forwarding to the jsp?
>> In using System.out.printlns() to debug the application, the validate 
receives
>>the ActionMapping object and HttpServletRequest objects as arguments. If
>>I do a printout of the one of the request attributes in this method, the
>>request is already null coming to the method.
I think there is some minunderstaing..The request object can never be null.Do U 
mean to say the attribute is not there?And BTW, U should be looking for the 
parameter and not attribut if u are checking for the presence of some values 
being passed form a jspUnless ua re explicitely doing some thing like 
request.setAttribute() in the jsp...






-Original Message-
From: jrgermany [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 5:17 PM
To: struts-user
Cc: jrgermany
Subject: Re: Lifecycle of a request object


Thanks for the response.  What I'm trying to do is validate the page
using the struts validate method which I have overridden. In using
System.out.printlns() to debug the application, the validate receives
the ActionMapping object and HttpServletRequest objects as arguments. If
I do a printout of the one of the request attributes in this method, the
request is already null coming to the method.  Thus, I get a "Cannot
find bean null in request scope" in my logs.  So I was wondering at what
point is the request object losing scope after going from the .jsp page
to the form's validate method.

Thanks,
Randy

[EMAIL PROTECTED] wrote:
> 
> Hi,
> Struts uses HTTpRequest object as it is.So it behaves exactly the same like a
> httpRequest(VAlid for one http transaction...Available form the time the 
client
> sends a request to the server till the response is commited).Also it will be
> available if u do any forwards etc.
> 
> What is it exactly u want to know?
> 
> -Original Message-
> From: jrgermany [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 16, 2002 4:28 PM
> To: struts-user
> Cc: jrgermany
> Subject: Lifecycle of a request object
> 
> Can someone tell me where to find documentation on the lifecycle of a
> request object within the struts framework?  I've been looking through
> the documentation but haven't come across this reading as of yet.
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 



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




RE: Lifecycle of a request object

2002-12-16 Thread shirishchandra . sakhare
Hi,
Struts uses HTTpRequest object as it is.So it behaves exactly the same like a 
httpRequest(VAlid for one http transaction...Available form the time the client 
sends a request to the server till the response is commited).Also it will be 
available if u do any forwards etc.

What is it exactly u want to know?

-Original Message-
From: jrgermany [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 4:28 PM
To: struts-user
Cc: jrgermany
Subject: Lifecycle of a request object


Can someone tell me where to find documentation on the lifecycle of a
request object within the struts framework?  I've been looking through
the documentation but haven't come across this reading as of yet.


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



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




RE: Struts-config.xml

2002-12-16 Thread shirishchandra . sakhare
struts 1.1 already supports that.But I am not sure if u want to use struts 1.1 
as of yet as its not that stable

But we are using struts 1.0 for a fairly large application (some 300 pages and 
150 actions).As u said, struts config becomes big and managing it in a big team 
is a bit of problem as well.

-Original Message-
From: usha [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 6:37 AM
To: struts-user
Cc: usha
Subject: Struts-config.xml


Hi

I am new to the Struts, testing some sample applications. we want to 
implement the struts in our existing project. right now we have almost 
50 tables and more than 200 submittion pages. what my concern about the 
struts is if i have to configure all the form beans and the action 
mappings the struts-config.xml will become large file. is there any way 
i can create new configuration file and the action servlet class referes 
to this config.xml. what i mean is can i divide into different config files.

Thanks
usha


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



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




RE: a question about transaction tokens

2002-12-13 Thread shirishchandra . sakhare
search the mailing list archive for "Token mechanism in Struts:"

U will find teh answers...a few very good mails...

-Original Message-
From: akriger [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 4:09 PM
To: struts-user
Cc: akriger
Subject: a question about transaction tokens


I'm wondering how these are used. They're not mentioned in the O'Reilly book
or in the docs. After calling generateToken, do I need to wrap my action's
execute code in an isTokenValid block to check for an existing token?

For example...

execute(...) {
generateToken(request);
if(!isTokenValid(request)) {
// do action stuff
}
else
return ???what???
}

thx
andy



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



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




RE: Re: OptionsCollection

2002-12-13 Thread shirishchandra . sakhare
Hi,
There are many ways of doing this.So first is as the collection is being 
displayed on screen,make it an attribute of form and popolate it in action on 
form.So in jsp u will access like a form attribute.

But the problem with this approach is If u get an error and forward back the 
user to same jsp, u loose the collection data as u are directly going to the 
screen.So the solution could be have a generic action which will be called in 
case of errors and the action will populate form with list before forwarding it 
to same jsp.

Else U can have lazy in itialising forms.i.e forms getList emthod itself will 
call service to get data if list is null.And then in this case ,u can just use 
an epty action class which does nothing but forwarsd to "success" which is the 
origicnal jsp.But this action will be mapped with the Original actions form so 
that the form will use its auto population mechanism to get the list..But i 
dont like this approach ..just not a good design i think.But very conveninent.


Hope this helps,
Regards,
Shirish

-Original Message-
From: marklowe [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 12:12 PM
To: struts-user
Cc: marklowe
Subject: Re: OptionsCollection


Okay... But a drop down menu is screen data.

And a list of companies is something that will be used more than once.

So I have a normal class in my model layer

ListCompanies

In my UserAction

(ListCompanies).getCompanies();

But this Action's primary job is to return a list of users (which it does).

As the list is screen data i should be defining this in my form bean? This
is something thats being confusing me for weeks. If i've a bunch of
collections how can i make them available to iterate tags and select menus,
without using useBean (sorry silly design constraint, but beyond my
control).

Hopefully I'm just being silly, i could really do with some pointers as
where i'm missing the point.

Cheers mark


On 13-12-2002 11:49, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> Also i dont understand why u need to access the request directly.I mean why
> are 
> u setting all the collections as request attributes.GEnerally I think the good
> design is when u r FormBEan represents the screen data.So in this case
> whatever 
> u need on screen will become attribute of form.
> I know it does not make much difference in implemantation but as a design it
> becomes pretty straight forward.I mean for an action , if u just look at the
> form, u know what is being displayed.So u just populate the form in action.
> 
> Any comments... :-))
> 
> 
> -Original Message-
> From: VEDRE [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 11:44 AM
> To: struts-user
> Cc: VEDRE
> Subject: RE: OptionsCollection
> 
> 
> You can either use attribute collection="users" for options tag if you store
> in request
> or you can use   name="formName" property="myList"   if you have
> a getMyList() method for the form(You have to fill call formName.setMyList()
> in your action class before forwarding to a jsp).
> 
> 
> checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> if you have not looked at the documentation.
> 
> -rana.
> 
> 
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 5:36 AM
> To: Struts Users Mailing List
> Subject: OptionsCollection
> 
> 
> Hello
> 
> I've a number of collections already defined that end up being passed to my
> jsp's via the request object.
> 
> Users in this case is a map defined in my business logic class that does db
> queries.
> 
> users = (ListUsers).getUsers();
> 
> request.setAttribute("users",users);
> 
> 
> I itertate through this collection using iterate. But now i want to use this
> in a select menu.
> 
> Should I be thinking about making my collection available to my FormBean i.e
> making a getMyList() method.
> 
> Thanks in advance
> 
> mark
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 


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



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




RE: OptionsCollection

2002-12-13 Thread shirishchandra . sakhare
Also i dont understand why u need to access the request directly.I mean why are 
u setting all the collections as request attributes.GEnerally I think the good 
design is when u r FormBEan represents the screen data.So in this case whatever 
u need on screen will become attribute of form.
I know it does not make much difference in implemantation but as a design it 
becomes pretty straight forward.I mean for an action , if u just look at the 
form, u know what is being displayed.So u just populate the form in action.

Any comments... :-))


-Original Message-
From: VEDRE [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 11:44 AM
To: struts-user
Cc: VEDRE
Subject: RE: OptionsCollection


You can either use attribute collection="users" for options tag if you store
in request
or you can use   name="formName" property="myList"   if you have
a getMyList() method for the form(You have to fill call formName.setMyList()
in your action class before forwarding to a jsp).


checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
if you have not looked at the documentation.

-rana.


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 5:36 AM
To: Struts Users Mailing List
Subject: OptionsCollection


Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.
 
users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu. 

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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



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




RE: org.apache.jasper.JasperException: No getter method for property appauth.aAuthLevel of bean element

2002-12-13 Thread shirishchandra . sakhare
Hi,
The problem has to do with java beans specification 1.01  section 8.8 
The mechanism used by java beans introspection to derive method names from 
property names is like this.
1.Append get/set to peoperty name and capitilise first letter of property.(e.g. 
for a property name, method names derived will be getName and setName)
2.But if second letter of property is also capital, then dont apply the 
capitalisation.(e.g for a property URL,method names derived will be getURL and 
setURL.)

And this is why u are having the problem.


regards,
Shirish

-Original Message-
From: david.karr [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 10:01 PM
To: struts-user
Subject: RE: org.apache.jasper.JasperException: No getter method for
property appauth.aAuthLevel of bean element


This is the "two starting caps" rule.  I don't know exactly how this 
translates, as I try to avoid this situation.  Change your property name (in 
both places) so that the second character is NOT a capital.  I believe this 
will solve this problem, at least that part.

> -Original Message-
> From: Jyothi Panduranga
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 12, 2002 12:55 PM
> To: [EMAIL PROTECTED]
> Subject: org.apache.jasper.JasperException: No getter method for
> property appauth.aAuthLevel of bean element
> 
> 
> Hi,
> 
>   I have been getting this error when I try to access a 
> property.  I have
> both getter and setter properties defined in the bean. Both 
> deals with the
> variable of same type.  Eg., I have this defined in my bean.
> 
> /**
>  * Sets the value of field 'aAuthLevel'.
>  *
>  * @param aAuthLevel the value of field 'aAuthLevel'.
> **/
> public void setAAuthLevel(java.lang.String aAuthLevel)
> {
> this._aAuthLevel = aAuthLevel;
> }
> 
>/**
>  * gets the value of field 'aAuthLevel'.
>  *
>  *
> **/
> public String getAAuthLevel()
> {
> return this._aAuthLevel;
> }
> 
> Here is the part of my JSP sniplet which calls the property
> 
> 
>   property="appauth.aAuthLevel" />
> 
> 
> I get this following error.
> 
> org.apache.jasper.JasperException: No getter method for property
> appauth.aAuthLevel of bean element
> 
> However, If I change the name of the getter and setter properties to
> getAuthLevel/setAuthLevel and JSP according do that(appauth.authLevel
> instead of appauth.aAuthLevel), then everything works fine.
> 
> I want to know if this is a bug in JSP or struts.  I use 
> Tomcat 4.1.12.
> Any insight would be helpful.
> 
> Thanks in advance,
> Jyothi
> 
> 
> --
> To unsubscribe, e-mail:   

For additional commands, e-mail: 

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



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




RE: dropdowns being reset

2002-12-12 Thread shirishchandra . sakhare
try using html:options instead..and supply it with the collection or array of 
indexes...

because if in html:select u specify property attribute, and the property is 
there in the request(which should be the case when u forward the request back 
to same jsp with errors..),the same is used to preselect a element.
I think may be as u are using html:ootion in a loop, u are having this problem.

regards,
Shirish

-Original Message-
From: david.heagney [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 1:17 PM
To: struts-user; david.heagney
Subject: dropdowns being reset


Hi,

I have a page in my STRUTS app which dynamically populates a dropdown list:

Month


--
<% for (int i=1; i <= 12; i++) { %>
  <%= getMonthName (i) %>
<% } %>


getMonthName() returns the month as a string based in the passed integer, 1
- 12.

If the user submits the form and leaves out a required field, the above
dropdown gets re-set, i.e. doesn't retain the selection when the page is
refreshed with it's errors... does anyone know how i can avoid this?

Thanks,
David


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.


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



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




RE: Form Bean Scope.

2002-12-12 Thread shirishchandra . sakhare
Hi Gopi,
Why do u need to use the same instance of form bean as from BAsicSearch.jsp?
DO u mean that, when u get search results, U still want to maintain what the 
search creteria was and allow the user to search again by modifying some or all 
of the search creteria?

BEcause generalayy U dont try to reuse beans in struts but think in terms of 
data.And what ever data u need in next action, u carry it forward using hidden 
parameters if necessary.

regards,
Shirish

-Original Message-
From: Gopinath.D [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 10:04 AM
To: struts-user; Vinodh.Kumar
Subject: RE: Form Bean Scope.


Hi vinodh,

That didn't work. Note i need to call the action (basicSearch.do) again from
the searchResults.jsp and not from basicSearch.jsp. At this point i need to
same instance of formbean which was created on basicSearchAction called from
basicSearch.jsp.






Is this clear..

~gopi

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 2:10 PM
To: Struts Users Mailing List
Subject: Re: Form Bean Scope.



hi Gopinath,

You could set the request object attributes, instead of thinking in terms
of sessions. On a new search you could reset the request objects attribute.

regards
Vinod

Vinodh Kumar B
Technical Leader
IT Solutions
[EMAIL PROTECTED]
Office: 6655122 Extn. 2153
Mobile: +91 9845458208

-Original Message-
From: D, Gopinath (MED) 
Sent: Thursday, December 12, 2002 2:03 PM
To: 'Struts Users Mailing List'
Subject: Form Bean Scope.


Hi,

I'm new to Struts, needed immediate help.

How to set the scope of formbean to be session, so that it can be called
from other Jsps also. I know i'm not clear. !!

Ok, here is in details.

BasicSearh.jsp(attached to basicSearchBean) submit calls basicSearchAction
and fwds to searchResults.jsp. In searchResults.jsp i'm calling the
basicSearchAction again with different start & end parameters. In this case
basicSearhBean goes as null. Can some one help me out on this fast.

Here is the code.












searchResults.jsp has code similar to this.

Page results : 
Next 

Thanks in advance,
Gopi


"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."


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



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




RE: Re: Re[2]: Best Practices for Logging?

2002-12-11 Thread shirishchandra . sakhare
Hi,
 
> If I'm understanding what you are doing correctly, doesn't this make
> the logging level global to all logging in your application?  The
> approach Struts uses internally (essentially a category name per
> class) lets you make much more fine grained decisions about wanting
> DEBUG messages from this class, but WARN messages from that class.
I think u can still avoid putting logging instantiation code in every class 
.And use class level loggers as well.This is what we have done in done

class ApplicationLogger{
public static void debug(
Object logSource,
Object message) {
getLogger(logSource).debug(message);
}

public static void debug(Object logSource, Object message, Throwable t) {
getLogger(logSource).debug(message, t);
}

public static void info(Object logSource, Object message) {
getLogger(logSource).info(message);
}
//similarly all other  log methods are overloaded...
private Logger getLogger(Object logSource){
String loggerName= logSource.getClass().getName();
try {
loggerName = getLoggerName(className,companyId);
} catch (Exception e) {
return defaultLogger;
}
return Logger.getLogger(loggerName);
}


SO now I have loggers per class level and also every class need not have a 
instance of logger.So when I want to log,i wil just say
ApplicationLogger.log(this,"message");

so if u want to change logging behaviour , it is at one place only.

regards,
Shirish
-Original Message-
From: maillist [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 7:55 AM
To: struts-user
Cc: maillist
Subject: Re: Re[2]: Best Practices for Logging?


On Tue, 10 Dec 2002 17:34:10 -0800 (PST)
"Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
 
> If I'm understanding what you are doing correctly, doesn't this make
> the logging level global to all logging in your application?  The
> approach Struts uses internally (essentially a category name per
> class) lets you make much more fine grained decisions about wanting
> DEBUG messages from this class, but WARN messages from that class.
> 

Yes, I see your point. I guess I was trying to avoid having to put
something like:

Category log = Category.getInstance( FooThisClass.class.getName() );

on the top of each class (or maybe that doesn't have to be done?). I was
thinking what if later on I decide not to use log4j then all my classes
would still be tied to it would they not? By going straight to another
class called "Logging" I could then implement any other type of logging
I like in the future, but I guess the drawback is the lack of fine
grained logging. Would it be a bad idea to possibly pass the name of the
class you want logging for to another class? That way if I ever decided
to a different type of logging in the future the app would still work
fine. For example if I had an a class called "Logging" I could now call
the Logging methods in this class from another class as such...

Logging.debug("FooBarName.class", "my message to log" );
 
I really should do some more reading on how to better implement log4j in
my Struts apps. Any good pointers to sources for this particular topic?

Thanks for the help.

Rick
 
 


I apologize, I haven't been following this whole thread, but I'm
wondering if what I've implemented is a poor solution. For a
particular app called "taskmanager" I created a Logging class which is
pretty small and looks like this:

public class Logging {

static Category log = Category.getInstance("taskmanager");

public static void debug(String msg) {
log.debug(msg);
}

public static void error(String msg) {
log.error(msg);
}

public static void info(String msg) {
log.info(msg);
}
//etc
}

"taskmanager" corresponds to a category in my log4j.properties file so
that I can set up what I want for the app this way. Then wherever I
need to do logging in the app I just call
Logging.info("...") or Logging.error(" ")..etc

Are there some major drawbacks to using this type of a solution? I'm
pretty much a log4j newbie so I'm probably missing a better way to do
all of this and will go back through the archives to read these past
posts.

Thanks for any feedback

-- 
Rick

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



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




RE: dynamically disable a input field.

2002-12-10 Thread shirishchandra . sakhare
If u dont want to wory about netscape then i think u can go the other way.And i 
Am talking about netscape 4.77.
So in the other case u can use logic equla in just one place as u said.
<%!String isDisbled="false"%>

<%isDisbled= "false";%>  


and then in ur html:text just use this

then u dont need to do this 25 times as u said.



-Original Message-
From: GMouratidis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 12:56 PM
To: struts-user
Cc: GMouratidis
Subject: RE: dynamically disable a input field.


the disadvange is that i have to do it for 25 inputfields.

25x ...
25x ...

is this the only way you know?

thx
georg

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Dienstag, 10. Dezember 2002 12:51
To: [EMAIL PROTECTED]
Subject: RE: dynamically disable a input field.


Hi,
I had similar functionality.But I will advice u not to use  because it does not work with Netscape.
So instead i used logic:equal tag and bean write.

 
  

   
 
//Also use html:hidden if u stil want to pass the parameter in request 
  


hope this helps..
regards,
Shirish
-Original Message-
From: GMouratidis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 12:40 PM
To: struts-user
Cc: GMouratidis
Subject: dynamically disable a input field.


Greetings

i want to disable some input elements but only if a bean property is not set:

e.g.



here i want to set a variable to be used than in each input element.
  e.g. something like disabled="disabled"
  


in the inputs than i would like to use the above setted variable.
somthing like :



is this possible? can somebody help? any other suggestions?

thx in advance


mit freundlichen Grüßen 

Georg XL. Mouratidis 
Web Application Developer 

Heiler|Software AG 
Mittlerer Pfad 9 
D-70499 Stuttgart 

Tel: 0711-139 84-265
Fax: 0711-866 63 01 
Email: [EMAIL PROTECTED] 

Connecting Buyer and Supplier
http://www.heiler.com 

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



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


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



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




RE: dynamically disable a input field.

2002-12-10 Thread shirishchandra . sakhare
Hi,
I had similar functionality.But I will advice u not to use  because it does not work with Netscape.
So instead i used logic:equal tag and bean write.

 
  

   
 
//Also use html:hidden if u stil want to pass the parameter in request 
  


hope this helps..
regards,
Shirish
-Original Message-
From: GMouratidis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 12:40 PM
To: struts-user
Cc: GMouratidis
Subject: dynamically disable a input field.


Greetings

i want to disable some input elements but only if a bean property is not set:

e.g.



here i want to set a variable to be used than in each input element.
  e.g. something like disabled="disabled"
  


in the inputs than i would like to use the above setted variable.
somthing like :



is this possible? can somebody help? any other suggestions?

thx in advance


mit freundlichen Grüßen 

Georg XL. Mouratidis 
Web Application Developer 

Heiler|Software AG 
Mittlerer Pfad 9 
D-70499 Stuttgart 

Tel: 0711-139 84-265
Fax: 0711-866 63 01 
Email: [EMAIL PROTECTED] 

Connecting Buyer and Supplier
http://www.heiler.com 

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



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




RE: Re: Best Practices for Logging?

2002-12-10 Thread shirishchandra . sakhare
I had not checked this.Had taken what log4j documentation says about 
performance verbatim...

BTW,I didnt get your comment about 
**
In particular, under a Tag library for Tomcat 4.0.X [where tags are not 
reused]
*

Are the tags reused on other servers?
And what do u mean by reused?Do u mean Tag instance or something?
My understanding of Tags is that they are like handlers...So the compiled 
servlet for jsp calls this handlers various methods on tag when it comes across 
the tag.

regards,
Shirish



-Original Message-
From: rimovm [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 9:01 PM
To: struts-user
Cc: rimovm
Subject: RE: Re: Best Practices for Logging?


At 10:49 AM 12/9/2002 +0100, you wrote:
>Just some addition to this logging discussion.
>If u are using log4j , then in any case,there wil be 1 instance per class and
>not per object.BEcause logger instances are named entities and they are
>cached.So if u ask for the same logger again(same class name I mean), u will
>retrieve same instance.New instance will not be created.I dont know how other
>logger implementations used in commons logging work.So u dont add any
>performance advantage by making them static.

Hi Shirish and all,

Actually, I have to disagree here.  Yes it is true that the Log4j Log 
manager only holds one instance of the logger class, but I've done some 
profiling and found that Logger.getLogger(String) can take significantly 
more CPU cycles than just referring to your static instance.  In 
particular, under a Tag library for Tomcat 4.0.X [where tags are not 
reused], this was resulting in significant overhead. [IIRC about 10-15% of 
the CPU time.]

Of course, using static variables can cause class reloading problems.. so 
it is kind of a "six of one, half-dozen of the other" situation.  What you 
end up doing in the long run is your choice... but people do need to know 
that constructing logs DOES take CPU time.

 -Mike



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



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




RE: collections in forms((correction in Form code to make it work))

2002-12-10 Thread shirishchandra . sakhare
Hi,
There was a problem in the sample FOrm Bean code I have given.
The getEmployee (int Index){
}method should be modified as follows

/*
instead of if(index >= beanList.size()){
beanList.add(new Employee());
}
now I have made it 
while(index >= beanList.size()){
beanList.add(new Employee());
}
/***

public class EmployeeListForm extends ActionForm {

public Employee getEmployee(int index){

while(index >= beanList.size()){
beanList.add(new Employee());
}
return (Employee)beanList.get(index);
}

}

-Original Message-
From: drew.zimber [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 5:36 PM
To: drew.zimber; Sakhare, Shirishchandra; drew.zimber
Subject: RE: collections in forms




hi,

Thank you for the explanation and sample code.  Everything seems to make
sense but i have implmented your example and cannot get it working.   The
biggest reason is because the jsp does not like your custom tag to display
the values.  could you take a look at it again and see if it is correct:

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



">
">




thank you!
dz



-Original Message-
From: Drew Zimber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 4:55 PM
To: 'Struts Users Mailing List'
Subject: RE: collections in forms




thanks for the reply...i was busy doing something else but i will get back
to you tomorrow after some testing

dz

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 9:59 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: collections in forms


Hi,
If u are displaying the screen as text fields(using html:text tag),what ever
u
show on screen will be retained as all the data gets resubmitted back and
struts repopulates teh form again with the data.
But if u are showing a read only data on screen using bean:write tag,then
the
data will nto be retained as bean write tag does not include parameters in
request.So in this case if u want to retain the data, u should also use
html:hidden for each bean write u want to retain so that when the form is
submitted, the data is resent back.

I am giving some sample code...GO through it.Hope it helps.

//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
// teh fporm is populated properly.
if(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" %>



">
">



***





-Original Message-
From: drew.zimber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 3:07 PM
To: struts-user
Subject: collections in forms



hey all...

i've used struts quite a bit now, but im not too well versed with
manipulating collections in form objects.  I had thought there w

RE: newbie question - tags in JSTL vs Struts

2002-12-09 Thread shirishchandra . sakhare
there are some posts in  the mailing list archive on struts:el tags  which 
discuss the same..


-Original Message-
From: agrawalanuj [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 3:45 PM
To: struts-user
Cc: agrawalanuj
Subject: RE: newbie question - tags in JSTL vs Struts


Wow! Thanks Shirish and David!  This mailing list is GREAT! :)

I figured i would get answers like that.  So the follow-up question is "will
Struts ever phase out some of these 'duplicated' tag functionality?" :)

Thanks.
Anuj.

> -Original Message-
> From: David Graham [mailto:[EMAIL PROTECTED]]
>
> I always use JSTL over Struts when possible.  I only import the
> Struts html
> taglib and use the JSTL for everything else.

> -Original Message-
> From: [EMAIL PROTECTED]
>
> I think u should use struts tags only when there is no
> corresponding jstl tag..
> reason being jstl is THE STANDARD tag library...SO stick to it as far as
> possible ...
>
> -Original Message-
> From: agrawalanuj [mailto:[EMAIL PROTECTED]]
>
> I'm trying to figure out how to decide when to use a JSTL tag and when to
> use a Struts tag - more so when the tags have similar functionality (e.g.
> for looping and for conditional statements).
>
> How do you folks decide when to use one over the other?  Are there special
> circumstances when you *have* to use one over the other?


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



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




RE: newbie question - tags in JSTL vs Struts

2002-12-09 Thread shirishchandra . sakhare
I think u should use struts tags only when there is no corresponding jstl tag..
reason being jstl is THE STANDARD tag library...SO stick to it as far as 
possible ...

-Original Message-
From: agrawalanuj [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 3:29 PM
To: struts-user
Cc: agrawalanuj
Subject: newbie question - tags in JSTL vs Struts


I'm enjoying using Struts very much. :)

I'm trying to figure out how to decide when to use a JSTL tag and when to
use a Struts tag - more so when the tags have similar functionality (e.g.
for looping and for conditional statements).

How do you folks decide when to use one over the other?  Are there special
circumstances when you *have* to use one over the other?


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



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




RE: does ActionForm support inheritance field

2002-12-09 Thread shirishchandra . sakhare
if u cans end sample code(the form classs relavent code and jsp), may be 
somebody can help u...
But there is no reason for struts to impose any such restriction ..

-Original Message-
From: dwang [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 3:28 PM
To: struts-user
Cc: dwang
Subject: does ActionForm support inheritance field


Hello,
Sorry to send the question again.  But I didn't see the message appearing on
the mailing list for some reasons.  Besides the previous message has a wrong
return email address.

I have an ActionForm, which includes a field/getter/setter of subclass.  The
subclass inherits the description field/getter/setter method from its
superclass.
In my JSP page, I try to access the description.  But it is complained "no
getter method for subclass.description in the ActionForm".
Does anybody have any clue?  Is it a limitation of Struts?
Thanks.
Denis



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



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




RE: Re: No bean found under attribute key - any config problem?

2002-12-09 Thread shirishchandra . sakhare
No.U are not getting it right.
U should understand the flow of struts for this.

For the bean to get instantiated, it has to associated with some action.
And from u r config file, it looks that u have mapped the form to /customer 
action.So if u call this customer action first, then in the action say 
mapping.findForward("success") and change the mapping for action as follows.

 
>  type="org.ig.shopone.web.actions.CustomerAction" name="customerForm"
> scope="request"/>
 
> 

then this will work.

If u are directly calling jsp, there is no way the form bean will be available.

And the tag does not create any bean.It accesses the bean avaiblable 
already(generally created in action..)

And it works without the logic tag is because in rest of u r page, u are not 
refering to any of bean attributes.i.e. form bean is not referred.

regards,
Shirish

-Original Message-
From: satyanarayana [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 2:13 PM
To: struts-user
Cc: satyanarayana
Subject: Re: No bean found under attribute key - any config problem?


Hi,

I am using Tomcat 4.1.1
I didn't configured any action forwards..

I think the main problem is with logic:equal usage I think the bean is
not getting instantiated.

Its working fine without any logic:equal tags in my JSP... but to add extra
functionality, I have to use logic:equal tag

Thanks

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 6:27 PM
Subject: RE: No bean found under attribute key - any config problem?


> What do u mean by executing the jsp?
> The way u have done configuration, there will not be any problem if u are
> calling the CustomerAction and the CustomerAction action is doing a
forward to
> the jsp.
> BEcause then only the form bean will be available.
>
> How u are executing the jsp?
>
>
> -Original Message-
> From: satyanarayana [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 1:57 PM
> To: struts-user
> Cc: satyanarayana
> Subject: No bean found under attribute key - any config problem?
>
>
> Greetings,
>
> I am new to Struts list
> I am getting an exception with the message "No bean found under attribute
key
> customerForm" when I am accessing the JSP where in which I am using the
> logic:equal tag. I am using this tag to check whether a formbean variable
> (called action) value is equal to "new" or not.
> I have configured the formbean with the name customerForm in the config
file.
> and I am sure that the bean is in classpath.
> I am in need of the corrective action to solve the problem
> The following are the details..
>
> Thanks,
> Satya
> 
>
> I have written an Action Form class called org.ig.shopone.web.CustomerForm
that
> is having following 6 fields with public getter and setter methods (along
with
> validate and reset methods)..
>
> private String name;
> private String address;
> private String customerId;
> private String password;
> private String password2;
> private String action;
>
> I am using the above Form in a JSP to check whether the action field value
is
> "new" or "edit".
>
> 
> 
>  value="new">
> 
> 
>  value="new">
> 
> 
> 
> 
> 
> 
> ...
> ..
> When I am executing the above JSP file I am getting the following
Exception
>
> --
--
> --
> HTTP Status 500 -
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
from
> fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: No bean found under attribute key
> customerForm
> void
>
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpS
ervl
> etRequest, javax.servlet.http.HttpServletResponse, boolean)
> JspServletWrapper.java:248
> void
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS
ervl
> etRequest, javax.servlet.http.HttpServletResponse, java.lang.String,
> java.lang.Throwable, boolean)
> JspServlet.java:289
> void
>
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR
eque
> st, javax.servlet.http.HttpServletResponse)
> JspServlet.java:240
> ...
> 
> --
--
> --
>
> The following is the configuration file
>
> 
>  Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
> 
> 
> 
> 
> 
>  type="org.ig.shopone.web.actions.CustomerAction" name="customerForm"
> scope="request"/>
> 
> 
> 
>
> --
--
> --
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:


RE: No bean found under attribute key - any config problem?

2002-12-09 Thread shirishchandra . sakhare
What do u mean by executing the jsp?
The way u have done configuration, there will not be any problem if u are 
calling the CustomerAction and the CustomerAction action is doing a forward to 
the jsp.
BEcause then only the form bean will be available.

How u are executing the jsp?


-Original Message-
From: satyanarayana [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 1:57 PM
To: struts-user
Cc: satyanarayana
Subject: No bean found under attribute key - any config problem?


Greetings,

I am new to Struts list
I am getting an exception with the message "No bean found under attribute key 
customerForm" when I am accessing the JSP where in which I am using the 
logic:equal tag. I am using this tag to check whether a formbean variable 
(called action) value is equal to "new" or not.
I have configured the formbean with the name customerForm in the config file. 
and I am sure that the bean is in classpath.
I am in need of the corrective action to solve the problem
The following are the details..

Thanks,
Satya


I have written an Action Form class called org.ig.shopone.web.CustomerForm that 
is having following 6 fields with public getter and setter methods (along with 
validate and reset methods).. 

private String name;
private String address;
private String customerId;
private String password;
private String password2;
private String action;

I am using the above Form in a JSP to check whether the action field value is 
"new" or "edit".













...
..
When I am executing the above JSP file I am getting the following Exception


--
HTTP Status 500 - 
type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

org.apache.jasper.JasperException: No bean found under attribute key 
customerForm
void 
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServl
etRequest, javax.servlet.http.HttpServletResponse, boolean)
JspServletWrapper.java:248
void 
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServl
etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, 
java.lang.Throwable, boolean)
JspServlet.java:289
void 
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletReque
st, javax.servlet.http.HttpServletResponse)
JspServlet.java:240
...


--

The following is the configuration file 


http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>











--


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




RE: Question about adding ActionErrors

2002-12-09 Thread shirishchandra . sakhare
that makes sense...May be u are right..

-Original Message-
From: andrew.david.hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 10:54 AM
To: struts-user
Subject: RE: Question about adding ActionErrors


I thought it was normally request scope?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 17:44
To: [EMAIL PROTECTED]
Subject: RE: Question about adding ActionErrors


I think the errors are saved in session not in form.

-Original Message-
From: MohanR [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 7:27 AM
To: struts-user
Cc: MohanR
Subject: RE: Question about adding ActionErrors


Hi,
We are validating against the database in the LoginAction through a
business delegate. I think the validation in the form would be limited to
checking for null or spaces...

A related question.

In my action, I use saveErrors. How are the 'errors' saved inside the
form ?

Thanks,
Mohan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 08, 2002 1:24 AM
To: Struts Users Mailing List
Subject: Question about adding ActionErrors


Hi,

i have a LoginForm ( ValidatorForm ), which will validate if username and
password is entered. Ok, but after this i have to probe if the entered
username/password combination really exists in the database.

My question is where to perform the database-check ... in the LoginForm by
overriding the validate method or in the requested Action ( /Login.do ) ?

It seems to me a litte bit confusing that a ValidatorForm should make a
database-connect instead of the Action.

Any help would be appreciated.

Jan Zimmek



--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:



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



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




RE: Re: Best Practices for Logging?

2002-12-09 Thread shirishchandra . sakhare
Just some addition to this logging discussion.
If u are using log4j , then in any case,there wil be 1 instance per class and 
not per object.BEcause logger instances are named entities and they are 
cached.So if u ask for the same logger again(same class name I mean), u will 
retrieve same instance.New instance will not be created.I dont know how other 
logger implementations used in commons logging work.So u dont add any 
performance advantage by making them static.

regards,
Shirish

-Original Message-
From: ekbush [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 9:38 PM
To: struts-user
Cc: ekbush
Subject: Re: Best Practices for Logging?


Sri Sankaran wrote:

>>-Original Message-
>>From: Matt Raible [mailto:[EMAIL PROTECTED]] 
>>Sent: Friday, December 06, 2002 1:34 PM
>>To: [EMAIL PROTECTED]
>>Subject: Best Practices for Logging?
>>
>>
>>I'm wondering what is considered the best practice for logging using 
>>commons-logging in a Struts app.  My current approach is to 
>>have a Base 
>>class in every package that has the following:
>>
>>protected Log log =
>> LogFactory.getLog("my.package.name");
>>
>>But I've noticed that some of the Struts examples have an instance of 
>>this in every class.  
>>
>>
>Personally I prefer the class level.  This provides you with a finer grain of 
control.  However, I restrict it to only one per class and not one per object
>
>public class Foo {
>  private static Log log = LogFactory.getLog(Foo.class);
>  ..
>}
>
General consensus seems to be that this is the "best practice" approach. 
 You wind up with more loggers, but they give you very fine-grained 
control as Sri mentioned.  You can still set a log-level for a package, 
but you then also have the ability to manipulate the log-level on a per 
class basis too - so you can relaly "zoom-in" on things.

>>Is this recommended, so that logging 
>>can be done 
>>on a class level, as well as a package level?  Any thoughts/opinions 
>>are appreciated.
>>
It should be a static member as per what Sri shows (so you only have one 
per class).  Yes - it's so you can control logging on a package/class 
basis.

>>Thanks,
>>
>>Matt
>>
>>
>Sri
>

-- 
Eddie Bush





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



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




RE: Re: Best Practices for Logging?(pne more addition..:-)))

2002-12-09 Thread shirishchandra . sakhare
Also I think one more thing that is important to do when using log4j in web 
application is to use NDC(nested diagnostic context).AS the web server is 
mulitthreaded, this becames very important so that u can keep track of the 
logging for a perticular user by addingd his session id in the NDC .Else the 
logging is absolutely meaning less as there will be so many log enreies by 
different threads for different requests and u cant see whats happening for a 
perticzular user.
More information about Nested Diagnostic context can be found at:
http://jakarta.apache.org/log4j/docs/manual.html


regards,
Shirish

-Original Message-
From: ekbush [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 9:38 PM
To: struts-user
Cc: ekbush
Subject: Re: Best Practices for Logging?


Sri Sankaran wrote:

>>-Original Message-
>>From: Matt Raible [mailto:[EMAIL PROTECTED]] 
>>Sent: Friday, December 06, 2002 1:34 PM
>>To: [EMAIL PROTECTED]
>>Subject: Best Practices for Logging?
>>
>>
>>I'm wondering what is considered the best practice for logging using 
>>commons-logging in a Struts app.  My current approach is to 
>>have a Base 
>>class in every package that has the following:
>>
>>protected Log log =
>> LogFactory.getLog("my.package.name");
>>
>>But I've noticed that some of the Struts examples have an instance of 
>>this in every class.  
>>
>>
>Personally I prefer the class level.  This provides you with a finer grain of 
control.  However, I restrict it to only one per class and not one per object
>
>public class Foo {
>  private static Log log = LogFactory.getLog(Foo.class);
>  ..
>}
>
General consensus seems to be that this is the "best practice" approach. 
 You wind up with more loggers, but they give you very fine-grained 
control as Sri mentioned.  You can still set a log-level for a package, 
but you then also have the ability to manipulate the log-level on a per 
class basis too - so you can relaly "zoom-in" on things.

>>Is this recommended, so that logging 
>>can be done 
>>on a class level, as well as a package level?  Any thoughts/opinions 
>>are appreciated.
>>
It should be a static member as per what Sri shows (so you only have one 
per class).  Yes - it's so you can control logging on a package/class 
basis.

>>Thanks,
>>
>>Matt
>>
>>
>Sri
>

-- 
Eddie Bush





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



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




RE: Question about adding ActionErrors

2002-12-09 Thread shirishchandra . sakhare
I think the errors are saved in session not in form.

-Original Message-
From: MohanR [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 7:27 AM
To: struts-user
Cc: MohanR
Subject: RE: Question about adding ActionErrors


Hi,
We are validating against the database in the LoginAction through a
business delegate. I think the validation in the form would be limited to
checking for null or spaces...

A related question.

In my action, I use saveErrors. How are the 'errors' saved inside the
form ?

Thanks,
Mohan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 08, 2002 1:24 AM
To: Struts Users Mailing List
Subject: Question about adding ActionErrors


Hi,

i have a LoginForm ( ValidatorForm ), which will validate if username and
password is entered. Ok, but after this i have to probe if the entered
username/password combination really exists in the database.

My question is where to perform the database-check ... in the LoginForm by
overriding the validate method or in the requested Action ( /Login.do ) ?

It seems to me a litte bit confusing that a ValidatorForm should make a
database-connect instead of the Action.

Any help would be appreciated.

Jan Zimmek



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



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




RE: How is property field used in errors.add

2002-12-09 Thread shirishchandra . sakhare
The property can  be used if you want to display the error message next to a 
specific field on the jsp page.
So after the form  adds the errors, on the resulting jsp, if u have something 
like
  wil make the error 
to be displayed next to the html:text tag..

regards,
Shirish

-Original Message-
From: norman.klein [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 8:48 PM
To: struts-user
Subject: How is property field used in errors.add



We are using just standard validation using a validate method within the
ActionForm

There are a series of validations, which look like the following:

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if (getCG_Branch() == null || getCG_Branch().length() < 1) {
errors.add("CG_Branch", new
ActionError("errors.required", "Contact General: Branch"));
System.out.println("getCG_Branch failed.
Contact_General_LoanAction will not executed");
}

return errors;
}

The "Contact General: Branch" is passed as a parameter to errors:required
(which is specified in the ApplicationsResources.properties file)

{0} is required

According to the Struts documentation, the "errors.add" call

void add(java.lang.String property, ActionError error) 
Add an error message to the set of errors for the specified
property.

So what functionality does this specified property provide??

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



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




RE: E: E: setting form attributes within jsp

2002-12-06 Thread shirishchandra . sakhare
I forgot to add one more thing.
U had also mentioned that the form has the logic to get the list data from 
database.

In our project we had lot of problems because some of  the forms were directly 
getting data from database to populate lists etc in case of errors.
So i will say that you should avoid mixing model layer lggic(data access)in the 
form.If form needs any data let it go through action which interacts with Model 
to get the data.This seems a bit too much in some cases.But this keeps the 
design clean,.And u use the form classes the way they are meant to be.(Forms to 
collect data).

regards,
shirish


-Original Message-
From: meissa.Sakho [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 2:50 PM
To: struts-user
Cc: meissa.Sakho
Subject: Réf. : RE: E: setting form attributes within jsp



I'll try the approach 2 cause'it seems like much more flexible for me.
Thank you Shirish for your advices.

Meissa


|-+-->
| |   shirishchandra.sakh|
| |   [EMAIL PROTECTED]|
| |  |
| |   06/12/2002 11:57   |
| |   Veuillez répondre à|
| |   "Struts Users  |
| |   Mailing List"  |
| |  |
|-+-->
  
>---
|
  | 
  |
  |   Pour :[EMAIL PROTECTED]  
  |
  |   cc :  
  |
  |   Objet :   RE: E: setting form attributes within jsp   
  |
  
>---
|




There are 2 approaches to this problem .
For the perticular action, change the input mapping to the action u want to

forward control to in case of error(which in your case will be the error
handler action which repopulates the data in the form from database and
sends
back to same jsp).
And in the error handler action , the success forward will point back to
same
jsp.

Approach 2:
In my case, i have conditional error behaviour.SO depending on what error
occurs, i want to forwqard to different pages/Actions.So in this case,Do as

folows.In the Action mapping for action , disable the
validation(validate=false).And in the actions perform method,call the
different
validate methods on form i have defined.And there conditionally decide
which
forward to use.

But in your case , as u dont seem to have conditional error forward
behaviour,
u can go ahead with first approach.

Hope this helps.
Regards,
Shirish

-Original Message-
From: meissa.Sakho [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 9:12 AM
To: struts-user
Cc: struts-user
Subject: Réf. : RE: setting form attributes within jsp



Shirish,
The solution you suggest me is quite good for me and is
near to my approach. In my ActionForm, I have a restoreDatas
method which is called to repopulate datas in case of validation errors.
This is a little bit cumbersome. Because I have to go back to the database
from the ActionForm.

Can you tell me in your case, how you are doing to forward to another
action when a validation fails(from ActionForm). The only way I know to
detect validation
failure is to call ActionErrors.isEmpty()  method. And as I know, It' the
input
of the action that called back .

regards,
Meissa



|-+-->
| |   shirishchandra.sakh|
| |   [EMAIL PROTECTED]|
| |  |
| |   05/12/2002 17:15   |
| |   Veuillez répondre à|
| |   "Struts Users  |
| |   Mailing List"  |
| |  |
|-+-->

>
---

|
  |

  |
  |   Pour :[EMAIL PROTECTED]

  |
  |   cc :

  |
  |   Objet :   RE: setting form attributes within jsp

  |

>
---

|




Ok.I got your problem.
But as U dont want to put the collection in session , the only way out is
to
get it back from model and populate it in the form before sending it to
jsp.
I th

RE: Re: Pass a ActionForward via the session.

2002-12-06 Thread shirishchandra . sakhare
Hi,
U can definately do this.BEcause forward is nothing else but another java 
object.So u can put it in session scope(i will prefer request scope if its just 
to share between 2 actions which are handling same request).Also about handling 
it in servlet i dont think it is a good idea as this is just a very specific 
behaviour related to one action .So it should not be moved to servlet which is 
the controller.

regards,
Shirish

-Original Message-
From: marklowe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 6:26 PM
To: struts-user
Cc: marklowe
Subject: Re: Pass a ActionForward via the session.


I guess you could..

Just define forward one to fire up action2

Forward1 does /secondaction.do

But cant you mess with the session in the action servlet  and then forward?

Cheers amrk

On 5-12-2002 18:22, "ROSSEL Olivier" <[EMAIL PROTECTED]> wrote:

> I wish to pass an ActionForward to an action via the session.
> Is it possible?
> 
> Action1 has several forward available.
> It saves on ein the session.
> 
> Action2 retrieves this forward from the session, and use it
> to forward there.
> 
> 
> ---cut here---
> 
> 
> This e-mail is intended only for the above addressee. It may contain
> privileged information. If you are not the addressee you must not copy,
> distribute, disclose or use any of the information in it. If you have
> received it in error please delete it and immediately notify the sender.
> Security Notice: all e-mail, sent to or from this address, may be
> accessed by someone other than the recipient, for system management and
> security reasons. This access is controlled under Regulation of
> Investigatory Powers Act 2000, Lawful Business Practises.
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 


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



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




RE: E: setting form attributes within jsp

2002-12-06 Thread shirishchandra . sakhare
There are 2 approaches to this problem .
For the perticular action, change the input mapping to the action u want to 
forward control to in case of error(which in your case will be the error 
handler action which repopulates the data in the form from database and sends 
back to same jsp).
And in the error handler action , the success forward will point back to same 
jsp.

Approach 2:
In my case, i have conditional error behaviour.SO depending on what error 
occurs, i want to forwqard to different pages/Actions.So in this case,Do as 
folows.In the Action mapping for action , disable the 
validation(validate=false).And in the actions perform method,call the different 
validate methods on form i have defined.And there conditionally decide which 
forward to use.

But in your case , as u dont seem to have conditional error forward behaviour, 
u can go ahead with first approach.

Hope this helps.
Regards,
Shirish

-Original Message-
From: meissa.Sakho [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 9:12 AM
To: struts-user
Cc: struts-user
Subject: Réf. : RE: setting form attributes within jsp



Shirish,
The solution you suggest me is quite good for me and is
near to my approach. In my ActionForm, I have a restoreDatas
method which is called to repopulate datas in case of validation errors.
This is a little bit cumbersome. Because I have to go back to the database
from the ActionForm.

Can you tell me in your case, how you are doing to forward to another
action when a validation fails(from ActionForm). The only way I know to
detect validation
failure is to call ActionErrors.isEmpty()  method. And as I know, It' the
input
of the action that called back .

regards,
Meissa



|-+-->
| |   shirishchandra.sakh|
| |   [EMAIL PROTECTED]|
| |  |
| |   05/12/2002 17:15   |
| |   Veuillez répondre à|
| |   "Struts Users  |
| |   Mailing List"  |
| |  |
|-+-->
  
>---
|
  | 
  |
  |   Pour :[EMAIL PROTECTED]  
  |
  |   cc :  
  |
  |   Objet :   RE: setting form attributes within jsp  
  |
  
>---
|




Ok.I got your problem.
But as U dont want to put the collection in session , the only way out is
to
get it back from model and populate it in the form before sending it to
jsp.
I think in such case if u dont want to keep the list in session but
repopulate
it on validation error(Like a country list on a user input form..)you can
forward to another action in case of error which will repopulate the form
with
the collection.and then forward it back to the same jsp.

We have pretty much similar functionality.And u can even have a generic
action
class which will just populate the forms in case of errors and send them
back
to jsps.

regards,
Shirish

-Original Message-
From: meissa.Sakho [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 4:56 PM
To: struts-user; meissa.Sakho
Subject: setting form attributes within jsp


Hi all,

I would like to set some of my form attributes within the jsp so that
to be able to get it back when the form validation fails.
the conserned attribute is a collection and I don't want to put in in the
session.

I've tried the jsp setProperty tag in vain.

the attributes have getters and setters method in the ActionForm bean.

can someone help me about that

Thanks

meissa



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



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







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



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




RE: setting form attributes within jsp

2002-12-05 Thread shirishchandra . sakhare
Ok.I got your problem.
But as U dont want to put the collection in session , the only way out is to 
get it back from model and populate it in the form before sending it to jsp.
I think in such case if u dont want to keep the list in session but repopulate 
it on validation error(Like a country list on a user input form..)you can 
forward to another action in case of error which will repopulate the form with 
the collection.and then forward it back to the same jsp.

We have pretty much similar functionality.And u can even have a generic action 
class which will just populate the forms in case of errors and send them back 
to jsps.

regards,
Shirish

-Original Message-
From: meissa.Sakho [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 4:56 PM
To: struts-user; meissa.Sakho
Subject: setting form attributes within jsp


Hi all,

I would like to set some of my form attributes within the jsp so that
to be able to get it back when the form validation fails.
the conserned attribute is a collection and I don't want to put in in the
session.

I've tried the jsp setProperty tag in vain.

the attributes have getters and setters method in the ActionForm bean.

can someone help me about that

Thanks

meissa



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



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




RE: Collection iterate question!

2002-12-05 Thread shirishchandra . sakhare
use logic iterate tag.
And use the indexid attribute to decide whether its even or odd row..

I think the type of IndexId Bean is Integer (or BigDecimal).So get value from 
it.
<%!int index=0;%>
<%!boolean show=false;%>


<% show = (index == (indexId.getInt()%2));%>
<%if(show ){%>
blh blah blah
<%}%>


//not sure which method to use here..indexId.getInt().Check the class  of 
indexId..and use accordingly

-Original Message-
From: jana.navaneethan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 4:58 PM
To: struts-user
Subject: Collection iterate question!


Hi ,
I have a collection in my JSP, I want to iterate this collection and
display even rows only. Is there a way to do this?
Any help would be greatly appreciated!

Thanks in advance,
Jana.

<%
  java.util.ArrayList paymentListOdd = new java.util.ArrayList();
  paymentListOdd.add("American Express");
  paymentListOdd.add("Credit Terms Available");
  paymentListOdd.add("Diner's Club");
  paymentListOdd.add("Mastercard");
  paymentListOdd.add("Financing Available");
  paymentListOdd.add("Traveler's Check");
  pageContext.setAttribute("paymentListOdd", paymentListOdd,
PageContext.PAGE_SCOPE);
%>


 
 
   
   



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



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




RE: collections in forms

2002-12-05 Thread shirishchandra . sakhare
Hi,
If u are displaying the screen as text fields(using html:text tag),what ever u 
show on screen will be retained as all the data gets resubmitted back and 
struts repopulates teh form again with the data.
But if u are showing a read only data on screen using bean:write tag,then the 
data will nto be retained as bean write tag does not include parameters in 
request.So in this case if u want to retain the data, u should also use 
html:hidden for each bean write u want to retain so that when the form is 
submitted, the data is resent back.

I am giving some sample code...GO through it.Hope it helps.

//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
// teh fporm is populated properly.
if(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" %>



">
">



***





-Original Message-
From: drew.zimber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 3:07 PM
To: struts-user
Subject: collections in forms



hey all...

i've used struts quite a bit now, but im not too well versed with
manipulating collections in form objects.  I had thought there was a way to
set up your forms/pages so that if you display a collection on screen and
submit back, the form in the least retains the collection in the action
class (an update would be nice too, but step by step i guess).

everytime i submit back to a form, the Collection comes back null.  Can
anyone give me some info/links/ideas on this so i dont have to rely on the
session so much?


thx!
dz


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



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




RE: Loosing form data when chaining actions

2002-12-04 Thread shirishchandra . sakhare
Hi,
To ensure that The same form is being shared,u neeed to make sure that the name 
and scope attributes for both the actions are same.
And in As  the second point VEDRE  mentioned,  u dont ned to keep the form in 
the session scope as the actions are directly called one after another so are 
sharing the teh same request object and so the form as well.And as far as 
possible, use of session scope should be avoided.

regards,
Shirish


-Original Message-
From: VEDRE [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 10:25 PM
To: struts-user
Cc: VEDRE
Subject: RE: Loosing form data when chaining actions



1. make sure u are not creating a new instance of the form bean in the
second action and you have name attribute for both the action mappings(they
should be same, since u are using same form in both actions).

2. if you are going from the first action to the second action directly(ie.,
first action is not forwarding to a view/jsp),u dont even have to keep the
form in session(request scope also works fine). struts uses the same form
instance in the second action if  it finds a form instance in request or
session added/filled in first action.

hope this helps ...

-Original Message-
From: Etienne Labonté [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 4:11 PM
To: Struts Users Mailing List (E-mail)
Subject: Loosing form data when chaining actions


Hi,

I defined 2 actions in session scope referring the same form. The first
action sets some properties in the form and then forwards the request to the
second action. The second action sets some more properties and then forwards
to a JSP page which contains the html form. The problem is only the data set
by the last action remains... This makes me think the form-bean is not
shared between actions. I understand this can be desired behaviour. Any
insight would be appreciated. thanks!



Etienne

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



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




RE: Re: Design Issue in struts

2002-12-03 Thread shirishchandra . sakhare
What u mean by dynamically generating a form?
Its a normal form(Extends ActionForm).
And the action to deal with will be what ever action u define to achieve this 
functionality.It will be a very simple action.
Home this clarifies the confusion.

regards,
Shirish

-Original Message-
From: marklowe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 3:11 PM
To: struts-user
Cc: marklowe
Subject: Re: Design Issue in struts


If you're dynamically generating a form, what action would deal with the
form produced?

I have this problem and i'm thinking of using standard java/jsp for this
problem now.. As I'd have to pass an array of values and one form element to
an action. 

Any thoughts on this issue will be gratfully recieved.

Thanks in advance

Mark


On 3-12-2002 12:10, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> Hi,
> I have implemented pretty much the same functionality in our application.
> U can do this using Struts actions.When the user presses a button,call an
> action.In the action add an empty row to the form(add a empty object to the
> list on form).And then call the same jsp which will just iterate over the list
> as earlier.
> //Pseudo code
> Form MyForm{
> List rowList = new ArrayList();
> public Bean getBean(int index){
> if(rowList.size < index){
> rowList.add(new Bean());
> }
> return rowList.get(index);
> }// getObject
> public void setBean(int index,Bean obj){
> rowList.setObject(index,obj);
> }//setBean
> //getter setter for list
> public List getRowList (){
> }
> public void setRowList (List list){
> }
> }//MyForm
> 
> //JSP //
> 
> 
>  \"].name\"%>">
>  \"].location\"%>">
> 
> 
> So when the action is called, all the data on screen will be preserved as the
> screen data gets repopulated in the form automatically.Then u add a new object
> and the jsp cretes new table with a empty row.
> 
> Hope this helps.
> Regards,
> Shirish
> 
> 
> -Original Message-
> From: graham.cook [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 03, 2002 11:30 AM
> To: struts-user
> Subject: Design Issue in struts
> 
> 
> 
> Can I use struts to perform the following task:
> 
> generate a JSP page, but have multiple entry lines on the page. Im not going
> to know how many lines the user is going to enter, so i'd like them to have
> some kind of way ( maybe a button ) that the user can click on, the page
> refreshes (retaining data) and shows a new blank line at the bottom of the
> page under the other lines. When im talking lines I mean eg. Name, Location,
> DOB, last contact
> 
> 
> ---
> 
> Security Code: 0162
> 
> Entry Date:  03/12/2002
> 
> 
> 
> NameLocationDOBLast Contact
> -----
> --
> FredWoking07/12/197311/11/2002
> BertWolverhampton04/11/197611/11/2002
> {Add}
> 
> 
> {Submit} {Reset}
> -
> 
> Then when the user presses SUBMIT the action is called and all data entered
> into a database.
> 
> Has anyone got some real world example of this
> Ta
> 
> 
> 
> **
> **
> 
> " This message contains information that may be privileged or confidential and
> is the property of the Cap Gemini Ernst & Young Group. It is intended only for
> the person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use 
> this message or any part thereof. If you receive this message in error, please
> notify the sender immediately and delete all copies of this message ".
> **
> **
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 


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



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




RE: Multibox

2002-12-03 Thread shirishchandra . sakhare
yes..U are right...

-Original Message-
From: donl34 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 2:57 PM
To: struts-user
Cc: donl34
Subject: Multibox


Hello,
I'm using struts 1.0.2.
I would like to present an input form on a jsp and part of that would be to
display a number of checkboxes.

Ted Husted writes:

To provide different sets of labels and values, the standard LabelValueBean
class [org.apache.struts.util.LabelValueBean] (since 1.1) can be used with
the multibox control.

  

  

  
  



  Question: what is "items" ? An arraylist containing LabelValueBean's ?



  Thanks

  Don







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



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




RE: Design Issue in struts

2002-12-03 Thread shirishchandra . sakhare
Hi,
I have implemented pretty much the same functionality in our application.
U can do this using Struts actions.When the user presses a button,call an 
action.In the action add an empty row to the form(add a empty object to the 
list on form).And then call the same jsp which will just iterate over the list 
as earlier.
//Pseudo code
Form MyForm{
List rowList = new ArrayList();
public Bean getBean(int index){
if(rowList.size < index){
rowList.add(new Bean());
}
return rowList.get(index);
}// getObject
public void setBean(int index,Bean obj){
rowList.setObject(index,obj);
}//setBean
//getter setter for list
public List getRowList (){
}
public void setRowList (List list){
}
}//MyForm

//JSP //


">
">


So when the action is called, all the data on screen will be preserved as the 
screen data gets repopulated in the form automatically.Then u add a new object 
and the jsp cretes new table with a empty row.

Hope this helps.
Regards,
Shirish


-Original Message-
From: graham.cook [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 11:30 AM
To: struts-user
Subject: Design Issue in struts



Can I use struts to perform the following task:

generate a JSP page, but have multiple entry lines on the page. Im not going
to know how many lines the user is going to enter, so i'd like them to have
some kind of way ( maybe a button ) that the user can click on, the page
refreshes (retaining data) and shows a new blank line at the bottom of the
page under the other lines. When im talking lines I mean eg. Name, Location,
DOB, last contact


---

Security Code: 0162

Entry Date:  03/12/2002



NameLocationDOB Last Contact
--- --
--
FredWoking  07/12/1973  11/11/2002
BertWolverhampton   04/11/1976  11/11/2002
{Add}


{Submit}{Reset}
-

Then when the user presses SUBMIT the action is called and all data entered
into a database.

Has anyone got some real world example of this
Ta





" This message contains information that may be privileged or confidential and 
is the property of the Cap Gemini Ernst & Young Group. It is intended only for 
the person to whom it is addressed. If you are not the intended recipient, you 
are not authorized to read, print, retain, copy, disseminate, distribute, or 
use 
this message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message ".




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



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




RE: Re: Re: newbie question from expierenced user

2002-11-27 Thread shirishchandra . sakhare
But how do i access Those different forms in The jsps ?because as far as i 
know,I use the name attribuite from action mapping of action to get the 
Formbean in jsps.And because of this, my understanding was that the forms are 
stored using the name as key in thier required scopes.
So in this case, both the form beans will have same name.And if as u said, 
attribute is used to store the forms, does it means that in the jsps to access 
the formbean, i need to use the attribute value instead of name now?

-Original Message-
From: gemes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 10:27 AM
To: struts-user
Cc: gemes
Subject: Re: Re: newbie question from expierenced user


2002. november 27. 10:15 dátummal [EMAIL PROTECTED] ezt írtad:
> Can you please explain how to use this attribute of action mapping?Do u
> mean that if same form is defined with two diferent scopes and same name,
> still u can reuse same instance,using attribute?

If you define it to different scope with the same name, then they will be 
found in the following order:

page -> request -> session -> application. 

So if you store with the same name in request and session scope, and you don't 
supply the bean:define the scope explicitely, only the request scope bean 
will be found.

If you intend to use the same formbean with 2 ActionMapping and you don't want 
to interfere these actions, then you add for both mappings the same "name" 
attribute and different "attribute" attribute. So both action will use the 
same type of form but store under different attribute.

Hth,

Tib 


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



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




RE: great error in struts! Include a JSP result of an Action in other JSP

2002-11-27 Thread shirishchandra . sakhare
Hi,
Refer to yesterdays similar problem.."Include an Action in a page".
I think if u want to include the result of a action in another jsp, using 
jsp:inlude  to call the action should work.But I have not tried this.But as 
using jsp include U can call a servlet as well(Thats what the documentation 
says),this should work.

Let me know if it works.
Regards,
Shirish

-Original Message-
From: trabajo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 12:57 PM
To: struts-user
Cc: trabajo
Subject: great error in struts! Include a JSP result of an Action in
other JSP


Hello everybody! :-)

I am trying the follow:

index.jsp:

<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>


  



templateIndex.jsp:

...

...


ultimaHoraAction.do:

...
req.setAttribute("var", var);
...
return mapping.findForward("a_JSP_page");


My goal is to include a_JSP_page (in wich there are struts-tags like
) in index.jsp... but dont work.

Dont work too the following, in index.jsp:



nor



nor



¡Nothing dont work! ¿How can I include the JSP result (with struts-tags like
) of an Action in other JSP page?

Thanks.


CARLOS GRIMA
· www.carlosgrima.com
· [EMAIL PROTECTED]
· MSN: carlos_grima (hotmail)


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



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




RE: Re: newbie question from expierenced user

2002-11-27 Thread shirishchandra . sakhare
Can you please explain how to use this attribute of action mapping?Do u mean 
that if same form is defined with two diferent scopes and same name, still u 
can reuse same instance,using attribute?

I checked the javadoc for attribuite of ActionMapping class.It does not give 
much idea about how to use it.

regards,
Shirish



-Original Message-
From: gemes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 9:20 AM
To: struts-user
Cc: gemes
Subject: Re: newbie question from expierenced user


2002. november 27. 08:56 dátummal Marcus Biel ezt írtad:
> What if I am using one form for different actions, using different
> scopes ?
> Could it be that that creates different ActionForms in different scopes
> of the same type ???

Yes. 

If you don't want to hide one form from the other you might want to use the 
"attribute" attribute of the ActionMapping. I use this in case of 2 session 
scope ActionForm of the same type.

Tib

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



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




RE: Include an Action in a page

2002-11-26 Thread shirishchandra . sakhare
I have not tried this but think this should work..

1: In Action 1, after getting the data,U say return 
maping.findForward("success");
2: success forward does a forward to u jsp1...

In jsp1,U first display data given by action1.
3: thenm after that u do a jsp:inlude which calls action 2.
4:action 2 gets the data and does a forward to jsp2 which shows data from 
action 2. and then does a jsp:include which calls action 3.
5:action 3 then gets the data and does a forward to jsp3 which displaya the 
data from action 3
So in effect u are doing something like
(Jsp1..includes jsp2 and jsp3.)

And if u want to use those actions in other context as well, then before doing 
those fiorwards, u will have to put a check to see where the request is coming 
from(you can use mapping.getParameter()).if its from some other page , then do 
the normal forward which may to another jsp without any includes..

Hope this helps,
Shirish

-Original Message-
From: miguel-angel.mulero [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:31 PM
To: struts-user
Subject: RE: Include an Action in a page


Hi,
I've got a page wich must execute 3 actions and print the page result of it:


 ACTION1

 AC2 | AC3


I wan't to make the three action independent, so I want to include them in
the principal with some include ( or  ...)

Some idea??

Thanks!!
Miguel

> -Mensaje original-
> De: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Enviado el: martes, 26 de noviembre de 2002 16:27
> Para: [EMAIL PROTECTED]
> Asunto: RE: Include an Action in a page
>
>
> Can u specify u r requirement please?
> Because if U need to show the output of 2 actions on the screen ,
> still they
> can use the forwards and use request as a shared container to
> pass along any
> data beans.
>
> but hwy a template needs to include action?
>
> -Original Message-
> From: miguel-angel.mulero [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 4:10 PM
> To: struts-user
> Subject: Include an Action in a page
>
>
> Hi all, I've got a little problem.
>
> I'm using Struts 1.0.2, and I'm using Templates (not Tiles). I use
>  to include a little page inside my page. This work great
> with HTML and JSP, but not with actions. How can I do it for:
>
> 
>
> Is there other way to do this?
>
> Thanks to all!!
> Miguel
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:



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



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




RE: Include an Action in a page

2002-11-26 Thread shirishchandra . sakhare
Can u specify u r requirement please?
Because if U need to show the output of 2 actions on the screen , still they 
can use the forwards and use request as a shared container to pass along any 
data beans.

but hwy a template needs to include action?

-Original Message-
From: miguel-angel.mulero [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:10 PM
To: struts-user
Subject: Include an Action in a page


Hi all, I've got a little problem.

I'm using Struts 1.0.2, and I'm using Templates (not Tiles). I use
 to include a little page inside my page. This work great
with HTML and JSP, but not with actions. How can I do it for:



Is there other way to do this?

Thanks to all!!
Miguel


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



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




RE: Re: struggling with indexed/repeating input fields

2002-11-19 Thread shirishchandra . sakhare
HI,
I think u are suggesting that every form has to be in session scope which is 
dangerous and will unnecessarily clog the session object.

If u have problems when calling setters on u r form because the list on form is 
smaller, i will suggest following approach.

public class MyForm {
private List objectList = new ArrayList();
//use arrayList instead of array as it does not force u to declare size
 public Object getObject(index i){
while(index >= this.getList().size() ){
this.getList().add(new Object());
}
return this.getList().getObject(index);
}
}

So in this case, when the setter is called,the form will be added with bean 
first nd then the setter will be called.
Try this approach and let me know.

Regards,
Shirish

-Original Message-
From: leomaciel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 5:43 PM
To: struts-user
Cc: leomaciel
Subject: Re: struggling with indexed/repeating input fields



I GOT IT!

I forgot to send the struts-config.xml and there were the difference


if I set the action scope="request" I get:
javax.servlet.ServletException: BeanUtils.populate
...
Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 0
or
Caused by: java.lang.NullPointerException

make sure you don't have scope="request" in your 



=== my struts-config.xml ===

  ...
  
  

...
















===
Try it out.

Cheers,
Leo



>From: "Leonardo Maciel" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: struggling with indexed/repeating input fields
>Date: Tue, 19 Nov 2002 15:33:04 +
>
>Kevin,
>
>I finally got
> ... 
>to work.
>
>The sample code came from
>http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12084.html
>Thank you Dave.
>
>I built Dave's code on top of struts-example. All necessary code is 
>attached.
>On the index.jsp page there are two links
>
>Iterate html:text indexed example
>
>From Dave Iterate html:text indexed 
>example
>
>The first one, indexed.do, doesn't work. Gives IndexOutOfBoundException.
>The second, ShowParameters.do, works. :D
>
>I still trying to figure out the differences between those two...
>
>Good luck!
>Leo
>
>
>
>>From: Kevin HaleBoyes <[EMAIL PROTECTED]>
>>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED]
>>Subject: struggling with indexed/repeating input fields
>>Date: Tue, 19 Nov 2002 07:10:15 -0800 (PST)
>>
>>I've asked this question several times on this mailing list but
>>I've never received an answer that would help.  I've dug a bit
>>deeper and understand more about the problem but I'm still really
>>struggling with indexed/repeating input fields so I thought I'd
>>ask again.  I'm starting to wonder if it is possible.
>>
>>In my ActionForm I have an array property that is initialized to
>>null (I don't know the values until the Action executes).
>>I have a getter
>>that returns the entire array and a setter that takes an array.
>>I also have indexed getters and setters.  The array is of another
>>class (that simply has two strings in it with the default/empty
>>constructor and getters and setters).
>>
>>In my (edit) action I construct an array and call the setter in the
>>action form instance (that I just created).  I then forward to a JSP
>>page that has a  tag and  tags all within
>>a form tag.  The form has a  that calls my save action.
>>The save action simply forwards to a "confirmation" JSP page that
>>has a similar iteration to display the input values.
>>
>>The initial "edit" form gets displayed properly - the expected
>>number of iterations are performed and the expected values of the
>>input fields is shown.  When I press the submit button things break.
>>I know that isn't terribly descriptive but "how" it breaks depends
>>on how I form the  tags - there are two cases that I've
>>tried.
>>
>>In the first case, I use the following in the "edit" JSP form:
>>
>>
>>   
>>   
>>
>>
>>As I said, it displays properly.  I change the "desc" text and hit
>>the submit button and end up getting an exception:
>>
>>   ApplicationDispatcher[/cml] Servlet.service() for servlet
>>jsp threw exception
>>   org.apache.jasper.JasperException: No collection found
>>
>>In the "save" action I printed the toString() of the input form
>>before forwarding to the JSP page and can see that the array is
>>in fact null.  Why is it null?  Who is responsible for instantiating
>>an array for that field - struts or the application?  If it is the
>>application, how can it know how big to make the array?
>>
>>
>>In the second case, I use the following in the "edit" JSP form:
>>
>>> property="lineItem" indexId="i">
>><% String prop1 = "lineItem[" + i + "].itemNo"; %>
>>
>><% String prop2 = "lineItem[" + i + "].desc"; %>
>>
>>
>>
>>Again, it displays properly.  I change the 

RE: struggling with indexed/repeating input fields

2002-11-19 Thread shirishchandra . sakhare
can you please explain the problem preperly?

If u are showing the list using html:text and pressing submitting button then 
there is no reason why the values will not be passed over.But as u are on the 
same form , all the rows will be submitted instead of just the one from where 
the button is pressed.
So is this u r probvloem that u just want the data from selected row but 
getting all the data?ansd dont know how to get just the selected rows data?

-Original Message-
From: dinesh.samson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 5:16 PM
To: struts-user
Subject: RE: struggling with indexed/repeating input fields


Greetings Kevin,

For me the iterate tag is working. But I have a problem.

My requirement is,

I will show a list, from which I will be selecting a particular detail
and click on edit in the same row. This will take some of the values in
that row and pass it on to the next jsp/action.

I am unable to get it working.

My iterate tag is working with indexed property and the html generated
also has items[i].name
But I am unable to get the value of the item in the selected row. 

Can you tell me how to get them! 

Thanx in advance

regards,
 
Dinesh Samson J



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



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




RE: Query regarding initialization of jsp form

2002-11-19 Thread shirishchandra . sakhare
If you are sure that 0 or 0.0 is never a valid value, one way of avoiding this 
will be to use struts  logic:notEqual tag.

Age =   


-Original Message-
From: kpbhat [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 2:48 PM
To: struts-user
Cc: kpbhat
Subject: Query regarding initialization of jsp form




Hi,

I am facing the following issue with regard to jsp form initialization by
struts
When a primitive data type such as int or double is used in the form bean ,
the corresponding jsp shows the
form elment initialized to 0 or 0.0 as the case may be.
 How do i prevent this from happening ?

However if the form bean attribute carries a valid value (say 5 or 6.56 etc)
, then the same must be displayed on the jsp.


Let me enumerate with an example

Suppose the form bean look like this

FromBeanA.java
{
double age ;

public void setAge(double age)
{
this.age = age;
}

public double getAge()
{
return this.age
}
}

--- And the jsp has the following


--
---

Age =   




then  the display of the jsp will look like this

Age = 0.0

I do not want 0.0 to appear


Thanks in advance,

Prakash













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



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




RE: (Newbie Question) How to use java code as attributes in struts tags

2002-11-19 Thread shirishchandra . sakhare
U need to put the scriptlet code also in double quotes...




-Original Message-
From: amerolla [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 11:30 PM
To: struts-user
Cc: amerolla
Subject: (Newbie Question) How to use java code as attributes in struts
tags


I searched the archives but couldn't find anything on this.

When I try to use java code or jsp tags as the value of an attribute
in a Struts tag element, I get a compilation error.

The specific example is:


  length=<%=causeCodeTable.getMaxDisplayValue()%>
  id="causeCodeRecord"
  type="com. ... .CauseCodeData"
  indexId="index">

I'm tying to display a subset of an array of objects starting at "offset"
and up to "length" entries. If I hardcode the values of offset and
length, it works exactly as I'd expect.

Any suggestions? Thanks in advance.

Tony Merolla


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



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




RE: jsp name in action

2002-11-19 Thread shirishchandra . sakhare
Hi Amit,
I think the struts way will be to define 3 different mappings to call the 
action class from the 3 different jsps.And in each mapping define 
parameter=jsp1 ,parameter =jsp2 etc.
In actiin class u can do,
String reqSource = mapping.getParameter();So this helps u to decide the request 
origin.I think the paremeter attribute of action mappings is meant for the same 
purpose.

regards,
Shirish

-Original Message-
From: amit [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 10:11 AM
To: struts-user
Cc: amit
Subject: jsp name in action


How can I get the jsp name in the action from where the form is submitted?

I can not use input attribute as it is the input type is not static, and the 
action class is called from three different jsps.

pls help.


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




RE: ArrayList disappeared in ActionForm

2002-11-15 Thread shirishchandra . sakhare
Hi,
I didnt understand your problem very well.But some points U should know.

> I use the log4j, and the constructor of the ActionForm isn't 
> called. The set for the ArrayList isn't called too.

Struts uuses Class.forName() .newInstance() to instantiate new form objects.
So the default constructor will be called in this case.So Any lists etc u need 
to set must Be initialised in the default constructor.

-Original Message-
From: Sri.Sankaran [mailto:Sri.Sankaran@;sas.com]
Sent: Friday, November 15, 2002 3:18 PM
To: struts-user
Subject: RE: ArrayList disappeared in ActionForm


Intermixed...

> -Original Message-
> From: Míguel Ángel Mulero Martínez 
> [mailto:miguel-angel.mulero@;mad.tecsidel.es] 
> Sent: Friday, November 15, 2002 2:03 AM
> To: Lista Struts
> Subject: ArrayList disappeared in ActionForm
> 
> 
> Hi all! I've got a little problem with Struts 1.0.2.
> 
> I've got an ActionForm with two objects: one for save the 
> values of a HTML form, and an ArrayList with Strings to print 
> in the HTML form.

I don't follow.  Why do you need separate objects for display and for capture.  
That  is the purpose of the ActionForm.

> 
> The HTML form inits well, reading the values (object and 
> ArrayList) from the ActionForm created in an Action before. 
> When I press the submit button, the reset function is called 
> and afterwards the object is updated with the new values. My 
> problem is that if I read the ArrayList, it is null.

How do the objects in your ActionForm map to your ArrayList.  Need to see some 
code.  Send appropriate sections of your JSP, form-bean (ActionForm) and Action 
class.

> 
> I use the log4j, and the constructor of the ActionForm isn't 
> called. The set for the ArrayList isn't called too.
> 
> Where is my ArrayList? Why it's null?
> 
> Thanks to all!
> 
> Miguel
> 

Sri

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

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



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