How to forward from one LookupDispatchAction to another LDA

2004-04-23 Thread Riyad Kalla
Hello,
I have a situation where my LookupDispatchAction (LDA) has all my 
functionality for a particular entity defined in it (lets say 
"Product"). So that includes adding, removing, listing, editing and 
changing their order (moving them visually up/down in the table they are 
listed in).

So far everything works fine, however I am running into a problem when I 
have my LDA returning a forward BACK to itself. This situation arises 
when someone changes the order of a product (maybe they move it down), 
so what happens is the "Down" button is pressed, execution goes to the 
"moveDown" method in the LDA. At the end of that method, a forward is 
returned that actually points to the same LDA, but is suppose to call 
the "showList" method (different path). This is done because after the 
order of the products is changed, you need to refresh the page with the 
list of products again so the user sees the changed ordering.

However, as you can imagine, I get the following exception after 
returning the forward:

javax.servlet.ServletException: Request[/forward/product/showList] does not contain 
handler parameter named method

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:199)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
I've tried (at the end of the 'moveDown' method) to manually set a 
parameter (get an IllegalStateException because 'Config is Frozen') and 
tried to add a request attribute all by the name I have defined for the 
parameter (it happens to be 'method') and none of it worked.

So to recap if this isn't clear so far, going into my LDA to change the 
ordering is fine because its from a JSP link where a value for 
'parameter' is defined, so the LDA knows which method to call. However 
by the end of the "moveDown" method, where I need to send execution over 
to the "showList" method, I have no way to define a parameter value, so 
when the forward is returned, and execution comes BACK to the LDA, it 
has no parameter value (hence the exception). I've looked into using the 
"unspecified" method, but it SEEMS to me like that has the exact same 
problem... if no parameter is specified, I STILL want to forward to the 
showList method in the LDA, but I still won't be able to set the 
parameter, and it seems ugly to do a:

protected ActionForward unspecified(

   ActionMapping mapping,

   ActionForm form,

   HttpServletRequest request,

   HttpServletResponse response)

   throws Exception

   {

   

   return showList();

   }

Does anyone know how I would be able to forward from one method in an 
LDA to another method in the same LDA (or any other LDA for that 
matter...)? My entire site is a 1:1 mapping for actions and JSPs, so 
users never actually see ".jsp" in their address bar, its always ".do", 
so being able to go between LDAs is pretty important to me ;)

Thank you for any help you can provide!
-Riyad
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to forward from one LookupDispatchAction to another LDA

2004-04-23 Thread Riyad Kalla
UPDATE:
I just tried doing what I thought would be ugly:
protected ActionForward unspecified(

  ActionMapping mapping,

  ActionForm form,

  HttpServletRequest request,

  HttpServletResponse response)

  throws Exception

  {

  return showList(mapping, form, request, response);

  }

And it didn't work either, it threw the same exception, EVEN THOUGH the 
forward that returns from "showList" is actually pointing to a JSP page 
(not another Action or LDA like was my original problem). To be honest 
I'm not even entirely sure that my unspecified method got called, 
because the exception I get is EXACTLY the same... I'm using Struts 1.1, 
and I thought I saw somewhere in a longer thread from March I think that 
this didn't work in 1.1 but works in 1.2 (nightly build)?

Riyad Kalla wrote:

Hello,
I have a situation where my LookupDispatchAction (LDA) has all my 
functionality for a particular entity defined in it (lets say 
"Product"). So that includes adding, removing, listing, editing and 
changing their order (moving them visually up/down in the table they 
are listed in).

So far everything works fine, however I am running into a problem when 
I have my LDA returning a forward BACK to itself. This situation 
arises when someone changes the order of a product (maybe they move it 
down), so what happens is the "Down" button is pressed, execution goes 
to the "moveDown" method in the LDA. At the end of that method, a 
forward is returned that actually points to the same LDA, but is 
suppose to call the "showList" method (different path). This is done 
because after the order of the products is changed, you need to 
refresh the page with the list of products again so the user sees the 
changed ordering.

However, as you can imagine, I get the following exception after 
returning the forward:

javax.servlet.ServletException: Request[/forward/product/showList] 
does not contain handler parameter named method
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:199) 

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) 

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) 

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) 

org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
I've tried (at the end of the 'moveDown' method) to manually set a 
parameter (get an IllegalStateException because 'Config is Frozen') 
and tried to add a request attribute all by the name I have defined 
for the parameter (it happens to be 'method') and none of it worked.

So to recap if this isn't clear so far, going into my LDA to change 
the ordering is fine because its from a JSP link where a value for 
'parameter' is defined, so the LDA knows which method to call. However 
by the end of the "moveDown" method, where I need to send execution 
over to the "showList" method, I have no way to define a parameter 
value, so when the forward is returned, and execution comes BACK to 
the LDA, it has no parameter value (hence the exception). I've looked 
into using the "unspecified" method, but it SEEMS to me like that has 
the exact same problem... if no parameter is specified, I STILL want 
to forward to the showList method in the LDA, but I still won't be 
able to set the parameter, and it seems ugly to do a:

protected ActionForward unspecified(

   ActionMapping mapping,

   ActionForm form,

   HttpServletRequest request,

   HttpServletResponse response)

   throws Exception

   {

  
   return showList();

   }

Does anyone know how I would be able to forward from one method in an 
LDA to another method in the same LDA (or any other LDA for that 
matter...)? My entire site is a 1:1 mapping for actions and JSPs, so 
users never actually see ".jsp" in their address bar, its always 
".do", so being able to go between LDAs is pretty important to me ;)

Thank you for any help you can provide!
-Riyad
-
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 forward from one LookupDispatchAction to another LDA

2004-04-23 Thread Riyad Kalla
UPDATE:
Upgraded my Struts install to nightly build and now the code snippet 
below works. I'm still curious if anyone knows how one LDA can forward 
to another (or the same) LDA, even if it takes manually setting the 
parameter value (how?)

Thanks!
Riyad
Riyad Kalla wrote:

UPDATE:
I just tried doing what I thought would be ugly:
protected ActionForward unspecified(

  ActionMapping mapping,

  ActionForm form,

  HttpServletRequest request,

  HttpServletResponse response)

  throws Exception

  {

  return showList(mapping, form, request, response);

  }

And it didn't work either, it threw the same exception, EVEN THOUGH 
the forward that returns from "showList" is actually pointing to a JSP 
page (not another Action or LDA like was my original problem). To be 
honest I'm not even entirely sure that my unspecified method got 
called, because the exception I get is EXACTLY the same... I'm using 
Struts 1.1, and I thought I saw somewhere in a longer thread from 
March I think that this didn't work in 1.1 but works in 1.2 (nightly 
build)?

Riyad Kalla wrote:

Hello,
I have a situation where my LookupDispatchAction (LDA) has all my 
functionality for a particular entity defined in it (lets say 
"Product"). So that includes adding, removing, listing, editing and 
changing their order (moving them visually up/down in the table they 
are listed in).

So far everything works fine, however I am running into a problem 
when I have my LDA returning a forward BACK to itself. This situation 
arises when someone changes the order of a product (maybe they move 
it down), so what happens is the "Down" button is pressed, execution 
goes to the "moveDown" method in the LDA. At the end of that method, 
a forward is returned that actually points to the same LDA, but is 
suppose to call the "showList" method (different path). This is done 
because after the order of the products is changed, you need to 
refresh the page with the list of products again so the user sees the 
changed ordering.

However, as you can imagine, I get the following exception after 
returning the forward:

javax.servlet.ServletException: Request[/forward/product/showList] 
does not contain handler parameter named method

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:199) 


org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) 


org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) 


org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I've tried (at the end of the 'moveDown' method) to manually set a 
parameter (get an IllegalStateException because 'Config is Frozen') 
and tried to add a request attribute all by the name I have defined 
for the parameter (it happens to be 'method') and none of it worked.

So to recap if this isn't clear so far, going into my LDA to change 
the ordering is fine because its from a JSP link where a value for 
'parameter' is defined, so the LDA knows which method to call. 
However by the end of the "moveDown" method, where I need to send 
execution over to the "showList" method, I have no way to define a 
parameter value, so when the forward is returned, and execution comes 
BACK to the LDA, it has no parameter value (hence the exception). 
I've looked into using the "unspecified" method, but it SEEMS to me 
like that has the exact same problem... if no parameter is specified, 
I STILL want to forward to the showList method in the LDA, but I 
still won't be able to set the parameter, and it seems ugly to do a:

protected ActionForward unspecified(

   ActionMapping mapping,

   ActionForm form,

   HttpServletRequest request,

   HttpServletResponse response)

   throws Exception

   {

 return showList();

   }

Does anyone know how I would be able to forward from one method in an 
LDA to another method in the same LDA (or any other LDA for that 
matter...)? My entire site is a 1:1 mapping for actions and JSPs, so 
users never actually see ".jsp" in their address bar, its always 
".do", so being able to go between LDAs is pretty important to me ;)

Thank you for any help you can provide!
-Riyad
-
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: How to forward from one LookupDispatchAction to another LDA

2004-04-23 Thread Riyad Kalla
booya I really appreciate the code snippets and explination! I hadn't gotten 
involved in ActionForwards and appreciate you shedding light on the situation 
for me.

Best,
Riyad

On Friday 23 April 2004 09:34 am, bOOyah wrote:
> Riyad Kalla wrote:
>
> 
>
> > Does anyone know how I would be able to forward from one method in an
> > LDA to another method in the same LDA (or any other LDA for that
> > matter...)?
>
> I do exactly this in my own apps.  I use Struts forward Actions in my
> struts-config.  What about something like this? (I'm assuming your
> exsiting Struts forwards and 'showList' method work):
>
> Struts-Config.xml:
> =
>  
>  ...
>
>
>  
>
>  
>parameter="/processMyProducts.do?method=showList"
>  type="org.apache.struts.actions.ForwardAction"/>
>
>
> Your Action class:
> =
> public ActionForward execute(/* the usual args */) {
>  ActionForward forward = new ActionForward("defaultErrHandler");
>
>  String method= request.getParameter("method");
>
>  if (method!= null && !method.equals("")) {
>  if (method.equalsIgnoreCase("showList")) {
>  forward = showList(mapping, form, request, response);
>  }
>  else {
>  forward = super.execute(mapping, form, request, response);
>  }
>  }
>  return forward;
> }
> ...
> public ActionForward moveDown(/* the usual args */) {
>  ...
>  // Success! Now refresh the re-ordered list:
>  return mapping.FindForward("successShowList");
> }
>
> public ActionForward showList(/* the usual args */) {
>  // hit the DB for the new list and forward to the JSP
>  // etc.
> }
>
> To summarise:
> (1) The 'moveDown' handler is called.
> (2) It looks up "successShowList" thereby forwarding to
> "/forward/product/showList".
> (4) "/forward/product/showList" forwards back into your Struts Action
> class with a 'method' parameter called 'showList' causing your existing
> 'showList' method to execute.
>
>
> That's all off the top of my head Riyad.  But I use that approach all
> the time.

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



Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread Riyad Kalla
On Friday 23 April 2004 02:11 pm, bOOyah wrote:
> It's Friday.
>
> I need to buy a replacement for my borked Intellimouse Explorer.  It's
> starting to issue double-click events, which is pretty disconcerting.
> At least, I _hope_ it's my mouse, otherwise my RSI has taken a nasty
> turn for the worse.

This EXACT same thing happened to me for about 3months. I thought I was going 
crazy... at first it was a annoying but I think many people would be 
surprised how descructive double clicking can be when its not indended when 
using an IDE or just working on your PC (accidentally moving the C:\Windows 
directory into the Program Files directory just because you tried to mouse 
over a directory and rename it).

>
> I'm a fan of Microsoft's mice because the devices in its Explorer range
> are nice and big, just like my hands (Logitech's rodents tend to be
> smaller).  But nearly all the Microsoft mice available on Amazon.co.uk
> are wireless.  Ditto for my other favourite site, dabs.co.uk.  A quick
> excursion to Microsoft's corporate Mouse site reveals that, yes indeed,
> all the latest Explorer mice are wireless.

The bluetooth desktop (mouth and keyboard) are very nice, I think you'd like 
them. But they are pricey.

>
> Despite finding the concept of an stationary, yet wireless device deeply
> crazy, I might just buy a wireless mouse and have done with it...life's
> just too short.  But I think having to replace batteries every 6 months
> would get right on my nerves.

IIRC its got a basestation you mount it on when you aren't using it that 
recharges it.

-Riyad

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



Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread Riyad Kalla
You can't go wrong with an IntelliMouse Explorer 3.0

I personally don't like Logitec, but that's only cause I've had a series of 
bad luck with their opticals (keep crapping out).

On Friday 23 April 2004 02:29 pm, Barett McGavock wrote:
> I agree with you 100% and share your concerns about the wireless mice. I am
> shopping for a non-wireless mouse for myself, as well. I'm looking at
> products in stores from both Microsoft and Logitech that are not wireless.
> I presume that these are not the newest-out products.
>
> B
>
> > -Original Message-
> > From: bOOyah [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 23, 2004 2:12 PM
> > To: [EMAIL PROTECTED]
> > Subject: [VERY OT] Wireless Mice...what gives??
> >
> >
> > It's Friday.
> >
> > I need to buy a replacement for my borked Intellimouse
> > Explorer.  It's starting to issue double-click events,
> > which is pretty disconcerting. At least, I _hope_ it's
> > my mouse, otherwise my RSI has taken a nasty turn for
> > the worse.
> >
> > I'm a fan of Microsoft's mice because the devices in its
> > Explorer range are nice and big, just like my hands
> > (Logitech's rodents tend to be smaller).  But nearly all
> > the Microsoft mice available on Amazon.co.uk are wireless.
> > Ditto for my other favourite site, dabs.co.uk.  A quick
> > excursion to Microsoft's corporate Mouse site reveals that,
> > yes indeed, all the latest Explorer mice are wireless.
> >
> > Despite finding the concept of an stationary, yet wireless
> > device deeply crazy, I might just buy a wireless mouse and
> > have done with it...life's just too short.  But I think
> > having to replace batteries every 6 months would get right
> > on my nerves.
> >
> > Any opinions?  Does replacing the batteries in your wireless
> > mouse or keyboard drive you nuts?  Are there real advantages
> > to using a wireless input device that I just cannot see?
>
> -
> 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] Wireless Mice...what gives??

2004-04-23 Thread Riyad Kalla
Oh that sucks... I thought there was a docking station, guess not!

6 weeks... that's kind of rediculous... common MS! Put a digital camera 
battery in it or something and give us a recharger.

On Friday 23 April 2004 02:19 pm, Neale, Bennett wrote:
> I have the wireless bluetooth mouse from M$.
> It's cool for me because I have it hooked up to my pc at work and on my
> laptop at home. The thing that sucks is exactly what you hit on, the
> batteries. I've never owned a wireless mouse before but if I could get 6
>
> months out of the batteries I'd be happy. On average for me they run out
>
> about every 6 weeks.
>
> B
>
> -Original Message-
> From: bOOyah [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: [VERY OT] Wireless Mice...what gives??
>
> It's Friday.
>
> I need to buy a replacement for my borked Intellimouse Explorer.  It's
> starting to issue double-click events, which is pretty disconcerting.
> At least, I _hope_ it's my mouse, otherwise my RSI has taken a nasty
> turn for the worse.
>
> I'm a fan of Microsoft's mice because the devices in its Explorer range
> are nice and big, just like my hands (Logitech's rodents tend to be
> smaller).  But nearly all the Microsoft mice available on Amazon.co.uk
> are wireless.  Ditto for my other favourite site, dabs.co.uk.  A quick
> excursion to Microsoft's corporate Mouse site reveals that, yes indeed,
> all the latest Explorer mice are wireless.
>
> Despite finding the concept of an stationary, yet wireless device deeply
>
> crazy, I might just buy a wireless mouse and have done with it...life's
> just too short.  But I think having to replace batteries every 6 months
> would get right on my nerves.
>
> Any opinions?  Does replacing the batteries in your wireless mouse or
> keyboard drive you nuts?  Are there real advantages to using a wireless
> input device that I just cannot see?
>
> Trivially yours,

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



Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread Riyad Kalla
On Friday 23 April 2004 02:21 pm, bOOyah wrote:
> Barett McGavock wrote:
> > I agree with you 100% and share your concerns about the wireless mice. I
> > am shopping for a non-wireless mouse for myself, as well. I'm looking at
> > products in stores from both Microsoft and Logitech that are not
> > wireless. I presume that these are not the newest-out products.
>
> Let me know how you go Barett.  At worst I could buy another
> Intellimouse Explorer, but I'd like to inflict something new on my
> carpal tunnel.
>
> One time before, I opted for a flashy Logitech.  But it was so small I
> had to operate it using tweezers.  Amazon must have taken its picture
> with an electron microscope.

LOL

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



Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread Riyad Kalla
"Power User" w.r.t. to mice gives me a mental image of someone grunting and 
sweating while muscling their mouse around their desk... 

On Friday 23 April 2004 02:26 pm, Neale, Bennett wrote:
> Yeah, microsoft touted that the batteries should last over 6 months.
> I dunno, maybe I'm some type of power user ;).
> B
>
> -Original Message-
> From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 2:20 PM
> To: Struts Users Mailing List
> Subject: Re: [VERY OT] Wireless Mice...what gives??
>
> Oh that sucks... I thought there was a docking station, guess not!
>
> 6 weeks... that's kind of rediculous... common MS! Put a digital camera
> battery in it or something and give us a recharger.
>
> On Friday 23 April 2004 02:19 pm, Neale, Bennett wrote:
> > I have the wireless bluetooth mouse from M$.
> > It's cool for me because I have it hooked up to my pc at work and on
>
> my
>
> > laptop at home. The thing that sucks is exactly what you hit on, the
> > batteries. I've never owned a wireless mouse before but if I could get
>
> 6
>
> > months out of the batteries I'd be happy. On average for me they run
>
> out
>
> > about every 6 weeks.
> >
> > B
> >
> > -Original Message-
> > From: bOOyah [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 23, 2004 2:12 PM
> > To: [EMAIL PROTECTED]
> > Subject: [VERY OT] Wireless Mice...what gives??
> >
> > It's Friday.
> >
> > I need to buy a replacement for my borked Intellimouse Explorer.  It's
> > starting to issue double-click events, which is pretty disconcerting.
> > At least, I _hope_ it's my mouse, otherwise my RSI has taken a nasty
> > turn for the worse.
> >
> > I'm a fan of Microsoft's mice because the devices in its Explorer
>
> range
>
> > are nice and big, just like my hands (Logitech's rodents tend to be
> > smaller).  But nearly all the Microsoft mice available on Amazon.co.uk
> > are wireless.  Ditto for my other favourite site, dabs.co.uk.  A quick
> > excursion to Microsoft's corporate Mouse site reveals that, yes
>
> indeed,
>
> > all the latest Explorer mice are wireless.
> >
> > Despite finding the concept of an stationary, yet wireless device
>
> deeply
>
> > crazy, I might just buy a wireless mouse and have done with
>
> it...life's
>
> > just too short.  But I think having to replace batteries every 6
>
> months
>
> > would get right on my nerves.
> >
> > Any opinions?  Does replacing the batteries in your wireless mouse or
> > keyboard drive you nuts?  Are there real advantages to using a
>
> wireless
>
> > input device that I just cannot see?
> >
> > Trivially yours,
>
> -
> 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]



Benefits of LookupDispatchAction without parameter nonsense

2004-04-23 Thread Riyad Kalla
Hey guys,
After playing with the LookupDispatchAction most of the day and converting 
over some existing functionality to using it, I've figured out that i love 
the consolidation of functionality into 1 class, but the problems I've run 
into (non stop) dealing with the parameter and making sure that all my 
buttons now have "property" values (which, for example, breaks some existing 
code like ) so that the LDA has a parameter to determine which 
method to call has gotten me really short on nerves.

Does anyone else have a nice clean way that they have consolidated all their 
CRUD functions into a 1 action, then found a nice way to delegate to the 
proper method based on say the URL that the user is trying to access (instead 
of the parameter value)?

Best,
Riyad

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



Re: Benefits of LookupDispatchAction without parameter nonsense

2004-04-23 Thread Riyad Kalla
Hrrm.. I just found MappingDispatchAction and that seems to be exactly what I 
was looking for... has anyone used this class?

On Friday 23 April 2004 03:00 pm, Riyad Kalla wrote:
> Hey guys,
> After playing with the LookupDispatchAction most of the day and converting
> over some existing functionality to using it, I've figured out that i love
> the consolidation of functionality into 1 class, but the problems I've run
> into (non stop) dealing with the parameter and making sure that all my
> buttons now have "property" values (which, for example, breaks some
> existing code like ) so that the LDA has a parameter to
> determine which method to call has gotten me really short on nerves.
>
> Does anyone else have a nice clean way that they have consolidated all
> their CRUD functions into a 1 action, then found a nice way to delegate to
> the proper method based on say the URL that the user is trying to access
> (instead of the parameter value)?
>
> Best,
> Riyad
>
> -
> 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: Benefits of LookupDispatchAction without parameter nonsense

2004-04-23 Thread Riyad Kalla
Everyone thank you for the feedback, actually I tried the MappingDispatch and 
it seems to be just what I was looking for. You specify the method name IN 
the parameter... so you can set say 3 actions, with different paths, all 
pointing to the same type, and you specify the method to call in the param:







Pretty slick... its not in 1.1 so I have to use nightly :(

On Friday 23 April 2004 03:39 pm, Niall Pemberton wrote:
> Don't you still have to set the "parameter" using the MappingDispatchAction
> class?
>
> One way to do what you want (i.e. not specify the parameter) is to create
> your own custom ActionMapping and override the getParameter() method with
> some logic to look at the path and return the parameter based on it.
> Something like:
>
> public class ParameterActionMapping extends ActionMapping {
>
>public String getParameter() {
>
>   if (path.endsWith("Create"))
>  return "create";
>
>   if (path.endsWith("Read"))
>  return "read";
>
>   if (path.endsWith("Update"))
>  return "update";
>
>   if (path.endsWith("Delete"))
>  return "delete";
>
>   return super.getParameter();
>
>}
> }
>
>
> Then in struts-config.xml you can use this mapping for all your actions by
> setting the type:
>
>  
>
> or on indivdual actions using the className
>
>   
> Niall
>
> - Original Message -
> From: "Riyad Kalla" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, April 23, 2004 11:08 PM
> Subject: Re: Benefits of LookupDispatchAction without parameter nonsense
>
> > Hrrm.. I just found MappingDispatchAction and that seems to be exactly
>
> what I
>
> > was looking for... has anyone used this class?
> >
> > On Friday 23 April 2004 03:00 pm, Riyad Kalla wrote:
> > > Hey guys,
> > > After playing with the LookupDispatchAction most of the day and
>
> converting
>
> > > over some existing functionality to using it, I've figured out that i
>
> love
>
> > > the consolidation of functionality into 1 class, but the problems I've
>
> run
>
> > > into (non stop) dealing with the parameter and making sure that all my
> > > buttons now have "property" values (which, for example, breaks some
> > > existing code like ) so that the LDA has a parameter to
> > > determine which method to call has gotten me really short on nerves.
> > >
> > > Does anyone else have a nice clean way that they have consolidated all
> > > their CRUD functions into a 1 action, then found a nice way to delegate
>
> to
>
> > > the proper method based on say the URL that the user is trying to
> > > access (instead of the parameter value)?
> > >
> > > Best,
> > > Riyad
> > >
> > > -
> > > 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: How to get a value from the from bean

2004-04-23 Thread Riyad Kalla
If you are trying to print out the value:

where nameOfForm is the name of the form defined in your struts-config 
and passed in via the 'name' argument in the action for this page.

And use bean:define to create a page-scoped bean if you just want to use 
it places (like in calculations and such). Also jsp:useBean works too.

Billy Ng wrote:

In the JSP, I need to a get a value from a form bean's property.  How can I
do it in the JSP?
I tried to pageContext.findAttribute("org.apache.struts.taglib.html.BEAN")
to get the form bean, but it returned me null.  Please help!
Billy Ng

This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.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]


Struts Development seems slow, info?

2004-04-24 Thread Riyad Kalla
Hey guys,
I've been looking at this for a while as an indicator of a 1.2 release:
http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=Blocker&bug_severity=Critical&bug_severity=Major&bug_severity=Normal&bug_severity=Minor&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Struts&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=bugs.bug_id
and MOST of these bugs actually have solutions attached to them, but I 
noticed that (a) they don't seem to be getting closed out for months at 
a time and (b) I see the same developer name(s) over and over again on 
these bugs and (c) the communication over the bugs are not very verbal 
at all (slow)

And I know that all projects work differently, so I was wondering if 
anyone knew or heard (maybe even from the dev list) if there is waining 
interest in Struts and the devs are working on other things, or if the 
devs have always been this bad about communication?

Not to say that JSF is the future (I have no idea what will be) but if 
Struts development support is slowing down and people are starting to 
look else where, I'd just like to know for future-time-investment sake.

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


Re: Struts Development seems slow, info?

2004-04-24 Thread Riyad Kalla


Niall Pemberton wrote:

Running a bugzilla query  against Struts 1.1 and the nightly with a
"Resolution" of "FIXED" shows 359 bugs - looks good to me :-)
 

Ahh your query is a lot more impressive than mine ;)

