Re: core struts -- best practise fundementals

2005-08-31 Thread Radu Badita

peru cheppanu wrote:


Thanks for replying me.
 
The basic idea is knowing the need for tag libraries.. for which the 
explanation was given as reusability.


In my opinion, the purpose of tags, besides reusability (after all, 
plain objects and methods are reusable and easier to implement), is 
rendering the JSPs more readable and understandable by programmers more 
familiar with HTML. But this is true not only if assuming that one 
working with the JSPs is java challenged. And to demonstrate this I 
suggest the following experiment. Take a JSP (say medium sized) and make 
2 versions of it: one using the logic tags and the other using java 
scriptlets instead (the replacement should be straightforward). Then 
compare the 2 versions - the more readable one should be obvious. :-)


 
Now, coming to specific example I have given:
 
I agree that it should not be a part of logic: library. But, I think 
one such tag (substring) is useful in some cases.


Why not prepare the data in the form required by the view before getting 
there? Usually doing so in a custom tag requires for more intermediary 
steps to be done. And, as already suggested, maybe someone out there 
already made such a handy tools tag library that has one custom tag 
which does substring.


 
Say I need to populate a 40 * 10 table with two variables in each 
cell. I will need a object array of size 400 with two parameters in 
it. ( I can have Hashmap if I have identical keys, but say thats not 
the case either). Instead I can have 400 String objects sent with some 
delimeter. I will save lot of object instantiations and substring the 
ones with two params. What do you think?


I think that in the end, by doing substring in the jsp, you'll have even 
more objects created for each cell: the original string with the 
delimiter and two strings representing your needed values after 
extracting them. Remember that String is immutable and .substring() 
creates a new one when you call it on an instance.
If all you have to do with each the values pairs is showing it in a 
table cell, why don't you just concatenate the values using a space as 
separator and then just display the string in the cell?
Anyway... this kind of potential problems solving should be left aside 
initially when you design and develop your application. Otherwise it 
could really prevent you on concentrating on the business logic and 
model and postponing your delivery date. This kind of performance 
problems should only be addressed at the end, **if** they really show up 
as performance bottlenecks. You could be surprised by how fast java 
is... ;-)



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



Re: core struts -- best practise fundementals

2005-08-29 Thread Radu Badita


Although the previous two answers are basically correct, I don't think 
they really contain the response to Peru's initial question. I hope that 
the elders of this list will clarify things a bit for him. :-)
I considered that I'd better avoid responding myself to this, as one 
that sometime ago was asking (myself and others) why should using the 
logic:equals or logic:iterate be better than using the equivalent 
java code - which was also faster for me to do than learning the new 
tags
Still... In this specific case, maybe the answer is not writing a whole 
new custom tag at all. It wouldn't be very efficient anyway, especially 
if the parsing mentioned is done in one or two particular places only. 
It might show that maybe a model layer does not exist for the 
application, and maybe the data is directly retrieved from a (probably 
legacy) database. (Forgive me if I'm wrong.) At least that parsing could 
be done in the Action that prepares the view, and the data stored in a 
form that is easier to display.
Even if you will still chose to use a custom tag for that, attaching it 
to the struts standard logic taglib wouldn't be a good choice ( if 
that was what you meant by a tag used as


logic:substring ...)

Radu


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



[OT] Re: [To sum it up] Re: Confused / one little question

2005-06-15 Thread Radu Badita


In fact, this thread was really about Struts and how it integrates with 
various J2EE technologies and containers, not about Hibernate/EJBs...
Anyway: I don't think that anyone says that Hibernate is better than EJB 
period; but maybe easier and more flexible to use than Entity EJBs CMP, 
which is just one of the species of EJBs.
It is true that EJB (entity beans or not) has these nice features you 
mention: declarative transactions and declarative security (multi 
threading and synchronization are in fact container and coding 
related, and also implemented by Hibernate), BUT the question is: are 
those really necessary?
Hibernate also supports CMT, and, if facaded by SessionBeans (which is a 
very common scenario and is also recomanded for entity beans), you have 
declarative transactions.
Security is a very nice feature, but in scenarios where you only use a 
web application to access the EJBs, and the EJB container is isolated 
from the rest of the world, it becomes either useless, or a burdain to 
use... And I think that this scenario is the most common (especially 
among the subscribers to a list such as Struts Users :)
It's also true that in some scenarios the Entity Beans might be more 
effective than using an ORM such as Hibernate, but these scenarios are 
extremely rare...
Also, even Hibernate is sometimes regarded as being too complicated and 
too hard to learn by some (it was a very hot discussion about this on 
this list), and in even simpler scenarios are preferred even simpler 
tools such as iBatis, ORB, etc..
In my opinion, a discussion with a subject such as EJB is better than 
Hibernate is completely meaningless... The right tool always depends on 
the job, and the right tool for every imaginable job was just not yet 
invented.  :-)
The answer to your last question IMHO is: yes, you can, if the web layer 
is the only thing accessing your beans. But the subject of security is 
much more complicated in a real-life application than what framework do 
I need to best implement it?


You're welcome,
Radu

Marco Mistroni wrote:


Hello all,
Sorry to get into this thread so late...
Since I have same view as Daniel about Hibernate/EJBs, I wanted to ask
one additional
question, since right now I am using EJBs..

Now, EJBs have some features that let the coder concentrate only
On the business logic instead of dealing, for example, with
synchronization, transaction, threading ..and security, meaning that you
can declare in the
Deployment descriptor which roles are allowed to do what with your EJBs.

