AW: A customized Struts

2002-06-13 Thread Sann, Stephan

Hallo Joe,

thanx a lot for your lines.


> You have to use the same mechanism as with "dynamically defined query 
> parameters"  It only requires one  tag.

*dingdingding* - that's what I've been looking for!


>> 2.) How can I realize a "customized Forward"?
>>
>> Assumed there are two customers - "FirstCustomer" and "SecondCustomer".
>> These cusomers have totaly different JSPs but they share the same
>> Web-Application.
>
> [...]
> If you really don't think you can externalize the presentation 
> issues, I'd probably opt for installing two distinct instances of the 
> web application, one per customer.  That leaves you flexibility for 
> more variation between customers if you need it.

Nice idea - but no solution for our house! We have very strictly instructions
about our application-structure and there is not chance to deploy the same
application for two times (besides there are applications with four or more
customers).

So there is no way for a "customized forward"?


Best regards
Stephan

--
Stephan Sann
BHW Bausparkasse AG
Anwendungsentwicklung - Abteilung AEW CR -
Lubahnstraße 2, 31789 Hameln

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




Starter Action?

2002-06-13 Thread @Basebeans.com

Subject: Starter Action?
From: "Christopher Cheng" <[EMAIL PROTECTED]>
 ===
Is it possbile to define one of the actions to be executed during startup
instead of defining a new servlet in web.xml?



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




Re: Nested Tags question

2002-06-13 Thread Adam Hardy

Hi there,
I'll take a look at it this weekend. I don't get your reference to no 
session objects.

As far as the problem goes concerning setting against valid indices, my 
code does that simply enough using a check against ArrayList.size() and 
the index from the request parameter - if the size is too small, I just 
add new objects - 3 lines of code. This is all in a for loop, which 
could recurse - presumably what your commons wrapper does. Guess I'll 
find out.

All the best
Adam

Arron Bates wrote:

> Adam,
>
> Back to the old "want lists, but no session objects" issue. It's a 
> common problem these days. It's hard to get the list model working 
> nicely without "knowing" how big the list is going to be so that 
> objects can be set against valid indexes.
>
> The post you speek of in the archives is that I've made a collections 
> wrapps in the commons project which will wrap collections so that they 
> can expand by definition when the request comes in with indexed or 
> mapped properties.
>
> I'm cutting a short tutorial on it ("how to make funky complex form 
> models leaving the session object in the closet"), should be finished 
> in the next few days. It should help a lot of people. Most people end 
> up with indexed lists, but it's hard to get them working properly on 
> the back end. It's not just a nested tags thing.
>
> If you don't mind wading through code and having a go at the 
> collections wrapper with nothing but javadoc (good javadoc though :)...
>
> 
>http://cvs.apache.org/viewcvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LazyCollections.java
> 
>
>
>
> Arron.
>
>
> Adam Hardy wrote:
>
>> Hi Down Under,
>>
>> thanks for the reply. I figured that the form properties setting 
>> thing must be struts, after checking out the JSP spec. JSP does do a 
>> certain amount of it though, since you can specify a tag in your jsp 
>> and say parameters="*" - and JSP will match any parameters in the 
>> request to methods on the tag's bean.
>>
>> Anyway sorry for sounding like such a dumbass but I've been through 
>> your tutorials. For the display, I've got the nested tags sussed - 
>> it's for the save on submit that I'm having problems. It's one of 
>> those aggravating problems that I can't pin down so it's difficult to 
>> ask the right questions.
>>
>> I've actually hacked out some code to stuff the request parameters 
>> into the bean structure by hand in the form's validate method. 
>> Obviously I'd like to do it automatically but I had to get the app 
>> working. To try to sort out what I've done wrong, I'll strip it back 
>> to the simplest bare bones and take it from there.
>>
>> What I can't work out from playing with your SavingMonkey demo is how 
>> struts gets the request parameters into beans inside each other 
>> inside the formbean. Is it necessary to instantiate the right amount 
>> of empty beans first? I see SavingMonkey instantiates everything on 
>> construction.
>>
>> When saving request parameters to the beans in the formbean, does 
>> struts call the beans' getter methods to get the ArrayLists and 
>> beans? I can't see how else it would get access the setter methods on 
>> the deeper nested beans.
>>
>> Thanks for your help. I did see a message in the archives here but I 
>> can't find it again, where you were talking about changes awaiting 
>> acceptance in CVS - is that just stuff that is now incorporated into 
>> struts 1.1? I'm using 1.0.2
>>
>> All the best,
>> Adam
>
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
>
>



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




RE: workflow example explaination.

2002-06-13 Thread Anjali Jain

Hi,

I was looking at the getter setters in ApplicationMapping.java
where will the values of these variable(nextState, etc) be used...??
how is the value assignment to these affect the flow of pages...??

-anjali


-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 3:15 PM
To: [EMAIL PROTECTED]
Subject: RE: workflow example explaination.



Struts 1.1b1 give us a chance to customize an ActionMapping in a per action 
basis rather than doing it for the whole app in web.xml. Just place in your 
action definition in struts-config something like:



Adolfo

>From: Anjali Jain <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>Subject: RE: workflow example explaination.
>Date: Thu, 13 Jun 2002 14:35:48 +0530
>
>thanx a lot Matthias.
>I will now try to implement it.
>
>-Original Message-
>From: Matthias Bauer [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 13, 2002 1:31 PM
>To: Struts Users Mailing List
>Subject: Re: workflow example explaination.
>
>
> > But when I serached for the methods like setPrimaryWorkflow,
>setNewState(),
> > and setNextState() in SuccessAction class or GenericAction class,
> > I couldn't.
> > where are these methods & data members defined.
>
>It is the class ApplicationMapping, these methods are defined in. You also
>need
>to tell the Struts Servlet to use this mapping instead of the standard
>action
>mapping by this entry in web.xml (see the test application that is provided
>with
>the workflow extension package):
>
>  
>mapping
>com.livinglogic.struts.workflow.ApplicationMapping
>   
>  
>
>Please note: this works for Struts 1.0.x only, because the action mappings
>are
>defined differently in Struts 1.1.
>
> > I'm not able to map actually.
> >
> > In the struts-config.xml,
> > 
> >  
> >  
> >  
> >
> > what does value "1" signify for property "newState"...?
> > does it efine some kind of sequence...??
>
>What it says is:
>
>- newState: when this action is executed set the state of the "login"
>workflow
>to "1" and
>- nextState: any action that is following must belong to the workflow
>"login"
>and must set this workflow's state to 2 (otherwise a control flow exception
>is
>encountered)
>
> > Please explain comprehensively with the progression of screens..
>
>Please look at the test application and work through it thoroughly. This
>should
>demonstrate the ideas behind the workflow package pretty well.
>
>--- Matthias
>
>
>--
>To unsubscribe, e-mail:
>
>For additional commands, e-mail:
>
>
>Power your enterprise with custom solutions in eLearning and Knowledge
>Management from NIIT - Knowledge Solutions. For details visit our website
>http://www.ksb.niit.com
>
>___NOTICE
>This electronic mail transmission contains confidential information 
>intended
>only for the person(s) named.  Any use, distribution, copying or disclosure
>by any other person is strictly prohibited. If you received this
>transmission in error, please notify the sender by reply e-mail and then
>destroy the message.  Opinions, conclusions, and other information in this
>message that do not relate to the official business of NIIT shall be
>understood to be neither given nor endorsed by NIIT When addressed to NIIT
>clients, any information contained in this e-mail is subject to the terms
>and conditions in the governing client contract.
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>





  
 Adolfo's signature
  
  
 Adolfo Rodriguez Miguelez

  
  





_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:

For additional commands, e-mail:


Power your enterprise with custom solutions in eLearning and Knowledge
Management from NIIT - Knowledge Solutions. For details visit our website
http://www.ksb.niit.com 

___NOTICE 
This electronic mail transmission contains confidential information intended
only for the person(s) named.  Any use, distribution, copying or disclosure
by any other person is strictly prohibited. If you received this
transmission in error, please notify the sender by reply e-mail and then
destroy the message.  Opinions, conclusions, and other information in this
message that do not relate to the official business of NIIT shall be
understood to be neither given nor endorsed by NIIT When addressed to NIIT
clients, any information contained in this e-mail is subject to the terms
and conditions in the governing client contract.

--
To unsubscribe, e-mail:   

Re: Nested Tags question

2002-06-13 Thread Arron Bates

try...

document.forms[0]["mailingAddress.city"]

...works a treat.


Arron.

Jayaraman Dorai wrote:

>When I use nested tags, I am not able to access it through java scripts since the 
>name is "mailingAddress.city". Does anyone have a work around or am I missing 
>something?
>
>Jayaraman
>
>-Original Message-
>From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 13, 2002 12:23 PM
>To: Struts Users Mailing List
>Subject: Re: Re: Nested Tags question
>
>
>
>
>On Thu, 13 Jun 2002 [EMAIL PROTECTED] wrote:
>
>>Date: Thu, 13 Jun 2002 11:43:59 +0200
>>From: [EMAIL PROTECTED]
>>Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>Subject: Re: Re: Nested Tags question
>>
>>So Craig,
>>does the process work at submit time (when the request parameters are
>>being put into the nested beans) via calls to the getter methods to get
>>the beans on which the parameters have to be set?
>>
>>I can't see how else it would work.
>>
>
>It depends on what context you are using the expressions in.  For example:
>
>  
>  
>...
>
>...
>  
>
>will, in effect, do a call to:
>
>  customerForm.getMailingAddress().getCity()
>
>when the page is displayed, and a call to:
>
>  customerForm.getMailingAddress().setCity()
>
>when the request parameters are being copied in to the form bean.
>
>>Adam
>>
>
>Craig
>
>
>>
>>"Craig R. McClanahan" <[EMAIL PROTECTED]> schrieb am 13.06.2002,
>>08:22:43:
>>
>>>
>>>On Thu, 13 Jun 2002, Arron Bates wrote:
>>>
Date: Thu, 13 Jun 2002 14:14:13 +1000
From: Arron Bates
Reply-To: Struts Users Mailing List
To: Struts Users Mailing List
Subject: Re: Nested Tags question

>
>I know JSP will automatically save parameters to a javabean with the
>correctly named getters and setters, but there's obviously a gap in my
>knowledge because all my attempts to recreate the situation above have
>failed.
>
Setting form properties against beans is a Struts thing, not a JSP
thing. The property thing is a Bean thin and can be looked up in the
JavaBean spec.

The example you quote...

"monkeyTeamAlpha.monkeyWorkers[0].salary"

...is a nested property. An invention implemented within Struts
(Craig?).

>>>Yep, although in Struts 1.1 it is really a "commons-beanutils" thing
>>>because we abstracted out this generally useful code into a separate
>>>package.
>>>
What it basically is, is a string of calls rather than the
single property method. Here, it will get a hold of the form bean, get a
hold of the bean returned from the "monkeyTeamAlpha"property. On this
bean, it will invoke the indexed property "monkeyWorkers[0]" which will
pluck a bean from a collection or index provided, from this last bean it
will will get a hold of its "salary" property, and set the value.

>>>At each stage, you also get the benefit of some intelligence that is built
>>>in to the underlying PropertyUtils class.  For example, the JavaBeans spec
>>>defines two ways to define an indexed property -- you can use getter and
>>>setter methods that take a value and a subscript, or you can use getter
>>>and setter methods that return the entire array.  PropertyUtils makes the
>>>expression listed above work for either (or even for a property whose
>>>value is a java.util.List, which is an extension to the JavaBeans spec).
>>>
All this boils down to, is that you can compose objects a little
cleaner, rather than have truly enormous beans for everything. Having
the indexed properties allows for lists and whatever else.

The ability for nesting beans has been in Struts for a long time. The
nested tags just make it much easier.

There's a primer and tutorial for nested beans here...

http://www.keyboardmonkey.com/next

...it should take you over creating and using such a construct.

Hope this gets you on th path you're after.

>>>Another area of useful learning for the future is the JSP Standard Tag
>>>Library (JSTL).  Although the expression language syntax supported by JSTL
>>>is different from the one in Struts, it is well worth learning about --
>>>this expression language will be supported anywhere in a JSP page in JSP
>>>1.3, and (in the mean time) we will likely adapt Struts tags to be able to
>>>use it as well.
>>>

Arron.

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



--
To unsubscribe, e-mail:   
For additio

Re: Nested Tags question

2002-06-13 Thread Arron Bates

Adam,

Back to the old "want lists, but no session objects" issue. It's a 
common problem these days. It's hard to get the list model working 
nicely without "knowing" how big the list is going to be so that objects 
can be set against valid indexes.

The post you speek of in the archives is that I've made a collections 
wrapps in the commons project which will wrap collections so that they 
can expand by definition when the request comes in with indexed or 
mapped properties.

I'm cutting a short tutorial on it ("how to make funky complex form 
models leaving the session object in the closet"), should be finished in 
the next few days. It should help a lot of people. Most people end up 
with indexed lists, but it's hard to get them working properly on the 
back end. It's not just a nested tags thing.

If you don't mind wading through code and having a go at the collections 
wrapper with nothing but javadoc (good javadoc though :)...

http://cvs.apache.org/viewcvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LazyCollections.java


Arron.


Adam Hardy wrote:

> Hi Down Under,
>
> thanks for the reply. I figured that the form properties setting thing 
> must be struts, after checking out the JSP spec. JSP does do a certain 
> amount of it though, since you can specify a tag in your jsp and say 
> parameters="*" - and JSP will match any parameters in the request to 
> methods on the tag's bean.
>
> Anyway sorry for sounding like such a dumbass but I've been through 
> your tutorials. For the display, I've got the nested tags sussed - 
> it's for the save on submit that I'm having problems. It's one of 
> those aggravating problems that I can't pin down so it's difficult to 
> ask the right questions.
>
> I've actually hacked out some code to stuff the request parameters 
> into the bean structure by hand in the form's validate method. 
> Obviously I'd like to do it automatically but I had to get the app 
> working. To try to sort out what I've done wrong, I'll strip it back 
> to the simplest bare bones and take it from there.
>
> What I can't work out from playing with your SavingMonkey demo is how 
> struts gets the request parameters into beans inside each other inside 
> the formbean. Is it necessary to instantiate the right amount of empty 
> beans first? I see SavingMonkey instantiates everything on construction.
>
> When saving request parameters to the beans in the formbean, does 
> struts call the beans' getter methods to get the ArrayLists and beans? 
> I can't see how else it would get access the setter methods on the 
> deeper nested beans.
>
> Thanks for your help. I did see a message in the archives here but I 
> can't find it again, where you were talking about changes awaiting 
> acceptance in CVS - is that just stuff that is now incorporated into 
> struts 1.1? I'm using 1.0.2
>
> All the best,
> Adam




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




Re: thread safety

2002-06-13 Thread Noah Levitt

On Thu, Jun 13, 2002 at 09:07:58PM -0700, Craig R. McClanahan wrote:
> 
> Not always.  Example -- let's say you have a String property (very common
> in a form bean), so you have a setter like:
> 
>   private String foo = null;
> 
>   public String getFoo() {
> return (this.foo);
>   }
> 
>   public void setFoo(String foo) {
> this.foo = foo;
>   }
> 
> These methods do not need to be synchronized, because the assignments are
> atomic.

Ah, indeed you are right. I was under the impression that
their atomicity was platform-dependent, but I see from the
java language spec that I was mistaken.

> 
> > Would you also agree that every call to
> > session.setAttribute() and session.getAttribute() needs to
> > be synchronized?
> 
> Absolutely not.  The container takes care of ensuring that this call is
> thread safe on its internal implementation.
> 

That's a relief. And I see that access to the attributes is
synchronized in org.apache.catalina.session.StandardSession.
I didn't find any reassuring words in the servlet api,
though. Is the requirement stated somewhere?

Thanks for your help.

Noah

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




Re: thread safety

2002-06-13 Thread Craig R. McClanahan



On Thu, 13 Jun 2002, Noah Levitt wrote:

> Date: Thu, 13 Jun 2002 14:45:35 -0400
> From: Noah Levitt <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: thread safety
>
> Hello,
>
> Your suggestion is duly noted, and would probably be good
> advice for many web apps. But keeping form beans in session
> scope can be very handy at times, as has been pointed out in
> other posts. Sessions are one of the main advantages of
> servlets, after all.
>

Everything in life is a tradeoff ... session-scoped form beans survive in
between requests, but you have to worry about thread safety.  Request
scoped attributes don't survive, but thread safety is assured.  Pick the
approach that best meets your particular requirements, and deal with the
downside appropriately.

> So, you concede that using form beans the way they are
> commonly used, in session scope with setters and getters
> unsynchronized, is not thread-safe?
>

Not always.  Example -- let's say you have a String property (very common
in a form bean), so you have a setter like:

  private String foo = null;

  public String getFoo() {
return (this.foo);
  }

  public void setFoo(String foo) {
this.foo = foo;
  }

These methods do not need to be synchronized, because the assignments are
atomic.

The times you need to synchronize property setters is when they modify
some complex data structure (like a HashMap) that is not already ensuring
thread safety (the way Hashtable does).

NOTE 1:  If you have to synchronize the setter, you probably also have to
synchronize the getter so that it doesn't try to run when the setter is in
the middle of modifying the data structure.

NOTE 2:  It's better to synchronize on just the object being updated,
rather than adding the "synchronized" modifier to the method itself.  For
example, this:

  private HashMap foos = new HashMap();

  public synchronized Foo getFoo(String key) {
return ((Foo) foos.get(key));
  }

  public synchronized void addFoo(Foo foo) {
foos.put(foo.getKey(), foo);
  }

is essentially equivalent to this:

  private HashMap foos = new HashMap();

  public Foo getFoo(String key) {
synchronized (this) {
  return ((Foo) foos.get(key));
}
  }

  public void addFoo(Foo foo) {
synchronized (this) {
  foos.put(foo.getKey(), foo);
}
  }

which blocks other threads accessing *any* synchronized method on this
bean, even if they aren't touching the "foos" instance variable.  A better
approach:

  private HashMap foos = new HashMap();

  public Foo getFoo(String key) {
synchronized (foos) {
  return ((Foo) foos.get(key));
}
  }

  public void addFoo(Foo foo) {
synchronized (foos) {
  foos.put(foo.getKey(), foo);
}
  }

blocks only getFoo() and addFoo() calls from interfering with each other.

> Would you also agree that every call to
> session.setAttribute() and session.getAttribute() needs to
> be synchronized?

Absolutely not.  The container takes care of ensuring that this call is
thread safe on its internal implementation.

>
> Noah
>

Craig


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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Craig R. McClanahan



On Thu, 13 Jun 2002, Jerry Jalenak wrote:

> Date: Thu, 13 Jun 2002 13:12:00 -0500
> From: Jerry Jalenak <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>,
>  "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: RE: Please help clarify or confirm -- HttpSession
>
> A couple of reasons
>
> 1. My company has three main lines of business that for various regulatory
> reasons need to be kept separate.  This applies to deliver of content on the
> web as well.  What I am trying to accomplish is essentially a single-signon
> capability (within the framework) that the business applications can then
> validate against (successful logon, etc.).
>

Single sign on is a different kettle of fish ... and it does *not* require
sharing sessions for the server to accomodate it.  Tomcat 4, for example,
supports single sign on -- see the server config documents on the 
element of server.xml for the details.

All this does for you, though, is avoid the need for a user to log in to
each app -- it does nothing for sharing information between apps.  Your
best bet is to do something like:

* Store the shared info in a database or EJB that is accessible
  to all the relevant webapps.

* Store shared information in a static variable associated with
  a class that is loaded from the shared class loader (so that
  there really is only one instance).

Figuring out how to relate the information from various webapps together
is an exercise left to the user, but you can probably do something with
the fact that request.getRemoteUser() will return the same value in every
webapp.

> 2. I am also needing to integrate non-JSP applications (.ASP for instance)
> into the framework.  I know they cannot directly access my JavaBeans, but
> I'm wondering if a .ASP page could access the HttpSession data.
>

I don't have a clue how you could possibly accomplish this, given that the
ASP pages aren't running inside the same JVM that Tomcat is.

> Jerry
>

Craig


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




RE: Session Problem

2002-06-13 Thread Matt Smith

when you unpack the .war file, what is your directory structure like?