and this bug:

http://issues.apache.org/bugzilla/show_bug.cgi?id=28150

took 11 hours to get applied from being submitted!

When  Struts 1 beta was released the servlet spec was 2.2. Since then (about
3 years I think) Servlet 2.3, Servlet 2.4 the JSTL and Java Server Faces
have all come along - in the next few years who knows what the best
technology will be to deploy - but it won't be the same as today (even if
its still Struts) and your going to have to continually re-invest in the new
stuff that comes along - all you can do today is decided whats the best
solution now.
 

Yes this is certainly true. But I felt we were at an apex right now, 
between Old/New... JSF being the new golden child that I haven't really 
seen anyone use yet so we could figure out if it really was going to be 
"all that"... I was just curious. Thank you for the feedback.

Niall

----- Original Message - 
From: "Riyad Kalla" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, April 24, 2004 4:20 PM
Subject: Struts Development seems slow, info?

 

Hey guys,
I've been looking at this for a while as an indicator of a 1.2 release:
   

http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=Blocker&bug_severity=Critical&bug_severity=Major&bug_severity=Normal&bug_severity=Minor&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Struts&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=bugs.bug_id
 

and MOST of these bugs actually have solutions attached to them, but I
noticed that (a) they don't seem to be getting closed out for months at
a time and (b) I see the same developer name(s) over and over again on
these bugs and (c) the communication over the bugs are not very verbal
at all (slow)
And I know that all projects work differently, so I was wondering if
anyone knew or heard (maybe even from the dev list) if there is waining
interest in Struts and the devs are working on other things, or if the
devs have always been this bad about communication?
Not to say that JSF is the future (I have no idea what will be) but if
Struts development support is slowing down and people are starting to
look else where, I'd just like to know for future-time-investment sake.
Thanks!
Riyad
-
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: i18n with keys from DB

2004-04-24 Thread Riyad Kalla
Unfortunately you can't use tags inside of eachother like that, which is 
why my code is still spackled with little expressions:



You can use an expression language to get around some cases like this 
with JSTL, and I think Struts supports the EL as well... I don't know 
for sure, I haven't used it.

Axel Seinsche wrote:

Hi all,

I think I have a common problem, but couldn't find any solution in the archive of this list or with Google.

All I want to have is i18n where keys come from the DB. My DB contains a table where I can read the keys from. With this key I want to do a lookup in my properties file. How can I do this? Until now I failed to something like

" />

I hope this problem was solved before and someone can help me.

I thougt about storing my values language dependent in the DB, but for several reasons I don't like this approach! 

Thanks,

Axel

 



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


Re: Struts Development seems slow, info?

2004-04-24 Thread Riyad Kalla
You know I just did this same query, but used a resolution of "Fixed, 
Closed and Resolved" and got 728 bugs... WHEW WEEE!
http://issues.apache.org/bugzilla/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Struts&version=1.1+Final&version=Nightly+Build&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time

Niall Pemberton wrote:

Running a bugzilla query  against Struts 1.1 and the nightly with a
"Resolution" of "FIXED" shows 359 bugs - looks good to me :-)
and this bug:

http://issues.apache.org/bugzilla/show_bug.cgi?id=28150

took 11 hours to get applied from being submitted!

When  Struts 1 beta was released the servlet spec was 2.2. Since then (about
3 years I think) Servlet 2.3, Servlet 2.4 the JSTL and Java Server Faces
have all come along - in the next few years who knows what the best
technology will be to deploy - but it won't be the same as today (even if
its still Struts) and your going to have to continually re-invest in the new
stuff that comes along - all you can do today is decided whats the best
solution now.
Niall

- Original Message - 
From: "Riyad Kalla" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, April 24, 2004 4:20 PM
Subject: Struts Development seems slow, info?

 

Hey guys,
I've been looking at this for a while as an indicator of a 1.2 release:
   

http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=Blocker&bug_severity=Critical&bug_severity=Major&bug_severity=Normal&bug_severity=Minor&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Struts&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=bugs.bug_id
 

and MOST of these bugs actually have solutions attached to them, but I
noticed that (a) they don't seem to be getting closed out for months at
a time and (b) I see the same developer name(s) over and over again on
these bugs and (c) the communication over the bugs are not very verbal
at all (slow)
And I know that all projects work differently, so I was wondering if
anyone knew or heard (maybe even from the dev list) if there is waining
interest in Struts and the devs are working on other things, or if the
devs have always been this bad about communication?
Not to say that JSF is the future (I have no idea what will be) but if
Struts development support is slowing down and people are starting to
look else where, I'd just like to know for future-time-investment sake.
Thanks!
Riyad
-
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: Struts Development seems slow, info?

2004-04-24 Thread Riyad Kalla
Steve,
Thanks so much for the reply. I wanted to clarify that I READ day-in and 
day-out those typical "whats going on with this project? I HATE YOU" 
emails, and I really didn't intend mine to sound that way. I was really 
just curious about what was going on because I was new to the list 
(thanks for the tip abou subscribing to dev, I'll do that today!)

comments below:

Steve Raeburn wrote:

Also, perhaps the question you should be asking is, "How can *I* help
speed things up?"
 

Nope, I'm pretty sure my original question is what I wanted to ask :D

Here's a couple of ideas:

- Try out the Stuts 1.2.0 release and report back any problems, or
(hopefully) report how stable and reliable it is for your applications.
- Get the source code and try applying some of those patches that you've
seen on the bug reports. Let us know whether they work for you.
There *has* been a first 1.2.x release, it's just not considered
production quality so we're aiming for a 1.2.1 release that hopefully
will be. Ted & Martin, particularly, put a lot of effort into getting
that release out, so it's not like there's nothing going on here :-)
 

Very cool I didn't know this. After hitting bugzilla with those queries 
I'm REALLY stoked for 1.2.x (800 bug fixes? Wow -- note I realize bugs 
== features in bugzilla and not all of those were defects)

One of the misconceptions about supplying patches is that once a patch
has been submitted, that's the end of the job. However, a committer
still has to:
   1) understand the original bug report and be able to reproduce the
problem
   2) apply the patch and *test* it for himself
this can be quite a lot of work, even if you the patch works as
advertised (not all do).
If you also go through that process and report back that it works for
you, the committers' confidence in the patch is increased. We still have
to do our own testing, but if your results match ours, then we can be
reasonably confident that the patch is good.
 

Yes I see your point, sorry for drawing such rash conclusions.

To address your points, specifically:

 

(a) they don't seem to be getting closed out for months at a time and
 

I don't think that's uncommon in any software project. Some things get
fixed quickly because they're easy or urgent; others take a while. Only
recently, I noticed a bug for Mozilla that has been open for 4 *years*
:-) That doesn't mean Mozilla is a bad product or isn't being actively
developed, just that they had other priorities.
 

Again, definately right. What triggered the questions was that I was 
using THAT list as a gauge to see when 1.2 was comming out, and for the 
last month (maybe more) that list has closed 1 bug and added 2... so I 
was like "what the heck's going on here with progress?". I had no idea 
about the already closed bugs, OR the dev lists... again, it was an 
uneducated comment on my part.

 

(b) I see the same developer name(s) over and over again on these
 

bugs and

So only a few people are doing all the work? And you wonder why
everything isn't done immediately!
 

Oh absolutely, I just figured with Struts being such a high profile 
project that there would be more people. So combined with my comment 
above, I thought most of the devs had gone onto something else, or 
stopped contributing... either way I was wrong and you are all working 
very hard.

 

(c) the communication over the bugs are not very verbal at all
 

(slow)

I don't agree with you on this (or maybe I misunderstand). Communication
on the Struts project seems to be very good, to me. We have an excellent
user list, an active developer list and lots of communication via
bugzilla. Don't forget that some discussion about open issues may move
from bugzilla to the dev list, or the user list. It's worth monitoring
dev, if you're interested in where things are going.
 

This is my mistake, I should have checked the lists.

Lastly, don't forget that nobody gets paid to develop Struts. We all
have to work full-time jobs to make a living. Struts is what we do for
relaxation on the weekends :-)
 

We ALL appreciate it, but this is also what probably all of us on this 
list, along with 20,000 other developers around the globe do on our 
weekends and for relaxaction and I think we would be thrilled if a 
community formed around any of our hobby projects (not to say Struts is 
a hobby, but you get the point).

Now everyone repeat after me, "The next version will be released 'When
It's Ready'" ;-)
 

That's fine by me, I almost went crazy trying to convince the NetBeans 
development team to adopt a release cycle like the Jakarta projects: 
release when the bugs are fixed. Then I finally realized that my efforts 
were equivalent to putting a saddle on a rock and trying to ride it in a 
race.

Again I really appreciate the reply, I'll get myself up to speed more 
approrpiately before asking sweeping questions like that in the future.

Best wishes,
Riyad
-

Re: How to get a value from the from bean

2004-04-25 Thread Riyad Kalla
Cool I'm glad it helped

Billy Ng wrote:

Thank you.  It works perfectly.

Billy Ng

This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com
- Original Message - 
From: "Riyad Kalla" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, April 23, 2004 6:33 PM
Subject: Re: How to get a value from the from bean

 

If you are trying to print out the value:

where nameOfForm is the name of the form defined in your struts-config
and passed in via the 'name' argument in the action for this page.
And use bean:define to create a page-scoped bean if you just want to use
it places (like in calculations and such). Also jsp:useBean works too.
Billy Ng wrote:

   

In the JSP, I need to a get a value from a form bean's property.  How can
 

I
 

do it in the JSP?

I tried to
 

pageContext.findAttribute("org.apache.struts.taglib.html.BEAN")
 

to get the form bean, but it returned me null.  Please help!

Billy Ng

This mailbox protected from junk email by Matador
 

from MailFrontier, Inc. http://info.mailfrontier.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]
   



-
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: please clarify my doubt on Struts Checkbox

2004-04-25 Thread Riyad Kalla
I had a problem like this too... and if you check the taglib API docs 
for checkbox, you actually NEED to set the checkbox to false in the 
reset() method in the form in order for it to work... in my case my 
default was checked, but I HAD to set it to unchecked in order for it to 
work... seemed like a strange design decision to me.

Then you can use Javascript to check the checkbox on load, but that's a 
PIA IMO.

Latchoumi Narayanan wrote:

Hi All,

I am having problems populating(checked) struts checkbox while
loading them in a jsp page, do some one know how to do this. I can't
do it as in the case of normal Html checkbox by mentioning 'checked'
or by any other means like setting value attribute. In the jakartta
FAQ's I saw an article which says to do it by configuring a
ActionFormBean even then I can't do this, I am able to propagate the
Form bean by putting it in the request of Action Class but still its
not working.
Can some one tell me how to check a Struts Checkbox while loading a
page?
Thanks,
With Regards,
Latchoumi.


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


Is MappingDispatchAction (Struts?) multithreaded? (Do I need to worry about it?)

2004-04-25 Thread Riyad Kalla
I'm asking because I am now getting into MappingDispatchActions (MDA), 
and almost all of my actions do some form of DB validation and error out 
if something goes wrong. So I have stamped all over the place 4 lines of 
code that look like:

ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage("product.error.cannotMove"));
saveErrors(request, actionMessages);
return mapping.findForward("failure");
And I was thinking how nice, performance and organization if I could 
move a protected instance or even utility method into a base 
AbstractMappingDispatchAction class that did those 4 steps for me and I 
just passed in the message key

So the method would do something like:

actionMessages.clear();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(messageKey));
saveErrors(request, actionMessages);
return mapping.findForward(forwardName);
but then I realized that this could be a huge problem if I had (a) a lot 
of users using the system and (b) struts/servlet container was 
multithreaded and called 2 methods at the same time that BOTH had 
errors... I could run into a situation where one method cleared the 
errors that the other method was trying to return to the user because 
the actionMessages instance is shared per-class.

Can anyone let me know if my worry IS correct and I should keep 
everything the way it is, or if I'm safe and can go ahead with it, and 
"why", if you know.

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


Re: Is MappingDispatchAction (Struts?) multithreaded? (Do I need to worry about it?)

2004-04-25 Thread Riyad Kalla
Let me clarify:
The first sentence should read "and almost all of my METHODS in my MDA's 
do some form of...", so my question is pertaining to any danger I have 
when 2+ methods of the same MDA gets called at the same time and all of 
them want to return errors.

Also the subject had "Struts" in it, because I'm not sure if this is a 
"is Struts thread safe?" question or a "Does my servlet container 
determine if something is thread safe? And if so, is Struts?". So I'm 
not real clear on what takes care of threading, but I know the use-case 
I want and I'm curious if anyone knows if its not safe.

Best,
Riyad
Riyad Kalla wrote:

I'm asking because I am now getting into MappingDispatchActions (MDA), 
and almost all of my actions do some form of DB validation and error 
out if something goes wrong. So I have stamped all over the place 4 
lines of code that look like:

ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage("product.error.cannotMove"));
saveErrors(request, actionMessages);
return mapping.findForward("failure");

And I was thinking how nice, performance and organization if I could 
move a protected instance or even utility method into a base 
AbstractMappingDispatchAction class that did those 4 steps for me and 
I just passed in the message key