Where can you do the same with ORM tools?  In the web layer?
Or do you have to have a security framework in place (such as acegi)?

Thanx and regards
Marco
 



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



Re: session and request scope

2005-03-14 Thread Radu Badita
At 08:14 14.03.2005, Craig McClanahan wrote:
For a developer, though, you should train yourself to good habits in
the first place -- use request scope for *everything* unless it
absolutely must be saved, on the server side, in between requests from
the same user.
This sounds like common-sense but is only feasible in theory; that's 
because in non-trivial web-apps almost all the interactions are some kind 
of a dialog spanning multiple requests with the user and inevitably require 
session-stored data between request. Cleaning such data when the dialog 
ends becomes a pain.
I hope that the Dialog Controller in the forecoming Shale will address 
this problem and provide the means for a dialog-local session that will 
automatically be released once the dialog completes. Furthermore, once a 
user is in the middle of such a pageflow, it shouldn't be possible to leave 
(requesting another dialog sequence) until the current one finishes.
I've once worked with a home-made web framework which implemented such 
behavior (like a state machine) where the entire application was divided 
into states (each having a corresponding view), each state could have 
transitions (a transition executing an action) to other states or to 
another sub-application. Each state machine had it's own separate session 
which was removed on execution end. Between state-machines parameters could 
be sent by-value copying from one session to the other. All this was 
specified in an external xml doc. Too bad it was lacking a system for 
automating request and session parameters retrieval (like the ActionForms 
in Struts).
That is the behavior that I would personally like in Shale, because I think 
it allows for much better design and reuse.

Radu 


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


Re: Typical Struts development team and distribution of tasks?

2005-03-12 Thread Radu Badita
Hmm.. this sound like a lot of work for the Framework/HTML/User interface 
guy considering the user- and presentation-intensive kind of pages nowadays ;-)
And that's precisely what happens in practice; in fact that was also my 
point in the previous message. Working with JSPs (and Servlet / Action as 
controllers for the views) requires Framework/HTML/User interface persons 
(aka java web developers which are supposed to be experts in HTML, JSP and 
Servlets) to solve common web applications problems.
It's also true that Struts makes easier much of these aspects, but still...

At 21:13 11.03.2005, you wrote:
We don't even try to have the development people do the web page.  In 
theory the process is:

1.  Framework/HTML/User interface person creates an HTML version of the 
page that includes as manny of the options and alternatives as possible.

2.  Application developer builds the business logic and controller to 
build the functionality.  Along the way, the static HTML page is 
transformed into a JSP page.

3.  First person then does final tweaks and maintenance on the JSP page.
In practice, there are mutliple iterations of this, and I couldn't 
conceive of it working unless the framework person and the developer 
person work well together and are close both in the organization chart and 
geographically.