> -Original Message-
> From: Sudhir [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:16 PM
> To: Struts Users Mailing List
> Subject: RE: Session Problem
>
>
> Yes, they belong to same application and in same .war file.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 9:50 AM
> To: Struts Users Mailing List
> Subject: Re: Session Problem
>
>
>
> Are they in the same .war file (the same webapp)?
>
>
>
>
>
> "Sudhir" <[EMAIL PROTECTED]> on 06/13/2002 10:00:13 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  Session Problem
>
>
> Hi,
>
> I have got an application in which I have got many modules.  Only one
> module is with struts and the rest of the modules are using
> pure JSP.  I notice that the modules using with struts is creating new
> session and the modules with JSP are in another session.
>
> Can anybody tell me how can I make them run in same session.
>
> Thanks and Best Regards,
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




pager taglib !!

2002-06-13 Thread Amitkumar_J_Malhotra


anyone using pager tag library from JSPTags.com , i have a few doubts
regarding the same, could some help me out

regards,
amit malhotra



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




RE: thread safety

2002-06-13 Thread Andrew Hill

The hidden fields idea while technically possible becomes somewhat
unmanageable (ie: hard to maintain and prohibitively time consuming to
implement) when you have a lot of fields and where you need to do
comparisons on the new and old values when the request is submitted.

-Original Message-
From: Noah Levitt [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 02:46
To: Struts Users Mailing List
Subject: Re: thread safety


Hello,

Your suggestion is duly noted, and would probably be good
advice for many web apps. But keeping form beans in session
scope can be very handy at times, as has been pointed out in
other posts. Sessions are one of the main advantages of
servlets, after all.

So, you concede that using form beans the way they are
commonly used, in session scope with setters and getters
unsynchronized, is not thread-safe?

Would you also agree that every call to
session.setAttribute() and session.getAttribute() needs to
be synchronized?

Noah


On Wed, Jun 12, 2002 at 11:17:03PM -0700, Craig R. McClanahan wrote:
>
>
> The simplest way to avoid this whole set of problems is to use request
> scope for your form beans.  Then, the container guarantees that only one
> thread can access these beans, so you don't need to be concerned at all
> about thread safety in them.
>
> Following this advice will also be beneficial, in general, to the
> scalability of your application -- because the server will not need to
> store the form beans in memory "in between" requests.
>
> Craig

--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




RE: Session Problem

2002-06-13 Thread Chakradhar Tallam

in server.xml

-Original Message-
From: Sudhir [mailto:[EMAIL PROTECTED]]
Sent: Friday, 14 June 2002 12:15 PM
To: Struts Users Mailing List
Subject: RE: Session Problem


where can i check the context path.

-Original Message-
From: Matt Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 9:59 AM
To: Struts Users Mailing List
Subject: RE: Session Problem


What are the paths for your application?  I believe the context path is not
the same.

> -Original Message-
> From: Sudhir [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:00 PM
> To: Struts Users Mailing List
> Subject: Session Problem
>
>
> Hi,
>
> I have got an application in which I have got many modules.  Only
> one module is with struts and the rest of the modules are using
> pure JSP.  I notice that the modules using with struts is
> creating new session and the modules with JSP are in another session.
>
> Can anybody tell me how can I make them run in same session.
>
> Thanks and Best Regards,
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:




RE: Session Problem

2002-06-13 Thread Sudhir

Following is my context path setting.  Is this the one you mean context path.
If not can you suggest which tag.

  
action
struts.prjmgt.ActionServlet

  application
  struts.prjmgt.ApplicationResources


  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2


  validate
  true

2
  

-Original Message-
From: Matt Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 9:59 AM
To: Struts Users Mailing List
Subject: RE: Session Problem


What are the paths for your application?  I believe the context path is not
the same.

> -Original Message-
> From: Sudhir [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:00 PM
> To: Struts Users Mailing List
> Subject: Session Problem
>
>
> Hi,
>
> I have got an application in which I have got many modules.  Only
> one module is with struts and the rest of the modules are using
> pure JSP.  I notice that the modules using with struts is
> creating new session and the modules with JSP are in another session.
>
> Can anybody tell me how can I make them run in same session.
>
> Thanks and Best Regards,
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


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



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




RE: Session Problem

2002-06-13 Thread Sudhir

Yes, they belong to same application and in same .war file.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 9:50 AM
To: Struts Users Mailing List
Subject: Re: Session Problem



Are they in the same .war file (the same webapp)?





"Sudhir" <[EMAIL PROTECTED]> on 06/13/2002 10:00:13 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  Session Problem


Hi,

I have got an application in which I have got many modules.  Only one
module is with struts and the rest of the modules are using
pure JSP.  I notice that the modules using with struts is creating new
session and the modules with JSP are in another session.

Can anybody tell me how can I make them run in same session.

Thanks and Best Regards,


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








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



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




RE: Session Problem

2002-06-13 Thread Sudhir

where can i check the context path.

-Original Message-
From: Matt Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 9:59 AM
To: Struts Users Mailing List
Subject: RE: Session Problem


What are the paths for your application?  I believe the context path is not
the same.

> -Original Message-
> From: Sudhir [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:00 PM
> To: Struts Users Mailing List
> Subject: Session Problem
>
>
> Hi,
>
> I have got an application in which I have got many modules.  Only
> one module is with struts and the rest of the modules are using
> pure JSP.  I notice that the modules using with struts is
> creating new session and the modules with JSP are in another session.
>
> Can anybody tell me how can I make them run in same session.
>
> Thanks and Best Regards,
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


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



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




Re: Session Problem

2002-06-13 Thread Kevin . Bedell


Are they in the same .war file (the same webapp)?





"Sudhir" <[EMAIL PROTECTED]> on 06/13/2002 10:00:13 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  Session Problem


Hi,

I have got an application in which I have got many modules.  Only one
module is with struts and the rest of the modules are using
pure JSP.  I notice that the modules using with struts is creating new
session and the modules with JSP are in another session.

Can anybody tell me how can I make them run in same session.

Thanks and Best Regards,


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








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




RE: Session Problem

2002-06-13 Thread Matt Smith

What are the paths for your application?  I believe the context path is not
the same.

> -Original Message-
> From: Sudhir [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:00 PM
> To: Struts Users Mailing List
> Subject: Session Problem
>
>
> Hi,
>
> I have got an application in which I have got many modules.  Only
> one module is with struts and the rest of the modules are using
> pure JSP.  I notice that the modules using with struts is
> creating new session and the modules with JSP are in another session.
>
> Can anybody tell me how can I make them run in same session.
>
> Thanks and Best Regards,
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


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




Session Problem

2002-06-13 Thread Sudhir

Hi,

I have got an application in which I have got many modules.  Only one module is with 
struts and the rest of the modules are using
pure JSP.  I notice that the modules using with struts is creating new session and the 
modules with JSP are in another session.

Can anybody tell me how can I make them run in same session.

Thanks and Best Regards,


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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Craig R. McClanahan



On Thu, 13 Jun 2002, Joseph Barefoot wrote:

> Date: Thu, 13 Jun 2002 11:09:43 -0700
> From: Joseph Barefoot <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED]
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: Please help clarify or confirm -- HttpSession
>
> hmmm...but the sessionIDs have to be unique, even across web apps., correct?

Actually, session ids do *not* have to be unique across the entire server.
Tomcat, for example, sets the "path" attribute of the session id cookie to
match the context path of the webapp, so the browser only sends the right
cookie back to the right webapp.  If two session ids for different webapps
happen to be the same (possible ... it's based on a random number
generator), there is still no problem.

> If there weren't unique, URL rewriting would not work correctly if two users
> using two webapps on the same app. server happened to get the same session
> ID.

Still not a problem ... because URL rewriting only rewrites hyperlinks
that point back into the same webapp.  So, you are still insulated from
any grief caused by duplicate session ids in different webapps.

>  Therefore, one *should* be able to store objects from webapp A in a
> shared classloader class keyed by the sessionID and retrieve them from
> webapp B.

That is, unfortunately for this use case, not a valid conclusion.

* The servlet spec states that the set of sessions for each
  webapp is distinct from the set for any other webapp.

* Even if they *were* shared, you would have serious problems.
  Consider the case where you create a bean of some class that
  is loaded from /WEB-INF/classes or /WEB-INF/lib, and stick it
  in your session.  Even if a servlet in another app could get
  a reference to this HttpSession instance, it would get a
  ClassNotFoundException trying to do anything with the returned
  attribute, because it's implementation class is not visible
  in the calling webapp's class loader.

* If the container allows it, there is a way to do "cross context"
  request dispatcher calls via ServletContext.getContext() -- but
  that doesn't help you much.  You cannot ask for a session by id,
  so the best you could do would be start a second session in the
  other app.

> Am I missing something here? (besides why the hell you would want to do
> this)
> :)
>

Good question :-)

>
> joe
>

Craig


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




Is there a way to reverse engineer a WAR file for a struts app?

2002-06-13 Thread Jane . Muse

I have a WAR file for my struts app that I created from the JRE command
line with the 'jar' command. I then created an EAR file with the
Application Assembly tool in Websphere Application Server 4.0, then
deployed to WAS 4.0. My struts app was developed with Visual Age for Java
4.0 and tested with Tomcat. I now want to test with WAS 4.0 running on
Win2K, then once that works, will deploy to WAS 4.x on ZOS. While testing
with WAS 4.0 I got null pointer exceptions in areas of the code that worked
fine with Tomcat. So now it looks like I need a debugger to test with WAS
so I can step through the code and find out why the null pointer
exceptions. For this purpose, I installed Websphere Studio 4.0 with the
debugging tool. The question is does anyone know if I can turn my WAR file
into an application on Studio? In other words is there a way to 'reverse
engineer' a WAR file into an application that can be debugged?
The option of using Websphere Application Server from within VAJ is always
there I suppose, but that's WAS 3.5.3 and I specifically want to use WAS
4.x.
Thanks in advance.
Jane


This email message and all attachments transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and
privileged information. Please DO NOT forward this email outside of the recipient's 
Company unless expressly authorized to do so herein.  Any
unauthorized review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.

Any views expressed in this email message are those of the individual sender except 
where the sender specifically states them to be the views of Indus
 International, Inc.




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




Re: html:messages

2002-06-13 Thread Rick Reumann


On Thursday, June 13, 2002, 6:22:54 PM, [EMAIL PROTECTED] wrote:

wEBc> ACTION CODE---
wEBc> ActionMessages amsgs = new ActionMessages();
wEBc> ActionMessage am = new ActionMessage("drilldown.results.nomatches");
wEBc> amsgs.add(ActionMessages.GLOBAL_MESSAGE,am);
wEBc> request.setAttribute(Action.MESSAGE_KEY, amsgs); 
wEBc> return (mapping.findForward("continue"));

  Try--
  replacing
   request.setAttribute(Action.MESSAGE_KEY, amsgs);
  with:
   saveMessages( request, amsgs );

 If the above doesn't help then try in the jsp page:



  

I'm new to using the messages myself, so probably someone else can
help out more, but I know the above works for me.


--

Rick

mailto:[EMAIL PROTECTED]

"As the light changed from red to green to yellow and back to red
again, I sat there thinking about life. Was it nothing more than a
bunch of honking and yelling? Sometimes it seemed that way."
  -Jack Handey


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




RE: html:link

2002-06-13 Thread Keith Chew

Hi

I have found it. The  does exactly what I want.

Thanks
Keith



-Original Message-
From: Arik Levin ( Tikal ) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 11 June 2002 6:46 p.m.
To: 'Struts Users Mailing List'
Subject: RE: html:link


Yeah, there is an alternative, always.

If you need only some specific write just use the mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 4:57 AM
To: Struts Users Mailing List
Subject: html:link

Hi

I was wondering if there is a tag to generate a url link from a map, and
preserve the sessionid. Just like what html:link is doing. Ie

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



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




Problems dynamically specifying forward attribute in tag

2002-06-13 Thread Bartley, Chris P

My apologies if the answer to this is ridiculously obvious, but I'm having
problems dynamically specifying the "forward" attribute in the 
tag.

Something like this works just fine:

   

However, this does not:

   <% String crap = "forward.home"; %>
   

It fails with the following stack trace:

2002-06-13 17:09:29 - Ctx(/ptt) : compile error: req=R( /ptt +
/jsp/html/common/main/body/sublistTab
le/filterByLetter.jsp + null) - java.lang.ClassCastException:
java.lang.Object
at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java)
at
org.apache.struts.taglib.bean.StrutsTei.getVariableInfo(StrutsTei.java:90)
at javax.servlet.jsp.tagext.TagInfo.getVariableInfo(TagInfo.java)
[snip]

I'm using Tomcat 3.3.1 on Win2k sp1.

What the heck am I doing wrong?

thanks heaps,

chris

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




html:messages

2002-06-13 Thread wbchmura


Hello,

I cannot get the new messages tag to work for me...  I also can't find 
anything anywhere on how to use it...

In my action I am doing this:

When I run this it whines about the ID being required.  I looked at what 
the id attribute is for and I cannot seem to figure out
where it shoud point to...  I've tried many many things so far...

TIA

ACTION CODE---
ActionMessages amsgs = new ActionMessages();
ActionMessage am = new ActionMessage("drilldown.results.nomatches");
amsgs.add(ActionMessages.GLOBAL_MESSAGE,am);
request.setAttribute(Action.MESSAGE_KEY, amsgs); 
return (mapping.findForward("continue"));

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












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




RE: Javascript and Struts

2002-06-13 Thread Joe Germuska

At 5:43 PM -0400 2002/06/13, Leonardo Maciel wrote:
>
>
>or if you want open the page with reportNav action (that's what I use):
>
>href="javascript:openWindow('reportDelivery','fullPath/reportNav.do?action=Load',1,350,300)">

The problem with this one is that you end up hardcoding the web app 
context path into your JSP, which makes it less portable; my 
response, which uses , defers to Java classes to add in 
"fullPath" dynamically.


>or, not sure if they work, if you realy wants to use html:link:
>
>onclick="javascript:openWindow('reportDelivery','fullPath/reportNav.do?action=Load',1,350,300)"
> >
>or
>href="javascript:openWindow('reportDelivery','fullPath/reportNav.do?action=Load',1,350,300)"
> >

 is designed for situations like this -- both of these 
examples also end up with hardcoding "fullPath" (the web app context 
path).

Joe




>
>-Original Message-
>From: Villegas, Courtney [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 13, 2002 4:54 PM
>To: 'Struts Users Mailing List'
>Subject: Javascript and Struts
>
>
>Is it possible to mix javascript and struts?  I want to create a popup
>window that is opened through an action.
>
>There was some talk of doing this about a month ago, but I looked on the
>user-list archives and couldn't find any information.
>
>Any help would be greatly appreciated.
>
>Thanks!!!
>Courtney
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


-- 
--
* Joe Germuska{ [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
--Sam Goody, 1956
tune in posse radio: 

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




html:checkbox inside html:iterate on struts 1.0.2

2002-06-13 Thread Leonardo Maciel

Three quick questions on struts 1.0.2 

1. can I use html:checkbox inside a html:iterate ? Yes (two to go)
2. what should be on the form?  String[] checked or Boolean[] checked or ...? 


check the options you want







3. do I have to index the checkbox property ?


Thank you,
Leo

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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

Agreed.  The shared classloader approach is a fast-and-dirty solution that
would have to be replaced in a clustered environment.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:26 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> Ralph -
>
> I agree - In one of my first responses I recommended using an ejb server
> for this - that way you can have multiple servers accessing it at the same
> time while having the ejb server managing locking and transactions if
> required.
>
>
>
>
>
> "Ralph Roland" <[EMAIL PROTECTED]> on 06/13/2002 05:44:41 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> I haven't noticed anyone else pointing this out yet, so I guess maybe I
> should...  The approach described below (as far as I can see) will only
> work
> if you assume your app will never be deployed on more than a single server
> -
> or if you are fine with the fact that this 'shared' object will not
> actually
> be shared across multiple server instances in the cluster.
>
> If you can be certain you will never need to scale your apps to more than
> one server this may be appropriate, but personally I would be very leary
> about relying on this for any real project... YMMV
>
> Ralph Roland
> Strata-J
> [EMAIL PROTECTED]
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 4:04 PM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> >
> > OK. I checked this out.
> >
> > I'm running Tomcat 4.03 on NT with JDK 1.3.1.
> >
> > I created a simple static class:
> > -
> > public class ClassLoaderTest {
> >
> > public static int counter;
> >
> > public static void addCounter() {
> > counter++;
> > }
> >
> > public static String getCounter () {
> > return Integer.toString(counter);
> > }
> > }
> >
> >
> > I compiled it and put the .class file in %CATALINA_HOME%\classes
> >
> > -
> >
> > I then created a simple jsp named "test.jsp"
> >
> > <%@ page import="ClassLoaderTest" %>
> > 
> >   
> > Testing Class Loaders
> >   
> >   
> > <% ClassLoaderTest.addCounter(); %>
> > <% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
> >   
> > 
> >
> > -
> >
> > I then created two webapps, "webapp1" and "webapp2".  They are
> > completely empty except for the test.jsp file and the following
> > web.xml file:
> >
> > 
> >
> >  >   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
> >
> > 
> >
> >   
> >   
> > index.jsp
> >   
> >
> > 
> >
> >
> >
> > Now - I then restarted Tomcat and opened two browsers. I pointed one to:
> >
> >  http://localhost:8080/webapp1/test.jsp
> >
> > and the other to:
> >
> >  http://localhost:8080/webapp2/test.jsp
> >
> >
> > Then when I hit refresh on them I can see THEY ARE HITTING THE
> > SAME OBJECT. That is, this works. The counter increments each
> > time I refresh either
> > browser.
> >
> > Thanks for the thoughts on this Joe -
> >
> > Kevin
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

You are 100% correct.

Luckily this approach is actually very simple in implementation, but if
used, the handle to the shared utility object should be provided by a
factory method and the utility object itself should conform to an interface
(in each application).  Calling application objects should use this
interface and factory method to get/store objects.  That way a more robust
implementation can be swapped in "under the covers" without affecting the
calling applications.

A more robust implemenation would be to store the shared session data in a
common database, if the applications are indeed using the same database.
This has its own implications, however...  If they are not using a common
database, then an EJB layer or perhaps XML through sockets or over HTTP
between applications would be required.  I guess you would call the latter a
"web service" (why not). :)

peace,
Joe Barefoot

> -Original Message-
> From: Ralph Roland [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:45 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> I haven't noticed anyone else pointing this out yet, so I guess maybe I
> should...  The approach described below (as far as I can see)
> will only work
> if you assume your app will never be deployed on more than a
> single server -
> or if you are fine with the fact that this 'shared' object will
> not actually
> be shared across multiple server instances in the cluster.
>
> If you can be certain you will never need to scale your apps to more than
> one server this may be appropriate, but personally I would be very leary
> about relying on this for any real project... YMMV
>
> Ralph Roland
> Strata-J
> [EMAIL PROTECTED]
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 4:04 PM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> >
> > OK. I checked this out.
> >
> > I'm running Tomcat 4.03 on NT with JDK 1.3.1.
> >
> > I created a simple static class:
> > -
> > public class ClassLoaderTest {
> >
> > public static int counter;
> >
> > public static void addCounter() {
> > counter++;
> > }
> >
> > public static String getCounter () {
> > return Integer.toString(counter);
> > }
> > }
> >
> >
> > I compiled it and put the .class file in %CATALINA_HOME%\classes
> >
> > -
> >
> > I then created a simple jsp named "test.jsp"
> >
> > <%@ page import="ClassLoaderTest" %>
> > 
> >   
> > Testing Class Loaders
> >   
> >   
> > <% ClassLoaderTest.addCounter(); %>
> > <% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
> >   
> > 
> >
> > -
> >
> > I then created two webapps, "webapp1" and "webapp2".  They are
> > completely empty except for the test.jsp file and the following
> > web.xml file:
> >
> > 
> >
> >  >   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
> >
> > 
> >
> >   
> >   
> > index.jsp
> >   
> >
> > 
> >
> >
> >
> > Now - I then restarted Tomcat and opened two browsers. I pointed one to:
> >
> >  http://localhost:8080/webapp1/test.jsp
> >
> > and the other to:
> >
> >  http://localhost:8080/webapp2/test.jsp
> >
> >
> > Then when I hit refresh on them I can see THEY ARE HITTING THE
> > SAME OBJECT. That is, this works. The counter increments each
> > time I refresh either
> > browser.
> >
> > Thanks for the thoughts on this Joe -
> >
> > Kevin
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Javascript and Struts

2002-06-13 Thread Leonardo Maciel




or if you want open the page with reportNav action (that's what I use):



or, not sure if they work, if you realy wants to use html:link:


or



-Original Message-
From: Villegas, Courtney [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:54 PM
To: 'Struts Users Mailing List'
Subject: Javascript and Struts


Is it possible to mix javascript and struts?  I want to create a popup
window that is opened through an action.

There was some talk of doing this about a month ago, but I looked on the
user-list archives and couldn't find any information.

Any help would be greatly appreciated.

Thanks!!!
Courtney

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

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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell


Ralph -

I agree - In one of my first responses I recommended using an ejb server
for this - that way you can have multiple servers accessing it at the same
time while having the ejb server managing locking and transactions if
required.





"Ralph Roland" <[EMAIL PROTECTED]> on 06/13/2002 05:44:41 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


I haven't noticed anyone else pointing this out yet, so I guess maybe I
should...  The approach described below (as far as I can see) will only
work
if you assume your app will never be deployed on more than a single server
-
or if you are fine with the fact that this 'shared' object will not
actually
be shared across multiple server instances in the cluster.

If you can be certain you will never need to scale your apps to more than
one server this may be appropriate, but personally I would be very leary
about relying on this for any real project... YMMV

Ralph Roland
Strata-J
[EMAIL PROTECTED]

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 4:04 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
>
> OK. I checked this out.
>
> I'm running Tomcat 4.03 on NT with JDK 1.3.1.
>
> I created a simple static class:
> -
> public class ClassLoaderTest {
>
> public static int counter;
>
> public static void addCounter() {
> counter++;
> }
>
> public static String getCounter () {
> return Integer.toString(counter);
> }
> }
>
>
> I compiled it and put the .class file in %CATALINA_HOME%\classes
>
> -
>
> I then created a simple jsp named "test.jsp"
>
> <%@ page import="ClassLoaderTest" %>
> 
>   
> Testing Class Loaders
>   
>   
> <% ClassLoaderTest.addCounter(); %>
> <% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
>   
> 
>
> -
>
> I then created two webapps, "webapp1" and "webapp2".  They are
> completely empty except for the test.jsp file and the following
> web.xml file:
>
> 
>
>PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
>
> 
>
>   
>   
> index.jsp
>   
>
> 
>
>
>
> Now - I then restarted Tomcat and opened two browsers. I pointed one to:
>
>  http://localhost:8080/webapp1/test.jsp
>
> and the other to:
>
>  http://localhost:8080/webapp2/test.jsp
>
>
> Then when I hit refresh on them I can see THEY ARE HITTING THE
> SAME OBJECT. That is, this works. The counter increments each
> time I refresh either
> browser.
>
> Thanks for the thoughts on this Joe -
>
> Kevin
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>


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








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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Ralph Roland

I haven't noticed anyone else pointing this out yet, so I guess maybe I
should...  The approach described below (as far as I can see) will only work
if you assume your app will never be deployed on more than a single server -
or if you are fine with the fact that this 'shared' object will not actually
be shared across multiple server instances in the cluster.

If you can be certain you will never need to scale your apps to more than
one server this may be appropriate, but personally I would be very leary
about relying on this for any real project... YMMV

Ralph Roland
Strata-J
[EMAIL PROTECTED]

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 4:04 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
>
> OK. I checked this out.
>
> I'm running Tomcat 4.03 on NT with JDK 1.3.1.
>
> I created a simple static class:
> -
> public class ClassLoaderTest {
>
> public static int counter;
>
> public static void addCounter() {
> counter++;
> }
>
> public static String getCounter () {
> return Integer.toString(counter);
> }
> }
>
>
> I compiled it and put the .class file in %CATALINA_HOME%\classes
>
> -
>
> I then created a simple jsp named "test.jsp"
>
> <%@ page import="ClassLoaderTest" %>
> 
>   
> Testing Class Loaders
>   
>   
> <% ClassLoaderTest.addCounter(); %>
> <% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
>   
> 
>
> -
>
> I then created two webapps, "webapp1" and "webapp2".  They are
> completely empty except for the test.jsp file and the following
> web.xml file:
>
> 
>
>PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
>
> 
>
>   
>   
> index.jsp
>   
>
> 
>
>
>
> Now - I then restarted Tomcat and opened two browsers. I pointed one to:
>
>  http://localhost:8080/webapp1/test.jsp
>
> and the other to:
>
>  http://localhost:8080/webapp2/test.jsp
>
>
> Then when I hit refresh on them I can see THEY ARE HITTING THE
> SAME OBJECT. That is, this works. The counter increments each
> time I refresh either
> browser.
>
> Thanks for the thoughts on this Joe -
>
> Kevin
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>


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




RE: Javascript and Struts

2002-06-13 Thread Joe Germuska

At 2:03 PM -0700 2002/06/13, Villegas, Courtney wrote:
>can I feed an action into Javascript?
>
>This is what my struts link would look like to forward to another page:
>   
>
>and this is what my javascript looks like to open the new browser window
>   openWindow('reportDelivery', '/budsDev/jsp/reportDeliveryQP.jsp',1,
>350, 300)

well, if your JavaScript points directly to a JSP then you aren't 
really using Struts.  If the question is "how do I get Javascript to 
go to a Struts action,"  you need to use the  tag

something like:

openWindow('reportDelivery','',1,350,300)

see 
for 
the details.

BTW, would it make sense to add an optional "paramValue" attribute to 
the tags which do HTML rewriting?  It would basically take the String 
literal that is defined in   Seems like it would 
simplify a common case.  I can do it and provide the patch if no one 
objects, but I'm wondering if maybe it was left out for a reason?

Joe
-- 
--
* Joe Germuska{ [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
--Sam Goody, 1956
tune in posse radio: 

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




URGENT - PLS HELP

2002-06-13 Thread Bhaskar Gopalan

I know this is not a stutus question, but itz very urgent. Pls help!!

I am  moving EJBs from Visual Age for Java 4.0 to Websphere 4.0 AES. One
servlet contains the following piece of code:
InitialContext ic = getInitialContext();
java.lang.Object tmpObj = ic.lookup("Company");
companyHome =
(CompanyHome)PortableRemoteObject.narrow((org.omg.CORBA.Object)tmpObj,
com.mortgagehub.ejb.CompanyHome.class);
if(companyHome != null)
{
company = companyHome.findByPrimaryKey(key);
}

I am getting the following error in logins.log when I try to login: ""Thu
Jun 13 11:15:43 EDT
2002|member||pinfad81|FAILURE|org.omg.CORBA.BAD_PARAM:
org.omg.CORBA.BAD_PARAM: Servant is not of the expected type.  minor code:
0 completed: No|"

All of a sudden the above error has disappeared and I get the following
error:
"Thu Jun 13 17:07:16 EDT
2002|member||pinfad81|FAILURE|java.lang.ClassCastException:
java.lang.ClassCastException: com.mortgagehub.ejb._CompanyHome_Stub|"

Can you please tell me what could be the reason for the above two errors?

Thanks,
Bhaskar







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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

Oops, forgot to clarify Jerry:

Any access to a java.util.Hashtable is synchronized, so using it as a static
repository for shared in-memory data should be safe and fast.  Also, the
class definition for any objects that are stored in this Hashtable should be
loaded from the same (shared) classloader as the class containing the
hashtable itself.  So the utility class plus shared object classes should be
contained in the same JAR and dropped in the shared library folder (or
whatever you have to do to get the container to load this classes as
shared).


peace,
Joe

> -Original Message-
> From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:11 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Thanks for confirming this Kevin.  Should work for sharing object
> instances
> just fine based on your test.
>
> Jerry:
>
> I would recommend using a java.util.Hashtable, and storing your
> authenticated user bean with a String containing the jsessionid.  This
> should be safe.
>
>
> peace,
> Joe
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 1:28 PM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> > Not sure about these - maybe someone else can grab the ball and
> > push ahead.
> >
> > One of the things I was wondering about were FormBean instances
> and other
> > complex objects such as DB Pool connections.
> >
> >
> >
> >
> >
> >
> >
> > "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 04:38:28 PM
> >
> > Please respond to "Struts Users Mailing List"
> >   <[EMAIL PROTECTED]>
> >
> > To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> > Subject:  RE: Please help clarify or confirm -- HttpSession
> >
> >
> > Cool.  Building on this then, I should be able to define some sort of
> > Collection (HashMap? Vector?) that I should be able to store
> > instances of a
> > bean into (i.e. my authenticated user bean).  It looks like everything
> > needs
> > to be defined as static - no problem.  What about synchronization
> > problems?
> > Does the access need to be serialized in anyway?
> >
> > Jerry
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 3:04 PM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> >
> > OK. I checked this out.
> >
> > I'm running Tomcat 4.03 on NT with JDK 1.3.1.
> >
> > I created a simple static class:
> > -
> > public class ClassLoaderTest {
> >
> >public static int counter;
> >
> >public static void addCounter() {
> >counter++;
> >}
> >
> >public static String getCounter () {
> >return Integer.toString(counter);
> >}
> > }
> >
> >
> > I compiled it and put the .class file in %CATALINA_HOME%\classes
> >
> > -
> >
> > I then created a simple jsp named "test.jsp"
> >
> > <%@ page import="ClassLoaderTest" %>
> > 
> >   
> >Testing Class Loaders
> >   
> >   
> ><% ClassLoaderTest.addCounter(); %>
> ><% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
> >   
> > 
> >
> > -
> >
> > I then created two webapps, "webapp1" and "webapp2".  They are
> completely
> > empty except for the test.jsp file and the following web.xml file:
> >
> > 
> >
> >  >   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
> >
> > 
> >
> >   
> >   
> >index.jsp
> >   
> >
> > 
> >
> >
> >
> > Now - I then restarted Tomcat and opened two browsers. I pointed one to:
> >
> > http://localhost:8080/webapp1/test.jsp
> >
> > and the other to:
> >
> > http://localhost:8080/webapp2/test.jsp
> >
> >
> > Then when I hit refresh on them I can see THEY ARE HITTING THE
> > SAME OBJECT.
> > That is, this works. The counter increments each time I refresh either
> > browser.
> >
> > Thanks for the thoughts on this Joe -
> >
> > Kevin
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> > This transmission (and any information attached to it) may be
> confidential
> > and is intended solely for the use of the individual or entity
> to which it
> > is addressed. If you are not the intended recipient or the person
> > responsible for delivering the transmission to the intended
> recipient, be
> > advised that you have received this transmission in error and
> > that any use,
> > dissemination, forwarding, printing, or copying of this information is
> > strictly prohibited. If you have received this transmission in error,
> > please immediately notify LabOne at (800)388-4675.
> >
> >
> >
> > --
> > To unsubscribe, e

Re: Need Urgent help

2002-06-13 Thread Bharat Nagwani

use logic:present as a wrapper

At 08:10 PM 6/25/2002 +0530, you wrote:
>Hi,
>I have a problem in using logic:equal tag given below
>
>  DO SOME.
>
>This code is working fine when it is not null. But when ever it {
>beaninstance.getMethod() }
>is becoming null, page is getting exception as below...
>
>javax.servlet.jsp.JspException: Cannot compare null variable to value A
> at 
> org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193)
> at 
> org.apache.jsp.HNCTemplate$jsp._jspService(HNCTemplate$jsp.java:317)
> at 
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
>va:202)
> at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
>
>Can any one help me out in this, I tried to break this in logic:equal source
>file..
>
>TIA
>rayaku
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

Thanks for confirming this Kevin.  Should work for sharing object instances
just fine based on your test.

Jerry:

I would recommend using a java.util.Hashtable, and storing your
authenticated user bean with a String containing the jsessionid.  This
should be safe.


peace,
Joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:28 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> Not sure about these - maybe someone else can grab the ball and
> push ahead.
>
> One of the things I was wondering about were FormBean instances and other
> complex objects such as DB Pool connections.
>
>
>
>
>
>
>
> "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 04:38:28 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> Cool.  Building on this then, I should be able to define some sort of
> Collection (HashMap? Vector?) that I should be able to store
> instances of a
> bean into (i.e. my authenticated user bean).  It looks like everything
> needs
> to be defined as static - no problem.  What about synchronization
> problems?
> Does the access need to be serialized in anyway?
>
> Jerry
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 3:04 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
>
> OK. I checked this out.
>
> I'm running Tomcat 4.03 on NT with JDK 1.3.1.
>
> I created a simple static class:
> -
> public class ClassLoaderTest {
>
>public static int counter;
>
>public static void addCounter() {
>counter++;
>}
>
>public static String getCounter () {
>return Integer.toString(counter);
>}
> }
>
>
> I compiled it and put the .class file in %CATALINA_HOME%\classes
>
> -
>
> I then created a simple jsp named "test.jsp"
>
> <%@ page import="ClassLoaderTest" %>
> 
>   
>Testing Class Loaders
>   
>   
><% ClassLoaderTest.addCounter(); %>
><% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
>   
> 
>
> -
>
> I then created two webapps, "webapp1" and "webapp2".  They are completely
> empty except for the test.jsp file and the following web.xml file:
>
> 
>
>PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
>
> 
>
>   
>   
>index.jsp
>   
>
> 
>
>
>
> Now - I then restarted Tomcat and opened two browsers. I pointed one to:
>
> http://localhost:8080/webapp1/test.jsp
>
> and the other to:
>
> http://localhost:8080/webapp2/test.jsp
>
>
> Then when I hit refresh on them I can see THEY ARE HITTING THE
> SAME OBJECT.
> That is, this works. The counter increments each time I refresh either
> browser.
>
> Thanks for the thoughts on this Joe -
>
> Kevin
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> This transmission (and any information attached to it) may be confidential
> and is intended solely for the use of the individual or entity to which it
> is addressed. If you are not the intended recipient or the person
> responsible for delivering the transmission to the intended recipient, be
> advised that you have received this transmission in error and
> that any use,
> dissemination, forwarding, printing, or copying of this information is
> strictly prohibited. If you have received this transmission in error,
> please immediately notify LabOne at (800)388-4675.
>
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Javascript and Struts

2002-06-13 Thread Villegas, Courtney

can I feed an action into Javascript?

This is what my struts link would look like to forward to another page:


and this is what my javascript looks like to open the new browser window
openWindow('reportDelivery', '/budsDev/jsp/reportDeliveryQP.jsp',1,
350, 300)

How can I combine the two?

thanks








-Original Message-
From: greg rebuck [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:01 PM
To: Struts Users Mailing List
Subject: Re: Javascript and Struts


We've done this.  It's really no different, I think, than using Javascript
with
vanilla JSP/Servlets.

"Villegas, Courtney" wrote:

> Is it possible to mix javascript and struts?  I want to create a popup
> window that is opened through an action.
>
> There was some talk of doing this about a month ago, but I looked on the
> user-list archives and couldn't find any information.
>
> Any help would be greatly appreciated.
>
> Thanks!!!
> Courtney
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:


--
AKA Darth MacDougal, Jedi Knight from the Plaid Side of the Force



--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




Re: advice- session vs request scope for Action Form

2002-06-13 Thread Ted Husted

Generally, the reset() on an ActionForm should only be used on
checkboxes or things that really need to be reset. Many of us have been
using it reset things to their defaults, but in practice, there seems to
be no point to that, outside of the checkbox issue. 

So, go ahead and use a session-scope bean if that's what you need. 

If the DynaActionForm reset is getting in your way, then subclass it,
and make it do what ~you~ want. After all, this is still OOP. =:0) We
are ~suppose~ to subclass methods that don't work the way we want them
to. That's the ~beauty~ of OOP. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services

Rick Reumann wrote:
> 
> It seems as though the majority of times your ActionForms should use
> request scope, but what about situations where you might grab data
> from one jsp form and then need to use the information you got from
> that page during other parts of your application. Here's the actual
> situation...
> 
> 1) user has to select a "userType" from some select options.
> 2) once this "userType" is selected I need to use this property in
> some DispatchAction methods and as a display on some other pages as
> the user traverses the application. (the "userType" can change if he/she
> goes back to the original form and selects a new one).
> 
> Now the question is where should the "userType" field be stored so I
> have access to it in other parts of the user's session? I first
> thought it would be best stored as a field in my ActionForm with
> session scope so that other pages and Actions could have access to it,
> but if reset() is always called regardless of the scope it seems to
> imply that the ActionForms shouldn't really be used in Sesion scope?
> (Even though the default reset behavior wouldn't reset my field upon
> each request unless I provide implementation, it seems to imply that I
> should provide the implementation, and definitely as Chuck pointed out
> to me, in the case of DynaActionForms, the reset will truly reset the
> fields to default values, which means if I use a DynaActionForm and
> want it in Session scope I have to override the reset() method and
> make sure it doesn't touch the fields I want to keep in the session.
> That sort of seems ugly to me.)
> 
> Am I better off just sticking the "userType" variable itself into the
> session after I get it from the Form? Or maybe just put it into
> the DTO (that I eventually convert the ActionForm into anyway) and
> then stick that DTO in the session?
> 
> Thanks for any comments.
> 
> --
> 
> Rick
> mailto:[EMAIL PROTECTED]
> 
> "Any man, in the right situation, is capable of murder. But not any
> man is capable of being a good camper. So, murder and camping are not
> as similar as you might think."
>   -Jack Handey
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread James Mitchell

Although I don't recommend using ASP with Java, it is possible.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q167941

I have more experience with this then I care to admit.

HTH!

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:12 PM
> To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> A couple of reasons
>
> 1. My company has three main lines of business that for various regulatory
> reasons need to be kept separate.  This applies to deliver of
> content on the
> web as well.  What I am trying to accomplish is essentially a
> single-signon
> capability (within the framework) that the business applications can then
> validate against (successful logon, etc.).
>
> 2. I am also needing to integrate non-JSP applications (.ASP for instance)
> into the framework.  I know they cannot directly access my JavaBeans, but
> I'm wondering if a .ASP page could access the HttpSession data.
>
> Jerry
>
> -Original Message-
> From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:10 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> hmmm...but the sessionIDs have to be unique, even across web
> apps., correct?
> If there weren't unique, URL rewriting would not work correctly
> if two users
> using two webapps on the same app. server happened to get the same session
> ID.  Therefore, one *should* be able to store objects from webapp A in a
> shared classloader class keyed by the sessionID and retrieve them from
> webapp B.
>
> Am I missing something here? (besides why the hell you would want to do
> this)
> :)
>
>
> joe
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 10:46 AM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> > In general, there is no way session info from one webapp can be made
> > visible to other webapps. Some details of this may vary
> depending on your
> > app server.
> >
> > Sessions are controlled by cookies being set on the client. The
> "cookies"
> > that are set by each webapp are scoped for that webapp only. As
> > an example,
> > create the following .jsp file and name it session.jsp. Put it in
> > "webapp1"
> >
> > 
> >   
> > Testing Session Management
> >   
> >   
> > <% out.print("Session ID = " + request.getSession().getId() );  %>
> >   
> > 
> >
> >
> >
> > Then, if you were to do a low-level http request from the server,
> > you'd see
> > something like:
> >
> >
> > bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> > Trying 127.0.0.1...
> > Connected to localhost.
> > Escape character is 'off'.
> >
> > GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
> >
> > HTTP/1.1 200 OK
> > Content-Type: text/html;charset=ISO-8859-1
> > Date: Wed, 12 Jun 2002 00:39:49 GMT
> > Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
> > Connection: close
> > Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1
> >
> > 
> >   
> > Testing Session Management
> >   
> >   
> > Session ID = AC75B22FD1D283D1CEF0136928110679
> >   
> > 
> >
> > Connection closed by foreign host.
> > bash-2.05$
> >
> >
> > The JSESSIONID cookie is used by the servlet container to
> manage the user
> > session.
> >
> >
> > Notice that the the scope of the JSESSIONID Cookie in this example is
> > limited to the '/webapp1' web application. So even if you have many web
> > applications (or Struts applications) deployed in a servlet container,
> > session tracking is isolated between them.
> >
> >
> >
> > 
> > I'll be covering topics such as this and others in my upcoming book
> > "Struts: Rapid Working Knowledge" to be published by SAMS later
> this year.
> > 
> >
> >
> > HTH,
> >
> > Kevin
> >
> >
> >
> >
> >
> > "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 01:43:50 PM
> >
> > Please respond to "Struts Users Mailing List"
> >   <[EMAIL PROTECTED]>
> >
> > To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> > Subject:  RE: Please help clarify or confirm -- HttpSession
> >
> >
> > This is something I've wondered about, especially in a team development
> > environment where there are several programmers working on different
> > webapps
> > that need to share a common framework - in other words, something like
> > this:
> >
> >  Tomcat\webapps
> >   framework-application
> >WEB-INF
> >...
> >   webapplication_1
> >WEB-INF
> >...
> >   webapplication_2
> >WEB-INF
> >...
> >   etc etc etc
> >
> > Can the classes in webapplication_1 'see' session data that was
> > created and
>

Re: Javascript and Struts

2002-06-13 Thread greg rebuck

We've done this.  It's really no different, I think, than using Javascript with
vanilla JSP/Servlets.

"Villegas, Courtney" wrote:

> Is it possible to mix javascript and struts?  I want to create a popup
> window that is opened through an action.
>
> There was some talk of doing this about a month ago, but I looked on the
> user-list archives and couldn't find any information.
>
> Any help would be greatly appreciated.
>
> Thanks!!!
> Courtney
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
AKA Darth MacDougal, Jedi Knight from the Plaid Side of the Force



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




Javascript and Struts

2002-06-13 Thread Villegas, Courtney

Is it possible to mix javascript and struts?  I want to create a popup
window that is opened through an action.

There was some talk of doing this about a month ago, but I looked on the
user-list archives and couldn't find any information.

Any help would be greatly appreciated.

Thanks!!!
Courtney

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




RE: ActionForm question

2002-06-13 Thread wbchmura


Okay, that did work...

Problem was that I am using tiles and I had it set to the specific JSP 
the form was on (from early in the development).  I did try forwarding 
it to the action again when it had an error, but that was bad karma 
(Infinate loop).

I ended up setting the input tag to the name of the tile definition and 
it works wunderbar

Thanks








-Original Message-
From: LMaciel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:34 PM
To: struts-user
Subject: RE: ActionForm question



Isn't it the input attribute of the action tag in the struts-config.xml 
file?



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:40 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: ActionForm question



I am looking into the same problem...  I just read chapter 7 and did not 

see anything about it...

HELP?




-Original Message-
From: msoomar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:25 PM
To: struts-user
Subject: RE: ActionForm question


Dont have to answer this.
Sorry, for posting it. Got the answer - Chuck's Chapter 7 talks about 
it. Thanks.

Muki Soomar


Where do we define where the view gets forwarded to by the ActionServlet 

when we encounter 
validation errors from an ActionForm in the struts-config.xml file?  Or 
do we not need to do that at all
and the original view gets selected and uses the  tag 
which displays the
errors in the ActionErrors object ? Anybody .. any help .. ?

Muki Soomar


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




--
To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




Custom tags in struts

2002-06-13 Thread Ridgway, Jamie Mr USAREC

This maybe a newbie question but...can someone give me an idea or point me
to the proper documentation on how to integrate custom tags into struts.
Specifically, we would like to provide automatic bean population and
validation like that found in the struts tags.

Thanks,
Jamie Ridgway
EDS - MilRIC
Fort Knox, KY

[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




RE: Starter question

2002-06-13 Thread wbchmura


Oh yeah,

Another thing that helps me personally is to refactor mercilessly in the 
beginning and keep reading best practices...

I still suck, but I am getting there...



-Original Message-
From: tbaskan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:22 PM
To: struts-user
Subject: RE: Starter question


My bad.. Without "name" property  does the job for me now. I
wonder what you meant by "does not necessarily cover good practices".
Would you spot on this a little?

/tb.

On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote:
> 
> Unless you are submitting the request from a form you do not need an 
> actionform that I know of.
> 
> If you are always displaying the same list i think you want to:
> 
> Invoke the action
> The actions perform method should get a collection of beans 
representing 
> each row in the database.  
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where 

> you iterate through it using the html taglib in struts...
> 
> This is in a nutshell and does not necessarily cover good practices 
but 
> it will get you working
> 
> 
> 
> 
> 
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
> 
> 
> Hello everyone,
> 
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
> 
> My difficulties are generally related with MVC, I think.
> 
> For traning, I want to accomplish probably the easiest dynamic page 
for
> a web application: a page that shows some portion of a database table.
> 
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows 
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
> 
> Now.. My real problem is how to attach these together.
> 
> I decided to do this with an Action. I mean, when user hits a page 
like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  
in
> configuration file needs a "name" property, which is an ActionForm. Do 
I
> need an ActionForm in this case?
> 
> I need some enlightening.
> 
> /tb.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   

> For additional commands, e-mail: 

> 



--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell


Not sure about these - maybe someone else can grab the ball and push ahead.

One of the things I was wondering about were FormBean instances and other
complex objects such as DB Pool connections.







"Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 04:38:28 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


Cool.  Building on this then, I should be able to define some sort of
Collection (HashMap? Vector?) that I should be able to store instances of a
bean into (i.e. my authenticated user bean).  It looks like everything
needs
to be defined as static - no problem.  What about synchronization problems?
Does the access need to be serialized in anyway?

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 3:04 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession




OK. I checked this out.

I'm running Tomcat 4.03 on NT with JDK 1.3.1.

I created a simple static class:
-
public class ClassLoaderTest {

   public static int counter;

   public static void addCounter() {
   counter++;
   }

   public static String getCounter () {
   return Integer.toString(counter);
   }
}


I compiled it and put the .class file in %CATALINA_HOME%\classes

-

I then created a simple jsp named "test.jsp"

<%@ page import="ClassLoaderTest" %>

  
   Testing Class Loaders
  
  
   <% ClassLoaderTest.addCounter(); %>
   <% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
  


-

I then created two webapps, "webapp1" and "webapp2".  They are completely
empty except for the test.jsp file and the following web.xml file:



http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>



  
  
   index.jsp
  





Now - I then restarted Tomcat and opened two browsers. I pointed one to:

http://localhost:8080/webapp1/test.jsp

and the other to:

http://localhost:8080/webapp2/test.jsp


Then when I hit refresh on them I can see THEY ARE HITTING THE SAME OBJECT.
That is, this works. The counter increments each time I refresh either
browser.

Thanks for the thoughts on this Joe -

Kevin





--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error,
please immediately notify LabOne at (800)388-4675.



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








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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

Cool.  Building on this then, I should be able to define some sort of
Collection (HashMap? Vector?) that I should be able to store instances of a
bean into (i.e. my authenticated user bean).  It looks like everything needs
to be defined as static - no problem.  What about synchronization problems?
Does the access need to be serialized in anyway?

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 3:04 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession




OK. I checked this out.

I'm running Tomcat 4.03 on NT with JDK 1.3.1.

I created a simple static class:
-
public class ClassLoaderTest {

public static int counter;

public static void addCounter() {
counter++;
}

public static String getCounter () {
return Integer.toString(counter);
}
}


I compiled it and put the .class file in %CATALINA_HOME%\classes

-

I then created a simple jsp named "test.jsp"

<%@ page import="ClassLoaderTest" %>

  
Testing Class Loaders
  
  
<% ClassLoaderTest.addCounter(); %>
<% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
  


-

I then created two webapps, "webapp1" and "webapp2".  They are completely
empty except for the test.jsp file and the following web.xml file:



http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>



  
  
index.jsp
  





Now - I then restarted Tomcat and opened two browsers. I pointed one to:

 http://localhost:8080/webapp1/test.jsp

and the other to:

 http://localhost:8080/webapp2/test.jsp


Then when I hit refresh on them I can see THEY ARE HITTING THE SAME OBJECT.
That is, this works. The counter increments each time I refresh either
browser.

Thanks for the thoughts on this Joe -

Kevin





--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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




RE: Starter question

2002-06-13 Thread wbchmura


Sure,   I did not really go into detail about using generic actionforms, 
DAO's, and a whole host of other things...

Your best bet is to take a look at www.husted.com/struts

It was invaluable in getting up to speed.  
http://jguru.com/faq/subtopic.jsp?topicID=893704 is also good.  There 
are many more, including the book thats in "beta" on theServerSide.com

http://www.theserverside.com/resources/strutsreview.jsp
Probably good reading there - I only read one chapter quickly






-Original Message-
From: tbaskan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:22 PM
To: struts-user
Subject: RE: Starter question


My bad.. Without "name" property  does the job for me now. I
wonder what you meant by "does not necessarily cover good practices".
Would you spot on this a little?

/tb.

On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote:
> 
> Unless you are submitting the request from a form you do not need an 
> actionform that I know of.
> 
> If you are always displaying the same list i think you want to:
> 
> Invoke the action
> The actions perform method should get a collection of beans 
representing 
> each row in the database.  
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where 

> you iterate through it using the html taglib in struts...
> 
> This is in a nutshell and does not necessarily cover good practices 
but 
> it will get you working
> 
> 
> 
> 
> 
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
> 
> 
> Hello everyone,
> 
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
> 
> My difficulties are generally related with MVC, I think.
> 
> For traning, I want to accomplish probably the easiest dynamic page 
for
> a web application: a page that shows some portion of a database table.
> 
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows 
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
> 
> Now.. My real problem is how to attach these together.
> 
> I decided to do this with an Action. I mean, when user hits a page 
like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  
in
> configuration file needs a "name" property, which is an ActionForm. Do 
I
> need an ActionForm in this case?
> 
> I need some enlightening.
> 
> /tb.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   

> For additional commands, e-mail: 

> 



--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




RE: ActionForm question

2002-06-13 Thread Leonardo Maciel


Isn't it the input attribute of the action tag in the struts-config.xml file?



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:40 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: ActionForm question



I am looking into the same problem...  I just read chapter 7 and did not 
see anything about it...

HELP?




-Original Message-
From: msoomar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:25 PM
To: struts-user
Subject: RE: ActionForm question


Dont have to answer this.
Sorry, for posting it. Got the answer - Chuck's Chapter 7 talks about 
it. Thanks.

Muki Soomar


Where do we define where the view gets forwarded to by the ActionServlet 
when we encounter 
validation errors from an ActionForm in the struts-config.xml file?  Or 
do we not need to do that at all
and the original view gets selected and uses the  tag 
which displays the
errors in the ActionErrors object ? Anybody .. any help .. ?

Muki Soomar


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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

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




RE: ActionForm question

2002-06-13 Thread wbchmura


I am looking into the same problem...  I just read chapter 7 and did not 
see anything about it...

HELP?




-Original Message-
From: msoomar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:25 PM
To: struts-user
Subject: RE: ActionForm question


Dont have to answer this.
Sorry, for posting it. Got the answer - Chuck's Chapter 7 talks about 
it. Thanks.

Muki Soomar


Where do we define where the view gets forwarded to by the ActionServlet 
when we encounter 
validation errors from an ActionForm in the struts-config.xml file?  Or 
do we not need to do that at all
and the original view gets selected and uses the  tag 
which displays the
errors in the ActionErrors object ? Anybody .. any help .. ?

Muki Soomar


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




RE: Starter question

2002-06-13 Thread Tuncay Baskan

My bad.. Without "name" property  does the job for me now. I
wonder what you meant by "does not necessarily cover good practices".
Would you spot on this a little?

/tb.

On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote:
> 
> Unless you are submitting the request from a form you do not need an 
> actionform that I know of.
> 
> If you are always displaying the same list i think you want to:
> 
> Invoke the action
> The actions perform method should get a collection of beans representing 
> each row in the database.  
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where 
> you iterate through it using the html taglib in struts...
> 
> This is in a nutshell and does not necessarily cover good practices but 
> it will get you working
> 
> 
> 
> 
> 
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
> 
> 
> Hello everyone,
> 
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
> 
> My difficulties are generally related with MVC, I think.
> 
> For traning, I want to accomplish probably the easiest dynamic page for
> a web application: a page that shows some portion of a database table.
> 
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows 
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
> 
> Now.. My real problem is how to attach these together.
> 
> I decided to do this with an Action. I mean, when user hits a page like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  in
> configuration file needs a "name" property, which is an ActionForm. Do I
> need an ActionForm in this case?
> 
> I need some enlightening.
> 
> /tb.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 



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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell



OK. I checked this out.

I'm running Tomcat 4.03 on NT with JDK 1.3.1.

I created a simple static class:
-
public class ClassLoaderTest {

public static int counter;

public static void addCounter() {
counter++;
}

public static String getCounter () {
return Integer.toString(counter);
}
}


I compiled it and put the .class file in %CATALINA_HOME%\classes

-

I then created a simple jsp named "test.jsp"

<%@ page import="ClassLoaderTest" %>

  
Testing Class Loaders
  
  
<% ClassLoaderTest.addCounter(); %>
<% out.print("Counter = " + ClassLoaderTest.getCounter() );  %>
  


-

I then created two webapps, "webapp1" and "webapp2".  They are completely empty except 
for the test.jsp file and the following web.xml file:



http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>



  
  
index.jsp
  





Now - I then restarted Tomcat and opened two browsers. I pointed one to:

 http://localhost:8080/webapp1/test.jsp

and the other to:

 http://localhost:8080/webapp2/test.jsp


Then when I hit refresh on them I can see THEY ARE HITTING THE SAME OBJECT. That is, 
this works. The counter increments each time I refresh either
browser.

Thanks for the thoughts on this Joe -

Kevin





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




Re: Bean Instances

2002-06-13 Thread M Katz


 If I understand what you want, here is an example of how we do this:
Here is the the java action and by using the input form, we can get a connection to 
the original instance
and get thisReportForm.   I hope this helps.  The InsCommonReportForm is a common bean 
that our workgroup uses for different jsps.
It sounds like you want to do a similar thing.
 
 
 
public ActionForward perform( final ActionMapping mapping,
  final ActionForm form,
  final HttpServletRequest request,
  final HttpServletResponse response)
throws IOException, ServletException
{
  if( isDebug() )
 log( "In perform method - DetailedDependent21ReportAction" );
  // Create Struts application errors object
  final ActionErrors errors = new ActionErrors();
  RequestResult result = null;
  ActionForward forwardURL = null;
  final InsCommonReportForm thisReportForm = (InsCommonReportForm)form;

Now use thisReportForm.methods/attributes names  and go.
 
  "Kamholz, Keith (corp-staff) USX" <[EMAIL PROTECTED]> wrote: Hey everyone,
I have a question for anyone that wouldn't mind helping me out a little bit.
I have a form that stores a property in bean.
I have a separate action mapped in my struts-config that is run from a
different page that uses the same bean name. however, it seems to create a
new instance of the bean. If i'm using the same bean name, is a new
instance created for each action that i have mapped (that uses the same
action class) or is it supposed to reuse that same instance?
I'm not sure if I've been been clear enough about what I'm trying to say,
but hopefully it's understandable.

Keith Kamholz
Moog 
East Aurora, NY
(716) 687-7282
[EMAIL PROTECTED]


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



-
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup


servlet.getResources() method - deprecated ??

2002-06-13 Thread Soomar, Muki (R.)

I am getting a deprecated warning when doing this, although when looking up
the documentation
on the the API (JAVADOC) link on the Struts site does not say that. Do we
have the latest documentation
on the site ? Using struts version 1.0.2

Thanks.

Muki Soomar


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




Bean Instances

2002-06-13 Thread Kamholz, Keith (corp-staff) USX

Hey everyone,
I have a question for anyone that wouldn't mind helping me out a little bit.
I have a form that stores a property in bean.
I have a separate action mapped in my struts-config that is run from a
different page that uses the same bean name.  however, it seems to create a
new instance of the bean.  If i'm using the same bean name, is a new
instance created for each action that i have mapped (that uses the same
action class) or is it supposed to reuse that same instance?
I'm not sure if I've been been clear enough about what I'm trying to say,
but hopefully it's understandable.

Keith Kamholz
Moog 
East Aurora, NY
(716) 687-7282
[EMAIL PROTECTED]


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




RE: Using a resource file for managing Form errors

2002-06-13 Thread Soomar, Muki (R.)

Seem to be finding my own answers: 
Since I did not find any clear answers in the archives, here is the procedure of doing 
this

1. Define the Resource bundle in the struts-config.xml file. If you have a resource 
bundle by name
FormErrorResources.properties, then define it as follows:


Note:
a.  The resource bundle is expected to have the extension ".properties" .  If you 
do not have this it will not work
b.  The path to the resource file uses the java package naming convention. So in 
the above example, it
 implies that the resource bundle resides in the WEB-INF/classes/com/myDomain/ 
folder.
 So if you have the resource bundle in the classes folder your parameter value 
should be just your
 resource bundle file name minus the .properties extension

2.  If you want to check you have successfully configured it, try the following:
MessageResource msgRes = servlet.getResources();
servlet.log (msgRes.getMessage ("key");
This will log the message corresponding to the key in your log file if you are 
using Tomcat.


Muki Soomar
---

-Original Message-
From: Soomar, Muki (R.) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 3:21 PM
To: Struts-User (E-mail)
Subject: Using a resource file for managing Form errors


Problem:

I am trying to use a separate resource file for managing errors coming out of the form 
validation
in an ActionForm. How do I access this resource file? This is a second resource file 
defined in my
struts-config.xml file.

Steps taken so far:
-
1. Defined a Message Resource in the struts-config.xml file as follows:


2. Dont have a clue how to utilize this in the ActionForm's Validate method. Tried 
doing this..

if ((addressLine_1 == null) || (addressLine_1.length() < 1))
errors.add("addressLine_1", new 
ActionError("error.RegistrationForm.addressLine_1.required"));

I checked the archives for finding out the answers, but could not find any.
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33400.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33035.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31667.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31424.html

Any help will be much appreciated.

Muki Soomar


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

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




RE: Re: Nested Tags question

2002-06-13 Thread Jayaraman Dorai

When I use nested tags, I am not able to access it through java scripts since the name 
is "mailingAddress.city". Does anyone have a work around or am I missing something?

Jayaraman

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:23 PM
To: Struts Users Mailing List
Subject: Re: Re: Nested Tags question




On Thu, 13 Jun 2002 [EMAIL PROTECTED] wrote:

> Date: Thu, 13 Jun 2002 11:43:59 +0200
> From: [EMAIL PROTECTED]
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Re: Nested Tags question
>
> So Craig,
> does the process work at submit time (when the request parameters are
> being put into the nested beans) via calls to the getter methods to get
> the beans on which the parameters have to be set?
>
> I can't see how else it would work.
>

It depends on what context you are using the expressions in.  For example:

  
  
...

...
  

will, in effect, do a call to:

  customerForm.getMailingAddress().getCity()

when the page is displayed, and a call to:

  customerForm.getMailingAddress().setCity()

when the request parameters are being copied in to the form bean.

>
> Adam
>

Craig


>
>
> "Craig R. McClanahan" <[EMAIL PROTECTED]> schrieb am 13.06.2002,
> 08:22:43:
> >
> >
> > On Thu, 13 Jun 2002, Arron Bates wrote:
> >
> > > Date: Thu, 13 Jun 2002 14:14:13 +1000
> > > From: Arron Bates
> > > Reply-To: Struts Users Mailing List
> > > To: Struts Users Mailing List
> > > Subject: Re: Nested Tags question
> > >
> > > >
> > > >
> > > >I know JSP will automatically save parameters to a javabean with the
> > > >correctly named getters and setters, but there's obviously a gap in my
> > > >knowledge because all my attempts to recreate the situation above have
> > > >failed.
> > > >
> > >
> > > Setting form properties against beans is a Struts thing, not a JSP
> > > thing. The property thing is a Bean thin and can be looked up in the
> > > JavaBean spec.
> > >
> > > The example you quote...
> > >
> > > "monkeyTeamAlpha.monkeyWorkers[0].salary"
> > >
> > > ...is a nested property. An invention implemented within Struts
> > > (Craig?).
> >
> > Yep, although in Struts 1.1 it is really a "commons-beanutils" thing
> > because we abstracted out this generally useful code into a separate
> > package.
> >
> > > What it basically is, is a string of calls rather than the
> > > single property method. Here, it will get a hold of the form bean, get a
> > > hold of the bean returned from the "monkeyTeamAlpha"property. On this
> > > bean, it will invoke the indexed property "monkeyWorkers[0]" which will
> > > pluck a bean from a collection or index provided, from this last bean it
> > > will will get a hold of its "salary" property, and set the value.
> > >
> >
> > At each stage, you also get the benefit of some intelligence that is built
> > in to the underlying PropertyUtils class.  For example, the JavaBeans spec
> > defines two ways to define an indexed property -- you can use getter and
> > setter methods that take a value and a subscript, or you can use getter
> > and setter methods that return the entire array.  PropertyUtils makes the
> > expression listed above work for either (or even for a property whose
> > value is a java.util.List, which is an extension to the JavaBeans spec).
> >
> > > All this boils down to, is that you can compose objects a little
> > > cleaner, rather than have truly enormous beans for everything. Having
> > > the indexed properties allows for lists and whatever else.
> > >
> > > The ability for nesting beans has been in Struts for a long time. The
> > > nested tags just make it much easier.
> > >
> > > There's a primer and tutorial for nested beans here...
> > >
> > > http://www.keyboardmonkey.com/next
> > >
> > > ...it should take you over creating and using such a construct.
> > >
> > > Hope this gets you on th path you're after.
> >
> > Another area of useful learning for the future is the JSP Standard Tag
> > Library (JSTL).  Although the expression language syntax supported by JSTL
> > is different from the one in Struts, it is well worth learning about --
> > this expression language will be supported anywhere in a JSP page in JSP
> > 1.3, and (in the mean time) we will likely adapt Struts tags to be able to
> > use it as well.
> >
> > >
> > >
> > > Arron.
> > >
> >
> > Craig
> >
> >
> > --
> > To unsubscribe, e-mail:
> > For additional commands, e-mail:
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>
>


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


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




Using a resource file for managing Form errors

2002-06-13 Thread Soomar, Muki (R.)

Problem:

I am trying to use a separate resource file for managing errors coming out of the form 
validation
in an ActionForm. How do I access this resource file? This is a second resource file 
defined in my
struts-config.xml file.

Steps taken so far:
-
1. Defined a Message Resource in the struts-config.xml file as follows:


2. Dont have a clue how to utilize this in the ActionForm's Validate method. Tried 
doing this..

if ((addressLine_1 == null) || (addressLine_1.length() < 1))
errors.add("addressLine_1", new 
ActionError("error.RegistrationForm.addressLine_1.required"));

I checked the archives for finding out the answers, but could not find any.
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33400.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33035.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31667.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31424.html

Any help will be much appreciated.

Muki Soomar


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




RE: Starter question

2002-06-13 Thread wbchmura


When you say struts complained...  Can you be a little more informative?
also, if you could paste in the relevant parts of the Struts-config.xml 
it would be great...

Here are some of mine...

(Also, if you are using Struts 1.1, get the Struts-console...



























-Original Message-
From: tbaskan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:10 PM
To: struts-user
Subject: RE: Starter question


When I tried  without name property, Struts complained. Can you
give me a sample  struts-config element? Probably I'm missing
something.

/tb.

On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote:
> 
> Unless you are submitting the request from a form you do not need an 
> actionform that I know of.
> 
> If you are always displaying the same list i think you want to:
> 
> Invoke the action
> The actions perform method should get a collection of beans 
representing 
> each row in the database.  
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where 

> you iterate through it using the html taglib in struts...
> 
> This is in a nutshell and does not necessarily cover good practices 
but 
> it will get you working
> 
> 
> 
> 
> 
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
> 
> 
> Hello everyone,
> 
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
> 
> My difficulties are generally related with MVC, I think.
> 
> For traning, I want to accomplish probably the easiest dynamic page 
for
> a web application: a page that shows some portion of a database table.
> 
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows 
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
> 
> Now.. My real problem is how to attach these together.
> 
> I decided to do this with an Action. I mean, when user hits a page 
like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  
in
> configuration file needs a "name" property, which is an ActionForm. Do 
I
> need an ActionForm in this case?
> 
> I need some enlightening.
> 
> /tb.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   

> For additional commands, e-mail: 

> 



--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

I've got the framework and initial application to complete and demo before
next Wednesday, so I'm a little tight on time.  Hopefully around the first
of the July I'll some time to play around with this.  In the meantime if
anyone else can give it a go, please be sure to let everyone know.

Thanks.

Jerry

-Original Message-
From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:28 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession


Kevin wrote:
> It even says that the "shared" class loader exists for "classes and
> resources that you wish to share across ALL web applications".
>
> So as long as you've got a 2.3 compliant container and you can get the
> functionality you need from a static class, then this should work.

Thanks for the support Kevin, I was beginning to wonder if everyone thought
I was wacko for suggesting this. :)  I do realize that this isn't the most
robust or generic solution in the world, but it damn sure would be easy to
implement.

Jerry (or anyone else interested):  If you do test this out, could you
please post your conclusions back to the list?  This has been a very
interesting thread for me (having dealt with classloader craziness in the
past), so I'm curious if theory is backed by reality in this case.


peace,
Joe Barefoot

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:17 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Damn, not yet ready to go to Tomcat 4.x.  Might be a good
> argument to start
> moving that direction.  (:-)
>
> Thanks to everyone for their comments - it's given me plenty to
> think about.
>
> Jerry
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:00 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
>
> > > Second, having common
> > > directories on the two CLASSPATHS for the two webapps allows you to
> load
> > > CLASSES to create new objects, but not to share the objects once they
> are
> > > created.
>
> > True, but not what I suggested at all.  Two webapps sharing a common
> > CLASSPATH is far different from them having access to a common
> > (shared,parent) CLASSLOADER.  In the former two different classloaders
> are
> > loading the same class into two different "memory spaces", as you say.
> In
> > the latter, a parent classloader is loading a class into a
> "memory space"
> > accessible by either of the two child classloaders for the
> webapps.  So I
> > fail to see why a static class with static resources loaded by this
> parent
> > classloader will not enable objects to be shared between the two child
> > classloaders, so long as the objects themselves are also created from
> > classes loaded by the shared classloader.
> >
> > Note that I am also not claiming that this will 100% work, I just don't
> see
> > why it wouldn't.
>
> Sorry, misunderstood you.
>
> I'm not sure if this would work either, but I follow your logic.
> Seems like
> it would be easy to try. Just create a simple static class holding a
> counter and then hit two diff web apps that increment and display its
> value.
>
> Looking at:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it
> looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec
> 2.3 sections 9.4 & 9.6) provides exactly this functionality.
>
> It even says that the "shared" class loader exists for "classes and
> resources that you wish to share across ALL web applications".
>
> So as long as you've got a 2.3 compliant container and you can get the
> functionality you need from a static class, then this should work.
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> This transmission (and any information attached to it) may be
> confidential and is intended solely for the use of the individual
> or entity to which it is addressed. If you are not the intended
> recipient or the person responsible for delivering the
> transmission to the intended recipient, be advised that you have
> received this transmission in error and that any use,
> dissemination, forwarding, printing, or copying of this
> information is strictly prohibited. If you have received this
> transmission in error, please immediately notify LabOne at (800)388-4675.
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or th

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

Kevin wrote:
> It even says that the "shared" class loader exists for "classes and
> resources that you wish to share across ALL web applications".
>
> So as long as you've got a 2.3 compliant container and you can get the
> functionality you need from a static class, then this should work.

Thanks for the support Kevin, I was beginning to wonder if everyone thought
I was wacko for suggesting this. :)  I do realize that this isn't the most
robust or generic solution in the world, but it damn sure would be easy to
implement.

Jerry (or anyone else interested):  If you do test this out, could you
please post your conclusions back to the list?  This has been a very
interesting thread for me (having dealt with classloader craziness in the
past), so I'm curious if theory is backed by reality in this case.


peace,
Joe Barefoot

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:17 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Damn, not yet ready to go to Tomcat 4.x.  Might be a good
> argument to start
> moving that direction.  (:-)
>
> Thanks to everyone for their comments - it's given me plenty to
> think about.
>
> Jerry
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:00 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
>
> > > Second, having common
> > > directories on the two CLASSPATHS for the two webapps allows you to
> load
> > > CLASSES to create new objects, but not to share the objects once they
> are
> > > created.
>
> > True, but not what I suggested at all.  Two webapps sharing a common
> > CLASSPATH is far different from them having access to a common
> > (shared,parent) CLASSLOADER.  In the former two different classloaders
> are
> > loading the same class into two different "memory spaces", as you say.
> In
> > the latter, a parent classloader is loading a class into a
> "memory space"
> > accessible by either of the two child classloaders for the
> webapps.  So I
> > fail to see why a static class with static resources loaded by this
> parent
> > classloader will not enable objects to be shared between the two child
> > classloaders, so long as the objects themselves are also created from
> > classes loaded by the shared classloader.
> >
> > Note that I am also not claiming that this will 100% work, I just don't
> see
> > why it wouldn't.
>
> Sorry, misunderstood you.
>
> I'm not sure if this would work either, but I follow your logic.
> Seems like
> it would be easy to try. Just create a simple static class holding a
> counter and then hit two diff web apps that increment and display its
> value.
>
> Looking at:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it
> looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec
> 2.3 sections 9.4 & 9.6) provides exactly this functionality.
>
> It even says that the "shared" class loader exists for "classes and
> resources that you wish to share across ALL web applications".
>
> So as long as you've got a 2.3 compliant container and you can get the
> functionality you need from a static class, then this should work.
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> This transmission (and any information attached to it) may be
> confidential and is intended solely for the use of the individual
> or entity to which it is addressed. If you are not the intended
> recipient or the person responsible for delivering the
> transmission to the intended recipient, be advised that you have
> received this transmission in error and that any use,
> dissemination, forwarding, printing, or copying of this
> information is strictly prohibited. If you have received this
> transmission in error, please immediately notify LabOne at (800)388-4675.
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Struts Design/construction process. question

2002-06-13 Thread Niall Pemberton

Yeah Excellent, yahh booo...you suck too.

I still think we don't quite live up to the MG standard though - yoiu let
yourself down on the 'take back', but thanks, hehe ;-)

Niall

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: 13 June 2002 18:35
> To: [EMAIL PROTECTED]
> Subject: RE: Struts Design/construction process. question
>
>
>
> We may be heading off topic here...  I started out at the tail end of
> that era...  I swore an oath that I would never work on a mainframe and
> managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in
> school...
>
> Now back our regularly scheduled topics
>
> MAINFRAMES SUCK! (Happy Niall?)
> (incidentally the above was in jest - I hear you can run Linux on them
> now...)
>
>
>
> -Original Message-
> From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:00 PM
> To: struts-user
> Subject: RE: Struts Design/construction process. question
>
>
> Hard to believe there was a time when Cobol ruled the universe and
> programs
> were designed in a 'top-down' fashion isn't it?  And as an old (actually
> 40+) mainframe programmer who is trying to make the transition from the
> non-object world of Cobol and (gasp here) assembler to the
> object-oriented
> world of Java (and JSP and struts and XML and and and), there are times
> when
> I really miss those 'good old days'.  But then I think, nah, just post a
> question on the mailing list and get the 'right' answer from all of you
> guys!
>
> Jerry
>
> -Original Message-
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 11:51 AM
> To: Struts Users Mailing List
> Subject: RE: Struts Design/construction process. question
>
>
> I saw this thread and thought..."great, flame war...", but you guys are
> too
> nice.
>
> IMHO I suggest you learn from the guru before trying this next time:
>
>
> http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone
>
> Niall
>
> P.S. 'old (35?) mainframe programmers' on this list must have seen the
> light...Hallelujah!
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> >
> > I'd like to apologize for that comment...  I did not mean it as a bad
> > thing...
> >
> > I guess I just liken the old mainframes with the old programming
> > methodologies that involved tons of upfront planning and an pretty
> > unflexible design once programming started.  Back when the project
> > delivery times were in years, not weeks...
> >
> > :)
> >
> > -Original Message-
> > From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
> >
> > As an 'old mainframe programmer' I resent this.  (:-)
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> >
> > I tend to agree on this.  I have only done a few things in struts, but
> > have been programming for quite a while.  The idea of pumping
> everything
> >
> > out in seperate development projects just out right scares me.  If
> this
> > was to have any chance of working out you would need:
> >
> > (1) A horrendous amount of upfront planning
> > (2) Program requirements that don't change at all
> > (3) A programming team that would not quit during an upfront design
> this
> >
> > heavy
> >
> >
> > All in all, if its a large project you could probably dub it a death
> > march project.
> >
> > #1 is too terrible to consider, #2 is just plain silly, #3... well...
> >
> > Personally, iterative development has worked in most of the projects I
> > have been on and run.
> >
> > Thats all from here...
> >
> > PS. Are the project managers old mainframe programmers or something?
> >
> >
> >
> > -Original Message-
> > From: josephb [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 7:54 PM
> > To: struts-user
> > Subject: RE: Struts Design/construction process. question
> >
> >
> > This reminds me of the adage a former professor of mine used to
> preach:
> > "It is much easier to build a program than to give birth to one."
> >
> > The "pump out a list of components" and "while bringing the page to
> > life"
> > parts of your message make it sound an awful lot like your project
> > management is involved in obstetrics in addition to software
> > development. :)
> >
> > Seriously, though, you *will* run into problems doing things this way.
> > For
> > instance, having a junior developer create 60 form beans for the
> > expected
> > inputs on each page has several implications:
> >
> > 1.  Your action developers will have to modify the beans anyway most
> > likely
> > because the form bean developer cannot know things like whether an
> array
> >
> > or
> > a List is more appropriate for collection data in a particular
> instance
> > (this usually depends on the Action).
> >
> > 2. A naming convention for the beans must be established or madness
> will
> > ensue.
> >
> > 3. It may make sense to re-use a form bean for different jsps, o

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

Damn, not yet ready to go to Tomcat 4.x.  Might be a good argument to start
moving that direction.  (:-)

Thanks to everyone for their comments - it's given me plenty to think about.

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:00 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession




> > Second, having common
> > directories on the two CLASSPATHS for the two webapps allows you to
load
> > CLASSES to create new objects, but not to share the objects once they
are
> > created.

> True, but not what I suggested at all.  Two webapps sharing a common
> CLASSPATH is far different from them having access to a common
> (shared,parent) CLASSLOADER.  In the former two different classloaders
are
> loading the same class into two different "memory spaces", as you say.
In
> the latter, a parent classloader is loading a class into a "memory space"
> accessible by either of the two child classloaders for the webapps.  So I
> fail to see why a static class with static resources loaded by this
parent
> classloader will not enable objects to be shared between the two child
> classloaders, so long as the objects themselves are also created from
> classes loaded by the shared classloader.
>
> Note that I am also not claiming that this will 100% work, I just don't
see
> why it wouldn't.

Sorry, misunderstood you.

I'm not sure if this would work either, but I follow your logic. Seems like
it would be easy to try. Just create a simple static class holding a
counter and then hit two diff web apps that increment and display its
value.

Looking at:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it
looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec
2.3 sections 9.4 & 9.6) provides exactly this functionality.

It even says that the "shared" class loader exists for "classes and
resources that you wish to share across ALL web applications".

So as long as you've got a 2.3 compliant container and you can get the
functionality you need from a static class, then this should work.








--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell



> > Second, having common
> > directories on the two CLASSPATHS for the two webapps allows you to
load
> > CLASSES to create new objects, but not to share the objects once they
are
> > created.

> True, but not what I suggested at all.  Two webapps sharing a common
> CLASSPATH is far different from them having access to a common
> (shared,parent) CLASSLOADER.  In the former two different classloaders
are
> loading the same class into two different "memory spaces", as you say.
In
> the latter, a parent classloader is loading a class into a "memory space"
> accessible by either of the two child classloaders for the webapps.  So I
> fail to see why a static class with static resources loaded by this
parent
> classloader will not enable objects to be shared between the two child
> classloaders, so long as the objects themselves are also created from
> classes loaded by the shared classloader.
>
> Note that I am also not claiming that this will 100% work, I just don't
see
> why it wouldn't.

Sorry, misunderstood you.

I'm not sure if this would work either, but I follow your logic. Seems like
it would be easy to try. Just create a simple static class holding a
counter and then hit two diff web apps that increment and display its
value.

Looking at:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it
looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec
2.3 sections 9.4 & 9.6) provides exactly this functionality.