So the method would do something like:

actionMessages.clear();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage(messageKey));
saveErrors(request, actionMessages);
return mapping.findForward(forwardName);

but then I realized that this could be a huge problem if I had (a) a 
lot of users using the system and (b) struts/servlet container was 
multithreaded and called 2 methods at the same time that BOTH had 
errors... I could run into a situation where one method cleared the 
errors that the other method was trying to return to the user because 
the actionMessages instance is shared per-class.

Can anyone let me know if my worry IS correct and I should keep 
everything the way it is, or if I'm safe and can go ahead with it, and 
"why", if you know.

Thanks!
Riyad
-
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: Populating a form before displaying it

2004-05-11 Thread Riyad Kalla
Miguel,
I had this problem alot when I was developing a management system. For 
example, on my DeleteConfirmation pages, I wanted to show all the info 
for the entity I was erasing (for example, a User). So how I set that up 
was 2 actions in my struts-config:


   


   
   

So the idea here is that your first action is a pretty plain action that 
looks like this:

execute()
{
   UserForm userForm = (UserForm)form;
   userForm.setXXX;
   ...
   userForm.setXXX;
   request.setAttribute("userForm", userForm);
   return mapping.findForward("continue");
}
and when you get the JSP page, your userForm has been populated with all 
the necessary info.

Hope this helped,
Riyad
Miguel Arroz wrote:

Hello!

  I want to display a JSP when a user clicks on a link on a previous 
page. The JSP has a form that must be populated with data before being 
displayed for the first time. How can I populate the form before 
showing it?

  Yours

Miguel Arroz

 Fire, walk with me.

  Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.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: Populating a form before displaying it

2004-05-11 Thread Riyad Kalla
Just to follow this up, the reson this works is that struts uses the 
'name' of the form from your struts-config to store the actual object 
under in the request or session scope, so as long as you keep your 
naming synced up you can also duplicate this behavior, like I did below 
when I populated the userForm OBJECT and then stuck it back into the 
request with the "userForm" key, because in my struts-config, I had an 
entry like this:


   ...
   
   ...

Hope this helped a little more ;)
-Riyad
Riyad Kalla wrote:

Miguel,
I had this problem alot when I was developing a management system. For 
example, on my DeleteConfirmation pages, I wanted to show all the info 
for the entity I was erasing (for example, a User). So how I set that 
up was 2 actions in my struts-config:


   


   
   

So the idea here is that your first action is a pretty plain action 
that looks like this:

execute()
{
   UserForm userForm = (UserForm)form;
   userForm.setXXX;
   ...
   userForm.setXXX;
   request.setAttribute("userForm", userForm);
   return mapping.findForward("continue");
}
and when you get the JSP page, your userForm has been populated with 
all the necessary info.

Hope this helped,
Riyad
Miguel Arroz wrote:

Hello!

  I want to display a JSP when a user clicks on a link on a previous 
page. The JSP has a form that must be populated with data before 
being displayed for the first time. How can I populate the form 
before showing it?

  Yours

Miguel Arroz

 Fire, walk with me.

  Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.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]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: reloading Actions

2004-05-12 Thread Riyad Kalla
IIRC this is your app server's job, not Struts.

Can someone correct me?

Nimmons, Buster wrote:

Is there a init parameter for the ActionServlet to have struts reload
changed Action classes if they have changed
-
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: ApplicationResource.properties reload

2004-05-12 Thread Riyad Kalla
If you are using Tomcat, it should reload this automatically if you have 
"reload properties" selected for your context (Atleast mine does while 
I'm wokring on the ApplicationResource file), and if all else fails, 
just use the Manager to restart the context (takes about 1 second).

-Riyad

Janarthan Sathiamurthy wrote:

Gurus,

I am using Struts1.1.
Is there any custom code(already available) that can reload the 
ApplicationResource.properties file without a redeploy/restart of the application ?

Regards,
Janarthan S


-
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: ApplicationResource.properties reload

2004-05-12 Thread Riyad Kalla
Use the administrator, its easier :)

Make sure you have setup an "admin" and "manager" Account in your 
tomcat-users.xml file per the tomcat docs. Then go to 
http://localhost:8080 while Tomcat is running, and click the 
Administrator link. Expand the host link (I believe it is) and drill 
down to your context, change the options there and save/commit them.

Michael McGrady wrote:

Hello, Riyad,

I would like to select reload for my context.  My present server.xml 
is the following:  How would I do that?




  

  auth="Container"
  description="User database that can be updated and saved"
  name="UserDatabase"
  type="org.apache.catalina.UserDatabase"/>

  name="UserDatabase">
  
factory

org.apache.catalina.users.MemoryUserDatabaseFactory
  
  
pathname
conf/tomcat-users.xml
  

  
  
name="Catalina">

  port="14567">


  port="8009"
  protocol="AJP/1.3"
  protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler">


  defaultHost="localhost"
  name="Catalina">
  
appBase="webapps"
name="localhost">
  
  
    className="org.apache.catalina.logger.FileLogger"/>
  
className="org.apache.catalina.realm.UserDatabaseRealm"/>

  


Thanks.  Michael

At 06:58 AM 5/12/2004, Riyad Kalla wrote:

If you are using Tomcat, it should reload this automatically if you 
have "reload properties" selected for your context (Atleast mine does 
while I'm wokring on the ApplicationResource file), and if all else 
fails, just use the Manager to restart the context (takes about 1 
second).

-Riyad

Janarthan Sathiamurthy wrote:

Gurus,

I am using Struts1.1.
Is there any custom code(already available) that can reload the 
ApplicationResource.properties file without a redeploy/restart of 
the application ?

Regards,
Janarthan S


-
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: ApplicationResource.properties reload

2004-05-12 Thread Riyad Kalla
The properties file will be reloaded by the servlet. i'm not sure what 
you mean by "changed" in this context, it needs to be re-read if it is 
modified.

Michael McGrady wrote:

If the properties class is loaded, which I assume it is, the file 
would not have to be loaded, just changed, right?

At 06:58 AM 5/12/2004, Riyad Kalla wrote:

If you are using Tomcat, it should reload this automatically if you 
have "reload properties" selected for your context (Atleast mine does 
while I'm wokring on the ApplicationResource file), and if all else 
fails, just use the Manager to restart the context (takes about 1 
second).

-Riyad

Janarthan Sathiamurthy wrote:

Gurus,

I am using Struts1.1.
Is there any custom code(already available) that can reload the 
ApplicationResource.properties file without a redeploy/restart of 
the application ?

Regards,
Janarthan S


-
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: reloading Actions

2004-05-12 Thread Riyad Kalla
Tomcat 5 seems to do this for me implicitly... reloads all my classes 
depending on what is changed.. (actions, forms, util classes, dtos, 
daos, etc.)



Nimmons, Buster wrote:

My appserver will reload the ActionServlet if it has changed (which would in
fact reload any Action classes) however it does not reload the ActionClasses
alone. I asked the question because the Framework I wrote a few years back
had an init parameter called devel and if set to true my ActionServlet would
check to see if an ActionHandler had changed before calling its
handleRequest() method and reload it as needed so I figured struts might
have done something similar
-Original Message-
From: Riyad Kalla [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 8:57 AM
To: Struts Users Mailing List
Subject: Re: reloading Actions
IIRC this is your app server's job, not Struts.

Can someone correct me?

Nimmons, Buster wrote:

 

Is there a init parameter for the ActionServlet to have struts reload
changed Action classes if they have changed
-
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: reuse of request parameter in application flow

2004-05-12 Thread Riyad Kalla
Samuel,
I've had this problem as well and what I ended up doing was to add 'hidden' 
tags to the top of my html:form element that encapsulated the parameters that 
I wanted to persist to the next page. Something like:




...
User Name: 
Join Date: 
...
 


I'm not aware of another way to do this that is 'hidden' to the user while 
still keeping the vars in your request scope, just because of the way HTTP 
works.

Best,
Riyad

On Wednesday 12 May 2004 09:07 am, Samuel Rochas wrote:
> Hello,
>
> I am using an Action which puts some data in the request scope. That's
> just fine to display the data in the (exactly one) next jsp page (let's
> call it target.jsp).
>
> I am submiting a form in target.jsp which should do some action an show
> again the target.jsp page.
>
> How can I tell my page / app to use the data of the prior request to
> resend the page? Can I resend the request info from the page to the server?
> Or should I use a session scope variable, or reexecute the prior action
> instead?
>
> Sincerly
> Samuel
>
> ---  andinasoft SA - Software y Consulting  ---
> Mariano Aguilera 276 y Almagro - Quito, Ecuador
> Tel. +593 2 290 55 18  Cel. +593 9 946 4046
> -  http://www.andinasoft.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: Accessing ResourceBundle items from Action class

2004-05-12 Thread Riyad Kalla
I swear I answered this question yesterday yes I did, but it was from 
someone else:

--
You could subclass the ActionServlet with your own instance that in its init 
method reads the properties file...

I think this should do the trick, please fix the path when necessary:
Properties properties = new 
Properties().load(MyActionServlet.getClass().getResourceAsStream("ApplicationResources.properties");


On Wednesday 12 May 2004 12:51 pm, None None wrote:
> Hello all.  I have in my app a resouce bundle, and I can use it in my JSP's
> no problem... my question though is how can I access those items from an
> Action?
>
> Specifically, I have some error messages that I want to return to the view.
> At present they are hardcoded in my Action classes and they are displayed
> via onLoad of my JSP with a simple JavaScript alert.  I'd like to have
> those error messages in my resource bundle and be able to return a specific
> key as my error message from various Action classes.
>
> Any help is appreciated.  Thanks all!
>
> Frank
>
> _
> MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
> download! http://toolbar.msn.com/go/onm00200413ave/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: Accessing ResourceBundle items from Action class

2004-05-12 Thread Riyad Kalla
On Wednesday 12 May 2004 01:04 pm, None None wrote:
> Thank you for that answer Riyad.  I think I actually found another
> (better?) way in my stumbling about trying to solve it on my own...

No you didn't, mine is the BEST :*D

>
> All I did is in my Action, after all my real processing, is this:
>
> MessageResources mr = getResources(request);
> lpcaf.setMessage(mr.getMessage("messages.deleteFailed"));
>
> where lpcaf is the ActionForm from the form submission.  That seems to do
> precisely what I want.

oh... yea your way IS better! Thanks for sharing, now I know.

Best,
Riyad

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



Re: equal tag question

2004-05-12 Thread Riyad Kalla
Using the dot operator to separate method calls should work:


This user is currently Inactive



That should call:
assignUserForm.getAssignUser().getName(), and then compare it to "Bob".

If the above doesn't work, then pretend someone else told you to do it.

Best,
Riyad

On Wednesday 12 May 2004 02:00 pm, Williams, Robert E wrote:
> Hello all,
>
> I have been trying to get a piece of code to work in my JSP.  I understand
> how to do a comparison using a String attribute on the form bean.
>
> Is it possible to use a Value Object on the form bean, in the "property"
> attribute of the tag?  Drilling into the VO to get a String value for
> comparison to the "value" parameter in the tag?
>
>
>   
>This user is currently Inactive
>   
>
> Thank you,
>
> Rob
>
> -
> 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: global forward to tile definition does NOT work

2004-05-12 Thread Riyad Kalla
I sure hope there is a nicer way around it than this... is this really what it 
takes to use Tiles in this situation?

On Wednesday 12 May 2004 02:05 pm, Mark Lowe wrote:
> Use an empty action.
>
> 
>   
> 
>
> the action just needs to return this.
> return (mapping.findForward("success"));
>
> and you'll be there.
>
> On 12 May 2004, at 22:58, Keith Bottner wrote:
> > I am trying to forward directly to a tiles definition from the
> >  with
> >
> > # struts-config.xml
> > 
> > 
> >  >
> >
> > My JSP page uses:
> > BLAH URL
> >
> >
> > However when the JSP is generated it actually generates
> > BLAH URL
> >
> > Any ideas on why global-forwards to tile definitions do not work?
> >
> > Thanks in advance,
> >
> > Keith
> >
> >
> > -
> > 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: Null collections

2004-05-11 Thread Riyad Kalla


...

...

...




On Tuesday 11 May 2004 10:03 am, None None wrote:
> Hi folks... this should be a simple one, but I've been reading for about 30
> minutes now without finding the answer...
>
> I have a collection that I iterate over with logic:iterate, building a
> table... normal stuff... problem is, the collection might be null, which
> the tag handles just fine, except that since I start my table OUTSIDE the
> logic:iterate tag, I have a black square on the screen, the outline of the
> table.
>
> So, my question simply is what tag can I use, and with what syntax, to
> check if a collection in a bean is null before starting my logic:iterate
> tag?  I of course found logic:equal. but it doesn't seem like it would do
> what I want.  logic:notEmpty or maybe logic:notPresent might be the ticket,
> but I'm not sure how to set up the tag if one of them is the answer.
>
> Thanks all!
>
> _
> MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
> download! http://toolbar.msn.com/go/onm00200413ave/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: Null collections

2004-05-11 Thread Riyad Kalla
Woops I just reread your message and noticed that I missed that part. But you 
found it, so nice job.

Have fun strusting

On Tuesday 11 May 2004 10:13 am, None None wrote:
> Wow, it really is that easy, isn't it?!? :)  The only problem is that, as I
> understand it, this will check if the myList BEAN is present, I actually
> need to see if a given property of a bean is null.  I answered that part
> myself though... there's a property attribute, just like logic:iterate, and
> now it does what I wanted.  Thanks very much!
>
> >From: Riyad Kalla <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Re: Null collections
> >Date: Tue, 11 May 2004 10:06:49 -0700
> >
> >
> > 
> > ...
> > 
> > ...
> > 
> > ...
> > 
> >
> >
> >On Tuesday 11 May 2004 10:03 am, None None wrote:
> > > Hi folks... this should be a simple one, but I've been reading for
> > > about
> >
> >30
> >
> > > minutes now without finding the answer...
> > >
> > > I have a collection that I iterate over with logic:iterate, building a
> > > table... normal stuff... problem is, the collection might be null,
> > > which the tag handles just fine, except that since I start my table
> > > OUTSIDE
> >
> >the
> >
> > > logic:iterate tag, I have a black square on the screen, the outline of
> >
> >the
> >
> > > table.
> > >
> > > So, my question simply is what tag can I use, and with what syntax, to
> > > check if a collection in a bean is null before starting my
> > > logic:iterate tag?  I of course found logic:equal. but it doesn't seem
> > > like it would
> >
> >do
> >
> > > what I want.  logic:notEmpty or maybe logic:notPresent might be the
> >
> >ticket,
> >
> > > but I'm not sure how to set up the tag if one of them is the answer.
> > >
> > > Thanks all!
> > >
> > > _
> > > MSN Toolbar provides one-click access to Hotmail from any Web page –
> >
> >FREE
> >
> > > download! http://toolbar.msn.com/go/onm00200413ave/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]
>
> _
> FREE pop-up blocking with the new MSN Toolbar – get it now!
> http://toolbar.msn.com/go/onm00200415ave/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: how to read ApplicationResources.properties from a servlet

2004-05-11 Thread Riyad Kalla
You could subclass the ActionServlet with your own instance that in its init 
method reads the properties file...

I think this should do the trick, please fix the path when necessary:
Properties properties = new 
Properties().load(MyActionServlet.getClass().getResourceAsStream("ApplicationResources.properties");

you could probably break that into multiple lines to make it easier to read.

On Tuesday 11 May 2004 12:45 pm, Julio Cesar De Salvo wrote:
> Hi, I was wondering if there's a chance to read the
> ApplicationResources.propoerties file outside the struts frame work (a
> servlet) and what the best way to do so.
>
> Thanks

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



Re: strange tomcat problem with struts1.1

2004-05-10 Thread Riyad Kalla
Jingesh,
See my last post, you don't need to synchronize and it will just slow 
down your app (NOTE: Do not make use of non-final class variables in 
Actions and you will be fine)

Jignesh Patel wrote:

Hi All,
We are facing one strange problem, our server hangs after every 2-3 days. The 
reason behind it, is it tomcat creates unwanted java processes.
From my side I haven't implemented anything special except adding 
"synchronized (this) {"  line in execute method so that I can avoid 
concurrent request.

Will it be the reason?

 

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


Re: Struts File-Upload performance issue

2004-05-10 Thread Riyad Kalla
You need to store 1GB files in a database? Yea, so good luck with that ;)

On Monday 10 May 2004 08:07 am, Ralf Alt wrote:
> Hallo,
>
> I'm using the struts file upload with Struts Version 1.1.
>
> If I try to upload big files there is a performance problem. For a file of
> 40Mb the upload needs about 20 minutes before the action is executed. I
> need the file upload for storing big files > 1Gb in the database. The
> storing in the database is very fast, but the "waiting time" is the time
> between sending request and entering the Struts action.
>
> What can I do?
>
> Thanks
> Ralf
>
>
> -
> 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: strange tomcat problem with struts1.1

2004-05-10 Thread Riyad Kalla
Ahh, good point. I was thinking of Strings or ints in my head, but yes you are 
right; probably best to just not use them.

On Monday 10 May 2004 08:33 am, MARU, SOHIL (SBCSI) wrote:
> Do not use class variables at all. A FINAL class variable may point to a
> hashmap so the variable cannot point to another hashmap once initialized
> but its contents can still be modified. So just use method level
> variables.
>
> -Original Message-----
> From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 10, 2004 8:56 AM
> To: Struts Users Mailing List
> Subject: Re: strange tomcat problem with struts1.1
>
>
> Jingesh,
> See my last post, you don't need to synchronize and it will just slow
> down your app (NOTE: Do not make use of non-final class variables in
> Actions and you will be fine)
>
> Jignesh Patel wrote:
> >Hi All,
> >We are facing one strange problem, our server hangs after every 2-3
>
> days. The
>
> >reason behind it, is it tomcat creates unwanted java processes.
> >From my side I haven't implemented anything special except adding
> >"synchronized (this) {"  line in execute method so that I can avoid
> >concurrent request.
> >
> >Will it be the reason?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: [OT] intern(): setting pooled String values

2004-05-10 Thread Riyad Kalla
IIRC interning of Strings has been implied String behavior since the Java 1.2 
VM.

For example:
String one = "ham";
String two = "ham";

if(one == two)
System.out.println("Same!");

will print 'Same'.

-Riyad

On Monday 10 May 2004 09:30 am, Michael McGrady wrote:
> Anyone know whether
>
> public void setValue(String value) {
>this.value = value.intern();
> }
>
> sets the this.value to a pooled String?  I am trying to avoid a separate
> call to intern() after setting the value.  Thanks.
>
> Michael McGrady
>
>
> LEGAL NOTICE

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



Re: newbe question - is this possible

2004-05-10 Thread Riyad Kalla
I've tried to use the 'collection' arg in the iterate tag and never had it 
work (with array, collection, or anything) and always have to use 'name'. I'm 
not sure why, but yes it seems to work fine.

On Monday 10 May 2004 09:31 am, Jimmy Coyne wrote:
> Hi all ,
>
> Seen an example like this in the kick start struts book but when I try I
> get an
>
> "cannot create  iterator  for this collection"
>
> In the action class,   employee beans are added to an ArrayList which
> added to the request object
>
> ArrayListemployees = getEmployees();
> request.setAttribute("employees", employees);
>
>
> the jsp
>
>  
>  
>
> 
>
>   
>
>
> Should this works ?
> Thanks
> Jim

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



Re: LIL OT sercurityfilter question

2004-05-10 Thread Riyad Kalla
Enough to take it into consideration. SSL (encryption) is expensive especially 
on heavy traffic sites.

On Monday 10 May 2004 01:04 pm, Nathan Maves wrote:
> How much of a performance loss would this be?
>
> On May 10, 2004, at 1:53 PM, Hookom, Jacob wrote:
> > Configure your server to only accept requests in an SSL port.
> >
> > -Original Message-
> > From: Nathan Maves [mailto:[EMAIL PROTECTED]
> > Sent: Monday, May 10, 2004 2:49 PM
> > To: Struts Users Mailing List
> > Subject: LIL OT sercurityfilter question
> >
> > I have been using the sercurityfilter by Max Cooper.
> >
> > I wanted to know the best way to incorporate SSL into the picture.
> > What is the best way to ensure that the login page and submission
> > action is encrypted?
> >
> > Nathan
> >
> >
> > -
> > 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: concurrency in struts

2004-05-10 Thread Riyad Kalla
This question is actually what made me sign up to this mailing list... 
the answer is that there is no implicit concurrency. All your 
work/variables in Actions should be method-scoped and not use ANY class 
variables because of this. My specific questions was that I wanted to 
use a class variable "ActionErrors" so any of my methods 
(DispatchAction) could add errors without initializing a new ActionError 
instance, and return it. But this is incorrect and can/will introduce 
problems.

So there is no concurrency in Struts.

Jignesh Patel wrote:

On Monday 10 May 2004 17:21, Jignesh Patel wrote:
I am just wondering, how concurrent request will be handled by single
Action class. Because for many form objects(as there are thousands of
browser running with jsp forms) and there is only one action class.
 

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


Re: bean:write removes double spaces

2004-05-14 Thread Riyad Kalla
You'll have to intercept the spaces and covert them to  's, atleast 
this is what I have had to do.

Brad Balmer wrote:

This isn't a struts issue as it seems to be an issue with how browsers 
(IE) don't display two spaces in a row.

I'm using bean:write to display a variable to the page.  The problem 
is that the value sometimes contains double-spaces which are being 
displayed as a single-space.

Does anybody know of a way to defeat this WITHOUT wrapping the value 
in a  tag?

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: Remembering form values across requests

2004-04-30 Thread Riyad Kalla
Hmmm I would think that html:reset would tie into the Form.reset() 
method, but you said you are using a DynaForm so I'm not sure how that 
would work (I hard code all my forms because I like wasting time :)

Michael Weaver wrote:

I am new to Struts and have tried to used a DynaActionForm to hold the users form choices across requests by setting the form to session scope. This causes a problem with html:reset since I get back the same values on reset and in effect nothing is reset. I could be committing a big design no no here. Maybe I should be using a different bean to hold the form choices across requests but it seems redundant. Any thoughts on if this is a misuse of forms or not would be appreciated. If someone can point out a repository of programs demonstrating good Struts usages that would be helpful also.
 

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


Re: Is MappingDispatchAction (Struts?) multithreaded? (Do I need to worry about it?)

2004-05-01 Thread Riyad Kalla
Craig I really appreciate you taking the time to answer this. Now I have 
my answer and can avoid any nastiness!

Best,
Riyad
Craig R. McClanahan wrote:

Riyad Kalla wrote:

Can anyone answer this? (DEVs) I'm very interested in the answer...


Most of the aspects in which you have to worry about thread safety in 
Struts mirror those you have to be concerned with in servlets.  In the 
particular case of MapDispatchAction, though, there is nothing really 
special about it (in terms of thread safety) versus any other Action.

Struts creates one instance of an Action per  element in a 
struts-config.xml file.  If there are multiple simultaneous requests 
to the same action (very common in an app with lots of users), then 
you do indeed need to care about this.

The most important rule -- again, this relates to *all* Actions, not 
just MDAs -- is to *never* use instance variables in the Action class 
to store information related to the state of a particular request.  
Instead, you should use local variables inside your methods, and pass 
whatever data you need to other methods in the class via parameters.  
Why?  Because local variables and method parameters exist once per 
*thread* instead of once per *instance*, so there is no problem in 
using them to store the state for a particular request.

Thus, you are definitely correct in being concerned about thread 
safety of the proposed code.  If the "actionMessages" variable is 
coded as an instance variable of the MDA, it will be updated by all 
simultaneous requests to the same action (it only takes two 
simultaneous requests to ruin your day).  You'll want to come up with 
some mechanism that passes all the necessary data as parameters, and 
not rely on instance variables.

Craig McClanahan

Riyad Kalla wrote:

Let me clarify:
The first sentence should read "and almost all of my METHODS in my 
MDA's do some form of...", so my question is pertaining to any 
danger I have when 2+ methods of the same MDA gets called at the 
same time and all of them want to return errors.

Also the subject had "Struts" in it, because I'm not sure if this is 
a "is Struts thread safe?" question or a "Does my servlet container 
determine if something is thread safe? And if so, is Struts?". So 
I'm not real clear on what takes care of threading, but I know the 
use-case I want and I'm curious if anyone knows if its not safe.

Best,
Riyad
Riyad Kalla wrote:

I'm asking because I am now getting into MappingDispatchActions 
(MDA), and almost all of my actions do some form of DB validation 
and error out if something goes wrong. So I have stamped all over 
the place 4 lines of code that look like:

ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage("product.error.cannotMove"));
saveErrors(request, actionMessages);
return mapping.findForward("failure");

And I was thinking how nice, performance and organization if I 
could move a protected instance or even utility method into a base 
AbstractMappingDispatchAction class that did those 4 steps for me 
and I just passed in the message key

So the method would do something like:

actionMessages.clear();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage(messageKey));
saveErrors(request, actionMessages);
return mapping.findForward(forwardName);

but then I realized that this could be a huge problem if I had (a) 
a lot of users using the system and (b) struts/servlet container 
was multithreaded and called 2 methods at the same time that BOTH 
had errors... I could run into a situation where one method cleared 
the errors that the other method was trying to return to the user 
because the actionMessages instance is shared per-class.

Can anyone let me know if my worry IS correct and I should keep 
everything the way it is, or if I'm safe and can go ahead with it, 
and "why", if you know.

Thanks!
Riyad
-
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: Rendering Unfiltered Text

2004-05-03 Thread Riyad Kalla
Bill this will depending totally on the browser how 'broken' or 'unbroken' the 
text looks. Because of that, the only solution I can think of is to actually 
"fix" the text before displaying it, or remove the HTML markup.

On Monday 03 May 2004 01:03 pm, Bill Siggelkow wrote:
> This is somewhat of an HTML question so please don't slam me ...
>
> I am using  to
> display text containing HTML.  However, I would like to find a way to
> prevent mangled markup when the data contains unbalanced tags.  For
> example, if the value of bar is "Struts rocks!" -- then when I render
> this with filter="false" then the text and everything following the text
> is in bold because the  tag does not have an  tag.  Does anyone
> know of a way of preventing this problem?  I tried wrapping the text in
>  tags but still had the same problem.
>
> Bill Siggelkow
>
>
> -
> 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: Setting html:text readonly attribute

2004-05-03 Thread Riyad Kalla
Ohhh hell. Chris thanks for the info, I have some serious code updates to 
make ;)

Best,
Riyad

On Monday 03 May 2004 02:00 pm, Craig McClanahan wrote:
> Riyad Kalla wrote:
> >Whats the diff between readonly and "disabled=true", I've been using the
> >latter...
>
> In the terminology of the HTML Specification [1], a "disabled" control
> disallows user input *and* the field will not be "successful" on a form
> submit.  In other words, there will be no corresponding request
> parameter.  A "readonly" field [2] also disallows user input, but the
> request parameter for this field will still be returned (sort of a
> visible version of an  field).  There are also a
> few other minor differences that you can see in the spec language.
>
> Craig
>
> [1] http://www.w3.org/TR/html4/interact/forms.html#adef-disabled
> [2] http://www.w3.org/TR/html4/interact/forms.html#adef-readonly
>
>
> -
> 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: Setting html:text readonly attribute

2004-05-03 Thread Riyad Kalla
Whats the diff between readonly and "disabled=true", I've been using the 
latter...

On Monday 03 May 2004 01:25 pm, John Moore wrote:
> At 21:07 03/05/2004, John Moore wrote:
> >At 16:09 03/05/2004, Paul McCulloch wrote:
> >>1) Use an html (rather than a jsp) tag:
> >>
> >>  
> >
> >I've found that this, unfortunately doesn't work, at least with my current
> >browser of choice (Firefox), which insists on making the text field
> >read-only as long as there is a 'readonly' attribute present. I'm
> >exploring the other options next.
>
> LATER...
>
> Tweaking it so that it outputs only 'readonly' is, of course, the solution.
>
> John
>
>
> =
> John Moore -Norwich, UK-[EMAIL PROTECTED]
> =

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



Re: button as link

2004-05-04 Thread Riyad Kalla
Sam,
I do the same thing you are, and do what Hubert has suggested. It works 
nicely. I always define atleast one throw-away dynaform to use for these 
purposes, then you can use the form as a link, no problem.

On Tuesday 04 May 2004 02:37 pm, Hubert Rabago wrote:
> You can use an empty dyna form:
>
> 
>  type="org.apache.struts.action.DynaActionForm"/> 
>
> --- Samuel Rochas <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I would like to use a button as a link.
> >
> > I used to solve that, before struts, with a form containing only a
> > button.
> >
> > With struts, it seems I have to declare a form object in the
> > struts-config.xml, create a class for that empty form, etc.
> >
> > Is there a simple way to solve that?
> >
> > Sincerly
> > Samuel Rochas
> >
> > ---  andinasoft SA - Software y Consulting  ---
> > Mariano Aguilera 276 y Almagro - Quito, Ecuador
> > Tel. +593 2 290 55 18  Cel. +593 9 946 4046
> > -  http://www.andinasoft.com  -
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> __
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs
> http://hotjobs.sweepstakes.yahoo.com/careermakeover
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: struts repopulate bug?

2004-05-04 Thread Riyad Kalla
Dana,
Yes Struts should and does do this. It actually does this so well, that 
for login forms you need to manually clear the beans or else it 
repopulates the values :)