Mark Benussi wrote:
I agree, a good J2EE developer can take a UI from a designer (A Photoshop
file or the like) and return a pixel perfect html representation as well as
meeting the MVC business requirements.
-Original Message-
From: Radu Badita [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 17:20
To: Struts Users Mailing List
Subject: Re: Typical Struts development team and distribution of tasks?
Good question!
I barely can wait for answers from the other guys out there; cuz in what 
I saw so far, the Java Developers are supposed to be able to turn static 
visual models (often not even html) into Struts web applications, finding 
clever solutions (usually good ol' javascript) to UI designs that don't 
account for the nature of web applications (request/response interactions).
So a Java [web] Developer must know a lot of html, css, javascript (and 
of  course Struts tags / JSTL) or at least enough to know where to find 
solutions to particular problems...
On the other hand, I'm just starting with Tapestry right now and 
beginning to see that it could really make possible starting with a 
static html design of a UI  and enhancing it to become a dynamic web 
app. Also it provides an almost event-driven kind of framework... Also 
note that Shale is supposed that will support pretty much of the same 
design (components and events, but without the almost pure html 
templates), and even better, support for dialog-like interactions across 
multiple requests.
At 18:38 11.03.2005, you wrote:

Do most companies developing Struts applications tend to employ Web 
Designers, or is it more common for Struts development to be undertaken 
by a team consisting solely of Java Developers (who therefore need 
strong knowledge of HTML, Struts Tags, JSTL, CSS, JavaScript, etc as well as
J2EE)?
Along the same lines... If you are working in a mixed team of Web 
Designers and Java Developers, what is the best way to divide up Struts 
(+ Tiles) development between these groups?

The reason I ask these questions is that the vast majority of my 
previous experience has been in back-end development (EJB, JMS, ORM, 
RDBMS, etc), and now that I am learning Struts I am more than a little 
bit confused as to what I'd be expected to know for the average Struts job...

_
Express yourself instantly with MSN Messenger! Download today - it's 
FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-
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]
--
Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
Computing and Network Services, Kansas State University
-
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: Typical Struts development team and distribution of tasks?

2005-03-12 Thread Radu Badita
At 21:35 11.03.2005, you wrote:
 In practice, there are mutliple iterations of this, and I couldn't
 conceive of it working unless the framework person and the developer
 person work well together and are close both in the organization chart
 and geographically.
You can't get any closer than the two being the same person!  :-)
We have three Java/Web/SQL developers.  We all pretty much have our
hands in all of the layers of the application code, from SQL and
PL/SQL all the way to HTML and JavaScript.
Yeah... sad but true.

--
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA
-
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: using Taglibs

2005-03-11 Thread Radu Badita
In theory, you could... But in practice it's virtually impossible (unless 
you're building an app with just a few pages/forms/actions).
I suggest you take a look at Tapestry - it uses more than simple pages 
(they are instrumented HTML, not even JSPs) that can even be designed by 
a designer totally agnostic of JSP and maintain their original form.

At 09:46 11.03.2005, you wrote:
Hello,
Can we use struts without using its taglibs ?  We will
just write plain JSPs.  If yes how do we get the
values into and from our ActionForms ?
regards,
Nitin

__
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-
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: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Radu Badita
Good question!
I barely can wait for answers from the other guys out there; cuz in what I 
saw so far, the Java Developers are supposed to be able to turn static 
visual models (often not even html) into Struts web applications, finding 
clever solutions (usually good ol' javascript) to UI designs that don't 
account for the nature of web applications (request/response interactions).
So a Java [web] Developer must know a lot of html, css, javascript (and 
of  course Struts tags / JSTL) or at least enough to know where to find 
solutions to particular problems...
On the other hand, I'm just starting with Tapestry right now and beginning 
to see that it could really make possible starting with a static html 
design of a UI  and enhancing it to become a dynamic web app. Also it 
provides an almost event-driven kind of framework... Also note that Shale 
is supposed that will support pretty much of the same design (components 
and events, but without the almost pure html templates), and even better, 
support for dialog-like interactions across multiple requests.

At 18:38 11.03.2005, you wrote:
Do most companies developing Struts applications tend to employ Web 
Designers, or is it more common for Struts development to be undertaken by 
a team consisting solely of Java Developers (who therefore need strong 
knowledge of HTML, Struts Tags, JSTL, CSS, JavaScript, etc as well as J2EE)?

Along the same lines... If you are working in a mixed team of Web 
Designers and Java Developers, what is the best way to divide up Struts (+ 
Tiles) development between these groups?

The reason I ask these questions is that the vast majority of my previous 
experience has been in back-end development (EJB, JMS, ORM, RDBMS, etc), 
and now that I am learning Struts I am more than a little bit confused as 
to what I'd be expected to know for the average Struts job...

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-
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: map-backed forms with multibox/multiselect lists?

2005-03-08 Thread Radu Badita
That's great! Thanks for sharing.
Next time I'll know how to do it. Luckily you proved to be more 
determined and finally solved it. Congratulations!

Nidel, Mike wrote:
The good news is that this DOES work.
I simply declared my methods to be
public void setFoo(String key, String[] foos)
{
...
}
public String[] getFoo(String key)
{
...
}
and everything works fine. It took a detour through the Struts
source (and ultimately from there through the beanutils source)
to figure this out, but the problem was essentially that when
doing the bean introspection, the beanutils first finds the getFoo()
method and stores its return type. It then looks for a setFoo()
method with the same argument type as the return type of getFoo().
If you try to return foo as an Object, it just won't work -- your
setter won't be found and the method will never be called.
thanks for the input,
Mike
 

-Original Message-
From: Radu Badita [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 11:10 AM
To: Struts Users Mailing List
Subject: RE: map-backed forms with multibox/multiselect lists?

I had the same problem some time ago (the solution vaguely 
suggested by 
Jack wouldn't had been an option since the properties were 
dynamic so I 
needed the key to distinguish between them). I asked on this 
list for help 
at that time, but didn't got an answer, so I guess nobody 
succeeded in 
doing something like this. Therefore I had to find some other 
solution to 
my problem...
I'm guessing this might be some sort of a problem with 
commons-binutils 
(although public void setFoos(String key, String[] foos) 
isn't a valid 
javabeans setter so maybe it's just a bit out of it's scope).

At 16:44 07.03.2005, you wrote:
   

This works fine for list-backed form items (which we also use)
but in this case I need something like
public void setFoos(String key, String[] foos)
is this possible?
There are several workarounds I can think of, but this appears
to be the cleanest solution if I can make it work.
Mike
 

-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 9:42 AM
To: Struts Users Mailing List
Subject: Re: map-backed forms with multibox/multiselect lists?
public void setFoos(String [] foos)
On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel
[EMAIL PROTECTED] wrote:
   

I'm trying to build a form element that combines the
 

features of a map-backed
   

property with a multibox (and the same for a
 

multiple-selection list). I've made
   

multiboxes work fine without the map-backed element, but I
 

can't seem to get
   

this to work.
I've tried various method signatures in my form bean, but
 

to no avail. For
   

example, for a field called foo I have tried the following:
public void setFoo(String key, Object val)
{
...
}
or
public void setFoo(String key, String[] val)
{
...
}
I'm using a set of checkboxes on the JSP which should
 

result in a list of the
   

values of whichever boxes are selected. I can think of a
 

number of javascript
   

workarounds, as well as workarounds in my Action that go
 

directly to the request
   

parameters... but all of those are kludges and it seems
 

like there should be a
   

way to have multiple checkboxes that all reference a
 

map-backed form property.
   

Any thoughts?
thanks a bunch,
Mike Nidel
 

-
   

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

--
You can lead a horse to water but you cannot make it float
on its back.
~Dakota Jack~
   

-
   

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: map-backed forms with multibox/multiselect lists?

2005-03-07 Thread Radu Badita
I had the same problem some time ago (the solution vaguely suggested by 
Jack wouldn't had been an option since the properties were dynamic so I 
needed the key to distinguish between them). I asked on this list for help 
at that time, but didn't got an answer, so I guess nobody succeeded in 
doing something like this. Therefore I had to find some other solution to 
my problem...
I'm guessing this might be some sort of a problem with commons-binutils 
(although public void setFoos(String key, String[] foos) isn't a valid 
javabeans setter so maybe it's just a bit out of it's scope).

At 16:44 07.03.2005, you wrote:
This works fine for list-backed form items (which we also use)
but in this case I need something like
public void setFoos(String key, String[] foos)
is this possible?
There are several workarounds I can think of, but this appears
to be the cleanest solution if I can make it work.
Mike
 -Original Message-
 From: Dakota Jack [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 07, 2005 9:42 AM
 To: Struts Users Mailing List
 Subject: Re: map-backed forms with multibox/multiselect lists?


 public void setFoos(String [] foos)


 On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel
 [EMAIL PROTECTED] wrote:
  I'm trying to build a form element that combines the
 features of a map-backed
  property with a multibox (and the same for a
 multiple-selection list). I've made
  multiboxes work fine without the map-backed element, but I
 can't seem to get
  this to work.
 
  I've tried various method signatures in my form bean, but
 to no avail. For
  example, for a field called foo I have tried the following:
 
  public void setFoo(String key, Object val)
  {
  ...
  }
 
  or
 
  public void setFoo(String key, String[] val)
  {
  ...
  }
 
  I'm using a set of checkboxes on the JSP which should
 result in a list of the
  values of whichever boxes are selected. I can think of a
 number of javascript
  workarounds, as well as workarounds in my Action that go
 directly to the request
  parameters... but all of those are kludges and it seems
 like there should be a
  way to have multiple checkboxes that all reference a
 map-backed form property.
 
  Any thoughts?
 
  thanks a bunch,
 
  Mike Nidel
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 You can lead a horse to water but you cannot make it float
 on its back.
 ~Dakota Jack~

 -
 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: [Very OT] Hypothetical challege

2005-01-27 Thread Radu Badita
Hi, there
It happens that I'm having this same design problem today :-) (pretty 
interesting how things matched, huh?!)
I totally agree with Wiebe here - his is the only reasonable work-around 
that i could imagine to this problem. I also thought about serializing 
the Handle, but i think it won't work because the stateful session with 
the SFSB could time-out while the web server restarts and until it will 
get called again.
So I cannot see another way, other than persisting the HttpSession data 
until the same user logs-in again. But, maybe, someone else has another, 
even more interesting solution...

Radu
Wiebe de Jong wrote:
The simple answer is to store all your session data in a database, with a
cookie value as the key. 

When the client connects, get the cookie value, read the session data from
the database, do your stuff, update the database, and respond to the user.
This will create a permanent session, which will survive shutting down the
browser, web server, app server, and whatever else. The session will only
end when the user explicitly logs out and terminates the session.
If you don't like the performance hit of going to the database every time,
then add a plugin. When the application starts, the plugin will read all the
sessions from the database into memory. When the application ends, the
plugin would write out all the sessions to the database.
Wiebe de Jong 

-Original Message-
From: Chaikin, Yaakov Y. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 26, 2005 12:37 PM
To: 'Struts Users Mailing List'
Subject: [Very OT] Hypothetical challege

Hi,
This is a hypothetical question, but it's interesting to me if anyone can
come up with a solution and what that solution would be.
A few facts and requirements:
1) Suppose you have 2 machines. One must serve as your web server and the
other must serve as your EJB server.
2) Suppose you must keep track of some sort of session data for each client.
How you store the session data is flexible to a point... You want to take
advantage of stateful sessions for whatever reason (maybe your EJB server
has more resources or something like that).
3) You obviously have a remote reference to your stateful session EJBObject
in your web tier.
4) For whatever reason, you anticipate that you will want to restart your
web server now and then while there will be some moderate traffic to it
going on. Yet, you don't want to make all the clients lose their state.
5) You can use a cookie if you want to remember which client was which when
the server restarts.
6) You have the option of storing the remote references to you stateful
session EJBObject by getting EJBObject.getHandle() and storing it on the web
server machine in a serialized form.
7) No, you can not buy another web server and cluster them! Let's say there
is no more money left.
How do you catch server/web app shutdown event with no non-portable code,
so you can go through all your sessions and save the remote references to
your stateful beans on the EJB tier on hard disk so when the server starts
back up you would be able to restart the entire app without making the
clients lose their state?
Yes, this way of a contrived situation, but I am just very interested in how
this could be accomplished.
Anyone?
Thanks,
Yaakov.