It even says that the "shared" class loader exists for "classes and
resources that you wish to share across ALL web applications".

So as long as you've got a 2.3 compliant container and you can get the
functionality you need from a static class, then this should work.








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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

They have a very open license too.  You can redistribute JBoss however you
want, pretty much, as long as you leave it intact (i.e., you can't hack out
bits of it and incorporate into your own software, ala Microsoft)  It also
fully implements the EJB 2.0 specification, with message-driven beans, local
interfaces, etc.

Finally, it supports deployement of 'vanilla' EJB jars, i.e., you don't have
to put a propietary deployment descriptor (although there is an optional
one) into the jar, and you don't have to run some tool on it before
deployment (e.g. ejbc in Weblogic).  It uses a very clever class byte
generation mechanism (for stub/skeleton classes) to accomplish super-fast
hot deployment and un-deployment.

I give it a thumbs up. :)

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 11:54 AM
> To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Free?  Didn't realize that..
>
> -Original Message-
> From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:50 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Huh?  JBoss is FREE.
>
> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 2:41 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Kevin,
>
> I actually thought about the EJB solution, but we are trying to do this on
> the cheap without having to buy an EJB container (i.e. JBOSS).
> Something I
> was wondering about though - is it possible to run an EAR structure under
> Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
> here, but is it possible to create a pseudo-J2EE environment and create an
> Entity-Bean that can do this?
>
> The XML-Soap solution also is appealing, but we would like to be able to
> integrate these various app's with a minimum of re-write.
>
> Jerry
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:18 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> The container makes sure that Session ID's are unique. It sets the cookie
> as well - nothing in the webapp has to do this. This is just how the
> containers work.
>
> Regarding storing "objects from webapp A in a shared classloader class
> keyed by the sessionID and retrieve them from
> webapp B".
>
> First, you can't physically store an object in another webapp because the
> memory spaces are isolated from each other. Second, having common
> directories on the two CLASSPATHS for the two webapps allows you to load
> CLASSES to create new objects, but not to share the objects once they are
> created.
>
> But there are ways to share objects (in addition to classes) between
> webapps. And at times there may be good reasons to do so.
>
> For example, imagine you have an object representing a transaction to be
> executed on your system (maybe a stock trade). What if:
>
>  - The user who entered the transaction wants to see its real-time status.
>  - A trader who is going to execute the transaction needs to see it, and
>  - An auditor needs to monitor all trades currently in the system.
>
> Imagine also you want them to use three seperate webapps (or non-servlet
> applications) to do their work. While not the only approach, it
> is possible
> to have all access the same physical Java object. Here are some ways:
>
> 1. Implement the Object as an Entity EJB in an EJB container such
> as JBOSS.
> Have all the webapps (or whatever) connect to the same EJB Container
> instance and manipulate the data in the object. The EJB container will
> manage locking and transactional integrity for you as well.
>
> 2. Create the object as a singleton in some JVM somewhere and wrap an RMI
> server around it. This is basically a hack, but I saw it done
> once to allow
> clustered applications to share Properties objects between them (ensuring
> they were all using the same Properties). (And, yes - it was a pain.)
>
> 3. Put the object behind a web service and access it via SOAP. This allows
> some of the clients to be non-Java.
>
> All these solutions are based on putting the object in some place OUTSIDE
> any of the individual webapps.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> hmmm...but the sessionIDs have to be unique, even across web apps.,
> correct?
> If there weren't unique, URL rewriting would not work correctly if two
> users
> using two webapps on the same app. server happene

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Yuan, Tony

