How to create a web flow with Struts

2005-04-08 Thread Néstor Boscán
Hi
 
I have a new project were I have to create an application that is a web flow
of multiple standalone applications. Basically the user picks a service and
the web flow will take the user to all the applications necessary to fulfill
the service. We want to be able to save in a database the user navigation
information. Has anybody done something like this with struts?
 
Regards,
 
Néstor Boscán


RE: Which version of Validator was shipped with Struts 1.1b2

2005-04-08 Thread tarek.nabil
Thanks a lot Phil.

I hope somene can tell me how to do this, because I'm not into CVS at
all. 

-Original Message-
From: Phil Steitz [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 8:27 AM
To: Struts Users Mailing List
Subject: Re: Which version of Validator was shipped with Struts 1.1b2

IIRC, at the time when struts 1.1b2 was released, struts was bundling
commons jars built from tagged sources.  There is a tag named
STRUTS_1_1_B2 in the validator sources. If you check out the source
files using this tag, you should get the sources corresponding to what
was bundled with struts 1.1b2.

Can one of the struts committers pls confirm this?  Also, is there an
svn way to grab these sources or should they be checked out from the old
cvs repo?

Phil

On Apr 4, 2005 3:02 AM, tarek.nabil <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm using Oracle's BC4J framework which was shipped with JDeveloper
> 9.0.3.4 and I can not upgrade to newer versions. This frameworks 
> supports Struts 1.1b2 and not any other version. I'm currently facing 
> a problem with getting the validation framework to work in my 
> application and I need to debug using the source code.
> 
> My problem is, I can not determine exactly which version of 
> commons-validator shipped with Struts 1.1b2. I tried almost all the 
> versions on the distribution site and there's a mismatch between all 
> of them and the JAR file that shipped with Struts 1.1b2. 
> Unfortunately, the manifest file in the JAR doesn't say anything :(
> 
> I really need to determine the version and also get my hands on the 
> source code. I'm having a problem with the fact that some of the older

> source code is being taken off the arhive.apache.org site. For 
> example, Struts 1.1b2 is not on the site and if the source wasn't 
> shipped with JDeveloper I wouldn't have been able to get my hands on
it.
> Unfortunately, the source of the dependencies is not shipped with 
> JDeveloper.
> 
> Please help.
> 
> Tarek Nabil
> 
> -
> 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: Meta Information in Action Form

2005-04-08 Thread Craig McClanahan
On Apr 8, 2005 1:12 PM, Anil <[EMAIL PROTECTED]> wrote:
> Matt Raible  raibledesigns.com> writes:
> 
> >
> > As far as drop-downs, I typically populate all (or most) of mine from a
> > database at application startup using a ServletListener.  I stuff these
> > into the application scope as Lists of LabelValue beans.  Then I code
> > up a ReloadAction that can call my Listener to reload them all.  I've
> > found this useful so I don't have to restart the app if data changes.
> >
> > Matt
> 
> 
> > If I have edit screens for the drop-downs, I'll replace the List in
> > application scope after saving.
> 
> If the application scope has been used to store the drop-down values, how will
> you handle the updates on data in application scope in clustered environment?
> Is there any way to get rid of the problem?
> 

One option would be to add an administrative action in your URL that
calls the code to reinitialze the application scoped lists (i.e. the
same code called by your context listener or init method to load them
in the first place)?  That way, you can set up a button or something
that triggers reloading whenever someone knows that it is necessary.

An alternative strategy I've used in the past is to have a single
application scope bean that exposes each of the lists as a read-only
property.  The getter for that list, then, could do something (such as
a cheap database read to get a last modified timestamp or something)
to see if it needs to refresh the list before returning it.  That way,
the user of the list never has to worry about reloading.

> Anil.

Craig

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



Re: session expiration issue and tiles

2005-04-08 Thread Dave Newton
sudip shrestha wrote:
I have user types with varying level of privileges and only a defined
user type can access a particular page.  I thought of using filter for
this purpose, but not sure how to designate which layout*.jsp (have
created multiple layout.jsp pages for varying user types: e.g. admin
can access layout1.jsp, user can access layout2.jsp) can be accessed
by which user type.  

I'm not sure if we're addressing the same problems, or if my solution is 
a good one, but I have "tiles:insert" tags that insert menuing sub-tiles 
wrapped by an authorization level check, so depending on their auth 
level they get a different menu tile inserted.

So the overall layout is the same for all user types, but different user 
authorization levels have different subtiles inserted. This method could 
be extended to cover any aspect of the layout: in my case it's a single 
row of menu options underneath the page's logo header.

I imagine you could also create the name of the tile to be inserted 
on-the-fly using EL, but I didn't do that. Don't know why not; that 
seems cleaner, but I'm tired.

Dave

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


Re: Meta Information in Action Form

2005-04-08 Thread Matt Raible
On Apr 8, 2005, at 2:12 PM, Anil wrote:
Matt Raible  raibledesigns.com> writes:
As far as drop-downs, I typically populate all (or most) of mine from 
a
database at application startup using a ServletListener.  I stuff 
these
into the application scope as Lists of LabelValue beans.  Then I code
up a ReloadAction that can call my Listener to reload them all.  I've
found this useful so I don't have to restart the app if data changes.

Matt

If I have edit screens for the drop-downs, I'll replace the List in
application scope after saving.
If the application scope has been used to store the drop-down values, 
how will
you handle the updates on data in application scope in clustered 
environment?
Is there any way to get rid of the problem?

I tend to do this mostly for drop-downs that are pretty much static, 
but might change once a week/month.  I'm probably over-engineering in 
most cases - but once the infrastructure is setup, it's easy to do.  In 
a clustered environment, I'd probably keep the same solution and take 
the hit on application startup.  Otherwise, you could do request-scoped 
lists when you load your forms - or use something like XmlHttpRequest 
(the DWR project is nice - http://drw.dev.java.net) to populate 
drop-downs when your pages loads.  Spring MVC is pretty slick in that 
their form controllers have a "referenceData()" method that's 
specifically designed to populate drop-downs and such.

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


Re: session expiration issue and tiles

2005-04-08 Thread sudip shrestha
Dave:
I have user types with varying level of privileges and only a defined
user type can access a particular page.  I thought of using filter for
this purpose, but not sure how to designate which layout*.jsp (have
created multiple layout.jsp pages for varying user types: e.g. admin
can access layout1.jsp, user can access layout2.jsp) can be accessed
by which user type.  I could not use ldaprealm as system
administrators disagreed to storing password in server.xml file (which
is needed to read group membership)(I could have used container
managed security), so I am using tiles-layout page for the
verification.  This auth piece is at the top of the page,  so I don't
see the page already outputting to the HTTP connection before this
script executes.

On Apr 8, 2005 11:55 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
> sudip shrestha wrote:
> 
> >--
> >I have few layout.jsp templates  where I have following chuck of code
> >which should redirect the browser to login page if session expires:
> ><%   String loginCheck = "notLoggedIn";
> >   if( session.getAttribute( "session_unique_id" )!=null )
> >   {
> >   loginCheck = (String)session.getAttribute( 
> > "session_unique_id" );
> >   }
> >   if( !loginCheck.equals("admin0") )
> >   {
> >%>
> >   
> ><%   }
> >%>
> >
> >But when session expires, or when somebody who is not 'admin0' tries
> >to access the page, they get a blank page instead of getting
> >redirection.  I have tried using jsp:forward directive as well, but
> >the result is same.
> >If anybody has any suggestion on this, please let me know.
> >
> >
> Put this logic somewhere else like a filter or request processor.
> 
> Not knowing the full layout of your tiles I'd say that you've probably
> already output to the HTTP connection, which means you can't redirect
> anymore. Just a guess. In any case this is handled _far_ better some
> place other than the presentation layer, especially if you have the same
> code in more than one place--sketchy.
> 
> Dave
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Meta Information in Action Form

2005-04-08 Thread Dave Newton
Craig McClanahan wrote:
That being said, I have seen cases where the potential performance
penalty is quite large (many seconds of database access), which will
show up in one of your users waiting an abnormally long time for their
response -- not something I would find very appealling.
 

I don't like my users much anyway.
If it were up to me, they'd be waiting an infinitely long time for 
EVERYTHING. Saves me the trouble of having to write it.

It's Friday, and I'm crabby :/
;)
Dave

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


Re: Meta Information in Action Form

2005-04-08 Thread Anil
Matt Raible  raibledesigns.com> writes:

> 
> As far as drop-downs, I typically populate all (or most) of mine from a  
> database at application startup using a ServletListener.  I stuff these  
> into the application scope as Lists of LabelValue beans.  Then I code  
> up a ReloadAction that can call my Listener to reload them all.  I've  
> found this useful so I don't have to restart the app if data changes.   
> 
> Matt


> If I have edit screens for the drop-downs, I'll replace the List in  
> application scope after saving.

If the application scope has been used to store the drop-down values, how will 
you handle the updates on data in application scope in clustered environment? 
Is there any way to get rid of the problem?

Anil.


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



Re: Meta Information in Action Form

2005-04-08 Thread Craig McClanahan
On Apr 8, 2005 12:39 PM, Dave Newton <[EMAIL PROTECTED]> wrote:
> Craig McClanahan wrote:
> 
> >On Apr 8, 2005 11:28 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
> >
> >
> >>I haven't done much (anything?) with servlet listeners--what's the
> >>advantage to doing it this way as opposed to a servlet.init that loads
> >>on app startup? Generally what we've done is to have a thread that
> >>checks a flag that signals DB changes that then calls the same code to
> >>reload everything. I'm not too involved with that part of the code though.
> >>
> >The servlet container is *not* required to leave your load-on-startup
> >servlet loaded for the entire duration of the webapp's lifetime
> >(although, in practice, most containers do).  For example, the
> >container could unload a servlet that it sees isn't being used, or if
> >it has memory contention issues, or for whatever reason is desired.
> >
> >
> If the servlet is just putting objects into application scope does this
> matter?
> 
> We weren't using the same servlet to reload that app-scoped data (don't
> ask; I don't know) but even if we were, would the only penalty be time?
> IOW, the servlet isn't "gone forever," right?
> 

The previous servlet instance is indeed "gone forever", but anything
that it has placed into servlet context attributes is still around.

That being said, I have seen cases where the potential performance
penalty is quite large (many seconds of database access), which will
show up in one of your users waiting an abnormally long time for their
response -- not something I would find very appealling.

> >A ServletContextListener, on the other hand, guarantees that
> >contextInitialized() will get called at startup time (before any
> >requests have been processed), and contextDestroyed() will get called
> >at shutdown time (after the last request), no matter what happens in
> >between.
> >
> >
> I think I'll move all this stuff over to there anyway; that sounds much
> cleaner.
> 

Yep -- it's definitely cleaner.

> Thanks!
> 
> Dave
> 
> 

Craig

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



Re: Meta Information in Action Form

2005-04-08 Thread Dave Newton
Craig McClanahan wrote:
On Apr 8, 2005 11:28 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
 

I haven't done much (anything?) with servlet listeners--what's the
advantage to doing it this way as opposed to a servlet.init that loads
on app startup? Generally what we've done is to have a thread that
checks a flag that signals DB changes that then calls the same code to
reload everything. I'm not too involved with that part of the code though.
The servlet container is *not* required to leave your load-on-startup
servlet loaded for the entire duration of the webapp's lifetime
(although, in practice, most containers do).  For example, the
container could unload a servlet that it sees isn't being used, or if
it has memory contention issues, or for whatever reason is desired.
 

If the servlet is just putting objects into application scope does this 
matter?

We weren't using the same servlet to reload that app-scoped data (don't 
ask; I don't know) but even if we were, would the only penalty be time? 
IOW, the servlet isn't "gone forever," right?

A ServletContextListener, on the other hand, guarantees that
contextInitialized() will get called at startup time (before any
requests have been processed), and contextDestroyed() will get called
at shutdown time (after the last request), no matter what happens in
between.
 

I think I'll move all this stuff over to there anyway; that sounds much 
cleaner.

Thanks!
Dave


Re: Meta Information in Action Form

2005-04-08 Thread Craig McClanahan
On Apr 8, 2005 12:15 PM, Matt Raible <[EMAIL PROTECTED]> wrote:
> 
> On Apr 8, 2005, at 1:00 PM, Christine Huang wrote:
> 
> > On Apr 8, 2005 1:40 PM, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> >>
> >> The servlet container is *not* required to leave your load-on-startup
> >> servlet loaded for the entire duration of the webapp's lifetime
> >> (although, in practice, most containers do).  For example, the
> >> container could unload a servlet that it sees isn't being used, or if
> >> it has memory contention issues, or for whatever reason is desired.
> >>
> >> Of course, if you're talking about ActionServlet, it will get reloaded
> >> again on the next request, but that will cause your init() method to
> >> run again -- wasting a whole bunch of time in many cases.
> >>
> >> A ServletContextListener, on the other hand, guarantees that
> >> contextInitialized() will get called at startup time (before any
> >> requests have been processed), and contextDestroyed() will get called
> >> at shutdown time (after the last request), no matter what happens in
> >> between.
> >>
> >> Craig
> >>
> >
> > Craig,
> >
> > Thanks for the information about ServletContextListener. But I wonder
> > what you do to reload updated data from database without restarting
> > using ServletContextListener. Have another action to call it reload()
> > like Matt Riable said?
> 
> Just in case you're interested in some code:
> 
> StartupListener: http://tinyurl.com/3wvk9
> ReloadAction: http://tinyurl.com/6webx
> 
> Note that my StartupListener extends Spring's ContextLoaderListener.
> This is because servlet 2.3 containers do not guarantee listener order
> initialization.  If you're using Spring, I recommend this approach.  If
> not, you don't need to extend anything.
> 

Actually, both 2.3 and 2.4 are quite specfic about calling order --
see SRV.10.3.3 (startup calls in the order of registration, which
means the order of listing in web.xml) and SRV.10.3.4 (shutdown calls
in reverse order of presentation).

Nothing wrong with what Matt suggests, but it shouldn't be necessary
in a compliant container. (AFAICR, Tomcat 4.x and 5.x have always done
this in the order described above.)

> Matt

Craig

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



Re: Meta Information in Action Form

2005-04-08 Thread Matt Raible
On Apr 8, 2005, at 1:00 PM, Christine Huang wrote:
On Apr 8, 2005 1:40 PM, Craig McClanahan <[EMAIL PROTECTED]> wrote:
The servlet container is *not* required to leave your load-on-startup
servlet loaded for the entire duration of the webapp's lifetime
(although, in practice, most containers do).  For example, the
container could unload a servlet that it sees isn't being used, or if
it has memory contention issues, or for whatever reason is desired.
Of course, if you're talking about ActionServlet, it will get reloaded
again on the next request, but that will cause your init() method to
run again -- wasting a whole bunch of time in many cases.
A ServletContextListener, on the other hand, guarantees that
contextInitialized() will get called at startup time (before any
requests have been processed), and contextDestroyed() will get called
at shutdown time (after the last request), no matter what happens in
between.
Craig
Craig,
Thanks for the information about ServletContextListener. But I wonder
what you do to reload updated data from database without restarting
using ServletContextListener. Have another action to call it reload()
like Matt Riable said?
Just in case you're interested in some code:
StartupListener: http://tinyurl.com/3wvk9
ReloadAction: http://tinyurl.com/6webx
Note that my StartupListener extends Spring's ContextLoaderListener.  
This is because servlet 2.3 containers do not guarantee listener order 
initialization.  If you're using Spring, I recommend this approach.  If 
not, you don't need to extend anything.

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


Re: Meta Information in Action Form

2005-04-08 Thread Craig McClanahan
On Apr 8, 2005 11:50 AM, Jay Burgess <[EMAIL PROTECTED]> wrote:
> We too use a PlugIn, and I'm now wondering based on Craig's explanation 
> whether
> there are any advantages/disadvantages of one technique over the other?

Struts PlugIns are initialized and destroyed by the ActionServlet.init
and ActionServlet.destroy methods, so they are (of course) subject to
the same potential problems.

If you're on a Servlet 2.3 or later container, I would recommend
migrating your plugins to use ServletContextListener instead.  It's
really easy -- just tweak the method signature of the two relevant
methods.  You have access to the ServletContext for the application
(it's in the event parameter), so it's easy to do things like set up
application scope caches for your domain tables.

Craig

> 
> Jay
> Vertical Technology Group
> http://www.vtgroup.com/
> 
> 
> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 2:35 PM
> To: Struts Users Mailing List
> Subject: Re: Meta Information in Action Form
> 
> Matt's general approach is the one we use also, except instead of
> ServletListeners and the database, we use the DigestingPlugIn, which
> produces objects based on XML and can put them in the application
> context.  There's an example in the mailreader app which you should
> be able to just about cut-and-paste, with the exception of changing
> the XML which represents your menu items.
> 
> Joe
> 
> At 12:12 PM -0600 4/8/05, Matt Raible wrote:
> >As far as drop-downs, I typically populate all (or most) of mine
> >from a database at application startup using a ServletListener.  I
> >stuff these into the application scope as Lists of LabelValue beans.
> >Then I code up a ReloadAction that can call my Listener to reload
> >them all.  I've found this useful so I don't have to restart the app
> >if data changes.
> >If I have edit screens for the drop-downs, I'll replace the List in
> >application scope after saving.
> 
> --
> Joe Germuska
> [EMAIL PROTECTED]
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
> 
> -
> 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: Meta Information in Action Form

2005-04-08 Thread Christine Huang
On Apr 8, 2005 1:40 PM, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> 
> The servlet container is *not* required to leave your load-on-startup
> servlet loaded for the entire duration of the webapp's lifetime
> (although, in practice, most containers do).  For example, the
> container could unload a servlet that it sees isn't being used, or if
> it has memory contention issues, or for whatever reason is desired.
> 
> Of course, if you're talking about ActionServlet, it will get reloaded
> again on the next request, but that will cause your init() method to
> run again -- wasting a whole bunch of time in many cases.
> 
> A ServletContextListener, on the other hand, guarantees that
> contextInitialized() will get called at startup time (before any
> requests have been processed), and contextDestroyed() will get called
> at shutdown time (after the last request), no matter what happens in
> between.
> 
> Craig
> 

Craig, 

Thanks for the information about ServletContextListener. But I wonder
what you do to reload updated data from database without restarting
using ServletContextListener. Have another action to call it reload()
like Matt Riable said?

Christine

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



RE: Meta Information in Action Form

2005-04-08 Thread Jay Burgess
We too use a PlugIn, and I'm now wondering based on Craig's explanation whether
there are any advantages/disadvantages of one technique over the other?  

Jay
Vertical Technology Group
http://www.vtgroup.com/
 

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 2:35 PM
To: Struts Users Mailing List
Subject: Re: Meta Information in Action Form

Matt's general approach is the one we use also, except instead of 
ServletListeners and the database, we use the DigestingPlugIn, which 
produces objects based on XML and can put them in the application 
context.  There's an example in the mailreader app which you should 
be able to just about cut-and-paste, with the exception of changing 
the XML which represents your menu items.

Joe


At 12:12 PM -0600 4/8/05, Matt Raible wrote:
>As far as drop-downs, I typically populate all (or most) of mine 
>from a database at application startup using a ServletListener.  I 
>stuff these into the application scope as Lists of LabelValue beans. 
>Then I code up a ReloadAction that can call my Listener to reload 
>them all.  I've found this useful so I don't have to restart the app 
>if data changes.
>If I have edit screens for the drop-downs, I'll replace the List in 
>application scope after saving.


-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

-
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: Meta Information in Action Form

2005-04-08 Thread Joe Germuska
Matt's general approach is the one we use also, except instead of 
ServletListeners and the database, we use the DigestingPlugIn, which 
produces objects based on XML and can put them in the application 
context.  There's an example in the mailreader app which you should 
be able to just about cut-and-paste, with the exception of changing 
the XML which represents your menu items.

Joe
At 12:12 PM -0600 4/8/05, Matt Raible wrote:
As far as drop-downs, I typically populate all (or most) of mine 
from a database at application startup using a ServletListener.  I 
stuff these into the application scope as Lists of LabelValue beans. 
Then I code up a ReloadAction that can call my Listener to reload 
them all.  I've found this useful so I don't have to restart the app 
if data changes.
If I have edit screens for the drop-downs, I'll replace the List in 
application scope after saving.

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Re: Meta Information in Action Form

2005-04-08 Thread Craig McClanahan
On Apr 8, 2005 11:28 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
> Matt Raible wrote:
> 
> > As far as drop-downs, I typically populate all (or most) of mine from
> > a  database at application startup using a ServletListener.  I stuff
> > these  into the application scope as Lists of LabelValue beans.  Then
> > I code  up a ReloadAction that can call my Listener to reload them
> > all.  I've  found this useful so I don't have to restart the app if
> > data changes.   If I have edit screens for the drop-downs, I'll
> > replace the List in  application scope after saving.
> 
> I haven't done much (anything?) with servlet listeners--what's the
> advantage to doing it this way as opposed to a servlet.init that loads
> on app startup? Generally what we've done is to have a thread that
> checks a flag that signals DB changes that then calls the same code to
> reload everything. I'm not too involved with that part of the code though.
> 

The servlet container is *not* required to leave your load-on-startup
servlet loaded for the entire duration of the webapp's lifetime
(although, in practice, most containers do).  For example, the
container could unload a servlet that it sees isn't being used, or if
it has memory contention issues, or for whatever reason is desired.

Of course, if you're talking about ActionServlet, it will get reloaded
again on the next request, but that will cause your init() method to
run again -- wasting a whole bunch of time in many cases.

A ServletContextListener, on the other hand, guarantees that
contextInitialized() will get called at startup time (before any
requests have been processed), and contextDestroyed() will get called
at shutdown time (after the last request), no matter what happens in
between.

Craig


> (We store a LOT of information in the DB as we do not have access to the
> production servers. The more we keep in the DB the better off we are. I
> even keep some Jython scripts in there and almost had them convinced to
> keep classes, but sanity prevailed :)
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Meta Information in Action Form

2005-04-08 Thread Dave Newton
Matt Raible wrote:
As far as drop-downs, I typically populate all (or most) of mine from 
a  database at application startup using a ServletListener.  I stuff 
these  into the application scope as Lists of LabelValue beans.  Then 
I code  up a ReloadAction that can call my Listener to reload them 
all.  I've  found this useful so I don't have to restart the app if 
data changes.   If I have edit screens for the drop-downs, I'll 
replace the List in  application scope after saving.
I haven't done much (anything?) with servlet listeners--what's the 
advantage to doing it this way as opposed to a servlet.init that loads 
on app startup? Generally what we've done is to have a thread that 
checks a flag that signals DB changes that then calls the same code to 
reload everything. I'm not too involved with that part of the code though.

(We store a LOT of information in the DB as we do not have access to the 
production servers. The more we keep in the DB the better off we are. I 
even keep some Jython scripts in there and almost had them convinced to 
keep classes, but sanity prevailed :)

Dave

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


Re: Meta Information in Action Form

2005-04-08 Thread Matt Raible
As far as drop-downs, I typically populate all (or most) of mine from a  
database at application startup using a ServletListener.  I stuff these  
into the application scope as Lists of LabelValue beans.  Then I code  
up a ReloadAction that can call my Listener to reload them all.  I've  
found this useful so I don't have to restart the app if data changes.   
If I have edit screens for the drop-downs, I'll replace the List in  
application scope after saving.

Matt
On Apr 8, 2005, at 12:03 PM, Christine Huang wrote:
If those drop-down values are not dynamic, I would use a application
scope bean.
If it is dynamic, like credit card profiles in a dropdown list for a
particular user,  I will declare it as ActionForm property.
I would like to hear about other people's solution.
Christine
On Apr 8, 2005 12:18 PM, Anil <[EMAIL PROTECTED]> wrote:

Leon Rosenberg  anotheria.net> writes:
Sorry, but what exactly do you mean with meta information?
Leon
-Ursprüngliche Nachricht-
Von: news [mailto:news  sea.gmane.org] Im Auftrag von Anil
Gesendet: Freitag, 8. April 2005 02:34
An: user  struts.apache.org
Betreff: Meta Information in Action Form
Hi All,
Is it good approach to keep the meta information in action form ?
Thanks in advance.
Regards,
Anil.
 
-
To unsubscribe, e-mail: user-unsubscribe  struts.apache.org
For additional commands, e-mail: user-help  struts.apache.org



Hi Leon,
Thanks for the reply. Meta information is like drop-down values that  
are being
shown in a JSP page. In my case, this data should be fetched from  
database.
Before going to the JSP page, I have to make sure that the drop-down  
values
exist somewhere in scope. Here my question is, Is it ok to keep this  
kind of
information in Action Form?

Thanks,
Anil.
-
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: Meta Information in Action Form

2005-04-08 Thread Christine Huang
If those drop-down values are not dynamic, I would use a application
scope bean.

If it is dynamic, like credit card profiles in a dropdown list for a
particular user,  I will declare it as ActionForm property.

I would like to hear about other people's solution. 

Christine 
On Apr 8, 2005 12:18 PM, Anil <[EMAIL PROTECTED]> wrote:
> 
> 
> Leon Rosenberg  anotheria.net> writes:
> 
> >
> > Sorry, but what exactly do you mean with meta information?
> >
> > Leon
> >
> > > -Ursprüngliche Nachricht-
> > > Von: news [mailto:news  sea.gmane.org] Im Auftrag von Anil
> > > Gesendet: Freitag, 8. April 2005 02:34
> > > An: user  struts.apache.org
> > > Betreff: Meta Information in Action Form
> > >
> > >
> > > Hi All,
> > >
> > > Is it good approach to keep the meta information in action form ?
> > >
> > > Thanks in advance.
> > >
> > > Regards,
> > > Anil.
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: user-unsubscribe  struts.apache.org
> > > For additional commands, e-mail: user-help  struts.apache.org
> > >
> > >
> >
> 
> Hi Leon,
> 
> Thanks for the reply. Meta information is like drop-down values that are being
> shown in a JSP page. In my case, this data should be fetched from database.
> Before going to the JSP page, I have to make sure that the drop-down values
> exist somewhere in scope. Here my question is, Is it ok to keep this kind of
> information in Action Form?
> 
> Thanks,
> Anil.
> 
> -
> 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: Meta Information in Action Form

2005-04-08 Thread Anil


Leon Rosenberg  anotheria.net> writes:

> 
> Sorry, but what exactly do you mean with meta information?
> 
> Leon 
> 
> > -UrsprÃngliche Nachricht-
> > Von: news [mailto:news  sea.gmane.org] Im Auftrag von Anil
> > Gesendet: Freitag, 8. April 2005 02:34
> > An: user  struts.apache.org
> > Betreff: Meta Information in Action Form
> > 
> > 
> > Hi All,
> > 
> > Is it good approach to keep the meta information in action form ? 
> > 
> > Thanks in advance.
> > 
> > Regards,
> > Anil.
> > 
> > 
> > -
> > To unsubscribe, e-mail: user-unsubscribe  struts.apache.org
> > For additional commands, e-mail: user-help  struts.apache.org
> > 
> > 
> 


Hi Leon,

Thanks for the reply. Meta information is like drop-down values that are being 
shown in a JSP page. In my case, this data should be fetched from database. 
Before going to the JSP page, I have to make sure that the drop-down values 
exist somewhere in scope. Here my question is, Is it ok to keep this kind of 
information in Action Form?

Thanks,
Anil.


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



Re: session expiration issue and tiles

2005-04-08 Thread Dave Newton
sudip shrestha wrote:
--
I have few layout.jsp templates  where I have following chuck of code
which should redirect the browser to login page if session expires:
<%   String loginCheck = "notLoggedIn";
if( session.getAttribute( "session_unique_id" )!=null )
{
loginCheck = (String)session.getAttribute( "session_unique_id" 
);
}
if( !loginCheck.equals("admin0") )
{
%>

<%   }
%>
But when session expires, or when somebody who is not 'admin0' tries
to access the page, they get a blank page instead of getting
redirection.  I have tried using jsp:forward directive as well, but
the result is same.
If anybody has any suggestion on this, please let me know.
 

Put this logic somewhere else like a filter or request processor.
Not knowing the full layout of your tiles I'd say that you've probably 
already output to the HTTP connection, which means you can't redirect 
anymore. Just a guess. In any case this is handled _far_ better some 
place other than the presentation layer, especially if you have the same 
code in more than one place--sketchy.

Dave

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


RE: [OT] How to transpose a table in MS SQL Server 2000

2005-04-08 Thread Paul McCulloch
Assuming that month, val1 & val2 are the *names* of columns this is going to
be a tricky problem to solve with just SQL. You need to query the system
tables to extract the names of the columns.

The other problem is that the number of columns in your result set needs to
vary depending on the number of rows in your source data.

The only way I could solve this would be procedurally using TransactSQL
(create a temp table, populate it & select from it).

Paul

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 08 April 2005 16:12
> To: Struts Users Mailing List
> Subject: RE: [OT] How to transpose a table in MS SQL Server 2000
> 
> 
> id/ID are synthetic keys and can be ignored (as well as 
> 'total').  So, the 
> simplified case is:
> 
> source_table
> -
> month   val1val2
> jan 1   2
> feb 3   4
> 
> target_target
> -
> VAL COL1COL2
> month   jan feb
> val11   3 
> val22   4
> 
> Thanks,
> Dennis
> 
> 
> 
> 
> 
> Paul McCulloch <[EMAIL PROTECTED]> 
> 04/08/2005 10:47 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> 'Struts Users Mailing List' 
> cc
> 
> Subject
> RE: [OT]  How to transpose a table in MS SQL Server 2000
> 
> 
> 
> 
> 
> 
> I don't 100% understand your tables. Where does ID come from 
> (the values 1 
> &
> 2 exist in the first view, but 1,2,3,4 in the second).
> 
> Are the totals derived?
> 
> Give me the SQL for the first view and I'll have a look.
> 
> Paul
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > Sent: 08 April 2005 14:46
> > To: Struts Users Mailing List
> > Subject: [OT] How to transpose a table in MS SQL Server 2000
> > 
> > 
> > So, I have the following table:
> > 
> > id  month   val1val2total
> > 1   jan 1   2   3
> > 2   feb 3   4   7
> > 
> > And I'd like it transformed to:
> > 
> > ID  VAL COL1COL2
> > 1   month   jan feb
> > 2   val11   3 
> > 3   val22   4
> > 4   total   3   7
> > 
> > I'm guessing that it's possible, as I've seen variants of 
> > this type of 
> > tranformation.  I have googled this, but the solutions (I've 
> > found) are 
> > considerably more complicated and revolve around 
> > summing/aggregating, when 
> > I just need to change the structure of the results. 
> > 
> > Has anybody seen a solution that fits this problem?
> > 
> > Thanks,
> > Dennis
> > 
> > 
> > 
> > 
> > [EMAIL PROTECTED] 
> > 04/08/2005 09:26 AM
> > Please respond to
> > "Struts Users Mailing List" 
> > 
> > 
> > To
> > "Struts Users Mailing List" 
> > cc
> > 
> > Subject
> > [OT] RE: concurrency problem
> > 
> > 
> > 
> > 
> > 
> > 
> > As I hit the send button, something tickled in the back of my 
> > mind, and I 
> > began to remember that the spec forbids thread primitiives on 
> > bean methods 
> > 
> > and that the EJB container is responsible for handling 
> > concurrent access. 
> > Sounds like your provider might have a defect.
> > 
> > Dennis
> > 
> > 
> > 
> > 
> > 
> > [EMAIL PROTECTED] 
> > 04/08/2005 09:13 AM
> > Please respond to
> > "Struts Users Mailing List" 
> > 
> > 
> > To
> > "Struts Users Mailing List" 
> > cc
> > 
> > Subject
> > RE: concurrency problem
> > 
> > 
> > 
> > 
> > 
> > 
> > You're synchronizing on an object which is unique for each 
> > user, which 
> > might explain why more than 1 thread can concurrently enter 
> > the critsec. 
> > Wouldn't a better solution be to declare the method as synchronized?
> > 
> > Dennis
> > 
> > 
> > 
> > 
> > 
> > "Kalra, Ashwani" <[EMAIL PROTECTED]> 
> > 04/08/2005 08:53 AM
> > Please respond to
> > "Struts Users Mailing List" 
> > 
> > 
> > To
> > "Struts Users Mailing List" 
> > cc
> > 
> > Subject
> > RE: concurrency problem
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Isnt that valid when request is going to same action. In my 
> scenario, 
> > different actions are invoked quickly and all the actions 
> > have this call 
> > to SFSB.   Which I want to synchronise
> > 
> > Thanks & Regds
> >  Ashwani
> > 
> > Ext: 1860
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > -Original Message-
> > > From: James Mitchell [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, April 08, 2005 6:04 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: concurrency problem
> > >
> > 
> > >
> > 
> > > You'd be better off implementing token processing.
> > >
> > 
> > > Struts includes token generation and helper methods to ensure
> > 
> > > only one valid
> > 
> > > request is handled at a time.  Look at the struts example 
> > application
> > 
> > > (mailreader) for an example.
> > >
> > 
> > > For detailed info on why this pattern works, see:
> > > http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> > > pr_g_1/102-8250064-5792120?v=glance&s=books
> > >
> > 
> > >
> > 
> > >
> > 
> 

Re: concurrency problem

2005-04-08 Thread Jeff_Caswell




Maybe I'm being dense here but:

If every session contains a reference to the bean, and every thread is
synchronizing on their own session;

It would seem that there would not be any concurrency control.

I would think that they all need to sync on the same object.

JC




  "Kalra, Ashwani"  

  <[EMAIL PROTECTED]To:   "Struts (E-mail)" 

  gemini.com>   cc: 

Subject:  concurrency problem   

  04/08/2005 06:10  

  AM

  Please respond to 

  "Struts Users 

  Mailing List" 








I am facing concurrency problem in following scenario.


All our action classes call same stateful session bean .  Each action class
obtains the reference  from HTTPSession object and calls one and only one
business method.
To prevent the concurrent access to this instance which occurs when user
immediately presses two links quickly in succession I am using the
following code block




execute(...)  //execute methods of Action class
{




//Obtain the session from  Request.User will always be in session here
session=request.getSession()
Synchronised(session)
{
//call ejb's  business method.
}


}


However sometimes  more than one thread is able to pass through, And I get
exception from Appserver. As 2 threads are not allowed for statefull
Session bean.
Can there be problem in above code. Is it ok to synchronise on session
object.









Thanks & Regds
 Ashwani

Ext: 1860









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



--
**
The information contained in this communication is confidential, private, 
proprietary, or otherwise privileged and is intended only for the use of the 
addressee.  Unauthorized use, disclosure, distribution or copying is strictly 
prohibited and may be unlawful.  If you have received this communication in 
error, please notify the sender immediately at (312)653-6000 in Illinois; 
(972)766-6900 in Texas; or (800)835-8699 in New Mexico.
**
==


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



RE: [OT] How to transpose a table in MS SQL Server 2000

2005-04-08 Thread DGraham
id/ID are synthetic keys and can be ignored (as well as 'total').  So, the 
simplified case is:

source_table
-
month   val1val2
jan 1   2
feb 3   4

target_target
-
VAL COL1COL2
month   jan feb
val11   3 
val22   4

Thanks,
Dennis





Paul McCulloch <[EMAIL PROTECTED]> 
04/08/2005 10:47 AM
Please respond to
"Struts Users Mailing List" 


To
'Struts Users Mailing List' 
cc

Subject
RE: [OT]  How to transpose a table in MS SQL Server 2000






I don't 100% understand your tables. Where does ID come from (the values 1 
&
2 exist in the first view, but 1,2,3,4 in the second).

Are the totals derived?

Give me the SQL for the first view and I'll have a look.

Paul

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 08 April 2005 14:46
> To: Struts Users Mailing List
> Subject: [OT] How to transpose a table in MS SQL Server 2000
> 
> 
> So, I have the following table:
> 
> id  month   val1val2total
> 1   jan 1   2   3
> 2   feb 3   4   7
> 
> And I'd like it transformed to:
> 
> ID  VAL COL1COL2
> 1   month   jan feb
> 2   val11   3 
> 3   val22   4
> 4   total   3   7
> 
> I'm guessing that it's possible, as I've seen variants of 
> this type of 
> tranformation.  I have googled this, but the solutions (I've 
> found) are 
> considerably more complicated and revolve around 
> summing/aggregating, when 
> I just need to change the structure of the results. 
> 
> Has anybody seen a solution that fits this problem?
> 
> Thanks,
> Dennis
> 
> 
> 
> 
> [EMAIL PROTECTED] 
> 04/08/2005 09:26 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> [OT] RE: concurrency problem
> 
> 
> 
> 
> 
> 
> As I hit the send button, something tickled in the back of my 
> mind, and I 
> began to remember that the spec forbids thread primitiives on 
> bean methods 
> 
> and that the EJB container is responsible for handling 
> concurrent access. 
> Sounds like your provider might have a defect.
> 
> Dennis
> 
> 
> 
> 
> 
> [EMAIL PROTECTED] 
> 04/08/2005 09:13 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> RE: concurrency problem
> 
> 
> 
> 
> 
> 
> You're synchronizing on an object which is unique for each 
> user, which 
> might explain why more than 1 thread can concurrently enter 
> the critsec. 
> Wouldn't a better solution be to declare the method as synchronized?
> 
> Dennis
> 
> 
> 
> 
> 
> "Kalra, Ashwani" <[EMAIL PROTECTED]> 
> 04/08/2005 08:53 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> RE: concurrency problem
> 
> 
> 
> 
> 
> 
> 
> Isnt that valid when request is going to same action. In my scenario, 
> different actions are invoked quickly and all the actions 
> have this call 
> to SFSB.   Which I want to synchronise
> 
> Thanks & Regds
>  Ashwani
> 
> Ext: 1860
> 
> 
> 
> 
> 
> 
> 
> > -Original Message-
> > From: James Mitchell [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 08, 2005 6:04 PM
> > To: Struts Users Mailing List
> > Subject: Re: concurrency problem
> >
> 
> >
> 
> > You'd be better off implementing token processing.
> >
> 
> > Struts includes token generation and helper methods to ensure
> 
> > only one valid
> 
> > request is handled at a time.  Look at the struts example 
> application
> 
> > (mailreader) for an example.
> >
> 
> > For detailed info on why this pattern works, see:
> > http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> > pr_g_1/102-8250064-5792120?v=glance&s=books
> >
> 
> >
> 
> >
> 
> >
> 
> > --
> > James Mitchell
> > Software Engineer / Open Source Evangelist
> > Consulting / Mentoring / Freelance
> > EdgeTech, Inc.
> > 678.910.8017
> > AIM:   jmitchtx
> > Yahoo: jmitchtx
> > MSN:   [EMAIL PROTECTED]
> >
> 
> >
> 
> >
> 
> >
> 
> > - Original Message -
> 
> > From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> > To: "Struts (E-mail)" 
> > Sent: Friday, April 08, 2005 7:10 AM
> > Subject: concurrency problem
> >
> 
> >
> 
> >
> 
> > I am facing concurrency problem in following scenario.
> >
> 
> > All our action classes call same stateful session bean . 
> 
> > Each action class
> 
> > obtains the reference  from HTTPSession object and calls one
> 
> > and only one
> 
> > business method.
> > To prevent the concurrent access to this instance which
> 
> > occurs when user
> 
> > immediately presses two links quickly in succession I am
> 
> > using the following
> 
> > code block
> >
> 
> >
> 
> > execute(...)  //execute methods of Action class
> > {
> > 
> > 
> >
> 
> > //Obtain the session from  Request.User will always be in 
> session here
> > session=request.getSession()
> 

RE: [OT] How to transpose a table in MS SQL Server 2000

2005-04-08 Thread Paul McCulloch
I don't 100% understand your tables. Where does ID come from (the values 1 &
2 exist in the first view, but 1,2,3,4 in the second).

Are the totals derived?

Give me the SQL for the first view and I'll have a look.

Paul

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 08 April 2005 14:46
> To: Struts Users Mailing List
> Subject: [OT] How to transpose a table in MS SQL Server 2000
> 
> 
> So, I have the following table:
> 
> id  month   val1val2total
> 1   jan 1   2   3
> 2   feb 3   4   7
> 
> And I'd like it transformed to:
> 
> ID  VAL COL1COL2
> 1   month   jan feb
> 2   val11   3 
> 3   val22   4
> 4   total   3   7
> 
> I'm guessing that it's possible, as I've seen variants of 
> this type of 
> tranformation.  I have googled this, but the solutions (I've 
> found) are 
> considerably more complicated and revolve around 
> summing/aggregating, when 
> I just need to change the structure of the results. 
> 
> Has anybody seen a solution that fits this problem?
> 
> Thanks,
> Dennis
> 
> 
> 
> 
> [EMAIL PROTECTED] 
> 04/08/2005 09:26 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> [OT] RE: concurrency problem
> 
> 
> 
> 
> 
> 
> As I hit the send button, something tickled in the back of my 
> mind, and I 
> began to remember that the spec forbids thread primitiives on 
> bean methods 
> 
> and that the EJB container is responsible for handling 
> concurrent access. 
> Sounds like your provider might have a defect.
> 
> Dennis
> 
> 
> 
> 
> 
> [EMAIL PROTECTED] 
> 04/08/2005 09:13 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> RE: concurrency problem
> 
> 
> 
> 
> 
> 
> You're synchronizing on an object which is unique for each 
> user, which 
> might explain why more than 1 thread can concurrently enter 
> the critsec. 
> Wouldn't a better solution be to declare the method as synchronized?
> 
> Dennis
> 
> 
> 
> 
> 
> "Kalra, Ashwani" <[EMAIL PROTECTED]> 
> 04/08/2005 08:53 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> "Struts Users Mailing List" 
> cc
> 
> Subject
> RE: concurrency problem
> 
> 
> 
> 
> 
> 
> 
> Isnt that valid when request is going to same action. In my scenario, 
> different actions are invoked quickly and all the actions 
> have this call 
> to SFSB.   Which I want to synchronise
> 
> Thanks & Regds
>  Ashwani
> 
> Ext: 1860
> 
> 
> 
> 
> 
> 
> 
> > -Original Message-
> > From: James Mitchell [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 08, 2005 6:04 PM
> > To: Struts Users Mailing List
> > Subject: Re: concurrency problem
> >
> 
> >
> 
> > You'd be better off implementing token processing.
> >
> 
> > Struts includes token generation and helper methods to ensure
> 
> > only one valid
> 
> > request is handled at a time.  Look at the struts example 
> application
> 
> > (mailreader) for an example.
> >
> 
> > For detailed info on why this pattern works, see:
> > http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> > pr_g_1/102-8250064-5792120?v=glance&s=books
> >
> 
> >
> 
> >
> 
> >
> 
> > --
> > James Mitchell
> > Software Engineer / Open Source Evangelist
> > Consulting / Mentoring / Freelance
> > EdgeTech, Inc.
> > 678.910.8017
> > AIM:   jmitchtx
> > Yahoo: jmitchtx
> > MSN:   [EMAIL PROTECTED]
> >
> 
> >
> 
> >
> 
> >
> 
> > - Original Message -
> 
> > From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> > To: "Struts (E-mail)" 
> > Sent: Friday, April 08, 2005 7:10 AM
> > Subject: concurrency problem
> >
> 
> >
> 
> >
> 
> > I am facing concurrency problem in following scenario.
> >
> 
> > All our action classes call same stateful session bean . 
> 
> > Each action class
> 
> > obtains the reference  from HTTPSession object and calls one
> 
> > and only one
> 
> > business method.
> > To prevent the concurrent access to this instance which
> 
> > occurs when user
> 
> > immediately presses two links quickly in succession I am
> 
> > using the following
> 
> > code block
> >
> 
> >
> 
> > execute(...)  //execute methods of Action class
> > {
> > 
> > 
> >
> 
> > //Obtain the session from  Request.User will always be in 
> session here
> > session=request.getSession()
> > Synchronised(session)
> > {
> > //call ejb's  business method.
> > }
> >
> 
> > }
> >
> 
> > However sometimes  more than one thread is able to pass
> 
> > through, And I get
> 
> > exception from Appserver. As 2 threads are not allowed for
> 
> > statefull Session
> 
> > bean.
> > Can there be problem in above code. Is it ok to synchronise
> 
> > on session
> 
> > object.
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > Thanks & Regds
> >  Ashwani
> >
> 
> > Ext: 1860
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > This message contains information that may be privileged or
> 
> > conf

Re: Authorized Site Creation With Struts

2005-04-08 Thread gdeschen
Scott.

I have architectured an application a little over a year ago...
And opted to use a filter to handle logic before getting into the Struts 
portion of the application.
At first... I was unsure if this was the best way to go... but today I am 
sure glad I did so.

The users started making riduculous demands... since they have the stash 
of money it is hard to tell them they are crazy!
As an example, they wanted the application to update a database (another 
system) with the requested pages... plus with some detailed information.
This was not availble in the standard log files.
Since this was not the goal of the application but an external user 
request (dumb one) I simply used the HTTP Client to fire off a post to a 
page and don't really care what happens afterwards.

The filter gave me an incredibly efficient option to handle changes 
without affecting the application logic at all.
SInce then I have had other twisted requests!
Finally, if ever I need to remove this feature... it can be done in 5 
minutes!

- Glenn





"Scott Purcell" <[EMAIL PROTECTED]>
08/04/2005 10:28 AM
Please respond to "Struts Users Mailing List"




 
To: 
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Authorized Site Creation With Struts
 Classification: 
 


Hello,
First off, I am having trouble with creating a more elegant solution to a 
proboem.
 
A- Problem, I have a site that requires authentication (form-based) when 
they hit our site. 
Upon building the site which requires an "AppObject" and "UserObject", 
I subclassed the
RequestProcessor, and put in logic to ensure that both objects 
existed.
 
This works good.
 
   Next, I needed to find out when a user's session expired. Upon further 
investigation,
   I subclassed an Action class and added a new executeAction(signature) 
that pulled in
   the AppObject and UserObject that were in the session from the Request 
Processor.
 
  I then checked if the UserObject had a logged-in flag. If so, great, 
they can work, else
  I would throw them to the front door and create a ActionMessage that 
says "Session Expired".
 
All of this works, and does its job. Problem is now, I am not happy with 
my creation. It screwed with my ability to use
DispatchAction and LookupDispatchAction. Two things I wasn't sure I would 
need when I began.
 
Anyway, I have searched and searched, and was hoping someone may have a 
better way to handle
this session-management possibly all in the RequestProcesor?
 
The problem I am finding, is that I create new UserObject and AppObject 
each time someone comes through, because I do not know if they
are new or returning users. It is not until they are looking for an inside 
page, that I am aware they are not valid.
 
Does this make sense? I figured a lot of you out there may have this same 
type of secure site. Any ideas?
 
Thanks,

Scott K Purcell

 

 




RE: Authorized Site Creation With Struts

2005-04-08 Thread Paul McCulloch
The two approaches I have succesfully used are container managed
authentication & Filters.

Filters are simpler & more flexible than container managed authentication,
so unless you need a particular feature of CMA (e.g. automatic propogation
of credentials to EJBs) I wouldn't recommend it.

I believe, though I haven't used it, that there is a free package called
SecurityFilter which does lots of cools things for you.

Paul

> -Original Message-
> From: Scott Purcell [mailto:[EMAIL PROTECTED]
> Sent: 08 April 2005 15:28
> To: user@struts.apache.org
> Subject: Authorized Site Creation With Struts
> 
> 
> Hello,
> First off, I am having trouble with creating a more elegant 
> solution to a proboem.
>  
> A- Problem, I have a site that requires authentication 
> (form-based) when they hit our site. 
> Upon building the site which requires an "AppObject" and 
> "UserObject", I subclassed the
> RequestProcessor, and put in logic to ensure that both 
> objects existed.
>  
> This works good.
>  
>Next, I needed to find out when a user's session expired. 
> Upon further investigation,
>I subclassed an Action class and added a new 
> executeAction(signature) that pulled in
>the AppObject and UserObject that were in the session from 
> the Request Processor.
>  
>   I then checked if the UserObject had a logged-in flag. If 
> so, great, they can work, else
>   I would throw them to the front door and create a 
> ActionMessage that says "Session Expired".
>  
> All of this works, and does its job. Problem is now, I am not 
> happy with my creation. It screwed with my ability to use
> DispatchAction and LookupDispatchAction. Two things I wasn't 
> sure I would need when I began.
>  
> Anyway, I have searched and searched, and was hoping someone 
> may have a better way to handle
> this session-management possibly all in the RequestProcesor?
>  
> The problem I am finding, is that I create new UserObject and 
> AppObject each time someone comes through, because I do not 
> know if they
> are new or returning users. It is not until they are looking 
> for an inside page, that I am aware they are not valid.
>  
> Does this make sense? I figured a lot of you out there may 
> have this same type of secure site. Any ideas?
>  
> Thanks,
> 
> Scott K Purcell
> 
>  
> 
>  
> 
> 

Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you 
are not the addressee indicated in this message (or responsible for delivery of 
the message to such person), you may not copy or deliver this message to 
anyone. In such case, you should destroy this message, and notify us 
immediately. If you or your employer does not consent to Internet email 
messages of this kind, please advise us immediately. Opinions, conclusions and 
other information expressed in this message are not given or endorsed by my 
Company or employer unless otherwise indicated by an authorised representative 
independent of this message.
 
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being 
transmitted via electronic mail attachments we cannot guarantee that 
attachments do not contain computer virus code.  You are therefore strongly 
advised to undertake anti virus checks prior to accessing the attachment to 
this electronic mail.  Axios Systems Ltd grants no warranties regarding 
performance use or quality of any attachment and undertakes no liability for 
loss or damage howsoever caused.


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



RE: [OT] RE: concurrency problem

2005-04-08 Thread Kalra, Ashwani

No, I am getting appropriate exception from app server. Here is the exception. 
I want to avoid it and synchronize the request. But synchronisation is not 
working some how. Here is what my app server gives exception

com.evermind.server.rmi.OrionRemoteException: Second thread call to stateful
session bean at
com.evermind.server.ejb.AbstractEJBObject.startCall(AbstractEJBObject.java:138)

I want to avoid this.











> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 6:57 PM
> To: Struts Users Mailing List
> Subject: [OT] RE: concurrency problem
>
>
> As I hit the send button, something tickled in the back of my
> mind, and I
> began to remember that the spec forbids thread primitiives on
> bean methods
> and that the EJB container is responsible for handling
> concurrent access.
> Sounds like your provider might have a defect.
>
> Dennis
>
>
>
>
>
> [EMAIL PROTECTED]
> 04/08/2005 09:13 AM
> Please respond to
> "Struts Users Mailing List" 
>
>
> To
> "Struts Users Mailing List" 
> cc
>
> Subject
> RE: concurrency problem
>
>
>
>
>
>
> You're synchronizing on an object which is unique for each
> user, which
> might explain why more than 1 thread can concurrently enter
> the critsec.
> Wouldn't a better solution be to declare the method as synchronized?
>
> Dennis
>
>
>
>
>
> "Kalra, Ashwani" <[EMAIL PROTECTED]>
> 04/08/2005 08:53 AM
> Please respond to
> "Struts Users Mailing List" 
>
>
> To
> "Struts Users Mailing List" 
> cc
>
> Subject
> RE: concurrency problem
>
>
>
>
>
>
>
> Isnt that valid when request is going to same action. In my scenario,
> different actions are invoked quickly and all the actions
> have this call
> to SFSB.   Which I want to synchronise
>
> Thanks & Regds
>  Ashwani
>
> Ext: 1860
>
>
>
>
>
>
>
> > -Original Message-
> > From: James Mitchell [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 08, 2005 6:04 PM
> > To: Struts Users Mailing List
> > Subject: Re: concurrency problem
> >
>
> >
>
> > You'd be better off implementing token processing.
> >
>
> > Struts includes token generation and helper methods to ensure
>
> > only one valid
>
> > request is handled at a time.  Look at the struts example
> application
>
> > (mailreader) for an example.
> >
>
> > For detailed info on why this pattern works, see:
> > http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> > pr_g_1/102-8250064-5792120?v=glance&s=books
> >
>
> >
>
> >
>
> >
>
> > --
> > James Mitchell
> > Software Engineer / Open Source Evangelist
> > Consulting / Mentoring / Freelance
> > EdgeTech, Inc.
> > 678.910.8017
> > AIM:   jmitchtx
> > Yahoo: jmitchtx
> > MSN:   [EMAIL PROTECTED]
> >
>
> >
>
> >
>
> >
>
> > - Original Message -
>
> > From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> > To: "Struts (E-mail)" 
> > Sent: Friday, April 08, 2005 7:10 AM
> > Subject: concurrency problem
> >
>
> >
>
> >
>
> > I am facing concurrency problem in following scenario.
> >
>
> > All our action classes call same stateful session bean .
>
> > Each action class
>
> > obtains the reference  from HTTPSession object and calls one
>
> > and only one
>
> > business method.
> > To prevent the concurrent access to this instance which
>
> > occurs when user
>
> > immediately presses two links quickly in succession I am
>
> > using the following
>
> > code block
> >
>
> >
>
> > execute(...)  //execute methods of Action class
> > {
> > 
> > 
> >
>
> > //Obtain the session from  Request.User will always be in
> session here
> > session=request.getSession()
> > Synchronised(session)
> > {
> > //call ejb's  business method.
> > }
> >
>
> > }
> >
>
> > However sometimes  more than one thread is able to pass
>
> > through, And I get
>
> > exception from Appserver. As 2 threads are not allowed for
>
> > statefull Session
>
> > bean.
> > Can there be problem in above code. Is it ok to synchronise
>
> > on session
>
> > object.
> >
>
> >
>
> >
>
> >
>
> >
>
> > Thanks & Regds
> >  Ashwani
> >
>
> > Ext: 1860
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > This message contains information that may be privileged or
>
> > confidential and
>
> > is the property of the Capgemini Group. It is intended only
>
> > for the person
>
> > to whom it is addressed. If you are not the intended
>
> > recipient,  you are not
>
> > authorized to read, print, retain, copy, disseminate,
>
> > distribute, or use
>
> > this message or any part thereof. If you receive this
>
> > message in error,
>
> > please notify the sender immediately and delete all  copies
>
> > of this message.
> >
>
> >
>
> >
>
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> >
>
>
> This message contains information that may be privileged or
> confidential
> and is the property of the Capgemini Group. It is intended
> only for the
> person to whom it is addressed. If y

Authorized Site Creation With Struts

2005-04-08 Thread Scott Purcell
Hello,
First off, I am having trouble with creating a more elegant solution to a 
proboem.
 
A- Problem, I have a site that requires authentication (form-based) when they 
hit our site. 
Upon building the site which requires an "AppObject" and "UserObject", I 
subclassed the
RequestProcessor, and put in logic to ensure that both objects existed.
 
This works good.
 
   Next, I needed to find out when a user's session expired. Upon further 
investigation,
   I subclassed an Action class and added a new executeAction(signature) that 
pulled in
   the AppObject and UserObject that were in the session from the Request 
Processor.
 
  I then checked if the UserObject had a logged-in flag. If so, great, they can 
work, else
  I would throw them to the front door and create a ActionMessage that says 
"Session Expired".
 
All of this works, and does its job. Problem is now, I am not happy with my 
creation. It screwed with my ability to use
DispatchAction and LookupDispatchAction. Two things I wasn't sure I would need 
when I began.
 
Anyway, I have searched and searched, and was hoping someone may have a better 
way to handle
this session-management possibly all in the RequestProcesor?
 
The problem I am finding, is that I create new UserObject and AppObject each 
time someone comes through, because I do not know if they
are new or returning users. It is not until they are looking for an inside 
page, that I am aware they are not valid.
 
Does this make sense? I figured a lot of you out there may have this same type 
of secure site. Any ideas?
 
Thanks,

Scott K Purcell

 

 



Re: LazyLists and dynamic forms

2005-04-08 Thread Rick Reumann
Richard Rozema wrote the following on 4/7/2005 5:57 PM:
I'm pretty new on struts programming and I've read to avoid using session.
The only real reason I see not to use session is that if I stick 2 instances
of my search tile in the same page (and I will do so), they will share the
same property names in the session. Or do you think they will not overwrite
each others values?
I've never added two instances of a tile with a form in it into a page, 
so I'm not sure of the effect. I'm not really sure of the concept of 
what you are trying to do there.

You could be right here, I introduced the indexed properties because the
searchForm may contain from 1 to any number of properties to select on
depending on the table being searched. Each line in the form contains one
property for which the end user may select an operator to build a selection
criterium and enter values. But how else will I be able to determine which
operator to apply to a property and it's value(s)?  or in other words, how
do I keep the property name, operator and values of each line grouped
together?
Sorry, I should have been more clear, I've been using the nested tag so 
long I forgot that for what you wanted to do you WOLD need indexed 
properties unlss you did use the nested tag (part of Struts) or simply 
made the indexed values yourself with JSTL (which is what I opt for when 
not using the nested tag, only because I'm not sure how indexed works 
when you end up with deeply nested objects within objects(?)).

The nested tag will take care of this cleanly for you. So, for example, 
if you had a List of Employees (firstName, lastName, and inside each 
Employee was also a "AddressBean" with street, city,etc) your formBean 
might just have a settter getter for getEmployees() setEmployees(List 
employees). Then creating the form..


  




  
or if you don't like address.city, address.state you could do...

  


  


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


Re: [OT] Open source paginator

2005-04-08 Thread Ashish Kulkarni
Hi
http://kulkarni_ash.tripod.com/howto/jsptaglib-howto.html

Ashish
--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> N G wrote the following on 4/7/2005 3:31 PM:
> > Does anyone know of some open source paginator
> package out there?
> > Something generic enough that you could stick
> collections into and it
> > would paginate it for you based on some criteria
> and expose methods to
> > nextPage(), previousPage() and stuff like that.
> 
> You can try http://displaytag.sourceforge.net/ I
> haven't used it in a 
> long time though. Looks like a lot of progress on it
> since I used it 
> over  a year or two ago.
> 
> -- 
> Rick
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



__ 
Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates. 
http://personals.yahoo.com


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



session expiration issue and tiles

2005-04-08 Thread sudip shrestha
Using: Tomcat 5.5.7, Sun JDK 1.5,  Struts 1.2.4
--
I have few layout.jsp templates  where I have following chuck of code
which should redirect the browser to login page if session expires:
<%   String loginCheck = "notLoggedIn";
if( session.getAttribute( "session_unique_id" )!=null )
{
loginCheck = (String)session.getAttribute( "session_unique_id" 
);
}
if( !loginCheck.equals("admin0") )
{
%>

<%   }
%>

But when session expires, or when somebody who is not 'admin0' tries
to access the page, they get a blank page instead of getting
redirection.  I have tried using jsp:forward directive as well, but
the result is same.
If anybody has any suggestion on this, please let me know.

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



[OT] How to transpose a table in MS SQL Server 2000

2005-04-08 Thread DGraham
So, I have the following table:

id  month   val1val2total
1   jan 1   2   3
2   feb 3   4   7

And I'd like it transformed to:

ID  VAL COL1COL2
1   month   jan feb
2   val11   3 
3   val22   4
4   total   3   7

I'm guessing that it's possible, as I've seen variants of this type of 
tranformation.  I have googled this, but the solutions (I've found) are 
considerably more complicated and revolve around summing/aggregating, when 
I just need to change the structure of the results. 

Has anybody seen a solution that fits this problem?

Thanks,
Dennis




[EMAIL PROTECTED] 
04/08/2005 09:26 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
[OT] RE: concurrency problem






As I hit the send button, something tickled in the back of my mind, and I 
began to remember that the spec forbids thread primitiives on bean methods 

and that the EJB container is responsible for handling concurrent access. 
Sounds like your provider might have a defect.

Dennis





[EMAIL PROTECTED] 
04/08/2005 09:13 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
RE: concurrency problem






You're synchronizing on an object which is unique for each user, which 
might explain why more than 1 thread can concurrently enter the critsec. 
Wouldn't a better solution be to declare the method as synchronized?

Dennis





"Kalra, Ashwani" <[EMAIL PROTECTED]> 
04/08/2005 08:53 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
RE: concurrency problem







Isnt that valid when request is going to same action. In my scenario, 
different actions are invoked quickly and all the actions have this call 
to SFSB.   Which I want to synchronise

Thanks & Regds
 Ashwani

Ext: 1860







> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: concurrency problem
>

>

> You'd be better off implementing token processing.
>

> Struts includes token generation and helper methods to ensure

> only one valid

> request is handled at a time.  Look at the struts example application

> (mailreader) for an example.
>

> For detailed info on why this pattern works, see:
> http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> pr_g_1/102-8250064-5792120?v=glance&s=books
>

>

>

>

> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> 678.910.8017
> AIM:   jmitchtx
> Yahoo: jmitchtx
> MSN:   [EMAIL PROTECTED]
>

>

>

>

> - Original Message -

> From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> To: "Struts (E-mail)" 
> Sent: Friday, April 08, 2005 7:10 AM
> Subject: concurrency problem
>

>

>

> I am facing concurrency problem in following scenario.
>

> All our action classes call same stateful session bean . 

> Each action class

> obtains the reference  from HTTPSession object and calls one

> and only one

> business method.
> To prevent the concurrent access to this instance which

> occurs when user

> immediately presses two links quickly in succession I am

> using the following

> code block
>

>

> execute(...)  //execute methods of Action class
> {
> 
> 
>

> //Obtain the session from  Request.User will always be in session here
> session=request.getSession()
> Synchronised(session)
> {
> //call ejb's  business method.
> }
>

> }
>

> However sometimes  more than one thread is able to pass

> through, And I get

> exception from Appserver. As 2 threads are not allowed for

> statefull Session

> bean.
> Can there be problem in above code. Is it ok to synchronise

> on session

> object.
>

>

>

>

>

> Thanks & Regds
>  Ashwani
>

> Ext: 1860
>

>

>

>

>

>

>

> This message contains information that may be privileged or

> confidential and

> is the property of the Capgemini Group. It is intended only

> for the person

> to whom it is addressed. If you are not the intended

> recipient,  you are not

> authorized to read, print, retain, copy, disseminate, 

> distribute, or use

> this message or any part thereof. If you receive this 

> message in error,

> please notify the sender immediately and delete all  copies

> of this message.
>

>

>

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

>


This message contains information that may be privileged or confidential 
and is the property of the Capgemini Group. It is intended only for the 
person to whom it is addressed. If you are not the intended recipient, you 


are not authorized to read, print, retain, copy, disseminate,  distribute, 


or use this message or any part thereof. If you receive this  message in 
error, please notify t

Re: Nested ActionForm Validation

2005-04-08 Thread Jeff Beal
I think the only way you can have one ActionForm reuse another
ActionForm is to include the second ActionForm as a property of the
first.  For example, if you have a standard AddressActionForm that
includes validation rules for street, city, state, postal code, etc.
you can use this as a property in your PersonActionForm and your
CompanyActionForm.

public AddressActionForm getAddress() { return this.addressForm; }
public void setAddress(AddressActionForm newAddress) {
this.addressForm = newAddress; }

Then, in the validate() method in PersonActionForm and
CompanyActionForm, you'll need to call this.addressForm.validate().

-- Jeff

On Apr 8, 2005 6:57 AM, Ciaran Hanley <[EMAIL PROTECTED]> wrote:
> I am trying to reuse ActionForms within an application but I am unsure how
> to deal with validation. What I have at the moment is an ActionForm1 which
> contains a second form ActionForm2. In validation.xml, how do I use the
> validation for ActionForm2 within the ActionForm1 validation? Can I use it
> with something like this -
> 
> 
> 
>   
> 
>   
> 
>   
> 
> 
> 
> ActionForm2 has its own custom validations which I also need to call when
> submitting the form, can I call them by just using
> getActionForm2.validate(mapping,request) within ActionForm1 validation
> method or how can this be achieved?
> 
> Thanks,
> 
> Ciaran
> 
> 


-- 
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA

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



[OT] RE: concurrency problem

2005-04-08 Thread DGraham
As I hit the send button, something tickled in the back of my mind, and I 
began to remember that the spec forbids thread primitiives on bean methods 
and that the EJB container is responsible for handling concurrent access. 
Sounds like your provider might have a defect.

Dennis





[EMAIL PROTECTED] 
04/08/2005 09:13 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
RE: concurrency problem






You're synchronizing on an object which is unique for each user, which 
might explain why more than 1 thread can concurrently enter the critsec. 
Wouldn't a better solution be to declare the method as synchronized?

Dennis





"Kalra, Ashwani" <[EMAIL PROTECTED]> 
04/08/2005 08:53 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
RE: concurrency problem







Isnt that valid when request is going to same action. In my scenario, 
different actions are invoked quickly and all the actions have this call 
to SFSB.   Which I want to synchronise

Thanks & Regds
 Ashwani

Ext: 1860







> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: concurrency problem
>

>

> You'd be better off implementing token processing.
>

> Struts includes token generation and helper methods to ensure

> only one valid

> request is handled at a time.  Look at the struts example application

> (mailreader) for an example.
>

> For detailed info on why this pattern works, see:
> http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> pr_g_1/102-8250064-5792120?v=glance&s=books
>

>

>

>

> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> 678.910.8017
> AIM:   jmitchtx
> Yahoo: jmitchtx
> MSN:   [EMAIL PROTECTED]
>

>

>

>

> - Original Message -

> From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> To: "Struts (E-mail)" 
> Sent: Friday, April 08, 2005 7:10 AM
> Subject: concurrency problem
>

>

>

> I am facing concurrency problem in following scenario.
>

> All our action classes call same stateful session bean . 

> Each action class

> obtains the reference  from HTTPSession object and calls one

> and only one

> business method.
> To prevent the concurrent access to this instance which

> occurs when user

> immediately presses two links quickly in succession I am

> using the following

> code block
>

>

> execute(...)  //execute methods of Action class
> {
> 
> 
>

> //Obtain the session from  Request.User will always be in session here
> session=request.getSession()
> Synchronised(session)
> {
> //call ejb's  business method.
> }
>

> }
>

> However sometimes  more than one thread is able to pass

> through, And I get

> exception from Appserver. As 2 threads are not allowed for

> statefull Session

> bean.
> Can there be problem in above code. Is it ok to synchronise

> on session

> object.
>

>

>

>

>

> Thanks & Regds
>  Ashwani
>

> Ext: 1860
>

>

>

>

>

>

>

> This message contains information that may be privileged or

> confidential and

> is the property of the Capgemini Group. It is intended only

> for the person

> to whom it is addressed. If you are not the intended

> recipient,  you are not

> authorized to read, print, retain, copy, disseminate, 

> distribute, or use

> this message or any part thereof. If you receive this 

> message in error,

> please notify the sender immediately and delete all  copies

> of this message.
>

>

>

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

>


This message contains information that may be privileged or confidential 
and is the property of the Capgemini Group. It is intended only for the 
person to whom it is addressed. If you are not the intended recipient, you 

are not authorized to read, print, retain, copy, disseminate,  distribute, 

or use this message or any part thereof. If you receive this  message in 
error, please notify the sender immediately and delete all  copies of this 

message.


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





RE: concurrency problem

2005-04-08 Thread DGraham
You're synchronizing on an object which is unique for each user, which 
might explain why more than 1 thread can concurrently enter the critsec. 
Wouldn't a better solution be to declare the method as synchronized?

Dennis





"Kalra, Ashwani" <[EMAIL PROTECTED]> 
04/08/2005 08:53 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
RE: concurrency problem







Isnt that valid when request is going to same action. In my scenario, 
different actions are invoked quickly and all the actions have this call 
to SFSB.   Which I want to synchronise

Thanks & Regds
 Ashwani

Ext: 1860







> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: concurrency problem
>

>

> You'd be better off implementing token processing.
>

> Struts includes token generation and helper methods to ensure

> only one valid

> request is handled at a time.  Look at the struts example application

> (mailreader) for an example.
>

> For detailed info on why this pattern works, see:
> http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> pr_g_1/102-8250064-5792120?v=glance&s=books
>

>

>

>

> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> 678.910.8017
> AIM:   jmitchtx
> Yahoo: jmitchtx
> MSN:   [EMAIL PROTECTED]
>

>

>

>

> - Original Message -

> From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> To: "Struts (E-mail)" 
> Sent: Friday, April 08, 2005 7:10 AM
> Subject: concurrency problem
>

>

>

> I am facing concurrency problem in following scenario.
>

> All our action classes call same stateful session bean . 

> Each action class

> obtains the reference  from HTTPSession object and calls one

> and only one

> business method.
> To prevent the concurrent access to this instance which

> occurs when user

> immediately presses two links quickly in succession I am

> using the following

> code block
>

>

> execute(...)  //execute methods of Action class
> {
> 
> 
>

> //Obtain the session from  Request.User will always be in session here
> session=request.getSession()
> Synchronised(session)
> {
> //call ejb's  business method.
> }
>

> }
>

> However sometimes  more than one thread is able to pass

> through, And I get

> exception from Appserver. As 2 threads are not allowed for

> statefull Session

> bean.
> Can there be problem in above code. Is it ok to synchronise

> on session

> object.
>

>

>

>

>

> Thanks & Regds
>  Ashwani
>

> Ext: 1860
>

>

>

>

>

>

>

> This message contains information that may be privileged or

> confidential and

> is the property of the Capgemini Group. It is intended only

> for the person

> to whom it is addressed. If you are not the intended

> recipient,  you are not

> authorized to read, print, retain, copy, disseminate, 

> distribute, or use

> this message or any part thereof. If you receive this 

> message in error,

> please notify the sender immediately and delete all  copies

> of this message.
>

>

>

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

>


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


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




RE: concurrency problem

2005-04-08 Thread Kalra, Ashwani

Isnt that valid when request is going to same action. In my scenario, different 
actions are invoked quickly and all the actions have this call to SFSB.   Which 
I want to synchronise

Thanks & Regds
 Ashwani

Ext: 1860






> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 08, 2005 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: concurrency problem
>
>
> You'd be better off implementing token processing.
>
> Struts includes token generation and helper methods to ensure
> only one valid
> request is handled at a time.  Look at the struts example application
> (mailreader) for an example.
>
> For detailed info on why this pattern works, see:
> http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> pr_g_1/102-8250064-5792120?v=glance&s=books
>
>
>
>
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> 678.910.8017
> AIM:   jmitchtx
> Yahoo: jmitchtx
> MSN:   [EMAIL PROTECTED]
>
>
>
>
> - Original Message -
> From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
> To: "Struts (E-mail)" 
> Sent: Friday, April 08, 2005 7:10 AM
> Subject: concurrency problem
>
>
>
> I am facing concurrency problem in following scenario.
>
> All our action classes call same stateful session bean . 
> Each action class
> obtains the reference  from HTTPSession object and calls one
> and only one
> business method.
> To prevent the concurrent access to this instance which
> occurs when user
> immediately presses two links quickly in succession I am
> using the following
> code block
>
>
> execute(...)  //execute methods of Action class
> {
> 
> 
>
> //Obtain the session from  Request.User will always be in session here
> session=request.getSession()
> Synchronised(session)
> {
> //call ejb's  business method.
> }
>
> }
>
> However sometimes  more than one thread is able to pass
> through, And I get
> exception from Appserver. As 2 threads are not allowed for
> statefull Session
> bean.
> Can there be problem in above code. Is it ok to synchronise
> on session
> object.
>
>
>
>
>
> Thanks & Regds
>  Ashwani
>
> Ext: 1860
>
>
>
>
>
>
>
> This message contains information that may be privileged or
> confidential and
> is the property of the Capgemini Group. It is intended only
> for the person
> to whom it is addressed. If you are not the intended
> recipient,  you are not
> authorized to read, print, retain, copy, disseminate, 
> distribute, or use
> this message or any part thereof. If you receive this 
> message in error,
> please notify the sender immediately and delete all  copies
> of this message.
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


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



Re: concurrency problem

2005-04-08 Thread James Mitchell
You'd be better off implementing token processing.
Struts includes token generation and helper methods to ensure only one valid 
request is handled at a time.  Look at the struts example application 
(mailreader) for an example.

For detailed info on why this pattern works, see:
http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=lpr_g_1/102-8250064-5792120?v=glance&s=books

--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]

- Original Message - 
From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
To: "Struts (E-mail)" 
Sent: Friday, April 08, 2005 7:10 AM
Subject: concurrency problem


I am facing concurrency problem in following scenario.
All our action classes call same stateful session bean .  Each action class 
obtains the reference  from HTTPSession object and calls one and only one 
business method.
To prevent the concurrent access to this instance which occurs when user 
immediately presses two links quickly in succession I am using the following 
code block

execute(...)  //execute methods of Action class
{


//Obtain the session from  Request.User will always be in session here
session=request.getSession()
Synchronised(session)
{
   //call ejb's  business method.
}
}
However sometimes  more than one thread is able to pass through, And I get 
exception from Appserver. As 2 threads are not allowed for statefull Session 
bean.
Can there be problem in above code. Is it ok to synchronise on session 
object.



Thanks & Regds
Ashwani
Ext: 1860



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


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


RE: Popups and Struts Actions

2005-04-08 Thread Frank W. Zammetti
As I recall, and contrary to what some documentation says, it is actually the 
absence or presence of the settings of open() that determines what chrome 
elements are present.  So:

window.open(this.target,'','width=1,height=1');

I believe is what you want.  AFAIK,you also need to throw quotes around the 
options and it also looks like you missing the title (dunno if there are 
overloaded versions of open())  Here is how I do it in a production app, with 
just scrollbars visible, and it also centers the window...

myLeft = (screen.width) ? (screen.width - 1180) / 2 : 0;
myTop = (screen.height) ? (screen.height - 924) / 2 : 0;
myOpts = "resizable,scrollbars,width=1180,height=924,top=" + myTop + ",left=" + 
myLeft + ",";
window.open('page1.do', 'TOA', myOpts);

Frank

-Original Message-
From: "Dakota Jack"<[EMAIL PROTECTED]>
Sent: 4/8/05 3:01:43 AM
To: "Struts Users Mailing List"
Subject: Popups and Struts Actions

I am using the following code and do not want the menubar, etc. on my
popup.  But the menubar and everything else is still showing up.  You
javascript mavens out there, what is wrong?



  

  

  

  

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

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





[Message truncated. Tap Edit->Mark for Download to get remaining portion.]


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



RE: Popups and Struts Actions

2005-04-08 Thread Frank W. Zammetti
As I recall, and contrary to what some documentation says, it is actually the 
absence or presence of the settings of open() that determines what chrome 
elements are present.  So:

window.open(this.target,'','width=1,height=1');

I believe is what you want.  AFAIK,you also need to throw quotes around the 
options and it also looks like you missing the title (dunno if there are 
overloaded versions of open())  Here is how I do it in a production app, with 
just scrollbars visible, and it also centers the window...

myLeft = (screen.width) ? (screen.width - 1180) / 2 : 0;
myTop = (screen.height) ? (screen.height - 924) / 2 : 0;
myOpts = "resizable,scrollbars,width=1180,height=924,top=" + myTop + ",left=" + 
myLeft + ",";
window.open('page1.do', 'TOA', myOpts);

Frank

-Original Message-
From: "Dakota Jack"<[EMAIL PROTECTED]>
Sent: 4/8/05 3:01:43 AM
To: "Struts Users Mailing List"
Subject: Popups and Struts Actions

I am using the following code and do not want the menubar, etc. on my
popup.  But the menubar and everything else is still showing up.  You
javascript mavens out there, what is wrong?



  

  

  

  

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

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





[Message truncated. Tap Edit->Mark for Download to get remaining portion.]


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



Dinamic forms

2005-04-08 Thread Ext . Ilitia2
Hi,

  can your helpmy with a dinamic form with struts? I need an example of
a dinamic form, please

  thanks.



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



Re: [OT]Tool to find amount of data transfered in web application

2005-04-08 Thread Duncan Mills
I'd use a packet sniffer like ethereal (www.ethereal.com) . Its free 
under the GNU license and tremendously powerful.  You should be able to 
use it to measure both HTTP and Telnet traffic.  The only problem I have 
with it is the amount of stuff it captures, fortunately it has 
sophisticated filtering so you can limit it to Just your application 
endpoint for instance.

Duncan
http://www.groundside.com/blog
Ashish Kulkarni wrote:
Hi
I need this tool to find out the bandwidth used when
using a green screen (clinet access) application and
bandwidht when using web application
Ashish
--- "Fogleson, Allen" <[EMAIL PROTECTED]>
wrote:
 

You might check out jmeter
(http://jakarta.apache.org/jmeter/index.html)
it might be able to do what you want. Don't remember
off the top of my
head if it includes bandwidth reports but I think it
does.
Al
-Original Message-
From: Ashish Kulkarni
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 07, 2005 9:46 AM
To: user@struts.apache.org
Subject: [OT]Tool to find amount of data transfered
in web application

Hi
I have to make a report to display amount of data
transfered when using a web application, to find out
if it will work in existing networking (Intranet)
and
there are no band width issues,
Is there a open source tool which will tell the
amount
of data transfere in Intranet when accessing a web
site from client browser machine
Ashish
		
__ 
Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second
dates. 
http://personals.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]
   


		
__ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

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



concurrency problem

2005-04-08 Thread Kalra, Ashwani

I am facing concurrency problem in following scenario.

All our action classes call same stateful session bean .  Each action class 
obtains the reference  from HTTPSession object and calls one and only one 
business method.
To prevent the concurrent access to this instance which occurs when user 
immediately presses two links quickly in succession I am using the following 
code block


execute(...)  //execute methods of Action class
{



//Obtain the session from  Request.User will always be in session here
session=request.getSession()
Synchronised(session)
{
//call ejb's  business method.
}

}

However sometimes  more than one thread is able to pass through, And I get 
exception from Appserver. As 2 threads are not allowed for statefull Session 
bean.
Can there be problem in above code. Is it ok to synchronise on session object.





Thanks & Regds
 Ashwani

Ext: 1860







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


Nested ActionForm Validation

2005-04-08 Thread Ciaran Hanley
I am trying to reuse ActionForms within an application but I am unsure how
to deal with validation. What I have at the moment is an ActionForm1 which
contains a second form ActionForm2. In validation.xml, how do I use the
validation for ActionForm2 within the ActionForm1 validation? Can I use it
with something like this -

 



  

 

  

  



 

ActionForm2 has its own custom validations which I also need to call when
submitting the form, can I call them by just using
getActionForm2.validate(mapping,request) within ActionForm1 validation
method or how can this be achieved? 

 

Thanks,

Ciaran

 



Re: Popups and Struts Actions

2005-04-08 Thread James Mitchell


 method="post"
 action="album_photo.CRACKWILLOW"
 target="whereOwhere"
 onsubmit="window.open(this.action,this.target, 
'directories=0,status=0,menubar=0,scrollbar=2,toolbar=0,resizable=0,copyhistory=0,width=1,height=1');return 
false">

 
   
 
   
 
   
 
   
You should consider moving your scripts out to a separate method.  It would 
even be better to move them to a separate .js file and include that on the 
page.it's that whole 'reuse' thing.


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]

- Original Message - 
From: "Dakota Jack" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Friday, April 08, 2005 3:01 AM
Subject: Popups and Struts Actions


I am using the following code and do not want the menubar, etc. on my
popup.  But the menubar and everything else is still showing up.  You
javascript mavens out there, what is wrong?
   
onsubmit="window.open('',this.target,directories=0,status=0,menubar=0,scrollbar=2,toolbar=0,resizable=0,copyhistory=0,width=1,height=1);return
true;">
 
   
 
   
 
   
 
   
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Popups and Struts Actions

2005-04-08 Thread Dakota Jack
I am using the following code and do not want the menubar, etc. on my
popup.  But the menubar and everything else is still showing up.  You
javascript mavens out there, what is wrong?



  

  

  

  

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

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