1) Are you syncing up the names/properties of your fields on your JSP 
page in the form with the property names of the Form?
.. Java snippet ..
public String getUserName();
public void setUserName(String userName);

... JSP Snippet ...

2) Did you implement your reset method cleanly?

3) Is your validate method straight forward?
if(userName == null || userName.length() == 0)
 // make/add some errors
return actionErrors;
4) How is your action defined in your struts-config? Did you specify a 
scope for the bean? Have you tried NOT specifying the scope?

I want to reassure you that Struts does this very well and doesn't need 
you to hack around it, so if this is not working for you, we just need 
to keep trying.

Dana Jeffrey Hata wrote:

I'm using Struts with WSAD, and I am attempting something very simple, which should happen automagically.  Basically, I just need to have the form re-populate after submitting a form which doesn't pass the form bean's validate method.  Should happen without any special coding from me, as this is supposed to be a feature of struts.  Well, it didn't happen for me.  I checked things like form-bean scope.  By plugging in some strategically placed System.outs, I realized that struts was creating a new formbean object, and populating it, but when it came back to my JSP, that was using a different formbean object.  Shouldn't it be getting the form bean which (should have been) placed in the request/session by the actionservlet?  Well, it apparently wasn't, because the way I got it to work was simply putting the following line at the end of my formbean validate():

request.setAttribute(,this);

This made everhything work, so my question is, why the hell didn't struts do this?  Isn't it supposed to?  Is there anything I could have done to make struts not do this, or maybe place a different form bean instance on the request?  It works now, but I don't like hacks.

Thanks in advance,

Dana 

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

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


Re: struts repopulate bug?

2004-05-04 Thread Riyad Kalla
Dana Hata wrote:

Answers to the questions below...

I spent 10 hours on it so far, so I've tried many things.  Now I did see
 

Good god, I can understand your frustration now... I don't know why it 
is not doing this for you. Have you tried setting a breakpoint in your 
reset method and seeing when it is getting called? Are you using a 
stable build of Struts? What app server are you deploying too?

the Action errors listed in the JSP.  Either Struts is not putting the
form bean on the request/session, or it's not populating what it did put
on the request/session with was it found in the submitted form bean.
 

Good that your errors are being displayed, and no I don't think the 
scope of the form should matter, jsut for sanity sake remove the 'scope' 
attribute from your action in your struts-config. If you can narrow this 
down to a small test case: 1 jsp, 1 form, 1 action, 1 struts-config, you 
can post them here for us to look at.

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


Re: struts repopulate bug?

2004-05-04 Thread Riyad Kalla
... yea so I wasn't expecting that to be the fix... good job though!

Dana Hata wrote:

Problem solved.  Apparently, if you have the name and type attributes
defined in the html:form tag, it causes this behavior.  As in:


I simply changed that to:



And now the form gets repopulated.  Is this obvious to everyone else, or
does anyone else think struts should be more resilient?  Also, can
someone explain what actually happened in the first one?
Dana

On Tue, 2004-05-04 at 22:15, Barett McGavock wrote:
 

Hi Dana,

If I had only one guess as to the problem, I'd say there was a mismatch
between a JSP tag versus what was defined in struts-config. I've found my
silent errors most often trace back to JSP tags. This could be scope-related
but is more likely the name. The name attribute of the action tag
(struts-config) must match the name attribute of the form-bean tag
(struts-config). The action attribute of the html:form tag (JSP) must match
the path attribute of the action tag (struts-config). If the html:text or
other output elements are Struts tags and inside the form tag, you won't
need to specify the name attribute, just the property attribute. The JSP tag
names are often derided as poorly named.
Basic requirements for keeping an ActionForm contents:
- Must have your ActionForm defined in struts-config.xml
- Action must have this ActionForm associated in struts-config.xml.
- You should work with the ActionForm passed into the action.
- You should have an  tag configured to point to an action with
the form declared. (Don't forget to define the html JSP tag name.)
Beyond that, you might also compare your struts-config, jsp, and action to
some existing samples. I use the feature you mention in every one of my many
Struts modules and it works perfectly for me.
If you could give more concrete examples from the struts-config.xml, JSP,
and action files, we could probably be more helpful. Helpful stuff from
struts-config: your form, action, and action-mappings; from the JSP:
html:form tag and any fields, along with the definitions at the top. The
execute/perform method of your Action.
FYI: To know whether you're redirecting to the form, the form mapping must
have a redirect=true attribute in struts-config.xml.
B

   

-Original Message-
From: Dana Hata [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 04, 2004 6:38 PM
To: Struts Users Mailing List
Subject: Re: struts repopulate bug?

Answers to the questions below...

I spent 10 hours on it so far, so I've tried many things.  
Now I did see the Action errors listed in the JSP.  Either 
Struts is not putting the form bean on the request/session, 
or it's not populating what it did put on the request/session 
with was it found in the submitted form bean.

Dana

On Tue, 2004-05-04 at 21:26, Riyad Kalla wrote:
 

Dana,
Yes Struts should and does do this. It actually does this so well, 
that
for login forms you need to manually clear the beans or else it 
repopulates the values :)

1) Are you syncing up the names/properties of your fields 
   

on your JSP
 

page in the form with the property names of the Form?
.. Java snippet ..
public String getUserName();
public void setUserName(String userName);
... JSP Snippet ...

   

	Yes.  I am following Struts' strict naming conventions.

 

2) Did you implement your reset method cleanly?
   

	Yes.
 

3) Is your validate method straight forward?
if(userName == null || userName.length() == 0)
 // make/add some errors
return actionErrors;
   

	Yes.
 

4) How is your action defined in your struts-config? Did 
   

you specify a
 

scope for the bean? Have you tried NOT specifying the scope?

   

	I have tried both session and request, and neither 
worked, though it shouldn't matter which one you choose, no?

 

I want to reassure you that Struts does this very well and doesn't 
need
you to hack around it, so if this is not working for you, 
   

we just need 
 

to keep trying.

Dana Jeffrey Hata wrote:

   

I'm using Struts with WSAD, and I am attempting something very 
simple, which should happen automagically.  Basically, I 
 

just need to 
 

have the form re-populate after submitting a form which 
 

doesn't pass 
 

the form bean's validate method.  Should happen without 
 

any special 
 

coding from me, as this is supposed to be a feature of 
 

struts.  Well, 
 

it didn't happen for me.  I checked things like form-bean 
 

scope.  By 
 

plugging in some strategically placed System.outs, I realized that 
struts was creating a new formbean object, and populating it, but 
when it came back to my JSP, that was using a different formbean 
object.  Shouldn't it be getting the form bean which (should have 
been) placed in the request/session by the actionservlet?  
 

Well, it 
 

apparently wasn&#

Re: is this posible? return to the same page after being executed

2004-05-05 Thread Riyad Kalla
Julio,
This isn't a problem at all. I do this now with a page that builds 
itself out top-to-bottom as the user makes more selections and 'submits' 
them, then the page reloads with another section showing asking for more 
user input. I guess its kinda like a 1-page wizard.

Julio Cesar De Salvo wrote:

Is there some way to return to the page / action that called to action
that is being executed?
I've 1 jsp that forwards to an action and I would like to return to the
same page that called the action, by setting the path in the
ActionForward object.
Thanks.

 

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


Re: Clearing Input fields

2004-05-05 Thread Riyad Kalla
If it needs to be cleared every time, why not just reset the form before 
going back to the page? I had a problem similar to this w.r.t. to a 
login page, it was unsafe because if someone logged out, their login 
info was automatically populated back into the form. SO if they walked 
away, another user could walk over and hit enter and login as the person 
that just left. So I introduced an action that did a forward to the JSP 
page, but before it did it calls:
form.reset();

then forwards, so the form is always cleared.

Brian Boyle wrote:

Hi Reddy,

Thanks for your reply. I understand what you are saying by writing a 
javascript function for an onClick event. What I would like to know is 
if it is possible to call the function for an onLoad event. Would this 
function be called when the apage is loaded? I would prefer this 
instead of having to click reset when I return to the page.

Thanks
Brian

From: "Pingili, Madhupal" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: Clearing Input fields
Date: Wed, 5 May 2004 09:48:15 -0400 MIME-Version: 1.0
Received: from mail.apache.org ([208.185.179.12]) by 
mc8-f19.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 
2004 06:51:18 -0700
Received: (qmail 15274 invoked by uid 500); 5 May 2004 13:50:14 -
Received: (qmail 15221 invoked from network); 5 May 2004 13:50:14 -
Received: from unknown (HELO eastgate.bbtnet.com) (208.11.8.3)  by 
daedalus.apache.org with SMTP; 5 May 2004 13:50:14 -
Received: from wil-smtp-av02.bbtnet.com ([10.9.24.60]) by 
eastgate.bbtnet.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 5 May 
2004 09:45:30 -0400
Received: from wil-po05.bbtnet.com ([10.9.24.94]) by 
wil-smtp-av02.bbtnet.com (SAVSMTP 3.0.0.44) with SMTP id 
M2004050509453030262 for <[EMAIL PROTECTED]>; Wed, 05 May 2004 
09:45:30 -0400
Received: by wil-po05.bbtnet.com with Internet Mail Service 
(5.5.2653.19)id ; Wed, 5 May 2004 09:48:56 -0400
X-Message-Info: JGTYoYF78jHlJGzMSQsMqnhJCwOFuF3h
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: 
List-Subscribe: 
List-Help: 
List-Post: 
List-Id: "Struts Users Mailing List" 
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: Internet Mail Service (5.5.2653.19)
X-OriginalArrivalTime: 05 May 2004 13:45:30.0828 (UTC) 
FILETIME=[3B4150C0:01C432A7]
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
Return-Path: [EMAIL PROTECTED]