Thanks for all the reply and discussion on the question I asked. I am very
interested in doing some proof-of-concept
work by sharing the ClassLoader on two web apps. 

Can someone show me some sample code on how to specify a common class loader
for two different web apps? I am running WebLogic 6.1.

Thanks...
-Original Message-
From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:50 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession


> The container makes sure that Session ID's are unique. It sets the cookie
> as well - nothing in the webapp has to do this. This is just how the
> containers work.

Of course.

>
> Regarding storing "objects from webapp A in a shared classloader class
> keyed by the sessionID and retrieve them from
> webapp B".
>
> First, you can't physically store an object in another webapp because the
> memory spaces are isolated from each other. Second, having common
> directories on the two CLASSPATHS for the two webapps allows you to load
> CLASSES to create new objects, but not to share the objects once they are
> created.

True, but not what I suggested at all.  Two webapps sharing a common
CLASSPATH is far different from them having access to a common
(shared,parent) CLASSLOADER.  In the former two different classloaders are
loading the same class into two different "memory spaces", as you say.  In
the latter, a parent classloader is loading a class into a "memory space"
accessible by either of the two child classloaders for the webapps.  So I
fail to see why a static class with static resources loaded by this parent
classloader will not enable objects to be shared between the two child
classloaders, so long as the objects themselves are also created from
classes loaded by the shared classloader.