-
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: Nested and javascript'

2005-01-13 Thread Radu Badita
Sure it is a way to access those: just assign an unique id - maybe same as 
the name, but without the dots.

At 13:56 13.01.2005, you wrote:
Well, this is kinda off topic, but I thought that maybe some of you may 
ran into this problem.

I have a nested text field. It's name is : destiny[0].airShip.name
I need to use a javascript function to get this value. But 
document.forms[0].destiny[0].airShip.name will not work, which seems 
logical since those are not objects but a string generated by struts. Is 
there a way to access those properties?

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: prevent reset of bean after submit

2004-12-28 Thread Radu Badita
As Hubert pointed out: your form won't hold the state from your
first.jsp unless you store it in session scope, as the request created
on first.jsp submit will cease to exist after second.jsp is run.
But if you really don't wanna keep it in user's session, the only
workaround I see possible it's copying the properties from your
first.jsp in hidden inputs in your second.jsp, this way the values
will be introduced in the second request.


On Tue, 28 Dec 2004 14:12:30 +0530, sachin [EMAIL PROTECTED] wrote:
 hi Cliff ,
 
  You may consider put all the fields which are populated from
  frist.jsp in the second.jsp using hidden field.
 
 This is one solution and it helps ..
 only problem is that if the first.jsp have a number of fields
 then the second.jsp will be overloaded with that much number of hidden fields.
 
 and making the bean a session bean is also a solution , but it brings with
 some other problems in my project.
 
  I think there are so many solutions can solve this problem.
 
 Please if u know any other solution to this problem , it will help me design
 the project in a better way . .
 
 Regards,
 Sachin Hegde
 
 
 -- Original Message ---
 From: Cliff [EMAIL PROTECTED]
 To: struts-user@jakarta.apache.org
 Sent: Thu, 23 Dec 2004 02:21:16 -
 Subject: Re: prevent reset of bean after submit
 
  You may consider put all the fields which are populated from
  frist.jsp in the second.jsp using hidden field.
 
  I think there are so many solutions can solve this problem.
 
  Good Luck
  Merry Christmas
 
  Cliff
 
  --- In [EMAIL PROTECTED], Hubert Rabago [EMAIL PROTECTED] wrote:
   It's possible that you have your bean in request scope.  If so, a
  new
   bean is being used for each request.  Try putting your bean in
  session
   scope.
  
   Hubert
  
   On Tue, 21 Dec 2004 12:49:55 +0530, sachin [EMAIL PROTECTED]
  wrote:
hi all ,
   
On submit of a form , struts resets the bean before populating
  the form .
For that perticular action can i stop the resetting of bean ?
   
in my application i need to pupulate one bean from two forms .
It has following structure :-
JSP pages - First.jsp , Second.jsp
Actions   - FirstAction.java , SecondAction.java
which refer to same CommonBean.
   
the commonBean is first populated from First.jsp
then it is forwarded to Second.jsp to populate the remaining
  fields ..
But here the commonBean gets resetted ...
I tried to override reset action in CommonBean with a blank
  method .. but it
not doing ..
   
any help is appreciated
Thanks in advance
   
Regards,
Sachin Hegde
Software Developer
Paradyne Infotech Limited
Mumbai
022-38546711
   
-
  
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]
 --- End of Original Message ---
 
 
 -
 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: Inheritance of DynaActionForms

2004-12-23 Thread Radu Badita
Regarding the inheritance of DynaActionForms I've once read an very good 
and interesting article of someone who found an workaround. I don't have 
the url though, so maybe you'll get lucky with google ;-)

Hi,
I am looking for a Best practice of using the ActionForms. We are using
lot of Forms(both ActionForm and DynaActionForms) in our application. All
these Forms share some common properties and some validation logic is also
common.
Currently we are using the Inheritance in the ActionForms, to solve this
requirement(Like we have a Super ActionForm and all the other ActionForms
extend that Super ActionForm).
I would like to know, is there any possibility with the DynaActionForms. I
mean, we configure the properties of DynaActionForm in the
struts-config.xml, is there a possibility that we can say that one
DynaActionForm extends other DynaActionForm ? (with out replicating the
properties in all DynaActionForms)
As the struts-config.xml is an XML file, i guess we can imitate this by
using the XML INCLUDES( we include the super DynaActionForm properties in
the child DynaActionForms). Is there any configuration possible in
struts-config.xml ?
I wonder what are the advantages of DynaActionForms(whose properties are
configured in struts-config.xml) over ActionForms(which are Java Classes
created as JavaBeans) except the creation of extra java classes ?
Thanks,
Vijay.


-
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: ActionMessage replacement keys ?

2004-12-21 Thread Radu Badita
For the 99.9% of the situations I agree with you Jim, but when you do some 
kind of  generic subsystem to reuse across applications it's very possible 
to need such behavior. Here might be arguable that such situations can be 
avoided, but still... you might end up presenting messages that are much 
too general to the user.

At 17:53 21.12.2004, you wrote:

 -Original Message-
 From: Woodchuck [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 21, 2004 8:23 AM
 To: struts
 Subject: ActionMessage replacement keys ?


 hihi all,

 is everyone rolling their own helper function to use other
 message keys
 as replacement values when creating ActionMessage or ActionError
 objects?

 i'm wondering if there's a better way to do this other than
 getting the
 MessageResources object and calling the getMessage() function then
 putting the results into an object array and then passing this to the
 ActionMessage constructor...

 can/will this functionality be added to the ActionMessage
 object in the
 future?
If you're talking about building a message using other keys, no.  I 
generally find that I am better off using a seperate key for such 
situations.  The problem I run usually into is one of syntax, especially 
with other languages.  Breaking things up like that can make it harder to 
structure a well formed sentence.  Since one of my pet peeves is messages 
that are not grammatically correct, I avoid this at all costs.

Consider an English message translated into say German.  IIRC there is a 
joke about a German teacher who ends every class with 5 minutes of 
verbs.  Apparently German verb structure is different then English, so how 
would fit that structure into your messages?  Or Navajo, which is 
completely different from any other language?

Such flexibitlity in your messages might be nice from a programming 
standpoint, but could be a major pain when translating into foreign languages.

So, my answer to your question is that I don't use message resource keys 
as arguments to my messages.  In such cases I just use a different message 
key for each possibilty.

-
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: Missing message for key analystprofile.edit.screen.title

2004-12-16 Thread Radu Badita
The problem here is the tag in your jsp:
bean:message bundle=ANALYSTPROFILE_LABEL/ad 
key=analystprofile.edit.screen.title/
It should be:
bean:message bundle=ANALYSTPROFILE_LABEL 
key=analystprofile.edit.screen.title/

Why without '/ad' ? you may ask. Probably the example you copied from is 
a Struts module named 'ad'; in such cases, when the message-resources tag 
is in a Struts module config, then /name-of-the-module is appended to the 
name of the messages resource. In your case, you are not in a module, so 
nothing gets appended to the name of the bundle.

Hope it works. Good luck.
Hi, I am new to struts and currently encountered these errors:
Error 500--Internal Server Error
javax.servlet.jsp.JspException: Missing message for key 
analystprofile.edit.screen.title

In struts-config.xml
message-resources key=ANALYSTPROFILE_LABEL 
parameter=resources.i18n.ad.analystprofile_labels/

in analystprofile_labels_en_GB.properties
analystprofile.edit.screen.title=Edit Analyst Profile
in the jsp
titlebean:message bundle=ANALYSTPROFILE_LABEL/ad 
key=analystprofile.edit.screen.title//title

I followed the example from other source, which is working in other 
machine. Any advice..?

Thanks
rgds,
Yen
LeadingSide (M) Sdn Bhd
#29-11 The Boulevard
Mid Valley City
Lingkaran Syed Putra
59200 Kuala Lumpur, Malaysia
Tel: +603 2287 9631/2
Fax: +603 2287 9630
Email: [EMAIL PROTECTED]

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


Re: [ot] Naming generated files

2004-11-25 Thread Radu Badita
I see no point in such design... That will be replicating the same data 
(the images) in two separate systems (your database and your file 
system) and keeping the two synchronized. Too much overhead for a simple 
problem.

Why don't you just make your servlet simply output the images (read from 
the database based on the user's id) in the response (setting first the 
content-type to image/jpg or something appropriate). Then, in your 
html, you can simply put: image 
src=http://yourserver/pathtoyourservlet/