Hi Brian,
If you view the html source, you will see the value='x'.
Clicking on Reset button is initializing to this value for each field.
I have solved this problem by replacing Reset button with button and
onclick event javascript for that button which will clear all fields.
Let me know if you need generic javascript which only needs form name
to clear all fields.
Reddy Pingili

> -Original Message-
> From:Brian Boyle [SMTP:[EMAIL PROTECTED]
> Sent:Wednesday, May 05, 2004 9:40 AM
> To:[EMAIL PROTECTED]
> Subject:Clearing Input fields
>
> Hi guys!
>
> I was wonderng if anyone could help me with aporblem I have. I 
input data
> into my input fields on my JSP page. If I press reset the fields are
> cleared. I press submit and my ActoinForm reads the data in and my 
Action
> processes it etc However, when I return to this page again the 
same
> data
> is still there in hte input fields. When I press my reset button 
nothing
> happens. I want to be able to return to the page again and the 
fields be
> cleared. I don't want to see the same ddata in them.
>
> Any ideas on how to do this?
>
> Thanks for your help
>
> Brian
>
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> -
> 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]
_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

-
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: Clearing Input fields

2004-05-05 Thread Riyad Kalla
Brian you can either use 1 action, and parse the submit button values to 
determine what code to execute, OR you can use 2 seprate forms and actions, 
OR you can put all related actions into one MappingDispatchAction or 
LookupDispatchAction.

If you don't want to get into DispatchActions then I'd suggest the 2nd one, 
its very clean and straight forward. You have 2 execution paths, so you have 
2 actions and 2 forms. If you hide 2 actions in 1 action, it might be less 
clear.

The only thing here is that you will likely need to stick the forms in 2 TD's 
in an embedded table so they appear side by side, instead of ontop fo 
eachother.

-Riyad

On Wednesday 05 May 2004 08:39 am, Brian Boyle wrote:
> Thanks Reddy that seems like a good idea. However, that brings me to
> another problem. On my last page I have two buttons. One that will let me
> continue with the applicaiton and the other is the button that will bring
> me back to the original page. Will I need to have two forms and an
> differnent Action class for each form? Because for each button there is
> differnt htings happening. CAnI use the same form and Action class for this
> or will I need a differnet one for each button?
>
> Thanks,
>
> Brian
>
> >From: Riyad Kalla <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: Re: Clearing Input fields
> >Date: Wed, 05 May 2004 08:25:52 -0700
> >MIME-Version: 1.0
> >Received: from mail.apache.org ([208.185.179.12]) by mc8-f13.hotmail.com
> >with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 08:26:17 -0700
> >Received: (qmail 56341 invoked by uid 500); 5 May 2004 15:25:55 -
> >Received: (qmail 56324 invoked from network); 5 May 2004 15:25:54 -
> >Received: from unknown (HELO econlab.arizona.edu) (128.196.127.83)  by
> >daedalus.apache.org with SMTP; 5 May 2004 15:25:54 -
> >Received: from email.arizona.edu (pcp09138323pcs.pimaco01.az.comcast.net
> >[:::69.136.123.218])  (AUTH: LOGIN rsk)  by econlab.arizona.edu with
> >esmtp; Wed, 05 May 2004 08:25:56 -0700
> >X-Message-Info: JGTYoYF78jGXY/9ZgKXipF35LcMO6Wpa
> >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> >Precedence: bulk
> >List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> >List-Subscribe: <mailto:[EMAIL PROTECTED]>
> >List-Help: <mailto:[EMAIL PROTECTED]>
> >List-Post: <mailto:[EMAIL PROTECTED]>
> >List-Id: "Struts Users Mailing List" 
> >Delivered-To: mailing list [EMAIL PROTECTED]
> >Message-ID: <[EMAIL PROTECTED]>
> >User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
> >X-Accept-Language: en-us, en
> >References: <[EMAIL PROTECTED]>
> >In-Reply-To: <[EMAIL PROTECTED]>
> >X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> >Return-Path: [EMAIL PROTECTED]
> >X-OriginalArrivalTime: 05 May 2004 15:26:19.0743 (UTC)
> >FILETIME=[50B07EF0:01C432B5]
> >
> >If it needs to be cleared every time, why not just reset the form before
> >going back to the page? I had a problem similar to this w.r.t. to a login
> >page, it was unsafe because if someone logged out, their login info was
> >automatically populated back into the form. SO if they walked away,
> > another user could walk over and hit enter and login as the person that
> > just left. So I introduced an action that did a forward to the JSP page,
> > but before it did it calls:
> >form.reset();
> >
> >then forwards, so the form is always cleared.
> >
> >Brian Boyle wrote:
> >>Hi Reddy,
> >>
> >>Thanks for your reply. I understand what you are saying by writing a
> >>javascript function for an onClick event. What I would like to know is if
> >>it is possible to call the function for an onLoad event. Would this
> >>function be called when the apage is loaded? I would prefer this instead
> >>of having to click reset when I return to the page.
> >>
> >>Thanks
> >>Brian
> >>
> >>>From: "Pingili, Madhupal" <[EMAIL PROTECTED]>
> >>>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >>>To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >>>Subject: RE: Clearing Input fields
> >>>Date: Wed, 5 May 2004 09:48:15 -0400 MIME-Version: 1.0
> >>>Received: from mail.apache.org ([208.185.179.12]) by mc8-f19.hotmail.com
> >>>with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 06:51:18 -0700
> >>>Received: (qmail 15274 invoked by uid 500); 5 May 200

Re: [OT] Production app server

2004-05-05 Thread Riyad Kalla
Why not use Tomcat 5, and increase the memory that the server uses?

I don't know that many people that took Tomcat 4 seriously for production in 
its early stages, usually preferring Resin. However as 4.1.x stabalized and 5 
came out, it seems its a non-issue anymore... I don't see the holy-wars that 
I used to.

I'd suggest to deploy with what you are farmiliar with. If the system crashes 
6 times a day and kills a dog, then look at changing to a totally new app 
server ;)

On Wednesday 05 May 2004 09:39 am, Daniel Perry wrote:
> I've developed a struts+ojb based webapp running under tomcat 4.1.
>
> The question is, should i go live with tomcat4?
>
> I've been looking into the alternatives, but none seem that great.
>
> JBoss lacks free documentation. Any comments?
>
> Resin looks good, but the license is a bit unclear. The way its written it
> suggests that you have to pay if using it for commercial purposes.  The
> system i have developed is being sold commercially, but in terms of their
> license, i am not being 'paid to use resin'. We've developed the system
> under tomcat, and are setting up servers for the clients (although we are
> not being paid for this). I have been told that resin outperforms other
> servers.
>
> Tomcat works in development, but i have to restart it a few times a day due
> to it running out of memory (although this only when i stop and start the
> app!). Is it advisable to use tomcat in production?
>
> Daniel.
>
>
> -
> 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: Job

2004-05-06 Thread Riyad Kalla
That's OK, we had the same questions ;)

Freddy Villalba Arias wrote:

Sorry for the spam, everybody. Didn't mean to reply to all of you.



Regards,

Freddy.

 

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


Re: [ot] eclipse vs. IDEA

2004-05-19 Thread Riyad Kalla
IDEA (Swing) currently performs better on Mac and Linux because (a) IBM 
is dragging their feet getting the performance of SWT up to par on those 
non-Windows platforms. There was a HUGE stink about Linux performance, 
starting here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=37683, that 
resulted in major reworking of some key parts of Eclipse which will make 
3.0 much faster on all platforms, but that is still 1/2 as fast as Windows.

Also keep in mind that the JetBrains team is some of the sharpest and 
most systematic guys you'll ever meet. IntelliJ is an application with 
some of the finest tuned Swing programmer just about anywhere and the 
end result is a fantastic IDE.

If you have to use Eclipse and IntelliJ for 6 months each, I think you 
would fine IntelliJ is a much nicer IDE. "It Just Works" is a phrase you 
will find yourself using a lot. If you are doing JUST Java programming, 
you might be hard pressed to make a differential bulleted list, but if 
you are doing development (Java, Swing, JSP, Servlets, HTML Files, XML 
Files, DTDs, Schemas, TLDs, etc. etc. etc. etc.) you will spend most of 
your day trying to find half-finished plugins for Eclipse to do all of 
that (except the Java programming) while IntelliJ will offer you far 
superior support for these technologies by default. Also if you take the 
time to watch the viewlets for the GUI builder, I think you'll be 
pleasently surprised how powerful it can be.

If money isn't an object, and you are the kind of person that 
appreciates polish and attention to detail (I'm assuming you are, since 
you are on Mac already) then you have already selected IntelliJ. If you 
are a pretty nuts and bolts developers that loves free stuff and can 
stand needing to search for a plugin to give you missing functionality, 
and even then maybe not have the best support for it, then Eclipse is 
your choice.

Pound for Pound comparison of pure Java programming might be tight 
between the two, they are both *fantastic*, but once you start asking 
about other technologies and the like, then the arrow just points more 
and more to IntelliJ.

I hope this helped... I'm a bit passionate about IDEs :)
Best,
Riyad
Andy Engle wrote:
Hi all,
I am wondering (for you Mac users out there) if IDEA is less of a
resource hog than eclipse?  When I fire up eclipse on my Mac it seems
like that thing takes a lot o' juice.  Is IDEA just as bad, or is it a
little lighter?
Thanks,
Andy
-
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: connection pooling

2004-05-19 Thread Riyad Kalla
If your pool max is 4, then you will see 4 and your 5th user will wait 
until someone returns their connection to the pool.


Lokanath wrote:
hi all
i have a doubt over connection pooling.When 5 users are using a project in
struts and if i have defined the maximumnumber of connection to 4 .Then how
many connection will be estblished.What i mean to say is how many visible
connection will be there in mysqlprocess
 lokanath
-Original Message-
From: Struts Users Mailing List [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 20, 2004 4:19 AM
To: [EMAIL PROTECTED]
Subject: Multiple nested Hashmaps. Limit?
I am running into a problem with multiple Mapped nested properties

When I use the following lines to access the Value form my dynaValueObj
Object I get this error
<%
 String
value="dynaTableObj.dynaRowObjs("+rowNm+").dynaValueObjs("+key+").dynaCo
lumnValue";
%>



[ServletException in:/WEB-INF/src/jsp/dyna/dynaTableData.jsp] Null
property value for 'dynaValueObjs(1)''

After tracing I found that it is not calling getDynaValueObjs(String xx)
but calling getDynaValueObjs().

Is there a limitation on how many map-backed properties you can
reference?

Thanks
Randy Shelley
[EMAIL PROTECTED]


-- Dyna Table Form Bean
public class DynaTableDataForm extends ActionForm {

 private DynaTableObj dynaTableObj = null;

 public DynaTableObj getDynaTableObj () {
   if (this.dynaTableObj==null) {
 this.dynaTableObj = new DynaTableObj();
   }
   return this.dynaTableObj;
 }
 public void setDynaTableObj (DynaTableObj dynaTableObj) {
   this.dynaTableObj = dynaTableObj;
 }
}
 Dyna Table Object
public class DynaTableObj {
 private LinkedHashMap dynaColumnObjs = null;

 public DynaTableObj() {}

 public void setDynaColumnObjs(LinkedHashMap dynaColumnObjs) {
   this.dynaColumnObjs = dynaColumnObjs;
 }
 public LinkedHashMap getDynaColumnObjs() {
   return this.dynaColumnObjs;
 }
 public Object getDynaColumnObjs(String dynaColumnId) {
   if (dynaColumnObjs==null) {
 this.dynaColumnObjs = new LinkedHashMap();
 this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj());
   }
   else if (this.dynaColumnObjs.get(dynaColumnId)==null) {
 this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj());
   }
   return this.dynaColumnObjs.get(dynaColumnId);
 }

 public void setDynaColumnObjs(String dynaColumnId,Object
dynaColumnObj) {
   if (dynaColumnObjs==null) {
 this.dynaColumnObjs = new LinkedHashMap();
   }
   this.dynaColumnObjs.put(dynaColumnId,dynaColumnObj);
 }
}
-- Dyna Row Object
public class DynaRowObj {
 private LinkedHashMap dynaValueObjs = null;

 public DynaRowObj() {}

 public void setDynaValueObjs(LinkedHashMap dynaColumnObjs) {
   this.dynaValueObjs = dynaValueObjs;
 }
 public LinkedHashMap getDynaValueObjs() {
   return this.dynaValueObjs;
 }
 public Object getDynaValueObjs(String dynaColumnId) {
   if (dynaValueObjs==null) {
 this.dynaValueObjs = new LinkedHashMap();
 this.dynaValueObjs.put(dynaColumnId,new DynaValueObj());
   }
   else if (this.dynaValueObjs.get(dynaColumnId)==null) {
 this.dynaValueObjs.put(dynaColumnId,new DynaColumnObj());
   }
   return this.dynaValueObjs.get(dynaColumnId);
 }
 public void setDynaValueObjs(String dynaColumnId,Object dynaValueObj)
{
   if (dynaValueObjs==null) {
 this.dynaValueObjs = new LinkedHashMap();
   }
   this.dynaValueObjs.put(dynaColumnId,dynaValueObj);
 }
}

- Dyna Value Object
package rshelley.timesheet.util;

public class DynaValueObj {
 private String dynaColumnValue = null;

 public DynaValueObj() {
 }
 public void setDynaColumnValue(String dynaColumnValue) {
   this.dynaColumnValue = dynaColumnValue;
 }
 public String getDynaColumnValue() {
   return this.dynaColumnValue;
 }
}


-
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: Multiple Databases.

2004-05-19 Thread Riyad Kalla
IIRC you should use the connection pool mechanism of your App Server and 
not Struts... I believe its use was deprecated (someone please correct 
me if I'm wrong).

Vishal Arora wrote:
Hi,
   I want to connect to different Databases  in my application  using
the connection pooling of struts.How can i implement this and what all
changes i have to make in my application  and struts-config.xml file
to use such a scenario.If anybody can provide an example  it will be
very helpfull.
Thanks in advance.
Vishal   .
"Everybody makes mistakes; that's why they put erasers on pencils."

-
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: Compressing your struts for faster transfer

2004-05-25 Thread Riyad Kalla
It is very cool, but expensive for server resources (like SSL). So if your 
server spends most of its time sitting around, compression can be a nice 
addition.

On Friday 21 May 2004 10:02 am, Irfandhy Franciscus wrote:
> Hi,
>
> I jsut found out this very neat way of compressing our struts pages
> using GZIP for faster transfer. Basically we'll use a filter to ZIP our
> pages.
>
> here are some URL for references:
> http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=2
> http://www.servletsuite.com/servlets/gzipflt.htm
>
> But if you have downloaded Tomcat, look for compressionFilter java files
> in Tomcat installation folder (usually inside your Program Files in
> Windows OS), and use it as a filter.
>
> i am experimenting with this technique.. Has anyone tried this before?
> Please share your experience. Does it really make the loading faster? Or
> does it actually create more headache.
>
> Regards,
> Irfandhy Franciscus
>
>
> -
> 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]



Q: Can I have multiple ApplicationResources from the same locale?

2004-05-26 Thread Riyad Kalla
This may be a RTFM situation, but I didn't want to take a break and try it and 
then after a hour find out it didn't work so I was hoping (while I was 
coding) someone could let me know if the following is legal:

Situation:
I have an ApplicationResources_en.properties file that represents the English 
locale of my app. This file is getting huge (to say the least) as I've 
internationalized pretty much all the text in my entire app. I was hoping to 
break out this file into logical units that collective represented the 
English locale, for example:

ApplicationResources-User_en.properties
ApplicationResources-Product_en.properties
ApplicationResources-Module_en.properties
ApplicationResources-Administrator_en.properties.

and move the corresponding key/value strings into the appropriate .properties 
files. But then I had a question about how my message-resources tag in my 
struts-config file should change... it currently looks like this:


Thanks for any help you can provide.

Best,
Riyad

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



Re: how to reset only some fields from the form.

2004-05-26 Thread Riyad Kalla
Do the reset method, it will avoid the new object creation.

On Wednesday 26 May 2004 11:42 am, Julio Cesar De Salvo wrote:
> What’s the best way to do so?
>
> Redefine the reset() method in each ActionForm and call it from the
> action?
> Or hold the values  and do: form = new ActionForm(); in the action call?
>
> Thanks,
> Julio Cesar De Salvo - Project Leader
> iTechnology S.R.L. - Ciudad de la Paz 2846 - piso 1
> Tel 54 11 4782.6901 / Fax 54 11 4782.6901
>  [EMAIL PROTECTED]
> AVISO DE CONFIDENCIALIDAD. La información incluida en este e-mail está
> dirigida únicamente al destinatario. Puede contener información
> privilegiada, confidencial y que no debe ser revelada. Si ha recibido
> este e-mail por error, por favor no disemine, utilice, publique,
> distribuya, revele o copie esta comunicación de ningún modo. En cambio,
> por favor notifíquenos inmediatamente remitiéndonos este e-mail (incluso
> el mensaje original en su contestación), por fax (54-11-4782-6901) o
> teléfono (54-11-4782-6901) y entonces elimine y deseche todas las copias
> de este e-mail. Gracias.
> CONFIDENTIALITY NOTICE. The information in this e-mail is intended for
> the designated recipient only. It may contain information that is
> privileged, confidential and exempt from disclosure. If you have
> received this e-mail in error, please do not disseminate, use, publish,
> distribute, disclose or copy this communication in any way. Instead,
> please notify us immediately by return e-mail (including the original
> message in your reply), by fax (54-11-4782-6901) or by telephone
> (54-11-4782-6901) and then delete and discard all copies of this e-mail.
> Thank you.

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



Re: Can I have multiple ApplicationResources from the same locale ?

2004-05-26 Thread Riyad Kalla
Ahhh ok, thanks for the info. 

What is null=false for?