Note that I am also not claiming that this will 100% work, I just don't see
why it wouldn't.

>
> But there are ways to share objects (in addition to classes) between
> webapps. And at times there may be good reasons to do so.
>
> For example, imagine you have an object representing a transaction to be
> executed on your system (maybe a stock trade). What if:
>
>  - The user who entered the transaction wants to see its real-time status.
>  - A trader who is going to execute the transaction needs to see it, and
>  - An auditor needs to monitor all trades currently in the system.
>
> Imagine also you want them to use three seperate webapps (or non-servlet
> applications) to do their work. While not the only approach, it
> is possible
> to have all access the same physical Java object. Here are some ways:
>
> 1. Implement the Object as an Entity EJB in an EJB container such
> as JBOSS.
> Have all the webapps (or whatever) connect to the same EJB Container
> instance and manipulate the data in the object. The EJB container will
> manage locking and transactional integrity for you as well.
>
> 2. Create the object as a singleton in some JVM somewhere and wrap an RMI
> server around it. This is basically a hack, but I saw it done
> once to allow
> clustered applications to share Properties objects between them (ensuring
> they were all using the same Properties). (And, yes - it was a pain.)
>
> 3. Put the object behind a web service and access it via SOAP. This allows
> some of the clients to be non-Java.
>
> All these solutions are based on putting the object in some place OUTSIDE
> any of the individual webapps.


Putting an object into a shared classloader DOES put it OUTSIDE of any of
the individual webapps, in that that object's existence is not dependent on
the existence of any webapp.  If this were not true, then the classloader
hierarchy employed by app. servers would be meaningless.


peace,
joe


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> hmmm...but the sessionIDs have to be unique, even across web apps.,
> correct?
> If there weren't unique, URL rewriting would not work correctly if two
> users
> using two webapps on the same app. server happened to get the same session
> ID.  Therefore, one *should* be able to store objects from webapp A in a
> shared classloader class keyed by the sessionID and retrieve them from
> webapp B.
>
> Am I missing something here? (besides why the hell you would want to do
> this)
> :)
>
>
> joe
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 10:46 AM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> > In general, there is no way session info from one webapp can be made
> > visible to other webapps. Some details of this may vary
> depend

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell


JBOSS is free and a great product.  http://www.jboss.org

Web services are simpler than you think once you get past the initial
learning curve. They'd make later integration and maintenance easier.
(brings to mind the old saying, "moment of convenience, lifetime of
regret").

Another solution that could be done completely with Tomcat would be to
create a pseudo-web service using plain XML over HTTP. This means having
the user access the application as you normally would, but then having the
webapp issue an HTTP POST  to another webapp. In the HTTP POST you would
send an XML command string that the remote webapp would parse to get the
"command" and data. It would process the response and then return XML as
its response. The initial webapp would then receive the XML response and
parse it to get the results.

Then any app (Java, ASP or whatever - as long as it can issue and receive
HTTP requests) can access the data at the same time. And it would be easy
to convert to a web service later if needed.

I built something like this using example code in the O'Reilly Java Network
Programming book. In this case, the remote system that spoke XML over HTTP
already existed and I just needed to talk to it.

Hope all these ideas don't confuse you!!!

Best of luck,

Kevin






"Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 02:41:01 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


Kevin,

I actually thought about the EJB solution, but we are trying to do this on
the cheap without having to buy an EJB container (i.e. JBOSS).  Something I
was wondering about though - is it possible to run an EAR structure under
Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
here, but is it possible to create a pseudo-J2EE environment and create an
Entity-Bean that can do this?

The XML-Soap solution also is appealing, but we would like to be able to
integrate these various app's with a minimum of re-write.

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:18 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession



The container makes sure that Session ID's are unique. It sets the cookie
as well - nothing in the webapp has to do this. This is just how the
containers work.

Regarding storing "objects from webapp A in a shared classloader class
keyed by the sessionID and retrieve them from
webapp B".

First, you can't physically store an object in another webapp because the
memory spaces are isolated from each other. Second, having common
directories on the two CLASSPATHS for the two webapps allows you to load
CLASSES to create new objects, but not to share the objects once they are
created.

But there are ways to share objects (in addition to classes) between
webapps. And at times there may be good reasons to do so.

For example, imagine you have an object representing a transaction to be
executed on your system (maybe a stock trade). What if:

 - The user who entered the transaction wants to see its real-time status.
 - A trader who is going to execute the transaction needs to see it, and
 - An auditor needs to monitor all trades currently in the system.

Imagine also you want them to use three seperate webapps (or non-servlet
applications) to do their work. While not the only approach, it is possible
to have all access the same physical Java object. Here are some ways:

1. Implement the Object as an Entity EJB in an EJB container such as JBOSS.
Have all the webapps (or whatever) connect to the same EJB Container
instance and manipulate the data in the object. The EJB container will
manage locking and transactional integrity for you as well.

2. Create the object as a singleton in some JVM somewhere and wrap an RMI
server around it. This is basically a hack, but I saw it done once to allow
clustered applications to share Properties objects between them (ensuring
they were all using the same Properties). (And, yes - it was a pain.)

3. Put the object behind a web service and access it via SOAP. This allows
some of the clients to be non-Java.

All these solutions are based on putting the object in some place OUTSIDE
any of the individual webapps.



















"Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM

Please respond to "Struts Users Mailing List"
 <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps.,
correct?
If there weren't unique, URL rewriting would not work correctly if two
users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be ab

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

Free?  Didn't realize that..

-Original Message-
From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession


Huh?  JBoss is FREE.

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:41 PM
To: 'Struts Users Mailing List'
Subject: RE: Please help clarify or confirm -- HttpSession


Kevin,

I actually thought about the EJB solution, but we are trying to do this on
the cheap without having to buy an EJB container (i.e. JBOSS).  Something I
was wondering about though - is it possible to run an EAR structure under
Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
here, but is it possible to create a pseudo-J2EE environment and create an
Entity-Bean that can do this?

The XML-Soap solution also is appealing, but we would like to be able to
integrate these various app's with a minimum of re-write.

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:18 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession



The container makes sure that Session ID's are unique. It sets the cookie
as well - nothing in the webapp has to do this. This is just how the
containers work.

Regarding storing "objects from webapp A in a shared classloader class
keyed by the sessionID and retrieve them from
webapp B".

First, you can't physically store an object in another webapp because the
memory spaces are isolated from each other. Second, having common
directories on the two CLASSPATHS for the two webapps allows you to load
CLASSES to create new objects, but not to share the objects once they are
created.

But there are ways to share objects (in addition to classes) between
webapps. And at times there may be good reasons to do so.

For example, imagine you have an object representing a transaction to be
executed on your system (maybe a stock trade). What if:

 - The user who entered the transaction wants to see its real-time status.
 - A trader who is going to execute the transaction needs to see it, and
 - An auditor needs to monitor all trades currently in the system.

Imagine also you want them to use three seperate webapps (or non-servlet
applications) to do their work. While not the only approach, it is possible
to have all access the same physical Java object. Here are some ways:

1. Implement the Object as an Entity EJB in an EJB container such as JBOSS.
Have all the webapps (or whatever) connect to the same EJB Container
instance and manipulate the data in the object. The EJB container will
manage locking and transactional integrity for you as well.

2. Create the object as a singleton in some JVM somewhere and wrap an RMI
server around it. This is basically a hack, but I saw it done once to allow
clustered applications to share Properties objects between them (ensuring
they were all using the same Properties). (And, yes - it was a pain.)

3. Put the object behind a web service and access it via SOAP. This allows
some of the clients to be non-Java.

All these solutions are based on putting the object in some place OUTSIDE
any of the individual webapps.



















"Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps.,
correct?
If there weren't unique, URL rewriting would not work correctly if two
users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerome Jacobsen

Huh?  JBoss is FREE.

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:41 PM
To: 'Struts Users Mailing List'
Subject: RE: Please help clarify or confirm -- HttpSession


Kevin,

I actually thought about the EJB solution, but we are trying to do this on
the cheap without having to buy an EJB container (i.e. JBOSS).  Something I
was wondering about though - is it possible to run an EAR structure under
Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
here, but is it possible to create a pseudo-J2EE environment and create an
Entity-Bean that can do this?

The XML-Soap solution also is appealing, but we would like to be able to
integrate these various app's with a minimum of re-write.

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:18 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession



The container makes sure that Session ID's are unique. It sets the cookie
as well - nothing in the webapp has to do this. This is just how the
containers work.

Regarding storing "objects from webapp A in a shared classloader class
keyed by the sessionID and retrieve them from
webapp B".

First, you can't physically store an object in another webapp because the
memory spaces are isolated from each other. Second, having common
directories on the two CLASSPATHS for the two webapps allows you to load
CLASSES to create new objects, but not to share the objects once they are
created.

But there are ways to share objects (in addition to classes) between
webapps. And at times there may be good reasons to do so.

For example, imagine you have an object representing a transaction to be
executed on your system (maybe a stock trade). What if:

 - The user who entered the transaction wants to see its real-time status.
 - A trader who is going to execute the transaction needs to see it, and
 - An auditor needs to monitor all trades currently in the system.

Imagine also you want them to use three seperate webapps (or non-servlet
applications) to do their work. While not the only approach, it is possible
to have all access the same physical Java object. Here are some ways:

1. Implement the Object as an Entity EJB in an EJB container such as JBOSS.
Have all the webapps (or whatever) connect to the same EJB Container
instance and manipulate the data in the object. The EJB container will
manage locking and transactional integrity for you as well.

2. Create the object as a singleton in some JVM somewhere and wrap an RMI
server around it. This is basically a hack, but I saw it done once to allow
clustered applications to share Properties objects between them (ensuring
they were all using the same Properties). (And, yes - it was a pain.)

3. Put the object behind a web service and access it via SOAP. This allows
some of the clients to be non-Java.

All these solutions are based on putting the object in some place OUTSIDE
any of the individual webapps.



















"Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps.,
correct?
If there weren't unique, URL rewriting would not work correctly if two
users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is 'off'.
>
> GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
>
> HTTP/1.1 200 OK
> Content-Type: text/html;charset=ISO-8859-1
> Dat

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

JBoss has a release version with bundled Tomcat that will auto-deploy an
EAR -- splits the wars to the Tomcat container, ejb jars to the JBoss
container.  They have quite a hefty support mailing list as well, although I
am currently not on it.

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 11:41 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> Kevin,
>
> I actually thought about the EJB solution, but we are trying to do this on
> the cheap without having to buy an EJB container (i.e. JBOSS).
> Something I
> was wondering about though - is it possible to run an EAR structure under
> Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
> here, but is it possible to create a pseudo-J2EE environment and create an
> Entity-Bean that can do this?
>
> The XML-Soap solution also is appealing, but we would like to be able to
> integrate these various app's with a minimum of re-write.
>
> Jerry
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:18 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> The container makes sure that Session ID's are unique. It sets the cookie
> as well - nothing in the webapp has to do this. This is just how the
> containers work.
>
> Regarding storing "objects from webapp A in a shared classloader class
> keyed by the sessionID and retrieve them from
> webapp B".
>
> First, you can't physically store an object in another webapp because the
> memory spaces are isolated from each other. Second, having common
> directories on the two CLASSPATHS for the two webapps allows you to load
> CLASSES to create new objects, but not to share the objects once they are
> created.
>
> But there are ways to share objects (in addition to classes) between
> webapps. And at times there may be good reasons to do so.
>
> For example, imagine you have an object representing a transaction to be
> executed on your system (maybe a stock trade). What if:
>
>  - The user who entered the transaction wants to see its real-time status.
>  - A trader who is going to execute the transaction needs to see it, and
>  - An auditor needs to monitor all trades currently in the system.
>
> Imagine also you want them to use three seperate webapps (or non-servlet
> applications) to do their work. While not the only approach, it
> is possible
> to have all access the same physical Java object. Here are some ways:
>
> 1. Implement the Object as an Entity EJB in an EJB container such
> as JBOSS.
> Have all the webapps (or whatever) connect to the same EJB Container
> instance and manipulate the data in the object. The EJB container will
> manage locking and transactional integrity for you as well.
>
> 2. Create the object as a singleton in some JVM somewhere and wrap an RMI
> server around it. This is basically a hack, but I saw it done
> once to allow
> clustered applications to share Properties objects between them (ensuring
> they were all using the same Properties). (And, yes - it was a pain.)
>
> 3. Put the object behind a web service and access it via SOAP. This allows
> some of the clients to be non-Java.
>
> All these solutions are based on putting the object in some place OUTSIDE
> any of the individual webapps.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> hmmm...but the sessionIDs have to be unique, even across web apps.,
> correct?
> If there weren't unique, URL rewriting would not work correctly if two
> users
> using two webapps on the same app. server happened to get the same session
> ID.  Therefore, one *should* be able to store objects from webapp A in a
> shared classloader class keyed by the sessionID and retrieve them from
> webapp B.
>
> Am I missing something here? (besides why the hell you would want to do
> this)
> :)
>
>
> joe
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 10:46 AM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> > In general, there is no way session info from one webapp can be made
> > visible to other webapps. Some details of this may vary
> depending on your
> > app server.
> >
> > Sessions are controlled by cookies being set on the client. The
> "cookies"
> > that are set by each webapp are scoped for that webapp only. As
> > an example,
> > create the following .jsp file and name it session.jsp. Put it in
> > "webapp1"
> >
> > 
> >   
> > Testing Session Management
> >   
> >   
> >   

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

> The container makes sure that Session ID's are unique. It sets the cookie
> as well - nothing in the webapp has to do this. This is just how the
> containers work.

Of course.

>
> Regarding storing "objects from webapp A in a shared classloader class
> keyed by the sessionID and retrieve them from
> webapp B".
>
> First, you can't physically store an object in another webapp because the
> memory spaces are isolated from each other. Second, having common
> directories on the two CLASSPATHS for the two webapps allows you to load
> CLASSES to create new objects, but not to share the objects once they are
> created.

True, but not what I suggested at all.  Two webapps sharing a common
CLASSPATH is far different from them having access to a common
(shared,parent) CLASSLOADER.  In the former two different classloaders are
loading the same class into two different "memory spaces", as you say.  In
the latter, a parent classloader is loading a class into a "memory space"
accessible by either of the two child classloaders for the webapps.  So I
fail to see why a static class with static resources loaded by this parent
classloader will not enable objects to be shared between the two child
classloaders, so long as the objects themselves are also created from
classes loaded by the shared classloader.

Note that I am also not claiming that this will 100% work, I just don't see
why it wouldn't.

>
> But there are ways to share objects (in addition to classes) between
> webapps. And at times there may be good reasons to do so.
>
> For example, imagine you have an object representing a transaction to be
> executed on your system (maybe a stock trade). What if:
>
>  - The user who entered the transaction wants to see its real-time status.
>  - A trader who is going to execute the transaction needs to see it, and
>  - An auditor needs to monitor all trades currently in the system.
>
> Imagine also you want them to use three seperate webapps (or non-servlet
> applications) to do their work. While not the only approach, it
> is possible
> to have all access the same physical Java object. Here are some ways:
>
> 1. Implement the Object as an Entity EJB in an EJB container such
> as JBOSS.
> Have all the webapps (or whatever) connect to the same EJB Container
> instance and manipulate the data in the object. The EJB container will
> manage locking and transactional integrity for you as well.
>
> 2. Create the object as a singleton in some JVM somewhere and wrap an RMI
> server around it. This is basically a hack, but I saw it done
> once to allow
> clustered applications to share Properties objects between them (ensuring
> they were all using the same Properties). (And, yes - it was a pain.)
>
> 3. Put the object behind a web service and access it via SOAP. This allows
> some of the clients to be non-Java.
>
> All these solutions are based on putting the object in some place OUTSIDE
> any of the individual webapps.


Putting an object into a shared classloader DOES put it OUTSIDE of any of
the individual webapps, in that that object's existence is not dependent on
the existence of any webapp.  If this were not true, then the classloader
hierarchy employed by app. servers would be meaningless.


peace,
joe


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> hmmm...but the sessionIDs have to be unique, even across web apps.,
> correct?
> If there weren't unique, URL rewriting would not work correctly if two
> users
> using two webapps on the same app. server happened to get the same session
> ID.  Therefore, one *should* be able to store objects from webapp A in a
> shared classloader class keyed by the sessionID and retrieve them from
> webapp B.
>
> Am I missing something here? (besides why the hell you would want to do
> this)
> :)
>
>
> joe
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 10:46 AM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> >
> > In general, there is no way session info from one webapp can be made
> > visible to other webapps. Some details of this may vary
> depending on your
> > app server.
> >
> > Sessions are controlled by cookies being set on the client. The
> "cookies"
> > that are set by each webapp are scoped for that webapp only. As
> > an example,
> > create the following .jsp file and name it session.jsp. Put it in
> > "webapp1"
> >
> > 
> >   
> > Testing Session Management
> >   
> >   
> > <% out.print("Session ID = " + request.getSession().getId() );  %>
> >   
> > 
> >
> >
> >
> > Then, if you were to do a low-level http request from the server,
> 