Regarding your java.io.File problem: I used it many times before to 
create files and it never added anything to the filename. Maybe you can 
send a snippet of the code where you create the filename... Is it 
something like '@' followed by a number the weird stuff what you get?

Radu
Mark Lowe wrote:
Not really entirely a struts question but here seems as gooder place as any. 

To have the benefits of storing images in the database without having
to write a byte array to an output stream, I figured have a servlet
that lists all the blobs from a data base and then create files based
on those at start up. And when new images are added perhaps generate
them then. Likewise when deleting images from the database, then
delete those files.
The only problem I'm having is that the files I create using the
java.io.File appends some weird shite to the file name when i need
these to match exactly the uids and such like I'm trying to call them.
Anyone had to deal with this before?
Mark
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


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


Re: Problem downloading file

2004-11-23 Thread Radu Badita
I have the same problem trying to do the same as Morales... To overcome 
this, i've made a JSP (just because i was too lazy to write a Servlet 
:)  where I get the OutputStream from the response, set the content type 
and content-disposintion:
   response.setContentType(application/octet-stream);
   response.setHeader(Content-Disposition, attachment; filename= + 
exportedFile().getName() + ;);
then I output the content of the file.
Works perfectly in the browser, but in log i get: 
org.apache.jasper.JasperException: getOutputStream called (probably 
just as warning). I suppose that if I'll put a servlet instead of the 
JSP, it won't throw this anymore.
Regards.

Morales de Frías wrote:
Hi¡
I already know that this problem have been resolved before, but i can't find 
the solution searching in this post. (Or solutions founded don't help me).
I have an action that generates pdf files, and zip them. And i want to download 
it... but i have two problems:
-- File that appears in dialog is Action'sNameA.do, no MyFile.zip 

code is like this
-
			if (gz.exists()) { 

response.setContentType(application/zip);
response.setHeader(Content-Disposition,attachment; fichero=\ + nombreBaseFichero + \;);
response.setContentLength((int)gz.length());


ServletOutputStream sos;
sos = response.getOutputStream();

FileInputStream stream = new 
FileInputStream(gz);
BufferedInputStream  bis = new 
BufferedInputStream(stream);
InputStream is = new BufferedInputStream(bis);
int count;
byte buf[] = new byte[4096];
while ((count = is.read(buf))  -1)
sos.write(buf, 0, count);

is.close();
sos.close();
}
-
--- Dialog appears two times, and next any action i take, download's dialog appears. I 
read that action must return null but iit doesn't work.
Can you help me, please???
Thanks in advance.
 


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


Re: Help with message resource on Struts module

2004-11-22 Thread Radu Badita
Sadly, nobody gave me any useful help with this issue.
Fortunately I have found the answer myself looking at the DTD for
struts-config.xml files: The module prefix (if any) is appended to
the key (${key}${prefix}). So, in my JSP I should have written
something like:
bean:message bundle=mymodulekey/mymodule key=gs.filters.title/


On Fri, 19 Nov 2004 10:49:56 +0200, Radu Badita [EMAIL PROTECTED] wrote:
 
 Actually you are right - it is a typo, but only in the email (in the real
 files I have other names, and there are spelled right).
 
 
 
 At 21:53 18.11.2004, you wrote:
 Maybe this is just a typo but shouldn't you be using
 'bundle=mymodulekey' instead of 'bundle=mymodule'?
 
 bean:message bundle=mymodulekey key=gs.filters.title/
 
 Radu Badita wrote:
 
 
 Hello,
 I have a Struts module with the following message bundle:
 message-resources parameter=mymodule.Application key=mymodulekey /
 Inside an Action I can get messages from it with:
 dateFormat = getResources(request,mymodulekey).getMessage(date.format);
 and it works fine. But this Action forwards to a jsp in which I have this
 tag:
 bean:message bundle=mymodule key=gs.filters.title/
 it doesn't work because it cannot find the bundle in any scope.
 Can anyone please help me with this? Maybe I don't use the bean:message
 / as it should be used...
 Thanks
 Radu
 
 
 -
 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]