On Wednesday 26 May 2004 11:43 am, [EMAIL PROTECTED] wrote:
> 
>  key="BUTTONS_KEY" null="false" />
>
> And then in the use the 'bundle=""' attribute on the bean:write tag to
> specify the additional bundle to use, if different than the default.
>
>
> -Original Message-
> From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 26, 2004 11:38 AM
> To: Struts Users Mailing List
> Subject: Q: Can I have multiple ApplicationResources from the same
> locale?
>
>
> This may be a RTFM situation, but I didn't want to take a break and try it
> and
> then after a hour find out it didn't work so I was hoping (while I was
> coding) someone could let me know if the following is legal:
>
> Situation:
> I have an ApplicationResources_en.properties file that represents the
> English
> locale of my app. This file is getting huge (to say the least) as I've
> internationalized pretty much all the text in my entire app. I was hoping
> to
>
> break out this file into logical units that collective represented the
> English locale, for example:
>
> ApplicationResources-User_en.properties
> ApplicationResources-Product_en.properties
> ApplicationResources-Module_en.properties
> ApplicationResources-Administrator_en.properties.
>
> and move the corresponding key/value strings into the appropriate
> .properties
> files. But then I had a question about how my message-resources tag in my
> struts-config file should change... it currently looks like this:
> 
>
> Thanks for any help you can provide.
>
> Best,
> Riyad
>
> -
> 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: Can I have multiple ApplicationResources from the same locale ?

2004-05-26 Thread Riyad Kalla
Hey that's perfect, thanks Mick!

On Wednesday 26 May 2004 11:49 am, [EMAIL PROTECTED] wrote:
> That is so if the key does not exist, you will get ???bundle.key.attr???
> instead of a null string.
>
>
>
> -Original Message-----
> From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 26, 2004 11:44 AM
> To: Struts Users Mailing List
> Subject: Re: Can I have multiple ApplicationResources from the same
> locale ?
>
>
> Ahhh ok, thanks for the info.
>
> What is null=false for?
>
> On Wednesday 26 May 2004 11:43 am, [EMAIL PROTECTED] wrote:
> > 
> >  > key="BUTTONS_KEY" null="false" />
> >
> > And then in the use the 'bundle=""' attribute on the bean:write tag to
> > specify the additional bundle to use, if different than the default.
> >
> >
> > -Original Message-
> > From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, May 26, 2004 11:38 AM
> > To: Struts Users Mailing List
> > Subject: Q: Can I have multiple ApplicationResources from the same
> > locale?
> >
> >
> > This may be a RTFM situation, but I didn't want to take a break and try
> > it and
> > then after a hour find out it didn't work so I was hoping (while I was
> > coding) someone could let me know if the following is legal:
> >
> > Situation:
> > I have an ApplicationResources_en.properties file that represents the
> > English
> > locale of my app. This file is getting huge (to say the least) as I've
> > internationalized pretty much all the text in my entire app. I was hoping
> > to
> >
> > break out this file into logical units that collective represented the
> > English locale, for example:
> >
> > ApplicationResources-User_en.properties
> > ApplicationResources-Product_en.properties
> > ApplicationResources-Module_en.properties
> > ApplicationResources-Administrator_en.properties.
> >
> > and move the corresponding key/value strings into the appropriate
> > .properties
> > files. But then I had a question about how my message-resources tag in my
> > struts-config file should change... it currently looks like this:
> > 
> >
> > Thanks for any help you can provide.
> >
> > Best,
> > Riyad
> >
> > -
> > 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]



How long are your struts-config files? Should I worry about performance?

2004-05-26 Thread Riyad Kalla
I'm curious what the size of some of the verteran programmer's 
struts-config.xml files are. Mine is approaching 2k lines right now, and I'm 
about 1/2 done with the project I'm working on.

I don't know if I should really start worrying about performance/other issues, 
or if this is normal and I should smile and keep working.

Thanks!
Riyad

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



Re: How long are your struts-config files? Should I worry about performance?

2004-05-26 Thread Riyad Kalla
Ok this was what I was wondering about (runtime). I didn't know if the 
hashtable with all the actions in it was going to be "too big" or something 
to that effect.

Thanks for the feedback!

On Wednesday 26 May 2004 12:51 pm, Hubert Rabago wrote:
> If your concern is with the physical size of your file, you can break down
> your struts-config into multiple files with your entries spread among them.
> What I do is have a main struts-config.xml containing my global values and
> all plug-ins, then have several struts-config-nnn.xml files for nnn-related
> forms and action mappings.
>
> Can't say I've tried profiling the effect of having a large number of
> mappings as a result of a large config file.  I'd imagine there'd be some
> difference at the startup of the app while Struts parses your config.
> Overall, though, I wouldn't really worry about it.  In most cases, I'd say
> the effect at runtime, if any, would be negligible in terms of speed.
>
> --- Riyad Kalla <[EMAIL PROTECTED]> wrote:
> > I'm curious what the size of some of the verteran programmer's
> > struts-config.xml files are. Mine is approaching 2k lines right now, and
> > I'm
> > about 1/2 done with the project I'm working on.
> >
> > I don't know if I should really start worrying about performance/other
> > issues,
> > or if this is normal and I should smile and keep working.
> >
> > Thanks!
> > Riyad
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> __
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.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: LookUpDispatchAction :does not contain handler parameter named ...

2004-05-26 Thread Riyad Kalla
I agree, it drove me nuts so I switched to using MappingDispatchAction and it 
turned out to be exactly what I wanted. Same idea behind the DispatchActions, 
but you specify the method name in the "parameter" field... can't get more 
straight forward than that ;)

On Wednesday 26 May 2004 01:04 pm, Rick Reumann wrote:
> shankarr wrote:
> > Hi!
> >
> > I am getting an exception which reads like this : *:does not contain
> > handler parameter named empfieldsaction
> > *
> > I have the following jsp.
> >
> > 
> > 
> > Leads Custom Fields   
> > 
> > 
> > 
>
> I hate the LookupDispatchAction compared to the regular DispatchAction.
> I started out using it thinking it would be nice, but down the line it
> ends up being a pain, more so from the standpoint of being "unituitive."
> For example later on you might want to pass in a parameter through
> javascript or a url to the same LookupDispatchAction... well now you
> have to make a "button name" for it in your resources file just so you
> can get the lookupDispatchAction can work correctly. It gets annoying in
> my opinion. I understand the concept of the LookupDispatchAction and for
> simple cases it's fine. Ayway, I digress...
>
> What are you passing in for the value of empfieldsaction? You have to
> make sure that both that value is found as the key in your map in your
> LookupDispatchAction and also there is  key/value for it in your
> resources file.

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



Re: message resource problems