Re: thread safety

2002-06-13 Thread Noah Levitt

Hello,

Your suggestion is duly noted, and would probably be good
advice for many web apps. But keeping form beans in session
scope can be very handy at times, as has been pointed out in
other posts. Sessions are one of the main advantages of
servlets, after all.

So, you concede that using form beans the way they are
commonly used, in session scope with setters and getters
unsynchronized, is not thread-safe? 

Would you also agree that every call to
session.setAttribute() and session.getAttribute() needs to
be synchronized? 

Noah


On Wed, Jun 12, 2002 at 11:17:03PM -0700, Craig R. McClanahan wrote:
> 
> 
> The simplest way to avoid this whole set of problems is to use request
> scope for your form beans.  Then, the container guarantees that only one
> thread can access these beans, so you don't need to be concerned at all
> about thread safety in them.
> 
> Following this advice will also be beneficial, in general, to the
> scalability of your application -- because the server will not need to
> store the form beans in memory "in between" requests.
> 
> Craig

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




Re: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Scott Hewlitt

I came across a similar situation recently.
We have a major asp application that we are slowly converting to
jsp/struts/java.
So - we need the two technologies to talk to one another...

We use microsoft's msxml object to post data to a url/page, and then wait
for a response.

If the asp page needs to access the jsp's session data - what you could do
is
perform an empty post to the jsp page, which would execute the jsp page...
in turn the jsp page would read the session data and convert it to
name/value pairs and output it as a string - allowing the asp page to pickup
the string (...read the response) and parse it just like a normal post

this is just one idea... not sure what limitations may be imposed on your
project so this may or may not work for you... - Scott.

- Original Message -
From: "Jerry Jalenak" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, June 13, 2002 2:32 PM
Subject: RE: Please help clarify or confirm -- HttpSession


> I did find a product called JIntegra (from a different posting a few days
> ago) that I think will allow the .ASP apps to access a Java class through
> some sort of smoke-and-mirror arrangement.  I'm not sure if this will work
> across servers - if it does then I'm home free.  If not, then it's back to
> XML.
>
> Anyway, back to the original question, I was also thinking about ease of
> code maintainability.  If a webapp needs to be 'pulled' out and modified,
> wouldn't it be easier to do if the webapp was self-contained?  That way a
> programmer could ensure that they have everything related to the webapp
> (checked out through CVS), modify it, test, and then return the webapp to
a
> production status.
>
> Jerry
>
> -Original Message-
> From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:27 PM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> wo-boy!  Sounds like fun, Jerry, good luck!  I think maybe you could
> store a "UserRole" object using a static or singleton class in a shared
> classloader.  Should be pretty easy to test out with your setup (just try
to
> store something in the shared class from one webapp and retrieve it from
the
> other).
>
> I haven't a clue about ASPs accessing the session data though...perhaps by
> XML messaging through sockets?  That would mean that any session data you
> wanted to share would have to be easily converted to an XML format,
however,
> both in Java-land and ASP-land, and the conversion fairly swift.  If you
> just wanted it for authentication purposes, might not be too difficult
> though.  All of this depends on where the ASP application is running
> relative to the Java apps. too though.  Much easier if they are both
behind
> the same firewall (no encryption worries).
>
>
> peace,
> Joe Barefoot
>
> > -Original Message-
> > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 11:12 AM
> > To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> > A couple of reasons
> >
> > 1. My company has three main lines of business that for various
regulatory
> > reasons need to be kept separate.  This applies to deliver of
> > content on the
> > web as well.  What I am trying to accomplish is essentially a
> > single-signon
> > capability (within the framework) that the business applications can
then
> > validate against (successful logon, etc.).
> >
> > 2. I am also needing to integrate non-JSP applications (.ASP for
instance)
> > into the framework.  I know they cannot directly access my JavaBeans,
but
> > I'm wondering if a .ASP page could access the HttpSession data.
> >
> > Jerry
> >
> > -Original Message-
> > From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 1:10 PM
> > To: Struts Users Mailing List
> > Subject: RE: Please help clarify or confirm -- HttpSession
> >
> >
> > hmmm...but the sessionIDs have to be unique, even across web
> > apps., correct?
> > If there weren't unique, URL rewriting would not work correctly
> > if two users
> > using two webapps on the same app. server happened to get the same
session
> > ID.  Therefore, one *should* be able to store objects from webapp A in a
> > shared classloader class keyed by the sessionID and retrieve them from
> > webapp B.
> >
> > Am I missing something here? (besides why the hell you would want to do
> > this)
> > :)
> >
> >
> > joe
> >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, June 13, 2002 10:46 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: Please help clarify or confirm -- HttpSession
> > >
> > >
> > >
> > > In general, there is no way session info from one webapp can be made
> > > visible to other webapps. Some details of this may vary
> > depending on your
> > > app serve

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

Kevin,

I actually thought about the EJB solution, but we are trying to do this on
the cheap without having to buy an EJB container (i.e. JBOSS).  Something I
was wondering about though - is it possible to run an EAR structure under
Tomcat?  I'm not very familiar with EJB, so forgive me if I sound stupid
here, but is it possible to create a pseudo-J2EE environment and create an
Entity-Bean that can do this?

The XML-Soap solution also is appealing, but we would like to be able to
integrate these various app's with a minimum of re-write.

Jerry

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:18 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession



The container makes sure that Session ID's are unique. It sets the cookie
as well - nothing in the webapp has to do this. This is just how the
containers work.

Regarding storing "objects from webapp A in a shared classloader class
keyed by the sessionID and retrieve them from
webapp B".

First, you can't physically store an object in another webapp because the
memory spaces are isolated from each other. Second, having common
directories on the two CLASSPATHS for the two webapps allows you to load
CLASSES to create new objects, but not to share the objects once they are
created.

But there are ways to share objects (in addition to classes) between
webapps. And at times there may be good reasons to do so.

For example, imagine you have an object representing a transaction to be
executed on your system (maybe a stock trade). What if:

 - The user who entered the transaction wants to see its real-time status.
 - A trader who is going to execute the transaction needs to see it, and
 - An auditor needs to monitor all trades currently in the system.

Imagine also you want them to use three seperate webapps (or non-servlet
applications) to do their work. While not the only approach, it is possible
to have all access the same physical Java object. Here are some ways:

1. Implement the Object as an Entity EJB in an EJB container such as JBOSS.
Have all the webapps (or whatever) connect to the same EJB Container
instance and manipulate the data in the object. The EJB container will
manage locking and transactional integrity for you as well.

2. Create the object as a singleton in some JVM somewhere and wrap an RMI
server around it. This is basically a hack, but I saw it done once to allow
clustered applications to share Properties objects between them (ensuring
they were all using the same Properties). (And, yes - it was a pain.)

3. Put the object behind a web service and access it via SOAP. This allows
some of the clients to be non-Java.

All these solutions are based on putting the object in some place OUTSIDE
any of the individual webapps.



















"Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps.,
correct?
If there weren't unique, URL rewriting would not work correctly if two
users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is 'off'.
>
> GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
>
> HTTP/1.1 200 OK
> Content-Type: text/html;charset=ISO-8859-1
> Date: Wed, 12 Jun 2002 00:39:49 GMT
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
> Connection: close
> Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1
>
> 
>   
> Testing Session Management
>   
>  

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell



> A couple of reasons
>
> 1. My company has three main lines of business that for various
regulatory
> reasons need to be kept separate.  This applies to deliver of content on
the
> web as well.  What I am trying to accomplish is essentially a
single-signon
> capability (within the framework) that the business applications can then
> validate against (successful logon, etc.).
>

It may be possible to have the individuals sign in to the default web app
and access it through the URI of just "/" (instead of a URI such as
"/myWebApp". I believe this may scope the JSESSIONID cookie to "/" and have
it returned to all webapps on the system. I have not tried this and don't
know if it will work - though it would be easy to test.

> 2. I am also needing to integrate non-JSP applications (.ASP for
instance)
> into the framework.  I know they cannot directly access my JavaBeans, but
> I'm wondering if a .ASP page could access the HttpSession data.
>

Can you say, "Web Sevices"? To begin, look at the Apache SOAP project (now
extended under the Jakarta Axis project).

> Jerry

Good luck,

Kevin



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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell


The container makes sure that Session ID's are unique. It sets the cookie
as well - nothing in the webapp has to do this. This is just how the
containers work.

Regarding storing "objects from webapp A in a shared classloader class
keyed by the sessionID and retrieve them from
webapp B".

First, you can't physically store an object in another webapp because the
memory spaces are isolated from each other. Second, having common
directories on the two CLASSPATHS for the two webapps allows you to load
CLASSES to create new objects, but not to share the objects once they are
created.

But there are ways to share objects (in addition to classes) between
webapps. And at times there may be good reasons to do so.

For example, imagine you have an object representing a transaction to be
executed on your system (maybe a stock trade). What if:

 - The user who entered the transaction wants to see its real-time status.
 - A trader who is going to execute the transaction needs to see it, and
 - An auditor needs to monitor all trades currently in the system.

Imagine also you want them to use three seperate webapps (or non-servlet
applications) to do their work. While not the only approach, it is possible
to have all access the same physical Java object. Here are some ways:

1. Implement the Object as an Entity EJB in an EJB container such as JBOSS.
Have all the webapps (or whatever) connect to the same EJB Container
instance and manipulate the data in the object. The EJB container will
manage locking and transactional integrity for you as well.

2. Create the object as a singleton in some JVM somewhere and wrap an RMI
server around it. This is basically a hack, but I saw it done once to allow
clustered applications to share Properties objects between them (ensuring
they were all using the same Properties). (And, yes - it was a pain.)

3. Put the object behind a web service and access it via SOAP. This allows
some of the clients to be non-Java.

All these solutions are based on putting the object in some place OUTSIDE
any of the individual webapps.



















"Joseph Barefoot" <[EMAIL PROTECTED]> on 06/13/2002 02:09:43 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps.,
correct?
If there weren't unique, URL rewriting would not work correctly if two
users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is 'off'.
>
> GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
>
> HTTP/1.1 200 OK
> Content-Type: text/html;charset=ISO-8859-1
> Date: Wed, 12 Jun 2002 00:39:49 GMT
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
> Connection: close
> Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1
>
> 
>   
> Testing Session Management
>   
>   
> Session ID = AC75B22FD1D283D1CEF0136928110679
>   
> 
>
> Connection closed by foreign host.
> bash-2.05$
>
>
> The JSESSIONID cookie is used by the servlet container to manage the user
> session.
>
>
> Notice that the the scope of the JSESSIONID Cookie in this example is
> limited to the '/webapp1' web application. So even if you have many web
> applications (or Struts applications) deployed in a servlet container,
> session tracking is isolated between them.
>
>
>
> 
> I'll be covering topics such as this and others in my upcoming book
> "Struts: Rapid Working Knowledge" to be published by SAMS later this
year.
> 
>
>
> HTH,
>
> Kevin
>
>
>
>
>
> "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 01:43:50 PM
>
> Please respond to "Struts U

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

A couple of reasons

1. My company has three main lines of business that for various regulatory
reasons need to be kept separate.  This applies to deliver of content on the
web as well.  What I am trying to accomplish is essentially a single-signon
capability (within the framework) that the business applications can then
validate against (successful logon, etc.).

2. I am also needing to integrate non-JSP applications (.ASP for instance)
into the framework.  I know they cannot directly access my JavaBeans, but
I'm wondering if a .ASP page could access the HttpSession data.

Jerry

-Original Message-
From: Joseph Barefoot [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:10 PM
To: Struts Users Mailing List
Subject: RE: Please help clarify or confirm -- HttpSession


hmmm...but the sessionIDs have to be unique, even across web apps., correct?
If there weren't unique, URL rewriting would not work correctly if two users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is 'off'.
>
> GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
>
> HTTP/1.1 200 OK
> Content-Type: text/html;charset=ISO-8859-1
> Date: Wed, 12 Jun 2002 00:39:49 GMT
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
> Connection: close
> Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1
>
> 
>   
> Testing Session Management
>   
>   
> Session ID = AC75B22FD1D283D1CEF0136928110679
>   
> 
>
> Connection closed by foreign host.
> bash-2.05$
>
>
> The JSESSIONID cookie is used by the servlet container to manage the user
> session.
>
>
> Notice that the the scope of the JSESSIONID Cookie in this example is
> limited to the '/webapp1' web application. So even if you have many web
> applications (or Struts applications) deployed in a servlet container,
> session tracking is isolated between them.
>
>
>
> 
> I'll be covering topics such as this and others in my upcoming book
> "Struts: Rapid Working Knowledge" to be published by SAMS later this year.
> 
>
>
> HTH,
>
> Kevin
>
>
>
>
>
> "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 01:43:50 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> This is something I've wondered about, especially in a team development
> environment where there are several programmers working on different
> webapps
> that need to share a common framework - in other words, something like
> this:
>
>  Tomcat\webapps
>   framework-application
>WEB-INF
>...
>   webapplication_1
>WEB-INF
>...
>   webapplication_2
>WEB-INF
>...
>   etc etc etc
>
> Can the classes in webapplication_1 'see' session data that was
> created and
> stored in the session by the framework-application?
>
> Jerry
>
> -Original Message-
> From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:39 PM
> To: Struts Users Mailing List
> Subject: Re: Please help clarify or confirm -- HttpSession
>
>
>
> At my knowledge, under tomcat each webapp have his own
> "memory space" so you can't share HttpSession between
> 2 webapp. You can share object between 2 webapp with
> one condition, the class to be shared must be loaded
> in same ClassLoader.
>
>
> Did you understand my english ;)
>
> -Emmanuel
>
>
>
>  --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
> Hi Guys,
> > Can anyone help clarify or confirm the relationship
> > between an HttpSession
> > and a web application? I mean, can two WAR (two
> > application) share one
> > common HttpSession and whatever resource this
> > HttpSess

RE: Starter question

2002-06-13 Thread Tuncay Baskan

When I tried  without name property, Struts complained. Can you
give me a sample  struts-config element? Probably I'm missing
something.

/tb.

On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote:
> 
> Unless you are submitting the request from a form you do not need an 
> actionform that I know of.
> 
> If you are always displaying the same list i think you want to:
> 
> Invoke the action
> The actions perform method should get a collection of beans representing 
> each row in the database.  
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where 
> you iterate through it using the html taglib in struts...
> 
> This is in a nutshell and does not necessarily cover good practices but 
> it will get you working
> 
> 
> 
> 
> 
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
> 
> 
> Hello everyone,
> 
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
> 
> My difficulties are generally related with MVC, I think.
> 
> For traning, I want to accomplish probably the easiest dynamic page for
> a web application: a page that shows some portion of a database table.
> 
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows 
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
> 
> Now.. My real problem is how to attach these together.
> 
> I decided to do this with an Action. I mean, when user hits a page like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  in
> configuration file needs a "name" property, which is an ActionForm. Do I
> need an ActionForm in this case?
> 
> I need some enlightening.
> 
> /tb.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 



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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

hmmm...but the sessionIDs have to be unique, even across web apps., correct?
If there weren't unique, URL rewriting would not work correctly if two users
using two webapps on the same app. server happened to get the same session
ID.  Therefore, one *should* be able to store objects from webapp A in a
shared classloader class keyed by the sessionID and retrieve them from
webapp B.

Am I missing something here? (besides why the hell you would want to do
this)
:)


joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:46 AM
> To: Struts Users Mailing List
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
>
> In general, there is no way session info from one webapp can be made
> visible to other webapps. Some details of this may vary depending on your
> app server.
>
> Sessions are controlled by cookies being set on the client. The "cookies"
> that are set by each webapp are scoped for that webapp only. As
> an example,
> create the following .jsp file and name it session.jsp. Put it in
> "webapp1"
>
> 
>   
> Testing Session Management
>   
>   
> <% out.print("Session ID = " + request.getSession().getId() );  %>
>   
> 
>
>
>
> Then, if you were to do a low-level http request from the server,
> you'd see
> something like:
>
>
> bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is 'off'.
>
> GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]
>
> HTTP/1.1 200 OK
> Content-Type: text/html;charset=ISO-8859-1
> Date: Wed, 12 Jun 2002 00:39:49 GMT
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
> Connection: close
> Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1
>
> 
>   
> Testing Session Management
>   
>   
> Session ID = AC75B22FD1D283D1CEF0136928110679
>   
> 
>
> Connection closed by foreign host.
> bash-2.05$
>
>
> The JSESSIONID cookie is used by the servlet container to manage the user
> session.
>
>
> Notice that the the scope of the JSESSIONID Cookie in this example is
> limited to the '/webapp1' web application. So even if you have many web
> applications (or Struts applications) deployed in a servlet container,
> session tracking is isolated between them.
>
>
>
> 
> I'll be covering topics such as this and others in my upcoming book
> "Struts: Rapid Working Knowledge" to be published by SAMS later this year.
> 
>
>
> HTH,
>
> Kevin
>
>
>
>
>
> "Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 01:43:50 PM
>
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
> To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
> Subject:  RE: Please help clarify or confirm -- HttpSession
>
>
> This is something I've wondered about, especially in a team development
> environment where there are several programmers working on different
> webapps
> that need to share a common framework - in other words, something like
> this:
>
>  Tomcat\webapps
>   framework-application
>WEB-INF
>...
>   webapplication_1
>WEB-INF
>...
>   webapplication_2
>WEB-INF
>...
>   etc etc etc
>
> Can the classes in webapplication_1 'see' session data that was
> created and
> stored in the session by the framework-application?
>
> Jerry
>
> -Original Message-
> From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:39 PM
> To: Struts Users Mailing List
> Subject: Re: Please help clarify or confirm -- HttpSession
>
>
>
> At my knowledge, under tomcat each webapp have his own
> "memory space" so you can't share HttpSession between
> 2 webapp. You can share object between 2 webapp with
> one condition, the class to be shared must be loaded
> in same ClassLoader.
>
>
> Did you understand my english ;)
>
> -Emmanuel
>
>
>
>  --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
> Hi Guys,
> > Can anyone help clarify or confirm the relationship
> > between an HttpSession
> > and a web application? I mean, can two WAR (two
> > application) share one
> > common HttpSession and whatever resource this
> > HttpSession contains?
> >
> > My understanding is that if WARs are deployed
> > separately, then there will be
> > different HttpSessions and therefore you can not
> > share resources among them.
> > Can anyone help confirm this? or correct if I am
> > wrong?
> >
> > Thanks!
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
>
> ___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> This transmission (and any information attached to it) may be confidential
> and i

Re: Validator and DispatchAction

2002-06-13 Thread David Winterfeldt

Actually, I think I take that back.  You want to
actually skip certain fields if it is an insert or a
delete.  Making a method validation that returns false
(fails) will stop all validation.  You really probably
want a dispatchMethodRequired validator and any other
ones so they skip that validation if it shouldn't be
checked.  The other Validator methods kind of work
like this with required.  Everything else depends on
required, but if you remove the dependecies all those
methods, like mask, check if the field isn't blank
before they perform the validation.  If it is blank,
mask returns true and doesn't really do anything.

David

--- William W <[EMAIL PROTECTED]> wrote:
> 
> Good  :)
> I will try !!!
> Thanks !
> WIlliam.
> 
> >From: David Winterfeldt <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
> >Subject: Re: Validator and DispatchAction
> >Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT)
> >
> >You can't use booleans in the depends, but there
> can
> >be dependencies setup between validation routines.
> >You can make a method check pluggable validator and
> >have required and other validator depend on it.
> >Although the default configuration has everything
> >depend on required so if required depends on
> something
> >else, everything should work fine.  Method would be
> >checked first and then if it passes required would
> be
> >next.
> >
> > >classname="MyDispatchMethodChecker"
> >method="validateDispatchMethod"
>
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
> >msg="errors.method"/>
> >
> > >   
> classname="org.apache.struts.util.StrutsValidator"
> >method="validateRequired"
>
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
> >depends="method"
> >msg="errors.required"/>
> >
> >David
> >
> >--- William W <[EMAIL PROTECTED]> wrote:
> > >
> > > Is it possible ?
> > > Use boolean in the "depends" property ?
> > >
> > >  > >depends="method OR required">
> > >> > key="typeForm.password.displayname"/>
> > >   
> > >  methodName
> > >  update
> > >   
> > > 
> > >
> > >
> > > >From: "William W" <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Re: Validator and DispatchAction
> > > >Date: Thu, 13 Jun 2002 14:46:09 +
> > > >
> > > >
> > > >I think that if I use DispatchAction with
> > > ValidatorActionForm I will have
> > > >the same problem. How can I validate the form
> for
> > > diferents methods in the
> > > >same Action ? Am I wrong ?
> > > >Thanks,
> > > >William.
> > > >
> > > >
> > > >>From: David Winterfeldt
> <[EMAIL PROTECTED]>
> > > >>Reply-To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > >>To: Struts Users Mailing List
> > > <[EMAIL PROTECTED]>,  Rick
> > > >>Reumann <[EMAIL PROTECTED]>
> > > >>Subject: Re: Validator and DispatchAction
> > > >>Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT)
> > > >>
> > > >>You would currently have to write your own
> > > required
> > > >>validation method and have it check a variable
> > > defined
> > > >>by a field to see if it should perform the
> > > validation
> > > >>or not.  Or define a separate set of
> validation
> > > rules
> > > >>for each action and use ValidatorActionForm
> (which
> > > >>uses the action path to retrieve the
> validation
> > > >>rules).
> > > >>
> > > >>David
> > > >>
> > > >>--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> > > >> > On Wednesday, June 12, 2002, 10:14:09 AM,
> > > William
> > > >> > wrote:
> > > >> >
> > > >> > WW> I have a UserForm, the fields are :
> userId
> > > and
> > > >> > userName.
> > > >> > WW> I have a UserAction that extends
> > > DispatchAction.
> > > >> > The UserAction have  two
> > > >> > WW> methods (insert and update). For the
> insert
> > > >> > method only the userName is
> > > >> > WW> required, and for update method the
> userId
> > > and
> > > >> > the userName are required.
> > > >> > WW> How can I can do a dependency
> validation
> > > with
> > > >> > the validator.xml ?
> > > >> >
> > > >> > I'm curious about this as well. There
> was a
> > > post
> > > >> > a few days back
> > > >> > dealing with the same issue. I think
> you
> > > are
> > > >> > able to nest
> > > >> > validation rules for a form but I
> forgot
> > > the
> > > >> > exact syntax. Maybe
> > > >> > someone else could shed some light
> again on
> > > how
> > > >> > to do this.
> > > >> >
> > > >> >
> > > >> > --
> > > >> >
> > > >> > Rick
> > > >> > mailto:[EMAIL PROTECTED]
> > > >> >
> > > >> > "If you go to a party, and you want to be
> the
> > > 

RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Kevin . Bedell


In general, there is no way session info from one webapp can be made
visible to other webapps. Some details of this may vary depending on your
app server.

Sessions are controlled by cookies being set on the client. The "cookies"
that are set by each webapp are scoped for that webapp only. As an example,
create the following .jsp file and name it session.jsp. Put it in "webapp1"


  
Testing Session Management
  
  
<% out.print("Session ID = " + request.getSession().getId() );  %>
  




Then, if you were to do a low-level http request from the server, you'd see
something like:


bash-2.05$ ./telnet -E localhost 8080  [ <-- I type ]
Trying 127.0.0.1...
Connected to localhost.
Escape character is 'off'.

GET /webapp1/session.jsp HTTP/1.0   [ <-- I type ]

HTTP/1.1 200 OK
Content-Type: text/html;charset=ISO-8859-1
Date: Wed, 12 Jun 2002 00:39:49 GMT
Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
Connection: close
Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1


  
Testing Session Management
  
  
Session ID = AC75B22FD1D283D1CEF0136928110679
  


Connection closed by foreign host.
bash-2.05$


The JSESSIONID cookie is used by the servlet container to manage the user
session.


Notice that the the scope of the JSESSIONID Cookie in this example is
limited to the '/webapp1' web application. So even if you have many web
applications (or Struts applications) deployed in a servlet container,
session tracking is isolated between them.




I'll be covering topics such as this and others in my upcoming book
"Struts: Rapid Working Knowledge" to be published by SAMS later this year.



HTH,

Kevin





"Jerry Jalenak" <[EMAIL PROTECTED]> on 06/13/2002 01:43:50 PM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc:(bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:  RE: Please help clarify or confirm -- HttpSession


This is something I've wondered about, especially in a team development
environment where there are several programmers working on different
webapps
that need to share a common framework - in other words, something like
this:

 Tomcat\webapps
  framework-application
   WEB-INF
   ...
  webapplication_1
   WEB-INF
   ...
  webapplication_2
   WEB-INF
   ...
  etc etc etc

Can the classes in webapplication_1 'see' session data that was created and
stored in the session by the framework-application?

Jerry

-Original Message-
From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:39 PM
To: Struts Users Mailing List
Subject: Re: Please help clarify or confirm -- HttpSession



At my knowledge, under tomcat each webapp have his own
"memory space" so you can't share HttpSession between
2 webapp. You can share object between 2 webapp with
one condition, the class to be shared must be loaded
in same ClassLoader.


Did you understand my english ;)

-Emmanuel



 --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
Hi Guys,
> Can anyone help clarify or confirm the relationship
> between an HttpSession
> and a web application? I mean, can two WAR (two
> application) share one
> common HttpSession and whatever resource this
> HttpSession contains?
>
> My understanding is that if WARs are deployed
> separately, then there will be
> different HttpSessions and therefore you can not
> share resources among them.
> Can anyone help confirm this? or correct if I am
> wrong?
>
> Thanks!
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error,
please immediately notify LabOne at (800)388-4675.



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








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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Joseph Barefoot

Even if classes in webapplication_1 were able to access session data in
framework-application, how could they possibly acquire a reference to the
HTTPSession, since the two apps. are loaded by different classloaders?

If you wanted to share data between webapps (even HTTPSession objects), I
think you could create a utility class loaded by the shared class loader
(that all webapps have access to) which has a static hashtable (with static
initialization) accessible via static methods.  In theory, you should be
able to put any object (even an HTTPSession object) into the hashtable and
retrieve it from any class in any webapp.  You could store the session
object with the sessionID as its key, I suppose.

Of course, this begs the question, why would you want to couple your
applications this way?  Web apps. can share framework classes loaded from a
shared classloader (and thus info. like configuration/state data using
singletons or static classes) without having to share session objects,
so?


peace,
Joe Barefoot

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:44 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Please help clarify or confirm -- HttpSession
>
>
> This is something I've wondered about, especially in a team development
> environment where there are several programmers working on
> different webapps
> that need to share a common framework - in other words, something
> like this:
>
>   Tomcat\webapps
>   framework-application
>   WEB-INF
>   ...
>   webapplication_1
>   WEB-INF
>   ...
>   webapplication_2
>   WEB-INF
>   ...
>   etc etc etc
>
> Can the classes in webapplication_1 'see' session data that was
> created and
> stored in the session by the framework-application?
>
> Jerry
>
> -Original Message-
> From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:39 PM
> To: Struts Users Mailing List
> Subject: Re: Please help clarify or confirm -- HttpSession
>
>
>
> At my knowledge, under tomcat each webapp have his own
> "memory space" so you can't share HttpSession between
> 2 webapp. You can share object between 2 webapp with
> one condition, the class to be shared must be loaded
> in same ClassLoader.
>
>
> Did you understand my english ;)
>
> -Emmanuel
>
>
>
>  --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
> Hi Guys,
> > Can anyone help clarify or confirm the relationship
> > between an HttpSession
> > and a web application? I mean, can two WAR (two
> > application) share one
> > common HttpSession and whatever resource this
> > HttpSession contains?
> >
> > My understanding is that if WARs are deployed
> > separately, then there will be
> > different HttpSessions and therefore you can not
> > share resources among them.
> > Can anyone help confirm this? or correct if I am
> > wrong?
> >
> > Thanks!
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
>
> ___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> This transmission (and any information attached to it) may be
> confidential and is intended solely for the use of the individual
> or entity to which it is addressed. If you are not the intended
> recipient or the person responsible for delivering the
> transmission to the intended recipient, be advised that you have
> received this transmission in error and that any use,
> dissemination, forwarding, printing, or copying of this
> information is strictly prohibited. If you have received this
> transmission in error, please immediately notify LabOne at (800)388-4675.
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



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




Re: Starter question

2002-06-13 Thread Scott Hewlitt

When I started with Struts a few months ago, a colleague sent me these links
to review.
There is lots of information here.. but the one thing that really helped
everything click were the diagrams.

Main link:
http://gallery.bluestone.com/scripts/SaISAPI.dll/StrutsTrailMap.class/struts
-trailmap/default.htm

Some diagrams -
http://gallery.bluestone.com/scripts/SaISAPI.dll/StrutsTrailMap.class/struts
-trailmap/article/strutsarticle2.htm

Also, http://www.husted.com is a great resource as well...

Cheers,

Scott.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 13, 2002 1:51 PM
Subject: RE: Starter question


>
> Unless you are submitting the request from a form you do not need an
> actionform that I know of.
>
> If you are always displaying the same list i think you want to:
>
> Invoke the action
> The actions perform method should get a collection of beans representing
> each row in the database.
> You then stuff the collection into an attribute in the session
> the forward action should send you to the JSP page to display it where
> you iterate through it using the html taglib in struts...
>
> This is in a nutshell and does not necessarily cover good practices but
> it will get you working
>
>
>
>
>
> -Original Message-
> From: tbaskan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:26 PM
> To: struts-user
> Subject: Starter question
>
>
> Hello everyone,
>
> I'm a beginner for Struts and can't still figure out how to do simple
> things with the framework.
>
> My difficulties are generally related with MVC, I think.
>
> For traning, I want to accomplish probably the easiest dynamic page for
> a web application: a page that shows some portion of a database table.
>
> To my understanding, I need the following:
>  1. a model object must have a static method that fetches rows
> from the database table and puts them in a Collection object.
>  2. a JSP page containing  tags to iterate over this
> Collection.
>
> Now.. My real problem is how to attach these together.
>
> I decided to do this with an Action. I mean, when user hits a page like
> /myapp/groupList.do, the Action's perform method gets the Collection
> from model and sets it as a PageAttribute. But failed. Every  in
> configuration file needs a "name" property, which is an ActionForm. Do I
> need an ActionForm in this case?
>
> I need some enlightening.
>
> /tb.
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread emmanuel.boudrant

You can with this :

Foo foo = ...

HttpSession session = request.getSession();
session.setAttribute("foo",foo);

getServlet().getServletContext().getContext("/webapplication1").forward(request,reponse);

But Foo.class must be loader in same ClassLoader
foreach application.

The problem is under Tomcat, each application has a
differents ClassLoader. So you must put Foo.class in
Tomcat\common\lib.

If the class is already loaded in Tomcat ClassLoader,
it won't be in your webapp ClassLoader. If not, you
have a ClassClastException.

-Emmanuel
   


 --- Jerry Jalenak <[EMAIL PROTECTED]> a écrit
: > This is something I've wondered about, especially
in
> a team development
> environment where there are several programmers
> working on different webapps
> that need to share a common framework - in other
> words, something like this:
> 
>   Tomcat\webapps
>   framework-application
>   WEB-INF
>   ...
>   webapplication_1
>   WEB-INF
>   ...
>   webapplication_2
>   WEB-INF
>   ...
>   etc etc etc
> 
> Can the classes in webapplication_1 'see' session
> data that was created and
> stored in the session by the framework-application? 
> 
> 
> Jerry
> 
> -Original Message-
> From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 12:39 PM
> To: Struts Users Mailing List
> Subject: Re: Please help clarify or confirm --
> HttpSession
> 
> 
> 
> At my knowledge, under tomcat each webapp have his
> own
> "memory space" so you can't share HttpSession
> between
> 2 webapp. You can share object between 2 webapp with
> one condition, the class to be shared must be loaded
> in same ClassLoader.
> 
> 
> Did you understand my english ;)
> 
> -Emmanuel
> 
> 
> 
>  --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit :
> >
> Hi Guys,
> > Can anyone help clarify or confirm the
> relationship
> > between an HttpSession
> > and a web application? I mean, can two WAR (two
> > application) share one
> > common HttpSession and whatever resource this
> > HttpSession contains?
> > 
> > My understanding is that if WARs are deployed
> > separately, then there will be
> > different HttpSessions and therefore you can not
> > share resources among them.
> > Can anyone help confirm this? or correct if I am
> > wrong?
> > 
> > Thanks!
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> >
> 
> > For additional commands, e-mail:
> > 
> >  
> 
>
___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et
> en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> This transmission (and any information attached to
> it) may be confidential and is intended solely for
> the use of the individual or entity to which it is
> addressed. If you are not the intended recipient or
> the person responsible for delivering the
> transmission to the intended recipient, be advised
> that you have received this transmission in error
> and that any use, dissemination, forwarding,
> printing, or copying of this information is strictly
> prohibited. If you have received this transmission
> in error, please immediately notify LabOne at
> (800)388-4675.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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




advice- session vs request scope for Action Form

2002-06-13 Thread Rick Reumann

It seems as though the majority of times your ActionForms should use
request scope, but what about situations where you might grab data
from one jsp form and then need to use the information you got from
that page during other parts of your application. Here's the actual
situation...

1) user has to select a "userType" from some select options.
2) once this "userType" is selected I need to use this property in
some DispatchAction methods and as a display on some other pages as
the user traverses the application. (the "userType" can change if he/she
goes back to the original form and selects a new one).

Now the question is where should the "userType" field be stored so I
have access to it in other parts of the user's session? I first
thought it would be best stored as a field in my ActionForm with
session scope so that other pages and Actions could have access to it,
but if reset() is always called regardless of the scope it seems to
imply that the ActionForms shouldn't really be used in Sesion scope?
(Even though the default reset behavior wouldn't reset my field upon
each request unless I provide implementation, it seems to imply that I
should provide the implementation, and definitely as Chuck pointed out
to me, in the case of DynaActionForms, the reset will truly reset the
fields to default values, which means if I use a DynaActionForm and
want it in Session scope I have to override the reset() method and
make sure it doesn't touch the fields I want to keep in the session.
That sort of seems ugly to me.)

Am I better off just sticking the "userType" variable itself into the
session after I get it from the Form? Or maybe just put it into
the DTO (that I eventually convert the ActionForm into anyway) and
then stick that DTO in the session?

Thanks for any comments.

-- 

Rick
mailto:[EMAIL PROTECTED]

"Any man, in the right situation, is capable of murder. But not any
man is capable of being a good camper. So, murder and camping are not
as similar as you might think." 
  -Jack Handey


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




RE: Starter question

2002-06-13 Thread wbchmura


Unless you are submitting the request from a form you do not need an 
actionform that I know of.

If you are always displaying the same list i think you want to:

Invoke the action
The actions perform method should get a collection of beans representing 
each row in the database.  
You then stuff the collection into an attribute in the session
the forward action should send you to the JSP page to display it where 
you iterate through it using the html taglib in struts...

This is in a nutshell and does not necessarily cover good practices but 
it will get you working





-Original Message-
From: tbaskan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:26 PM
To: struts-user
Subject: Starter question


Hello everyone,

I'm a beginner for Struts and can't still figure out how to do simple
things with the framework.

My difficulties are generally related with MVC, I think.

For traning, I want to accomplish probably the easiest dynamic page for
a web application: a page that shows some portion of a database table.

To my understanding, I need the following:
 1. a model object must have a static method that fetches rows 
from the database table and puts them in a Collection object.
 2. a JSP page containing  tags to iterate over this
Collection.

Now.. My real problem is how to attach these together.

I decided to do this with an Action. I mean, when user hits a page like
/myapp/groupList.do, the Action's perform method gets the Collection
from model and sets it as a PageAttribute. But failed. Every  in
configuration file needs a "name" property, which is an ActionForm. Do I
need an ActionForm in this case?

I need some enlightening.

/tb.






--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




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




RE: Please help clarify or confirm -- HttpSession

2002-06-13 Thread Jerry Jalenak

This is something I've wondered about, especially in a team development
environment where there are several programmers working on different webapps
that need to share a common framework - in other words, something like this:

Tomcat\webapps
framework-application
WEB-INF
...
webapplication_1
WEB-INF
...
webapplication_2
WEB-INF
...
etc etc etc

Can the classes in webapplication_1 'see' session data that was created and
stored in the session by the framework-application?  

Jerry

-Original Message-
From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:39 PM
To: Struts Users Mailing List
Subject: Re: Please help clarify or confirm -- HttpSession



At my knowledge, under tomcat each webapp have his own
"memory space" so you can't share HttpSession between
2 webapp. You can share object between 2 webapp with
one condition, the class to be shared must be loaded
in same ClassLoader.


Did you understand my english ;)

-Emmanuel



 --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
Hi Guys,
> Can anyone help clarify or confirm the relationship
> between an HttpSession
> and a web application? I mean, can two WAR (two
> application) share one
> common HttpSession and whatever resource this
> HttpSession contains?
> 
> My understanding is that if WARs are deployed
> separately, then there will be
> different HttpSessions and therefore you can not
> share resources among them.
> Can anyone help confirm this? or correct if I am
> wrong?
> 
> Thanks!
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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




Re: DispatchAction with Image buttons

2002-06-13 Thread Mark Nichols

>
> Is anyone successfully using the DispatchAction with  tags???
>

We have this Dispatch Action:

package dhs.vcm.vis.action.finishReason;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import dhs.vcm.vis.business.FinishVisitReasonBO;
import dhs.vcm.vis.db.exception.Fin_Vst_Rsn_Exception;
import dhs.vcm.vis.entity.Constants;
import dhs.vcm.vis.entity.FinishVisitReason;
import dhs.vcm.vis.form.finishReason.FinishReasonDeleteForm;
import dhs.vcm.vis.form.finishReason.FinishReasonUpdateForm;
import dhs.vcm.vis.form.finishReason.FinishVisitReasonFormConverter;

/**
 * Implementation of DispatchAction that manages the
 * insert, update, and delete functionality for the Finish Reason
Maintenance page.
 *
 * @author Mark H. Nichols
 * @version $Revision: 1.0 $ $Date: 2001/02/25 9:08:00 $
 */

public final class DispatcherAction extends DispatchAction {

 // - Public Methods

 /**
  * Process the specified HTTP request, and create the corresponding HTTP
  * response (or forward to another web component that will create it).
  * Return an ActionForward instance describing where and how
  * control should be forwarded, or null if the response has
  * already been completed.
  *
  * @param mapping The ActionMapping used to select this instance
  * @param actionForm The optional ActionForm bean for this request (if any)
  * @param request The HTTP request we are processing
  * @param response The HTTP response we are creating
  *
  * @exception IOException if an input/output error occurs
  * @exception ServletException if a servlet exception occurs
  */

 public ActionForward delete(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  // create a new delete form to hold the data for the delete jsp
  FinishReasonDeleteForm deleteForm = new FinishReasonDeleteForm() ;
  deleteForm.setShortDescription(
(String)request.getParameter("shortDescription") ) ;
  request.setAttribute(Constants.FINISH_REASON_DELETE_KEY, deleteForm ) ;

  // Forward control to the specified success URI
  return (mapping.findForward("delete"));

 }

 public ActionForward insert(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  // Forward control to the specified success URI
  return (mapping.findForward("insert"));

 }

 public ActionForward update(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  // get the row to update using the selected reason Id
  FinishReasonUpdateForm updateForm = new FinishReasonUpdateForm() ;
  FinishVisitReasonBO reasonBO = new FinishVisitReasonBO() ;
  FinishVisitReason reasonForUpdate = new FinishVisitReason() ;

  try {
   reasonForUpdate =
reasonBO.getByReasonID(Integer.valueOf(request.getParameter("finishReasonID"
)).intValue()) ;
  }catch (Fin_Vst_Rsn_Exception fvre) {
   System.out.println(" Finish Visit Reason Exception caught: " +
fvre.getMessage()) ;
  }
  FinishVisitReasonFormConverter.toFinishReasonForm(reasonForUpdate,
updateForm) ;

  updateForm.debug() ;

  request.setAttribute(Constants.FINISH_REASON_UPDATE_KEY, updateForm ) ;

  // Forward control to the specified success URI
  return (mapping.findForward("update"));

 }

}

That works with this JSP using image buttons



<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/dhs-html.tld" prefix="dhshtml" %>
<%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg" %>



 
 

 

 

 
 
 






 
 

  
  
  
  

 
 
  
  
   

  
  
    
   
   
   
   
  

  
 
  
   
   

 
  
   

 

   
  
 


 
  
   

 

   
  
 


  


 
  
 




   

  
 
 

 
 
 
   
  
    
   

 Result Pages: 
 
  
  [< <%
  }
  if (pageNumber == pagerPageNumber) {
   %><%= pageNumber %><%
  } else {
   %><%= pageNumber %><%
  }
 %>
 
 
  
   [Next>>]
 

   
  
   
 
 
 
 
 
  
    
   

 
  
   
   
  
 

   
  
 








HTH,




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

Re: Validator and DispatchAction

2002-06-13 Thread William W


Good  :)
I will try !!!
Thanks !
WIlliam.

>From: David Winterfeldt <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>Subject: Re: Validator and DispatchAction
>Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT)
>
>You can't use booleans in the depends, but there can
>be dependencies setup between validation routines.
>You can make a method check pluggable validator and
>have required and other validator depend on it.
>Although the default configuration has everything
>depend on required so if required depends on something
>else, everything should work fine.  Method would be
>checked first and then if it passes required would be
>next.
>
>classname="MyDispatchMethodChecker"
>method="validateDispatchMethod"
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
>msg="errors.method"/>
>
>classname="org.apache.struts.util.StrutsValidator"
>method="validateRequired"
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
>depends="method"
>msg="errors.required"/>
>
>David
>
>--- William W <[EMAIL PROTECTED]> wrote:
> >
> > Is it possible ?
> > Use boolean in the "depends" property ?
> >
> >  >depends="method OR required">
> >> key="typeForm.password.displayname"/>
> >   
> >  methodName
> >  update
> >   
> > 
> >
> >
> > >From: "William W" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: Re: Validator and DispatchAction
> > >Date: Thu, 13 Jun 2002 14:46:09 +
> > >
> > >
> > >I think that if I use DispatchAction with
> > ValidatorActionForm I will have
> > >the same problem. How can I validate the form for
> > diferents methods in the
> > >same Action ? Am I wrong ?
> > >Thanks,
> > >William.
> > >
> > >
> > >>From: David Winterfeldt <[EMAIL PROTECTED]>
> > >>Reply-To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > >>To: Struts Users Mailing List
> > <[EMAIL PROTECTED]>,  Rick
> > >>Reumann <[EMAIL PROTECTED]>
> > >>Subject: Re: Validator and DispatchAction
> > >>Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT)
> > >>
> > >>You would currently have to write your own
> > required
> > >>validation method and have it check a variable
> > defined
> > >>by a field to see if it should perform the
> > validation
> > >>or not.  Or define a separate set of validation
> > rules
> > >>for each action and use ValidatorActionForm (which
> > >>uses the action path to retrieve the validation
> > >>rules).
> > >>
> > >>David
> > >>
> > >>--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> > >> > On Wednesday, June 12, 2002, 10:14:09 AM,
> > William
> > >> > wrote:
> > >> >
> > >> > WW> I have a UserForm, the fields are : userId
> > and
> > >> > userName.
> > >> > WW> I have a UserAction that extends
> > DispatchAction.
> > >> > The UserAction have  two
> > >> > WW> methods (insert and update). For the insert
> > >> > method only the userName is
> > >> > WW> required, and for update method the userId
> > and
> > >> > the userName are required.
> > >> > WW> How can I can do a dependency validation
> > with
> > >> > the validator.xml ?
> > >> >
> > >> > I'm curious about this as well. There was a
> > post
> > >> > a few days back
> > >> > dealing with the same issue. I think you
> > are
> > >> > able to nest
> > >> > validation rules for a form but I forgot
> > the
> > >> > exact syntax. Maybe
> > >> > someone else could shed some light again on
> > how
> > >> > to do this.
> > >> >
> > >> >
> > >> > --
> > >> >
> > >> > Rick
> > >> > mailto:[EMAIL PROTECTED]
> > >> >
> > >> > "If you go to a party, and you want to be the
> > >> > popular one at the
> > >> > party, do this: Wait until no one is looking,
> > then
> > >> > kick a burning log
> > >> > out of the fireplace onto the carpet. Then jump
> > on
> > >> > top of it with your
> > >> > body and yell, "Log o' fire! Log o' fire!" I've
> > >> > never done this, but I
> > >> > think it'd work."
> > >> >   -Jack Handey
> > >> >
> > >> >
> > >> > --
> > >> > To unsubscribe, e-mail:
> > >> >
> > 
> > >> > For additional commands, e-mail:
> > >> > 
> > >> >
> > >>
> > >>
> > >>__
> > >>Do You Yahoo!?
> > >>LAUNCH - Your Yahoo! Music Experience
> > >>http://launch.yahoo.com
> > >>
> > >>--
> > >>To unsubscribe, e-mail:
> >
> >>
> > >>For additional commands, e-mail:
> > >>
> > >
> > >
> > >
> > >
> >
> >_
> > >MSN Photos is the easiest wa

Re: Please help clarify or confirm -- HttpSession

2002-06-13 Thread emmanuel.boudrant


At my knowledge, under tomcat each webapp have his own
"memory space" so you can't share HttpSession between
2 webapp. You can share object between 2 webapp with
one condition, the class to be shared must be loaded
in same ClassLoader.


Did you understand my english ;)

-Emmanuel



 --- "Yuan, Tony" <[EMAIL PROTECTED]> a écrit : >
Hi Guys,
> Can anyone help clarify or confirm the relationship
> between an HttpSession
> and a web application? I mean, can two WAR (two
> application) share one
> common HttpSession and whatever resource this
> HttpSession contains?
> 
> My understanding is that if WARs are deployed
> separately, then there will be
> different HttpSessions and therefore you can not
> share resources among them.
> Can anyone help confirm this? or correct if I am
> wrong?
> 
> Thanks!
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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




Please help clarify or confirm -- HttpSession

2002-06-13 Thread Yuan, Tony

Hi Guys,
Can anyone help clarify or confirm the relationship between an HttpSession
and a web application? I mean, can two WAR (two application) share one
common HttpSession and whatever resource this HttpSession contains?

My understanding is that if WARs are deployed separately, then there will be
different HttpSessions and therefore you can not share resources among them.
Can anyone help confirm this? or correct if I am wrong?

Thanks!


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




RE: Struts Design/construction process. question

2002-06-13 Thread Joseph Barefoot