Alternate bundle with ActionMessage

2004-11-22 Thread Radu Badita
Hi,

I have a problem related with using a keyed MessageResources in a
module and creating an ActionMessage with keys from it. Sorry if it
has been discussed before, but I haven't found anything searching the
list...

So here it is: in my module I have defined a message-resource with a
key (let's say myresources) and when the form is validated I want to
create an ActionMessage specifying a key from this resource. My
question is how should I do this?

If I manually get a message from the resource like this:
String paramLabel = ((MessageResources)
request.getSession().getServletContext()
.getAttribute(Constants.MESSAGE_BUNDLE))
.getMessage(reports.param. + paramId + .prompt);
it works fine. But how do I construct an ActionMessage with another key from it?

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



Re: [Validation] and local string insertion

2004-11-22 Thread Radu Badita
I think the problem might be that you don't get the right
MessageResources. Here is what Struts API says about
public MessageResources getInternal() : Return the MessageResources
instance containing our internal message strings.

You should use:
MessageResources resources = request.getSession().getServletContext()
.getAttribute(Globals.MESSAGES_KEY));
to retrieve your bundle.

I hope this helps you.

On Thu, 18 Nov 2004 13:07:18 +0800, Corey Scott [EMAIL PROTECTED] wrote:
 Sorry ... resend, I cant find the previous one in the mail archive and
 I am not sure why the first one disappeared
 
 -Corey
 
 -- Forwarded message --
 From: Corey Scott [EMAIL PROTECTED]
 Date: Thu, 18 Nov 2004 01:36:54 +0800
 Subject: [Validation] and local string insertion
 To: [EMAIL PROTECTED]
 
 Hi,
 
 I have been trying to achieve the same in my validate method to the
 following extract from me validation.xml
  form name=UpdateTaskForm
  field property=txtTaskSummary
 depends=required
  msg
name=required
key=stdError.missing/
 
  arg0 key=UpdateTaskForm.txtTaskSummary/
  /field
   /form
 
 Extract from my message bundle:
 stdError.required.field=Please enter/choose a {0}
 UpdateTaskForm.txtTaskSummary=Task Summary
 
 My validate method:
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
 
if ((this.txtTaskSummary == null)
|| (this.txtTaskSummary.length() == 0))
{
MessageResources resources = this.getServlet().getInternal();
 
errors.add(
txtTaskSummary,
new ActionMessage(
stdError.required.field,
resources.getMessage( request.getLocale(),
 UpdateTaskForm.txtTaskSummary)));
}
 
return errors;
}
 
 Hopefully it is clear that I am trying get an output similar to:
 Please enter/choose a Task Summary
 
 But all I can get is:
 Please enter/choose a {0} // without the whole get resources stuff
 or
 Please enter/choose a null //code above
 
 I am getting the impression I am very much off track, any help would be great.
 
 Thanks,
 Corey
 
 -
 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: Help with message resource on Struts module

2004-11-19 Thread Radu Badita
Actually you are right - it is a typo, but only in the email (in the real 
files I have other names, and there are spelled right).

At 21:53 18.11.2004, you wrote:
Maybe this is just a typo but shouldn't you be using 
'bundle=mymodulekey' instead of 'bundle=mymodule'?

bean:message bundle=mymodulekey key=gs.filters.title/
Radu Badita wrote:
Hello,
I have a Struts module with the following message bundle:
message-resources parameter=mymodule.Application key=mymodulekey /
Inside an Action I can get messages from it with:
dateFormat = getResources(request,mymodulekey).getMessage(date.format);
and it works fine. But this Action forwards to a jsp in which I have this 
tag:
bean:message bundle=mymodule key=gs.filters.title/
it doesn't work because it cannot find the bundle in any scope.
Can anyone please help me with this? Maybe I don't use the bean:message 
/ as it should be used...
Thanks
Radu

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


Help with message resource on Struts module

2004-11-18 Thread Radu Badita

Hello,
I have a Struts module with the following message bundle:
message-resources parameter=mymodule.Application key=mymodulekey /
Inside an Action I can get messages from it with:
dateFormat = getResources(request,mymodulekey).getMessage(date.format);
and it works fine. But this Action forwards to a jsp in which I have this tag:
bean:message bundle=mymodule key=gs.filters.title/
it doesn't work because it cannot find the bundle in any scope.
Can anyone please help me with this? Maybe I don't use the bean:message / 
as it should be used...
Thanks

Radu

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


Re: Question about multiple fields in forms

2004-11-12 Thread Radu Badita
Hi,

It could be done using indexed properties and nested properties. Take a look at:
http://struts.apache.org/faqs/indexedprops.html
You can find lots of threads on this.


On Fri, 12 Nov 2004 11:15:45 +0100, Hevia Vega, Andrés
[EMAIL PROTECTED] wrote:
 
 Hi,
 
 We have a dynamic table that we would like to submit to an action.
 The number of columns and records are unknown.
 Is there any built in mechanism or trick in Struts that we can use in order
 to do this?
 
 A possible solution is to use arrays of fields that are send to the action:
 
 Cheers,
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Radu Badita
Galati, Romania
Phone : 004-0745-36.10.17
Email : [EMAIL PROTECTED]

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



Re: How use the BeanUtils and interface converts