2004-05-26 Thread Riyad Kalla
I believe if you have more than one resource file, you need to give them keys. 
The resource file with no key becomes the default, and then the others need 
to be referenced explicity using the "bundleKey" (I think that's the name...) 
attribute of the struts taglibs.

On Wednesday 26 May 2004 01:58 pm, ksitron wrote:
> I introduced the resource bundle errors_en_US.properties into my
> struts-config.xml file.
> Now, all the other declared resource files are ignored, WHY !!
> I ended up moving all declared messages into the
> errors_en_US.properties, and things work again.
> Anyone have any idea why.
>
> Thanks in advance.

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



Re: message resource problems

2004-05-26 Thread Riyad Kalla
No problem, glad it worked.

On Wednesday 26 May 2004 02:50 pm, ksitron wrote:
> Thanks Riyad, I think you hit right on the head.
>
> Riyad Kalla wrote:
> >I believe if you have more than one resource file, you need to give them
> > keys. The resource file with no key becomes the default, and then the
> > others need to be referenced explicity using the "bundleKey" (I think
> > that's the name...) attribute of the struts taglibs.
> >
> >On Wednesday 26 May 2004 01:58 pm, ksitron wrote:
> >>I introduced the resource bundle errors_en_US.properties into my
> >>struts-config.xml file.
> >>Now, all the other declared resource files are ignored, WHY !!
> >>I ended up moving all declared messages into the
> >>errors_en_US.properties, and things work again.
> >>Anyone have any idea why.
> >>
> >>Thanks in advance.
> >
> >-
> >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: version confusion

2004-05-26 Thread Riyad Kalla
Brian,
This can definately get confusing if you are just thrown into the mix. 

Tomcat 5 is definately the right way to go, its faster, more stable and 
supports newer specs. Struts, IIRC, is designed to only need the Servlet 2.2 
and JSP 1.0 or 1.1 spec, it was meant to be super-compatible, soyou should be 
safe.

There is information on the Struts page (under future direction) where it 
explains that the next Struts 2.0 release might change to require Servlet 
2.3/JSP 1.2 I believe it was.

As far as JSTL, just get the newest version possible. JSTL it a set of 
taglibs, and JSP has supported taglibs for a while. But if you want to get 
fancy with the Expression Language support in JSTL, then you will need a 
container that supports Servlet 2.4 spec (which Tomcat 5 does just fine).


I believe I've left out gaping holes of information, and may even be wrong, 
but AFAIK this is the gist of the version information you need. Generally 
going with the newest stuff you can find is pretty safe, especially with 
Jakarta projects (stuff comming out of apache group). They have one of the 
strictest (I love it) release cycles I've ever seen when it comes to shipping 
stable stuff.

I hope that helped atleast a little,
Riyad

On Wednesday 26 May 2004 01:31 pm, Barnett, Brian W. wrote:
> I'm a recent convert to java (from micro$oft... sh) and i'm still
> trying to understand which versions of which products work together. I just
> got Tomcat 5.x, which implements Servlet 2.4 and JSP 2.0.  Does it matter
> if I use Struts 1.0, 1.1 or 1.2 with this? Why?
>
>
>
> How does the version of the JRE affect things?  How do I know which version
> of the JSTL I need?
>
>
>
> Is there some good reading on these topics somewhere?  (A document that can
> explain how all these products work together and how the version of one
> affects the version of another?)
>
>
>
> Thanks,
>
> Brian Barnett

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



Re: How long are your struts-config files? Should I worry about performance?

2004-05-26 Thread Riyad Kalla
None,
That was EXACTLY the kind of information I was looking for! Thanks for the 
deatiled answer.

My god that homegrown framework must have been a beast to convert, but I bet 
the app is sure happier now that its using Struts.

Best,
Riyad

On Wednesday 26 May 2004 03:00 pm, None None wrote:
> My config file for a project I'm currently working on is 7k, and that's NOT
> counting comments (something like 16k counting them - I'm a comment freak).
> Since it's only parsed once at startup, I wouldn't be too overly concerned
> about performance.  Yes, your talking about a lookup for each request, and
> I'm not familiar with how it's stored internally (just a HashMap maybe?),
> but I wouldn't suspect it's a huge concern.  I can't speak to how typical
> that size is of course, but it's one example.
>
> I should also point out that the app I'm referring to was originally built
> on a homegrown framework (I didn't write it, so don't laugh at ME when I
> tell you this)... it used a very convoluted mapping XML file structure,
> much more complex than struts-config, and the that version of the file was
> 43k! Again, NOT counting comments!  And to make matter worse, this file was
> actually parsed WITH EACH REQUEST!!  But, and here's where I get to a point
> (aside from the fact that those that wrote that framework didn't know their
> a** from their elbows)... performance even under those conditions with a
> halfway decent load (50 concurrent users at any given time on average) was
> perfectly acceptable.  And it wasn't a monstrous server either (Dual
> P2-550's with 1G RAM and a SCSI array internally).
>
> So, I wouldn't be too concerned with the size of your struts-config, unless
> someone else has reason to disagree.  A couple of K wouldn't concern me.
>
> >From: Riyad Kalla <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: How long are your struts-config files? Should I worry about
> >performance?
> >Date: Wed, 26 May 2004 12:36:58 -0700
> >
> >I'm curious what the size of some of the verteran programmer's
> >struts-config.xml files are. Mine is approaching 2k lines right now, and
> >I'm
> >about 1/2 done with the project I'm working on.
> >
> >I don't know if I should really start worrying about performance/other
> >issues,
> >or if this is normal and I should smile and keep working.
> >
> >Thanks!
> >Riyad
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
> _
> Express yourself with the new version of 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: How long are your struts-config files? Should I worry about performance?

2004-05-27 Thread Riyad Kalla
Jose thank you for the detailed info, definately larger than mine!
When I first read your email, I thought that "19,35,4,41 Kb" was one 
number, and I was sitting there scratching my head trying to figure out 
what Locale you were from :D

Jose Ramon Diaz wrote:
Hi,
 We have 4 struts-config in our application as we have modules, and they
are 19,35,4,41 Kb each. We have never had problems with struts performance
at all, so I think the size file is not too much important.
Regards
Jose R. Díaz
 

-Mensaje original-
De: None None [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 27 de mayo de 2004 0:00
Para: [EMAIL PROTECTED]
Asunto: RE: How long are your struts-config files? Should I
worry about
performance?
My config file for a project I'm currently working on is 7k,
and that's NOT
counting comments (something like 16k counting them - I'm a
comment freak).
Since it's only parsed once at startup, I wouldn't be too
overly concerned
about performance.  Yes, your talking about a lookup for each
request, and
I'm not familiar with how it's stored internally (just a
HashMap maybe?),
but I wouldn't suspect it's a huge concern.  I can't speak to
how typical
that size is of course, but it's one example.
I should also point out that the app I'm referring to was
originally built
on a homegrown framework (I didn't write it, so don't laugh
at ME when I
tell you this)... it used a very convoluted mapping XML file
structure, much
more complex than struts-config, and the that version of the
file was 43k!
Again, NOT counting comments!  And to make matter worse, this
file was
actually parsed WITH EACH REQUEST!!  But, and here's where I
get to a point
(aside from the fact that those that wrote that framework
didn't know their
a** from their elbows)... performance even under those
conditions with a
halfway decent load (50 concurrent users at any given time on
average) was
perfectly acceptable.  And it wasn't a monstrous server either (Dual
P2-550's with 1G RAM and a SCSI array internally).
So, I wouldn't be too concerned with the size of your
struts-config, unless
someone else has reason to disagree.  A couple of K wouldn't
concern me.
   

From: Riyad Kalla <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: How long are your struts-config files? Should I worry about
performance?
Date: Wed, 26 May 2004 12:36:58 -0700
I'm curious what the size of some of the verteran programmer's
struts-config.xml files are. Mine is approaching 2k lines
 

right now, and
   

I'm
about 1/2 done with the project I'm working on.
I don't know if I should really start worrying about
 

performance/other
   

issues,
or if this is normal and I should smile and keep working.
Thanks!
Riyad
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Express yourself with the new version of 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]


Re: Session size

2004-05-27 Thread Riyad Kalla
Larry,
Good question. I am curious what others think about this situation as well.

On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> It is apparent true that if the session size is big, the performance will
> be negatively affected. The question is that how to actively control the
> size of session.
>
> Let's discuss this question:
>
> I have a page which displays all the subordinates of a manager, for some
> reasons I want to create a List or a Vector containing all the subordinates
> and put this List or Vector to the session. Each element in the List or
> Vector is a Java object, Employee( each Employee object has 200 String
> attributes, among which 5 are needed to be displayed on the screen)
>
> A picture of this situation is:
>
>   Vector allSubordinates = new Vector();
>   allSubordinates.add(Employee1);
>   allSubordinates.add(Employee2);
>   ...
>
>   allSubordinates.add(Employee1000);
>
>
> session.setAttribute("allSubordinates",allSubordinates);
>
> Do you think this actually makes the session very big?
>
>
> Then what will be the improvement of the following? Instead of add all the
> employee objects, we create a very small object called DisplayObject, which
> just contains the 5 attributes required on the screen.
>
>   Vector allSubordinates = new Vector();
>   allSubordinates.add(DisplayObject1);
>   allSubordinates.add(DisplayObject2);
>   ...
>
>   allSubordinates.add(DisplayObject1000);
>
>
> session.setAttribute("allSubordinates",allSubordinates);
>
> Your sharing of opinion is appreciated!
>
> Thanks.
>
> Larry
>
>
>
> -
> 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: Session size

2004-05-27 Thread Riyad Kalla
Mike,
Good suggestions. I was dealing with something like this recently and decided 
that for me, adding caching at the DAO level:

e.g. List userList = UserDAO.getAllUsers();

would offer the biggest performance benefit since it would be:

(a) application wide, instead of per session
(b) returned Lists are 4-byte pointers to the actual list object cached in the 
DAO
(c) The DAO itself handles all manipulation of those types, so it knows when 
to invalid its own cache (on inserts/updates/removes)


What do people think about this strategy? (Before I spend a week implementing 
it :)

Best,
Riyad

On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
> I personally think its too big. Large amounts of data like that should
> be put in request scope so that it gets flushed out of memory right
> away. If you need the data to be persistent through the user's session
> lifetime, mabye try serializing it to a database. Of course, different
> situations call for different solutions. Also, I would try and replace
> your Vector with a non-synchronized Collection like an ArrayList or
> LinkedList unless you have some sort of mutlithreaded access to this
> collection.
>
> Riyad Kalla wrote:
> >Larry,
> >Good question. I am curious what others think about this situation as
> > well.
> >
> >On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> >>It is apparent true that if the session size is big, the performance will
> >>be negatively affected. The question is that how to actively control the
> >>size of session.
> >>
> >>Let's discuss this question:
> >>
> >>I have a page which displays all the subordinates of a manager, for some
> >>reasons I want to create a List or a Vector containing all the
> >> subordinates and put this List or Vector to the session. Each element in
> >> the List or Vector is a Java object, Employee( each Employee object has
> >> 200 String attributes, among which 5 are needed to be displayed on the
> >> screen)
> >>
> >>A picture of this situation is:
> >>
> >>Vector allSubordinates = new Vector();
> >>allSubordinates.add(Employee1);
> >>allSubordinates.add(Employee2);
> >>...
> >>
> >>allSubordinates.add(Employee1000);
> >>
> >>
> >>session.setAttribute("allSubordinates",allSubordinates);
> >>
> >>Do you think this actually makes the session very big?
> >>
> >>
> >>Then what will be the improvement of the following? Instead of add all
> >> the employee objects, we create a very small object called
> >> DisplayObject, which just contains the 5 attributes required on the
> >> screen.
> >>
> >>Vector allSubordinates = new Vector();
> >>allSubordinates.add(DisplayObject1);
> >>allSubordinates.add(DisplayObject2);
> >>...
> >>
> >>allSubordinates.add(DisplayObject1000);
> >>
> >>
> >>session.setAttribute("allSubordinates",allSubordinates);
> >>
> >>Your sharing of opinion is appreciated!
> >>
> >>Thanks.
> >>
> >>Larry
> >>
> >>
> >>
> >>-
> >>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: Session size

2004-05-27 Thread Riyad Kalla
Why do you like ibatis? I've never heard of it, is it like OScache?

On Thursday 27 May 2004 09:08 am, Paul Barry wrote:
> Sounds like a good idea.  I suggest that you look into using something
> like ibatis to handle the caching for you, and it definately won't take
> you a week to implement, even with the learning curve of ibatis.
>
> Riyad Kalla wrote:
> > Mike,
> > Good suggestions. I was dealing with something like this recently and
> > decided that for me, adding caching at the DAO level:
> >
> > e.g. List userList = UserDAO.getAllUsers();
> >
> > would offer the biggest performance benefit since it would be:
> >
> > (a) application wide, instead of per session
> > (b) returned Lists are 4-byte pointers to the actual list object cached
> > in the DAO
> > (c) The DAO itself handles all manipulation of those types, so it knows
> > when to invalid its own cache (on inserts/updates/removes)
> >
> >
> > What do people think about this strategy? (Before I spend a week
> > implementing it :)
> >
> > Best,
> > Riyad
> >
> > On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
> >>I personally think its too big. Large amounts of data like that should
> >>be put in request scope so that it gets flushed out of memory right
> >>away. If you need the data to be persistent through the user's session
> >>lifetime, mabye try serializing it to a database. Of course, different
> >>situations call for different solutions. Also, I would try and replace
> >>your Vector with a non-synchronized Collection like an ArrayList or
> >>LinkedList unless you have some sort of mutlithreaded access to this
> >>collection.
> >>
> >>Riyad Kalla wrote:
> >>>Larry,
> >>>Good question. I am curious what others think about this situation as
> >>>well.
> >>>
> >>>On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> >>>>It is apparent true that if the session size is big, the performance
> >>>> will be negatively affected. The question is that how to actively
> >>>> control the size of session.
> >>>>
> >>>>Let's discuss this question:
> >>>>
> >>>>I have a page which displays all the subordinates of a manager, for
> >>>> some reasons I want to create a List or a Vector containing all the
> >>>> subordinates and put this List or Vector to the session. Each element
> >>>> in the List or Vector is a Java object, Employee( each Employee object
> >>>> has 200 String attributes, among which 5 are needed to be displayed on
> >>>> the screen)
> >>>>
> >>>>A picture of this situation is:
> >>>>
> >>>>  Vector allSubordinates = new Vector();
> >>>>  allSubordinates.add(Employee1);
> >>>>  allSubordinates.add(Employee2);
> >>>>  ...
> >>>>
> >>>>  allSubordinates.add(Employee1000);
> >>>>
> >>>>
> >>>>session.setAttribute("allSubordinates",allSubordinates);
> >>>>
> >>>>Do you think this actually makes the session very big?
> >>>>
> >>>>
> >>>>Then what will be the improvement of the following? Instead of add all
> >>>>the employee objects, we create a very small object called
> >>>>DisplayObject, which just contains the 5 attributes required on the
> >>>>screen.
> >>>>
> >>>>  Vector allSubordinates = new Vector();
> >>>>  allSubordinates.add(DisplayObject1);
> >>>>  allSubordinates.add(DisplayObject2);
> >>>>  ...
> >>>>
> >>>>  allSubordinates.add(DisplayObject1000);
> >>>>
> >>>>
> >>>>session.setAttribute("allSubordinates",allSubordinates);
> >>>>
> >>>>Your sharing of opinion is appreciated!
> >>>>
> >>>>Thanks.
> >>>>
> >>>>Larry
> >>>>
> >>>>
> >>>>
> >>>>-
> >>>>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: Session size

2004-05-27 Thread Riyad Kalla
Larry,
It depends on how you load the elements. If you are creating the smaller 
objects by first loading the full objects, then just save the time and use 
the full ones.

If however you are loading the DisplayObjects directly via a Hibernate query 
of course that will be magnitudes smaller.

Also you may consider what the average size of your 200 Strings are. If its 
around 24 characters each (maybe a name, or name of something) that's say 
roughly 30 (object overhead is probably more) x 200 = 6000 bytes (6k) and 
maybe as high as 8k for overhead (I'm pulling numbers out of air here, I 
don't know the VM details on this). Where as your 5-string object is going to 
be considerably smaller (30 x 5 = 150 bytes, ~0.15K).

I'd say if you can load the DisplayObject directly from the DB with a query, 
definately do that, especially if your employement trees can get large (100s 
or 1000s).

Best,
Riyad

On Thursday 27 May 2004 09:06 am, Zhang, Larry (L.) wrote:
> I would be more interested to know if we change the big elements in the
> list to much smaller ones in the list, does it reduce the session (my
> second part of question) at all?

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



Re: Are there any IDE's that understand Struts tags?

2004-05-27 Thread Riyad Kalla
I second this especially if you are doing Struts. MyEclipse offers wizards, 
visual flow navigation and manipulation for your Struts apps which is quite 
nice and of course JSP autocomplete, debugging, taglib autocomplete, xml 
autocomplete, etc. etc.  all the bells and whistles.

** Disclaimer: I help with support on the MyEclipse forums. If you have any 
questions drop on by.

On Thursday 27 May 2004 05:39 am, [EMAIL PROTECTED] wrote:
> You may want to check out the plunin at www.myeclipseide.com, it offers
> support for both Struts and other tag libs as long as you configure your
> project correctly.  While there is a small fee, 29.95, IMHO it is well
> worth it.
>
> Regards,
>
> Todd
>
> > From: Mike Duffy <[EMAIL PROTECTED]>
> > Date: 2004/05/27 Thu AM 08:11:50 EDT
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: RE: Are there any IDE's that understand Struts tags?
> >
> > I would strongly suggest that you stay away from (or move away from) the
> > Struts presentation tags and use JSTL instead.  Development has
> > essentially stopped on the Struts presentation tags.  JSTL has more
> > functionality and JSTL is the "standard".
> >
> > What I would really like to see in an IDE is the ability to select a
> > class and then map the parameters of the class to the JSTL tags in a JSP.
> >  The design mode of the IDE should be able to visually present the JSTL
> > tags in a "dumb HTML" mode so a web designer can easily work with JSTL
> > (without having to run an application server on his system).
> >
> > Dreamweaver from Macromedia is the "premier" design tool.  I emailed
> > Macromedia about JSTL integration and received no response.  I called
> > them, and after being bounced around to several managers I finally got
> > someone to admit that Macromedia has no current plans for JSTL support
> > although they were "considering" the issue.
> >
> > I've looked at some of the current Struts design tools and they appear to
> > be over-glorified config file editors.  I think there is an opportunity
> > for some of these small companies who wish to play in the IDE space to
> > create a JSP editor plugin for Eclipse that supports both Struts and
> > JSTL. I'd pay real money for such a plugin.
> >
> > Until then, the suggestion mentioned earlier is probably the best way to
> > go:  Have a designer design the page in HTML and then, "A java dev then
> > needs to insert the jstl etc in to the page and ensure it still maintains
> > the design/layout after dynamic elements have been added."
> >
> > Mike
> >
> > --- Daniel Perry <[EMAIL PROTECTED]> wrote:
> > > As a company we offer web design, programming, etc, etc.  We have had
> > > the exact same problems you describe, but have gone down the route of
> > > deciding that IDE's arn't the way forward for web design, and that a
> > > text editor is a much better solution.
> > >
> > > So, our web designers all work with raw html.
> > >
> > > You may find resistance to this with designers who think html is
> > > scarry, and would much rather stick with dreamweaver.  But when they
> > > get into it, if they are supported well they will find it a breeze.
> > >
> > > As an example, we took on a junior web designer in january who had no
> > > html/web design skills at all, but did have general design skills.  Now
> > > he's producing great sites, and is up to speed with html and can
> > > happily work with php sites, jstl/struts taglibs, etc.
> > >
> > > We do a lot of subcontracting for other desing companies in the area
> > > who get jobs that require these kinds of skills, but dont have the
> > > people who can do it!
> > >
> > > Daniel.
> > >
> > > > -Original Message-
> > > > From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> > > > Sent: 27 May 2004 10:03
> > > > To: Struts Users Mailing List
> > > > Subject: RE: Are there any IDE's that understand Struts tags?
> > > >
> > > >
> > > > I have had problems in the past getting a "web developer" from a
> > > > number of design companies that
> > > > a. understands what struts/jstl is
> > > > b. understands how to change html not using DW with no reworking
> > > > by a java developer of any tags after the redesign
> > > >
> > > > In my experience it has been easier to either
> > > > a. provide a static screen in Photoshop to the designer for
> > > > building up in a gui of their choice. A java dev then needs to
> > > > insert the jstl etc in to the page and ensure it still maintains
> > > > the design/layout after dynamic elements have been added.
> > > > b. get a java dev that has the ability to rework/create the html
> > > > inside the jsps to the required design.
> > > >
> > > >
> > > > a. is easier up front but more work in the long run as it
> > > > involves a lot more work for the java dev (especially if you are
> > > > using tiles).
> > > > b. is more work at first but works out better in the long run and
> > > > has more benefits.
> > > >
> > > >
> > > > There has been mention of a struts gui 

Re: Session size

2004-05-27 Thread Riyad Kalla
Hmm, I should clarify what I meant:

The DAO will be at the application scope, so if you cache say the last 50 
queries, the cache is held at application scope. In your case, this will 
still help. 

Lets say you have 20 users all working on the site, they all hit their "Show 
employement Tree" page, and you hit the 
UserDAO.getEmploymentTreeForUserID(int userID) method for all 20 people with 
different ID's. That will perform 20 separate queries, cache the result, and 
return it.

Now when all those users hit the refresh button on their web page, it hits 
your DAO again, the same method, with all 20 separate ID's again. But this 
time, all 20 of them are successful cache hits and are returned immediately.

Now say users 1-5 log out and come back 2 hours later and check your 
employement tree page, IF their list had been stored in their sessions, that 
would require you to hit the DB again to reload the lists, but because your 
caching the results in your DAO itself, all of those 5 users that came back 
and check their employement tree, are getting all their results from the 
DAO's cache again since it was stored at the application level (the cache is 
still valid).


The other sexy thing is that if someone calls UserDAO.removeUserByID(4) or 
something liek that, your DAO knows to either (a) aggressively invalid all 
the cache and have all caches rebuilt, OR (b) you could take some time to 
intelligently remove that user from all cached values if it was import to you 
to keep your caches full.


It just gives you more options since all your cache building/invalidating 
occurs in the same DAO class, instead of needing to worry about synchronizing 
multiple resources and classes with eachother.

Did that make sense?

Best,
Riyad

On Thursday 27 May 2004 09:13 am, Zhang, Larry (L.) wrote:
> In my case I have to keep the List in the session level instead of
> application level since different user will have different list of
> employees.
>
> -Original Message-
> From: Riyad Kalla [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 11:53 AM
> To: Struts Users Mailing List
> Subject: Re: Session size
>
>
> Mike,
> Good suggestions. I was dealing with something like this recently and
> decided that for me, adding caching at the DAO level:
>
> e.g. List userList = UserDAO.getAllUsers();
>
> would offer the biggest performance benefit since it would be:
>
> (a) application wide, instead of per session
> (b) returned Lists are 4-byte pointers to the actual list object cached in
> the DAO
> (c) The DAO itself handles all manipulation of those types, so it knows
> when to invalid its own cache (on inserts/updates/removes)
>
>
> What do people think about this strategy? (Before I spend a week
> implementing it :)
>
> Best,
> Riyad
>
> On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
> > I personally think its too big. Large amounts of data like that should
> > be put in request scope so that it gets flushed out of memory right
> > away. If you need the data to be persistent through the user's session
> > lifetime, mabye try serializing it to a database. Of course, different
> > situations call for different solutions. Also, I would try and replace
> > your Vector with a non-synchronized Collection like an ArrayList or
> > LinkedList unless you have some sort of mutlithreaded access to this
> > collection.
> >
> > Riyad Kalla wrote:
> > >Larry,
> > >Good question. I am curious what others think about this situation as
> > > well.
> > >
> > >On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> > >>It is apparent true that if the session size is big, the performance
> > >> will be negatively affected. The question is that how to actively
> > >> control the size of session.
> > >>
> > >>Let's discuss this question:
> > >>
> > >>I have a page which displays all the subordinates of a manager, for
> > >> some reasons I want to create a List or a Vector containing all the
> > >> subordinates and put this List or Vector to the session. Each element
> > >> in the List or Vector is a Java object, Employee( each Employee object
> > >> has 200 String attributes, among which 5 are needed to be displayed on
> > >> the screen)
> > >>
> > >>A picture of this situation is:
> > >>
> > >>  Vector allSubordinates = new Vector();
> > >>  allSubordinates.add(Employee1);
> > >>  allSubordinates.add(Employee2);
> > >>  ...
> 

Re: Session size

2004-05-27 Thread Riyad Kalla
On Thursday 27 May 2004 09:53 am, Zhang, Larry (L.) wrote:
> It sounds like very promising to me. The only consideration is that caching
> those objects may cause another issue of usage of the memory. And also when

Yes absolutely a concern, which is where you can tune how big your cache for 
DAO is. For example, UserRoles might be cheap/small objects, so your cache 
can be 100 units big, and your Users might be expensive/huge objects, so your 
cache only holds 20 units... something like that.

Doing analysis on the memory requirements is a good idea. Considering that 
your users (200 of them) takes up 8k, that's nothing to a server with 2Gig of 
ram... so you could probably increase this to hold a cache of 100s of users.

> the tree is changed (by deleting/transferred one employee from the tree) we
> need to somehow validate/rebuild the cached list of objects.

Hmm yes, if its important to keep the cache as intact as possible, then 
applying logic during table mutations is important.

>
> Is this approach sometimes called object pool?

Object pooling is more generic. The idea being pooling is to store objects for 
reuse usually in the pattern of (1) reinitialize/clear object then (2) 
repopulate and use it (3) return it to the pool.

Where in this case we want to create our objects, and then keep them in their 
same state before reusing them, we aren't really returning them to a 'pool' 
to be pulled out again and reinitialized.

Specifically, when we read in a UserDTO lets say (Data Transfer Object), we 
want to keep his data untouched (e.g. Name="Bob", Age="32"). After displaying 
Bob's data, we don't return his object to a pool, we keep it around in a 
cache, so when someone says "Hey give me Bob's record" we've got it handy 
without hitting the database again.

But yes, caching and pooling are definately in the same family of 'strategies' 
for program performance.

Best,
Riyad

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



Re: Are there any IDE's that understand Struts tags?

2004-05-27 Thread Riyad Kalla
Mike,
Give MyEclipse a try, what you described is what it does. The JSTL support 
isn't fully there yet, but it should be by the next release. And its $30 a 
year (that like 8 cents a day)

Best,
Riyad

On Thursday 27 May 2004 05:11 am, Mike Duffy wrote:
> I would strongly suggest that you stay away from (or move away from) the
> Struts presentation tags and use JSTL instead.  Development has essentially
> stopped on the Struts presentation tags.  JSTL has more functionality and
> JSTL is the "standard".
>
> What I would really like to see in an IDE is the ability to select a class
> and then map the parameters of the class to the JSTL tags in a JSP.  The
> design mode of the IDE should be able to visually present the JSTL tags in
> a "dumb HTML" mode so a web designer can easily work with JSTL (without
> having to run an application server on his system).
>
> Dreamweaver from Macromedia is the "premier" design tool.  I emailed
> Macromedia about JSTL integration and received no response.  I called them,
> and after being bounced around to several managers I finally got someone to
> admit that Macromedia has no current plans for JSTL support although they
> were "considering" the issue.
>
> I've looked at some of the current Struts design tools and they appear to
> be over-glorified config file editors.  I think there is an opportunity for
> some of these small companies who wish to play in the IDE space to create a
> JSP editor plugin for Eclipse that supports both Struts and JSTL. I'd pay
> real money for such a plugin.
>
> Until then, the suggestion mentioned earlier is probably the best way to
> go:  Have a designer design the page in HTML and then, "A java dev then
> needs to insert the jstl etc in to the page and ensure it still maintains
> the design/layout after dynamic elements have been added."
>
> Mike
>
> --- Daniel Perry <[EMAIL PROTECTED]> wrote:
> > As a company we offer web design, programming, etc, etc.  We have had the
> > exact same problems you describe, but have gone down the route of
> > deciding that IDE's arn't the way forward for web design, and that a text
> > editor is a much better solution.
> >
> > So, our web designers all work with raw html.
> >
> > You may find resistance to this with designers who think html is scarry,
> > and would much rather stick with dreamweaver.  But when they get into it,
> > if they are supported well they will find it a breeze.
> >
> > As an example, we took on a junior web designer in january who had no
> > html/web design skills at all, but did have general design skills.  Now
> > he's producing great sites, and is up to speed with html and can happily
> > work with php sites, jstl/struts taglibs, etc.
> >
> > We do a lot of subcontracting for other desing companies in the area who
> > get jobs that require these kinds of skills, but dont have the people who
> > can do it!
> >
> > Daniel.
> >
> > > -Original Message-
> > > From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> > > Sent: 27 May 2004 10:03
> > > To: Struts Users Mailing List
> > > Subject: RE: Are there any IDE's that understand Struts tags?
> > >
> > >
> > > I have had problems in the past getting a "web developer" from a
> > > number of design companies that
> > > a. understands what struts/jstl is
> > > b. understands how to change html not using DW with no reworking
> > > by a java developer of any tags after the redesign
> > >
> > > In my experience it has been easier to either
> > > a. provide a static screen in Photoshop to the designer for
> > > building up in a gui of their choice. A java dev then needs to
> > > insert the jstl etc in to the page and ensure it still maintains
> > > the design/layout after dynamic elements have been added.
> > > b. get a java dev that has the ability to rework/create the html
> > > inside the jsps to the required design.
> > >
> > >
> > > a. is easier up front but more work in the long run as it
> > > involves a lot more work for the java dev (especially if you are
> > > using tiles).
> > > b. is more work at first but works out better in the long run and
> > > has more benefits.
> > >
> > >
> > > There has been mention of a struts gui editor on this list
> > > before. You may want to check the history for the threads with
> > > struts+gui or struts+ide in them. I personally use
> > > JDeveloper+Ultraedit32.
> > >
> > >
> > > Chris McCormack
> > >
> > > -Original Message-
> > > From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
> > > Sent: 27 May 2004 09:40
> > > To: 'Struts Users Mailing List'
> > > Subject: Are there any IDE's that understand Struts tags?
> > >
> > >
> > > Folks,
> > >
> > > I am developing a J2EE server using Struts. The JSPs will be
> > > constructed by
> > > a web developer who is used to DreamWeaver.
> > >
> > > I imported the Struts tag libraries into DW, but the "design view"
> > > doesn't work.
> > > He cant layout the pages visually.
> > >
> > > Is this a limitation of DW?
> > > Are there any web IDE's tha

Re: standard tags vs. struts specific tags

2004-05-27 Thread Riyad Kalla
Thanks Rick for the link.

I just got done installing J2EE 1.4 so I could copy out the files, talk about 
overkill!



On Thursday 27 May 2004 11:59 am, Rick Reumann wrote:
> Barnett, Brian W. wrote:
> > Does this mean I should use jstl from Sun or are the standard tags (c,
> > fmt, sql, etc) that come with struts 1.1 just fine?
>
> Sun's site makes it very annoying. I don't know why they don't provide a
> link to the JSTL tags directly. You can get the JSTL tags here:
>
> http://jakarta.apache.org/taglibs/index.html
>
> And yes use them instead of the struts tags where possible. You still
> need to use the struts form tags and I still use the  key=''/> and html:messages tags, but that's about it.

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



Re: Best way to connect to Database in struts

2004-05-27 Thread Riyad Kalla
Ditto to this comment.

DB > Tomcat JNDI Context > Hibernate > Struts


Tomcat JNDI will manage the connection pooling to the DB for you, then 
hibernate will use the pooled connection to perform queries against, and then 
in your struts app all you do is add/update/remove your objects directly 
using hibernate.

Very slick stuff. I would suggest that you still make use of DAO's to 
centralize and hide the Hibernate query details from your Struts actions.

-Riyad

On Thursday 27 May 2004 01:30 pm, David Friedman wrote:
> Next vote: Hibernate! (www.hibernate.org)
>
> Regards,
> David
>
> -Original Message-
> From: Barnett, Brian W. [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 1:49 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Best way to connect to Database in struts
>
>
> Use iBATIS SqlMaps and Dao framework. www.ibatis.com
>
>
> -Original Message-
> From: Axel Seinsche [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 11:43 AM
> To: Struts Users Mailing List
> Subject: Re: Best way to connect to Database in struts
>
> Zaid wrote:
> >Dear Friends,
> >
> >I am new to struts, so I was confused in choosing the best way to make
> >connection to Database, whether data-resources or Plugin or any other
> >method, however, if any suggested way to connect, please inform me. Baring
> >in mind that I am using MySQL server.
>
> As the Struts data-sources did not work for me, I used JNDI to access my
> DB. This works very well. I somewhere read, that the Struts data-sources
> are not developed any longer and the suggest to use JNDI. I don't know,
> if this is true. But it could be possible.
>
> Axel
>
> -
> 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: Multiple submit buttons in the same form

2004-05-29 Thread Riyad Kalla
1) Yes you can do it
2) Given each button a different value, like "List Products" and "List 
All Products"
3) Add a "buttonValue" (or some other adequetly names) property to your 
form for the respective action, it will capture the button clicked.
4) In your action:

if(form.getButtonValue().equals("List Products"))
   // do stuff
else if(form.getButtonValue().equals("List All Products"))
   // do more stuff
Best,
Riyad
Miguel Arroz wrote:
Hi!
  Can I have multiple submit buttons on the same form? Imagine I have 
"Button A" and "Button B" on a JSP, and I want to do slightly 
different things when a user clicks on each button. It's enough to 
detect, on the Action, the button the user clicked... but that's 
precisely my question. How can I know what button did the user pressed 
to submit the form?

  Yours
Miguel Arroz
 Fire, walk with me.
  Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.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: Multiple submit buttons in the same form

2004-05-29 Thread Riyad Kalla
Rick,
This is a great approach as well and I think we've giving good answers. 
1 way you change the Form, and another way you change the Action.

I didn't know you could do it the way you described, thanks for the tip!
Rick Reumann wrote:
Riyad Kalla wrote:
1) Yes you can do it
2) Given each button a different value, like "List Products" and 
"List All Products"
3) Add a "buttonValue" (or some other adequetly names) property to 
your form for the respective action, it will capture the button clicked.
4) In your action:

if(form.getButtonValue().equals("List Products"))
   // do stuff
else if(form.getButtonValue().equals("List All Products"))
   // do more stuff

You can do it much easier using either of the approachs below:
1) Use the LookUpDispatch Action. You simply give the submit button 
your dispatch property name (ie property="UserAction" ) then the value 
of the button gets looked up from a map in your LookUpDispatchAction 
(see the docs). Much cleaner.. although..

2) I still prefer to set a hidden variable of a dispatch Action with 
javascript when a button is clicked. Then simply use a regular 
DispatchAction or someone mentioned even a MapplingDispatchAction 
which I wasn't aware of (maybe this later is in Struts 1.2?). Assuming 
a regular dispatch action you have buttons like..

Update 

Cancel 


Then just make sure you are using a DispatchAction. (In the above it's 
better if you use the resources properties file for you button names: 
 Just in case later the button 
names change, it's easier to modify one resources file.

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


Re: Page pre-processing

2004-05-29 Thread Riyad Kalla
Eric,
I have something exactly like this, and I get around it by setting the 
action's validate attribute to false for the "prepare" method, and true 
for the "submission" action... for example:

prepareEditUser: takes a user ID, loads all data up into request for JSP 
page to show, action does validation on the ID, form validate == false;
editUser: form validate == true, accepts all params from the edit page 
and verifies that they are sane.

So with the validate = false action, the form won't validate, you just 
have to move the check into the action then you can reuse the form.

Eric Fesler wrote:
Hi,
I'm currently working on an application with several pages having
multiple combo-boxes.
The content of the combo-boxes is closely related to other components of
the model. Therefore, I use a 'prepare' action to setup the model and
put the combo-box collections in the request scope.
Unfortunately, this way of working is not compatible with the Struts
validation process. Indeed, when the validation of the form failed, the
request is forwarded back to the input page and the collections are not
initialized.
A workaround would be to put the collections in the session scope (what
I finally did) but at the end the session becomes full of garbage
information. Another solution is to build the collection within the JSP
page (maybe with custom tags) but this is against the separation of the
view and the model.
I was wondering if anybody had already thought about an additional
parameter linked to a struts-forward allowing page pre-processing. This
parameter could point to a new kind of model action that will complete
the model with information needed by the view any time the forward is
activated.
Or... I'm missing something ...
How do you handle such a case?
Thanks,
--Eric

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


Semi-OT: Organizing WEB-INF/lib dir...

2004-06-03 Thread Riyad Kalla
Quick question for the people more versed in web apps than me, can you 
organized your libs in your WEB-INF/lib dir into separate sub dirs? I 
ask because my project is using Struts and Hibernate right now, and 
there is a such a mish-mash of JARs forming in my WEB-INF/lib dir, that 
its hard for me to upgrade the right jars when a new release comes out. 
I'd like to have something like:

WEB-INF/lib/struts
WEB-INF/lib/hibernate
or something to that extent. Can I do this?
TIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Semi-OT: Organizing WEB-INF/lib dir...

2004-06-04 Thread Riyad Kalla
Frank,
Great suggestion, I'll look into doing this as it is troublesome that 
hibernate and struts have the same deps (diff vers) on most of commons

Frank Zammetti wrote:
I'm pretty sure the answer is no. I just took all the JARs for a test 
app I had installed and moved them from WEB-INF/lib to 
WEB-INF/lib/stuff, and the app no longer works. This is in Tomcat, so 
possibly it would work with another app server, but I tend to doubt it.

One suggestion that I can make, a habit I've gotten into, is name your 
JARs liberally, since their names don't matter. I usually name the 
JARs as descriptively as possible (for example, 
"jakarta-taglibs-standard-1.1.0.jar" might be one) and include their 
version, so it's fairly easy to tradk down what's what and at a glance 
tell what versions I'm running. Probably not the ideal answer, but 
maybe it'll clean up the mess just a little.

Frank

From: Riyad Kalla <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Semi-OT: Organizing WEB-INF/lib dir...
Date: Thu, 03 Jun 2004 20:58:36 -0700
Quick question for the people more versed in web apps than me, can 
you organized your libs in your WEB-INF/lib dir into separate sub 
dirs? I ask because my project is using Struts and Hibernate right 
now, and there is a such a mish-mash of JARs forming in my 
WEB-INF/lib dir, that its hard for me to upgrade the right jars when 
a new release comes out. I'd like to have something like:

WEB-INF/lib/struts
WEB-INF/lib/hibernate
or something to that extent. Can I do this?
TIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
MSN 9 Dial-up Internet Access fights spam and pop-ups – now 3 months 
FREE! http://join.msn.click-url.com/go/onm00200361ave/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: Semi-OT: Organizing WEB-INF/lib dir...

2004-06-04 Thread Riyad Kalla
Eclipse + MyEclipse
Joe Hertz wrote:
What IDE are you using? Can't it help you with this? 

JBuilder certainly spares me this hassle (okay, that's not all good.
I've had some *other* hassles* because of it, but they are certainly
worth it).
 

-Original Message-----
From: Riyad Kalla [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 03, 2004 11:59 PM
To: Struts Users Mailing List
Subject: Semi-OT: Organizing WEB-INF/lib dir...

Quick question for the people more versed in web apps than 
me, can you 
organized your libs in your WEB-INF/lib dir into separate sub dirs? I 
ask because my project is using Struts and Hibernate right now, and 
there is a such a mish-mash of JARs forming in my WEB-INF/lib 
dir, that 
its hard for me to upgrade the right jars when a new release 
comes out. 
I'd like to have something like:

WEB-INF/lib/struts
WEB-INF/lib/hibernate
or something to that extent. Can I do this?
TIA
-
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: Semi-OT: Organizing WEB-INF/lib dir...

2004-06-04 Thread Riyad Kalla
Good idea, Maven would certainly have more requirements than I do :D
Dan Tran wrote:
Dont think jsp/servlet specs allows splitting of the lib
dir.  You may want to take a look at maven.apache.org
or use the way Maven names it dependencies jar files
good luck.
-Dan
- Original Message - 
From: "Joe Hertz" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 2004 10:29 PM
Subject: RE: Semi-OT: Organizing WEB-INF/lib dir...

 

What IDE are you using? Can't it help you with this? 

JBuilder certainly spares me this hassle (okay, that's not all good.
I've had some *other* hassles* because of it, but they are certainly
worth it).
   

-Original Message-
From: Riyad Kalla [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 03, 2004 11:59 PM
To: Struts Users Mailing List
Subject: Semi-OT: Organizing WEB-INF/lib dir...

Quick question for the people more versed in web apps than 
me, can you 
organized your libs in your WEB-INF/lib dir into separate sub dirs? I 
ask because my project is using Struts and Hibernate right now, and 
there is a such a mish-mash of JARs forming in my WEB-INF/lib 
dir, that 
its hard for me to upgrade the right jars when a new release 
comes out. 
I'd like to have something like:

WEB-INF/lib/struts
WEB-INF/lib/hibernate
or something to that extent. Can I do this?
TIA
-
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: Sorry : Semi-OT: Organizing WEB-INF/lib dir...

2004-06-04 Thread Riyad Kalla
This is also a very good suggestion, thanks Mark!
Mark Lowe wrote:
I think you perhaps what to organise you jars in a central place like
~/Projects/lib/struts-1.1
~/Projects/lib/hibernate-2.1
~/Projects/myapp/src
and such like
and then use ant to copy the dependencies into
~/Projects/myapp/build/WEB-INF/lib
at build time with an ant task.
This will give you the clarity of centralising your jars while not  
comprimising anything with the container spec.

Mark
On 4 Jun 2004, at 08:04, [EMAIL PROTECTED] wrote:
I think I am wrong. my experiment went a little wrong. soory about  
that. I think lib cannot be subdivided.

 Brati Sankar Ghosh
 Tata Consultancy Services
 Mailto: [EMAIL PROTECTED]
 Website: http://www.tcs.com

"Dan Tran" <[EMAIL PROTECTED]>
06/04/2004 11:23 AM
Please respond to
 "Struts Users Mailing List" <[EMAIL PROTECTED]>

To
"Struts Users Mailing List" <[EMAIL PROTECTED]>
cc
Subject
Re: Semi-OT: Organizing WEB-INF/lib dir...



Dont think jsp/servlet specs allows splitting of the lib
 dir.  You may want to take a look at maven.apache.org
 or use the way Maven names it dependencies jar files
 good luck.
 -Dan
 - Original Message -
 From: "Joe Hertz" <[EMAIL PROTECTED]>
 To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
 Sent: Thursday, June 03, 2004 10:29 PM
 Subject: RE: Semi-OT: Organizing WEB-INF/lib dir...
 > What IDE are you using? Can't it help you with this?
 >
 > JBuilder certainly spares me this hassle (okay, that's not all good.
 > I've had some *other* hassles* because of it, but they are certainly
 > worth it).
 >
 > > -Original Message-
 > > From: Riyad Kalla [mailto:[EMAIL PROTECTED]
 > > Sent: Thursday, June 03, 2004 11:59 PM
 > > To: Struts Users Mailing List
 > > Subject: Semi-OT: Organizing WEB-INF/lib dir...
 > >
 > >
 > > Quick question for the people more versed in web apps than
 > > me, can you
 > > organized your libs in your WEB-INF/lib dir into separate sub  
dirs? I
 > > ask because my project is using Struts and Hibernate right now,  
and
 > > there is a such a mish-mash of JARs forming in my WEB-INF/lib
 > > dir, that
 > > its hard for me to upgrade the right jars when a new release
 > > comes out.
 > > I'd like to have something like:
 > >
 > > WEB-INF/lib/struts
 > > WEB-INF/lib/hibernate
 > >
 > > or something to that extent. Can I do this?
 > >
 > > TIA
 > >
 > >  
-
 > > 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]
ForwardSourceID:NTAB2E
- 

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]


OT: Is taglib execution between start/end tags need to worry about synchronization?

2004-06-05 Thread Riyad Kalla
I have a situation where my taglib is pretty expensive in that its 
execution looks something like this:

startTag()
* get ID passed in as attribute to tag
* lookup object in App scope with that ID (Search list)
* look at object and get 2 dependency IDs from it (statusID and typeID)
   * lookup the Status object in the App scope using the statusID 
(Search list)
   * lookup the Type object in the App scope using the typeID (Search list)
* print some stuff to output stream
   
* print the end of the stuff to output stream


So everything with a asterik (*) before it is done in the taglib, and 
the "Search list" denotes that I'm getting an ArrayList from the App 
scope, and then searching it for the object with the ID I'm interested 
in. Now when I ran some load tests on this tag, it was understandably 
not as fast as I had hoped, so I thought to speed it up, I would 
remember the last ID asked for when I return from the tag, and if the 
NEXT TIME the tag is executed, the same ID is asked for, I just reuse 
the object, its status and its type that I already found the previous 
time the tag ran, so ti looks something like this:
* get ID passed in as attribute to tag
** if ID is the same as the last ID we processed, jump right to the printing
   * lookup object in App scope with that ID (Search list)
   * look at object and get 2 dependency IDs from it (statusID and typeID)
   * lookup the Status object in the App scope using the statusID 
(Search list)
   * lookup the Type object in the App scope using the typeID 
(Search list)
** previousID = ID
* print some stuff to output stream
   
* print the end of the stuff to output stream


The lines with douible asteriks is the new code that remembers the last 
ID. Now this seems to work just fine and sped things up by about a 
factor of 5 for me, but I'm wondering if I need to worry about any 
potential synchornization issues... I was thinking no, because it seemed 
that another call wasn't going to come into this tag until the doTagEnd 
method had been called, then it would be put back into the Tag pool for use.

Can anyone let me know if this is fine, or if I need to go back to the 
old slow way because this will totally break with multiple people on the 
same page using the same tag at the same time?

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


Taglib: how do you call a method like java.util.List.size() from the property of a tag?

2004-06-05 Thread Riyad Kalla
I'm trying to do something like:

   

but I'm obviously getting an exception on size because it doesn't follow 
JB naming conventions. How do I call this method? Do I NEED to use EL 
for this?

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


Re: clearing an ActionForm from session

2004-06-05 Thread Riyad Kalla
You can forcibly remove it as the last step in your last action before 
sending the user to a success page:
request.getSession().setAttribute("formName", null);

where "formName" is the same name you gave the bean in your 
struts-config.xml file in the "form-beans" section of the file. There is 
no automatic way I know of that you can tell Struts to destroy an object 
on purpose.

If you just want to reset the form, and not null it out, make your last 
line instead of the setAttribute, make it:
form.reset();

this way the form is still cached for use, but values are empty.
ksitron wrote:
I have an action form whose data is needed across several JSP's, for 
this reason I set the scope to session for this ActionForm in my
struts-config.xml.
When the transaction is completed I want the form to go away.  What is 
the best practice for this.

Thanks in advance.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Taglib: how do you call a method like java.util.List.size() from the property of a tag?

2004-06-06 Thread Riyad Kalla
Hey Joe that length function looks like just what I wantedI didn't 
want to do scriplets because of the possibility of a NPE if the session 
timed out and the list wasn't in the session, I want something that 
gracefully handles the missing item and I thought a custom taglib might 
be overkill.

Thanks for your suggestions!
Joe Germuska wrote:
At 5:15 PM -0700 6/5/04, Riyad Kalla wrote:
I'm trying to do something like:

   

but I'm obviously getting an exception on size because it doesn't 
follow JB naming conventions. How do I call this method? Do I NEED to 
use EL for this?

One of the unfortunate shortcomings of the Collections APIs is the 
lack of a bean-convention-named method to access the length of the list.

If you put userList into the request before forwarding to the JSP, you 
could also set another request attribute with the size value; or you 
could put the list in a simple wrapper:

public class MyListWrapper {
  private List list;
  public MyListWrapper(List list) { this.list = list; }
  public int getSize() { return this.list.size(); }
  public List getList() { return this.list; }
}
If you are using JSTL 1.1, you could use the "length" function.
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/length.fn.html
Of course, you could use scriptlets too.
Joe
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Raw newbie] Struts/JSTL - A cople of urgent question (Message resources)

2004-06-06 Thread Riyad Kalla
This doesn't necessarily sound like a Struts question, so I'll answer it 
in the general terms:

1) Create your ResourceBundle for that properties file containing all 
your measurement information, then from that get the enumeration from 
"getKeys" then cycle over the keys getting the values, doing your logic 
on each value (if contains DISTANCE then blah).

2) You can call get normally here but when you get back your result, 
call a string.split(",") on it to get back a 2-element array, one with 
"en_US" in it and the other with "USA" in it, then you do your logic to 
make one the display variable and one the logical variable in the 
system. NOTE: String.split is insanely fast, actually all of the regexp 
package is insanely fast, I tried benchmarking it once to see if I 
should implement a much simplier routine for my parser, and the regexp 
package blew me away, it was almost rediculous how fast it was.

Johan Wasserman - BCX - Infrastructure Services wrote:
As a RAW newbie:
How do I buid an ArayList of properties for a menu?
for example;
I have a resource file containing:
DISTANCE_MILE=Mile
DISTANCE_KILO=Kilometre
DISTANCE_FEET=Feet
DISTANCE_METRE=Metre
AREA_SQ_FOOT=Sqare Foot
AREA_SQ_METRE=Square Metre
VOLUME_QUBIC_INCH=q'
VOLUME_QUBIC_METRE=m2
now, I need to (from a class), get the resource bundle and build an
araylist of (key, value) for DISTANCE* so that only the distance
parameters show up in my list.
To do this even more trickier if I have something like:
LANG_EN_US=en_US, USA
LANG_EN_UK=en_UK, England
...etc
how do I have the en_US (constant) as the value and USA (variable,
depending on language) as the display?
get my drift?
Thank you for a wonderrful forum (MSDN, go suck eggs!)
 

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


Re: Front Controller?

2004-06-06 Thread Riyad Kalla
Model 2 / MVC / Front Controller are all the same thing. In Struts the 
"Front Controller" is the "ActionServlet", it 
receives/handles/dispatches every single request that comes into your 
web app. You write actions that are like units of functionality, then 
specify in a mapping file the relationship between URLs and the Action, 
then depending on where the user is going, the ActionServlet will call 
the appropriate Action at the appropriate time to handle the user's request.

Chaikin, Yaakov Y (US SSA) wrote:
Hi,
Struts project is for MVC. Is there a project out there that implements
Front Controller pattern?
Thank you.
Yaakov Chaikin
Software Engineer
BAE SYSTEMS
301-838-6899 (ph)
301-838-6802 (fax)

-
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: Taglib: how do you call a method like java.util.List.size() from the property of a tag?

2004-06-07 Thread Riyad Kalla
Comments below:
Hi Riyad,
here is a simple example:

 

I feel foolish, this is exactly what I wanted and didn't even see that 
in the taglib docs. Thanks a million!



BTW, you are doing a very good job on MyEclipseIDE Team!
 

Thank you, I appreciate that. They are a great/strong team to work with.
Best,
Riyad
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  1   2   >