core dumps, anyone?
:)

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Struts Design/construction process. question
>
>
>
> We may be heading off topic here...  I started out at the tail end of
> that era...  I swore an oath that I would never work on a mainframe and
> managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in
> school...
>
> Now back our regularly scheduled topics
>
> MAINFRAMES SUCK! (Happy Niall?)
> (incidentally the above was in jest - I hear you can run Linux on them
> now...)
>
>
>
> -Original Message-
> From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 1:00 PM
> To: struts-user
> Subject: RE: Struts Design/construction process. question
>
>
> Hard to believe there was a time when Cobol ruled the universe and
> programs
> were designed in a 'top-down' fashion isn't it?  And as an old (actually
> 40+) mainframe programmer who is trying to make the transition from the
> non-object world of Cobol and (gasp here) assembler to the
> object-oriented
> world of Java (and JSP and struts and XML and and and), there are times
> when
> I really miss those 'good old days'.  But then I think, nah, just post a
> question on the mailing list and get the 'right' answer from all of you
> guys!
>
> Jerry
>
> -Original Message-
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 11:51 AM
> To: Struts Users Mailing List
> Subject: RE: Struts Design/construction process. question
>
>
> I saw this thread and thought..."great, flame war...", but you guys are
> too
> nice.
>
> IMHO I suggest you learn from the guru before trying this next time:
>
>
> http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone
>
> Niall
>
> P.S. 'old (35?) mainframe programmers' on this list must have seen the
> light...Hallelujah!
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> >
> > I'd like to apologize for that comment...  I did not mean it as a bad
> > thing...
> >
> > I guess I just liken the old mainframes with the old programming
> > methodologies that involved tons of upfront planning and an pretty
> > unflexible design once programming started.  Back when the project
> > delivery times were in years, not weeks...
> >
> > :)
> >
> > -Original Message-
> > From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
> >
> > As an 'old mainframe programmer' I resent this.  (:-)
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> >
> > I tend to agree on this.  I have only done a few things in struts, but
> > have been programming for quite a while.  The idea of pumping
> everything
> >
> > out in seperate development projects just out right scares me.  If
> this
> > was to have any chance of working out you would need:
> >
> > (1) A horrendous amount of upfront planning
> > (2) Program requirements that don't change at all
> > (3) A programming team that would not quit during an upfront design
> this
> >
> > heavy
> >
> >
> > All in all, if its a large project you could probably dub it a death
> > march project.
> >
> > #1 is too terrible to consider, #2 is just plain silly, #3... well...
> >
> > Personally, iterative development has worked in most of the projects I
> > have been on and run.
> >
> > Thats all from here...
> >
> > PS. Are the project managers old mainframe programmers or something?
> >
> >
> >
> > -Original Message-
> > From: josephb [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 7:54 PM
> > To: struts-user
> > Subject: RE: Struts Design/construction process. question
> >
> >
> > This reminds me of the adage a former professor of mine used to
> preach:
> > "It is much easier to build a program than to give birth to one."
> >
> > The "pump out a list of components" and "while bringing the page to
> > life"
> > parts of your message make it sound an awful lot like your project
> > management is involved in obstetrics in addition to software
> > development. :)
> >
> > Seriously, though, you *will* run into problems doing things this way.
> > For
> > instance, having a junior developer create 60 form beans for the
> > expected
> > inputs on each page has several implications:
> >
> > 1.  Your action developers will have to modify the beans anyway most
> > likely
> > because the form bean developer cannot know things like whether an
> array
> >
> > or
> > a List is more appropriate for collection data in a particular
> instance
> > (this usually depends on the Action).
> >
> > 2. A naming convention for the beans must be established or madness
> will
> > ensue.
> >
> > 3. It may make sense to re-use a form bean for different jsps, or nest
> > form
> > beans depending on the implementation of the action classes.  The form
> > bean
> > developer will not know the nature of this

RE: Struts Design/construction process. question

2002-06-13 Thread Jerry Jalenak

Yeah, you can.  That's why their called 'Enterprise Servers' now-a-days.

(:-)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts Design/construction process. question



We may be heading off topic here...  I started out at the tail end of 
that era...  I swore an oath that I would never work on a mainframe and 
managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in 
school...

Now back our regularly scheduled topics

MAINFRAMES SUCK! (Happy Niall?)
(incidentally the above was in jest - I hear you can run Linux on them 
now...)



-Original Message-
From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:00 PM
To: struts-user
Subject: RE: Struts Design/construction process. question


Hard to believe there was a time when Cobol ruled the universe and 
programs
were designed in a 'top-down' fashion isn't it?  And as an old (actually
40+) mainframe programmer who is trying to make the transition from the
non-object world of Cobol and (gasp here) assembler to the 
object-oriented
world of Java (and JSP and struts and XML and and and), there are times 
when
I really miss those 'good old days'.  But then I think, nah, just post a
question on the mailing list and get the 'right' answer from all of you
guys!

Jerry

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 11:51 AM
To: Struts Users Mailing List
Subject: RE: Struts Design/construction process. question


I saw this thread and thought..."great, flame war...", but you guys are 
too
nice.

IMHO I suggest you learn from the guru before trying this next time:

  
http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone

Niall

P.S. 'old (35?) mainframe programmers' on this list must have seen the
light...Hallelujah!


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I'd like to apologize for that comment...  I did not mean it as a bad
> thing...
>
> I guess I just liken the old mainframes with the old programming
> methodologies that involved tons of upfront planning and an pretty
> unflexible design once programming started.  Back when the project
> delivery times were in years, not weeks...
>
> :)
>
> -Original Message-
> From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
>
> As an 'old mainframe programmer' I resent this.  (:-)
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I tend to agree on this.  I have only done a few things in struts, but
> have been programming for quite a while.  The idea of pumping 
everything
>
> out in seperate development projects just out right scares me.  If 
this
> was to have any chance of working out you would need:
>
> (1) A horrendous amount of upfront planning
> (2) Program requirements that don't change at all
> (3) A programming team that would not quit during an upfront design 
this
>
> heavy
>
>
> All in all, if its a large project you could probably dub it a death
> march project.
>
> #1 is too terrible to consider, #2 is just plain silly, #3... well...
>
> Personally, iterative development has worked in most of the projects I
> have been on and run.
>
> Thats all from here...
>
> PS. Are the project managers old mainframe programmers or something?
>
>
>
> -Original Message-
> From: josephb [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 7:54 PM
> To: struts-user
> Subject: RE: Struts Design/construction process. question
>
>
> This reminds me of the adage a former professor of mine used to 
preach:
> "It is much easier to build a program than to give birth to one."
>
> The "pump out a list of components" and "while bringing the page to
> life"
> parts of your message make it sound an awful lot like your project
> management is involved in obstetrics in addition to software
> development. :)
>
> Seriously, though, you *will* run into problems doing things this way.
> For
> instance, having a junior developer create 60 form beans for the
> expected
> inputs on each page has several implications:
>
> 1.  Your action developers will have to modify the beans anyway most
> likely
> because the form bean developer cannot know things like whether an 
array
>
> or
> a List is more appropriate for collection data in a particular 
instance
> (this usually depends on the Action).
>
> 2. A naming convention for the beans must be established or madness 
will
> ensue.
>
> 3. It may make sense to re-use a form bean for different jsps, or nest
> form
> beans depending on the implementation of the action classes.  The form
> bean
> developer will not know the nature of this implementation ahead of 
time
> and
> thus cannot make these decisions.
>
> b.t.w., there are tools (or you can build your own) for generating 
basic
> ActionForm beans, so this is not really an issue anyway.
>
>
> > I have a

RE: [ann] Easy Struts 0.2 for Eclipse users

2002-06-13 Thread emmanuel.boudrant

Hi,

About Eclipse, no problem, F3 was released today. This
is the last stable release.
...or you can wait for June 28, official release date
for Eclipse 2 ;)

more information about release plan :
http://www.eclipse.org/eclipse/freeze_plan_2_0.html

-Emmanuel

 --- Jerry Jalenak <[EMAIL PROTECTED]> a écrit
: > I'm dying to use Easy Struts for Eclipse, but am
> hesitant to go to Eclipse
> 2.0.  Is the F2 release stable yet?  The last time I
> tried it I couldn't get
> anything to work
> 
> Jerry
> 
> -Original Message-
> From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 5:36 AM
> To: Struts Users Mailing List;
> [EMAIL PROTECTED]
> Subject: [ann] Easy Struts 0.2 for Eclipse users
> 
> 
> Hi,
> 
> Easy Struts 0.2 for Eclipse is out
> 
> *Features 
>  - Wizard for action, form, jsp creation
>  - Create & Run with Tomcat Sysdeo Plugin
> 
> *Changes
>  - Wizard for forward creation added
>  - Distribution
>  - Some fix
> 
> *More : 
>  - http://sourceforge.net/projects/easystruts
>  - http://easystruts.sourceforge.net/
> 
> Enjoy,
> -Emmanuel
> 
>
___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et
> en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> This transmission (and any information attached to
> it) may be confidential and is intended solely for
> the use of the individual or entity to which it is
> addressed. If you are not the intended recipient or
> the person responsible for delivering the
> transmission to the intended recipient, be advised
> that you have received this transmission in error
> and that any use, dissemination, forwarding,
> printing, or copying of this information is strictly
> prohibited. If you have received this transmission
> in error, please immediately notify LabOne at
> (800)388-4675.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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




RE: Struts Design/construction process. question

2002-06-13 Thread wbchmura


We may be heading off topic here...  I started out at the tail end of 
that era...  I swore an oath that I would never work on a mainframe and 
managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in 
school...

Now back our regularly scheduled topics

MAINFRAMES SUCK! (Happy Niall?)
(incidentally the above was in jest - I hear you can run Linux on them 
now...)



-Original Message-
From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:00 PM
To: struts-user
Subject: RE: Struts Design/construction process. question


Hard to believe there was a time when Cobol ruled the universe and 
programs
were designed in a 'top-down' fashion isn't it?  And as an old (actually
40+) mainframe programmer who is trying to make the transition from the
non-object world of Cobol and (gasp here) assembler to the 
object-oriented
world of Java (and JSP and struts and XML and and and), there are times 
when
I really miss those 'good old days'.  But then I think, nah, just post a
question on the mailing list and get the 'right' answer from all of you
guys!

Jerry

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 11:51 AM
To: Struts Users Mailing List
Subject: RE: Struts Design/construction process. question


I saw this thread and thought..."great, flame war...", but you guys are 
too
nice.

IMHO I suggest you learn from the guru before trying this next time:

  
http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone

Niall

P.S. 'old (35?) mainframe programmers' on this list must have seen the
light...Hallelujah!


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I'd like to apologize for that comment...  I did not mean it as a bad
> thing...
>
> I guess I just liken the old mainframes with the old programming
> methodologies that involved tons of upfront planning and an pretty
> unflexible design once programming started.  Back when the project
> delivery times were in years, not weeks...
>
> :)
>
> -Original Message-
> From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
>
> As an 'old mainframe programmer' I resent this.  (:-)
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I tend to agree on this.  I have only done a few things in struts, but
> have been programming for quite a while.  The idea of pumping 
everything
>
> out in seperate development projects just out right scares me.  If 
this
> was to have any chance of working out you would need:
>
> (1) A horrendous amount of upfront planning
> (2) Program requirements that don't change at all
> (3) A programming team that would not quit during an upfront design 
this
>
> heavy
>
>
> All in all, if its a large project you could probably dub it a death
> march project.
>
> #1 is too terrible to consider, #2 is just plain silly, #3... well...
>
> Personally, iterative development has worked in most of the projects I
> have been on and run.
>
> Thats all from here...
>
> PS. Are the project managers old mainframe programmers or something?
>
>
>
> -Original Message-
> From: josephb [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 7:54 PM
> To: struts-user
> Subject: RE: Struts Design/construction process. question
>
>
> This reminds me of the adage a former professor of mine used to 
preach:
> "It is much easier to build a program than to give birth to one."
>
> The "pump out a list of components" and "while bringing the page to
> life"
> parts of your message make it sound an awful lot like your project
> management is involved in obstetrics in addition to software
> development. :)
>
> Seriously, though, you *will* run into problems doing things this way.
> For
> instance, having a junior developer create 60 form beans for the
> expected
> inputs on each page has several implications:
>
> 1.  Your action developers will have to modify the beans anyway most
> likely
> because the form bean developer cannot know things like whether an 
array
>
> or
> a List is more appropriate for collection data in a particular 
instance
> (this usually depends on the Action).
>
> 2. A naming convention for the beans must be established or madness 
will
> ensue.
>
> 3. It may make sense to re-use a form bean for different jsps, or nest
> form
> beans depending on the implementation of the action classes.  The form
> bean
> developer will not know the nature of this implementation ahead of 
time
> and
> thus cannot make these decisions.
>
> b.t.w., there are tools (or you can build your own) for generating 
basic
> ActionForm beans, so this is not really an issue anyway.
>
>
> > I have always assumed that the action classes would be completed
> > at the same
> > time that the page is converted to jsp/struts.
>
> Add "ActionForm classes" to the above statement and you are entirely
> correct.  We tend to view an Action, its ActionForm, and the
> presentation
> lo

RE: [ann] Easy Struts 0.2 for Eclipse users

2002-06-13 Thread Jerry Jalenak

I'm dying to use Easy Struts for Eclipse, but am hesitant to go to Eclipse
2.0.  Is the F2 release stable yet?  The last time I tried it I couldn't get
anything to work

Jerry

-Original Message-
From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 5:36 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: [ann] Easy Struts 0.2 for Eclipse users


Hi,

Easy Struts 0.2 for Eclipse is out

*Features 
 - Wizard for action, form, jsp creation
 - Create & Run with Tomcat Sysdeo Plugin

*Changes
 - Wizard for forward creation added
 - Distribution
 - Some fix

*More : 
 - http://sourceforge.net/projects/easystruts
 - http://easystruts.sourceforge.net/

Enjoy,
-Emmanuel

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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




Starter question

2002-06-13 Thread Tuncay Baskan

Hello everyone,

I'm a beginner for Struts and can't still figure out how to do simple
things with the framework.

My difficulties are generally related with MVC, I think.

For traning, I want to accomplish probably the easiest dynamic page for
a web application: a page that shows some portion of a database table.

To my understanding, I need the following:
 1. a model object must have a static method that fetches rows 
from the database table and puts them in a Collection object.
 2. a JSP page containing  tags to iterate over this
Collection.

Now.. My real problem is how to attach these together.

I decided to do this with an Action. I mean, when user hits a page like
/myapp/groupList.do, the Action's perform method gets the Collection
from model and sets it as a PageAttribute. But failed. Every  in
configuration file needs a "name" property, which is an ActionForm. Do I
need an ActionForm in this case?

I need some enlightening.

/tb.






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




RE: Struts Design/construction process. question

2002-06-13 Thread Jerry Jalenak

Hard to believe there was a time when Cobol ruled the universe and programs
were designed in a 'top-down' fashion isn't it?  And as an old (actually
40+) mainframe programmer who is trying to make the transition from the
non-object world of Cobol and (gasp here) assembler to the object-oriented
world of Java (and JSP and struts and XML and and and), there are times when
I really miss those 'good old days'.  But then I think, nah, just post a
question on the mailing list and get the 'right' answer from all of you
guys!

Jerry

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 11:51 AM
To: Struts Users Mailing List
Subject: RE: Struts Design/construction process. question


I saw this thread and thought..."great, flame war...", but you guys are too
nice.

IMHO I suggest you learn from the guru before trying this next time:

  http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone

Niall

P.S. 'old (35?) mainframe programmers' on this list must have seen the
light...Hallelujah!


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I'd like to apologize for that comment...  I did not mean it as a bad
> thing...
>
> I guess I just liken the old mainframes with the old programming
> methodologies that involved tons of upfront planning and an pretty
> unflexible design once programming started.  Back when the project
> delivery times were in years, not weeks...
>
> :)
>
> -Original Message-
> From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]]
>
> As an 'old mainframe programmer' I resent this.  (:-)
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
>
> I tend to agree on this.  I have only done a few things in struts, but
> have been programming for quite a while.  The idea of pumping everything
>
> out in seperate development projects just out right scares me.  If this
> was to have any chance of working out you would need:
>
> (1) A horrendous amount of upfront planning
> (2) Program requirements that don't change at all
> (3) A programming team that would not quit during an upfront design this
>
> heavy
>
>
> All in all, if its a large project you could probably dub it a death
> march project.
>
> #1 is too terrible to consider, #2 is just plain silly, #3... well...
>
> Personally, iterative development has worked in most of the projects I
> have been on and run.
>
> Thats all from here...
>
> PS. Are the project managers old mainframe programmers or something?
>
>
>
> -Original Message-
> From: josephb [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 7:54 PM
> To: struts-user
> Subject: RE: Struts Design/construction process. question
>
>
> This reminds me of the adage a former professor of mine used to preach:
> "It is much easier to build a program than to give birth to one."
>
> The "pump out a list of components" and "while bringing the page to
> life"
> parts of your message make it sound an awful lot like your project
> management is involved in obstetrics in addition to software
> development. :)
>
> Seriously, though, you *will* run into problems doing things this way.
> For
> instance, having a junior developer create 60 form beans for the
> expected
> inputs on each page has several implications:
>
> 1.  Your action developers will have to modify the beans anyway most
> likely
> because the form bean developer cannot know things like whether an array
>
> or
> a List is more appropriate for collection data in a particular instance
> (this usually depends on the Action).
>
> 2. A naming convention for the beans must be established or madness will
> ensue.
>
> 3. It may make sense to re-use a form bean for different jsps, or nest
> form
> beans depending on the implementation of the action classes.  The form
> bean
> developer will not know the nature of this implementation ahead of time
> and
> thus cannot make these decisions.
>
> b.t.w., there are tools (or you can build your own) for generating basic
> ActionForm beans, so this is not really an issue anyway.
>
>
> > I have always assumed that the action classes would be completed
> > at the same
> > time that the page is converted to jsp/struts.
>
> Add "ActionForm classes" to the above statement and you are entirely
> correct.  We tend to view an Action, its ActionForm, and the
> presentation
> logic (i.e., Struts tags) in their associated JSP(s) as an "action
> module"
> of sorts, and a single developer is resonsible for these components.
> Things
> become very messy when you try to split the JSP, ActionForm, and Action
> work
> to different developers, IMHO.
>
>
> My $.02  ( more like $1.02?)
>
>
> peace,
>
> Joe Barefoot
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 4:16 PM
> > To: [EMAIL PROTECTED]
> > Subject: Struts Design/construction process. question
> >
> >
> >
> >
> > This is our *FIRST* 

Re: thread safety

2002-06-13 Thread Oliver Refle

a DVO is a data value object. Look at the design pattern from sun, there
they are described


Am Don, 2002-06-13 um 18.56 schrieb Noah Levitt:
> What's a DVO?
> 
> 
> On Thu, Jun 13, 2002 at 12:56:38PM +0530, Vikram Goyal01 wrote:
> > >Also, how do we deal with the situation where we need to build up
> > >information over a series of requests before we can actually save it or do
> > >something with it (ie: wizards etc...)
> > 
> > In reply to an earlier post regarding something similar, my idea is to encapsulate 
>the information required for the wizard in a DVO and not a form bean. This helps keep 
>form beans in request and thus enables thread safety. On each page of the wizard, you 
>update the DVO with the values in the form bean and only keep the DVO in session.
> > I agree with Craig when he says that the form bean should only be kept in request 
>scope.
> > 
> > Rgs
> > Vikram
> > 
> > 
> > -Original Message-
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 13, 2002 14:17
> > To: Struts Users Mailing List
> > Subject: Re: thread safety
> > 
> > 
> > 
> > 
> > On Wed, 12 Jun 2002, Noah Levitt wrote:
> > 
> > > Date: Wed, 12 Jun 2002 19:57:39 -0400
> > > From: Noah Levitt <[EMAIL PROTECTED]>
> > > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: thread safety
> > >
> > > Hello struts users,
> > >
> > > The issue of thread safety bugs me. It seems as though it is
> > > standard practice to write servlets thread-*unsafely*. The
> > > odds of it ever being a problem are slim, but still.
> > >
> > > It seems to me that form bean setters (and probably getters)
> > > should be synchronized. I found the following two quotes
> > > from Craig McClanahan. To me, they seem contradictory.
> > > However, even if we use the "that's going to be real
> > > unusual" standard, shouldn't we synchronize setters, since,
> > > in theory, it's the only thread-safe thing to do?
> > >
> > > http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml
> > >
> > > Craig:
> > >  "For the form beans, you are creating them in a particular
> > >  user's session. If the user does two submits to the same
> > >  form at the same time you might have overlapping setXxx
> > >  method calls going on, but that's going to be real
> > >  unusual."
> > >
> > > http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml
> > >
> > > Craig:
> > >  "It is surprisingly easy to have multiple requests active
> > >  at the same time for the same session."
> > >
> > 
> > The simplest way to avoid this whole set of problems is to use request
> > scope for your form beans.  Then, the container guarantees that only one
> > thread can access these beans, so you don't need to be concerned at all
> > about thread safety in them.
> > 
> > Following this advice will also be beneficial, in general, to the
> > scalability of your application -- because the server will not need to
> > store the form beans in memory "in between" requests.
> > 
> > Craig
> > >
> > > Noah
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > 
> > > For additional commands, e-mail:
> > 
> > >
> > >
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > For additional commands, e-mail: 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > For additional commands, e-mail: 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 




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




Re: thread safety

2002-06-13 Thread Noah Levitt

What's a DVO?


On Thu, Jun 13, 2002 at 12:56:38PM +0530, Vikram Goyal01 wrote:
> >Also, how do we deal with the situation where we need to build up
> >information over a series of requests before we can actually save it or do
> >something with it (ie: wizards etc...)
> 
> In reply to an earlier post regarding something similar, my idea is to encapsulate 
>the information required for the wizard in a DVO and not a form bean. This helps keep 
>form beans in request and thus enables thread safety. On each page of the wizard, you 
>update the DVO with the values in the form bean and only keep the DVO in session.
> I agree with Craig when he says that the form bean should only be kept in request 
>scope.
> 
> Rgs
> Vikram
> 
> 
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 14:17
> To: Struts Users Mailing List
> Subject: Re: thread safety
> 
> 
> 
> 
> On Wed, 12 Jun 2002, Noah Levitt wrote:
> 
> > Date: Wed, 12 Jun 2002 19:57:39 -0400
> > From: Noah Levitt <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: thread safety
> >
> > Hello struts users,
> >
> > The issue of thread safety bugs me. It seems as though it is
> > standard practice to write servlets thread-*unsafely*. The
> > odds of it ever being a problem are slim, but still.
> >
> > It seems to me that form bean setters (and probably getters)
> > should be synchronized. I found the following two quotes
> > from Craig McClanahan. To me, they seem contradictory.
> > However, even if we use the "that's going to be real
> > unusual" standard, shouldn't we synchronize setters, since,
> > in theory, it's the only thread-safe thing to do?
> >
> > http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml
> >
> > Craig:
> >  "For the form beans, you are creating them in a particular
> >  user's session. If the user does two submits to the same
> >  form at the same time you might have overlapping setXxx
> >  method calls going on, but that's going to be real
> >  unusual."
> >
> > http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml
> >
> > Craig:
> >  "It is surprisingly easy to have multiple requests active
> >  at the same time for the same session."
> >
> 
> The simplest way to avoid this whole set of problems is to use request
> scope for your form beans.  Then, the container guarantees that only one
> thread can access these beans, so you don't need to be concerned at all
> about thread safety in them.
> 
> Following this advice will also be beneficial, in general, to the
> scalability of your application -- because the server will not need to
> store the form beans in memory "in between" requests.
> 
> Craig
> >
> > Noah
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




  1   2   >