2004-11-12 Thread Radu Badita
A simpler alternative to that approach would be to simply make an
additional setter method in you bean (and getter if appropriate) for
your Date member which takes a String, parses it (preferably according
to the user's Locale) and sets your Date member. The form data should
be first validated, otherwise you'll get a ParseException.
I hope this is useful to you.


On Fri, 5 Nov 2004 09:46:06 -0600, Joe Germuska [EMAIL PROTECTED] wrote:
 Writing a date converter is pretty simple; the
 only reason there isn't one included in the
 beanutils distribution is that there's not a very
 easy way to configure the date format in a
 universal way.
 
 Below is an example.  This one is implemented as
 a static inner class within the only class which
 uses it, but you could do it differently:
 
  static class SimpleDateFormatDateConverter
 implements org.apache.commons.beanutils.Converter
  {
 
  String dateFormat = null;
 
  SimpleDateFormatDateConverter(String dateFormat)
  {
  this.dateFormat = dateFormat;
  }
 
  public Object convert(Class clazz, Object obj)
  {
 
  if (obj == null) return null;
  if (obj instanceof java.util.Date) return obj;
  String toParse = obj.toString();
  if (toParse.trim().length() == 0) return null;
  java.text.SimpleDateFormat fmt = new
 java.text.SimpleDateFormat(dateFormat);
  try
  {
  return fmt.parse(obj.toString());
  }
  catch (Exception ex)
  {
  throw new 
 org.apache.commons.beanutils.ConversionException(ex);
  }
 
  }
  }
 
 Then, elsewhere in your Java code, you would
 register the converter doing something like this:
  String dateFormat = -MM-dd;
  ConvertUtils.register(new
 SimpleDateFormatDateConverter(dateFormat),
 java.util.Date.class);
 
 Since this code was written, beanutils has made
 good progress away from using static methods for
 everything, which makes it easier to have
 Converters in different parts of your app that
 behave differently.  See
 http://jakarta.apache.org/commons/beanutils/api/index.html
 and more specifically
 http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/BeanUtilsBean.html#BeanUtilsBean(org.apache.commons.beanutils.ConvertUtilsBean,%20org.apache.commons.beanutils.PropertyUtilsBean)
 for the doc details.
 
 Joe
 
 
 
 
 At 12:13 PM -0300 11/5/04, Gabriel França Campolina wrote:
 Hi,
 
 I'd like know how I can use BeanUtils.copyProperties(form, model),
 when I my objects have name equals but types noequals, example, in my
 form I have a attribuite named dateInsert of type string, but in my
 model I have this attribuite of the type java.util.Date. How I
 specified to BeanUtils this type of conversion. I read some articles
 in internet saw that I can implements a inteface converter, but i
 don't know use. SomeBody can hope me, with link or example use this
 classe???
 
 Thanks folks,
 
 --
 Gabriel França Campolina
 Sun Certified Programmer for the Java 2 Plataform
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 --
 Joe Germuska
 [EMAIL PROTECTED]
 http://blog.germuska.com
 In fact, when I die, if I don't hear 'A Love
 Supreme,' I'll turn back; I'll know I'm in the
 wrong place.
 - Carlos Santana
 


-- 
Radu Badita
Galati, Romania
Phone : 004-0745-36.10.17
Email : [EMAIL PROTECTED]

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



Re: How to use getServletConfig( ) outside a Servlet.

2004-11-12 Thread Radu Badita
Hi,

I had a problem similar to yours, and here is how I solved it:
1. made a Struts PlugIn (a class that implements
org.apache.struts.action.PlugIn) and has a method init(ActionServlet ,
ModuleConfig) and a String property (let's say configFileName). The
property will be automatically set by Struts at startup, and then the
init(...) method will be called.
2. in the init(...) method I read the file: 
InputStream is =
actionServlet.getServletContext().getResourceAsStream(configFileName);
3. the config file name is set from the struts-config.xml as follows:
plug-in className=mypackage.MyPlugIn
set-property value=/WEB-INF/config.xml property=configFileName/
/plug-in

This should work for you, too. Good luck! :-)


On Fri, 05 Nov 2004 17:28:25 +0100, Morkeleb [EMAIL PROTECTED] wrote:
 Hi.
 
 I want to make a static class which access a configuration file in /WEB-INF/.
 I tried Classname.class.getResourceAsStream(/WEB-INF/config-file.xml); 
 but it wont work.
 So I thought I have to do it by using getServletConfig().getServletContext( 
 ).getResourceAsStream(/WEB-INF/config-file.xml)
 but I did not figure out how to do that because getServletCofig only works in 
 Servlets, not in static beans.
 
 Can you help me?
 
 Thanx in Advance,
 Lukas
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Radu Badita
Galati, Romania
Phone : 004-0745-36.10.17
Email : [EMAIL PROTECTED]

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



Map-backed form property and multi-select

2004-11-04 Thread Radu Badita
Hi,

I'm using a map-backed property to get the data from a run-time
generated form. If one of the controls in the form is a multi-select,
I only get the first selected option.

The form definition:
form-bean name=myForm type=test.MyForm
form-property name=paramValue type=java.util.Map/
...
/form-bean

Setter method:
public void setParamValue(String paramId, Object value)

The select:
  html:select property=paramValue(%=paramName%) multiple=true
  html:options collection=entryes property=key
labelProperty=value/
  /html:select

The setter is called only once having a String for value, even if  I
select multiple options.
Can anyone please give me a hint?

Thanks
-- 
Radu

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