Re: [OT] RE: mesage message account

2003-08-19 Thread Micael
Tell us something we all did not already know, Mark, you commie creep! ///;-)

At 02:07 PM 8/19/2003 -0400, Mark Galbreath wrote:
Actually, I'm an African-American pro-Islamic militant revolutionary who is
on this list only to monitor the secret Zionist elitists disguised as Struts
developers and gather intelligence for the coming .NET holocaust and world
domination.
Mark (is only my code name)

-Original Message-
From: object worlds [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 9:42 AM
Did you take my message message account off the list ?
Is that because that white shit Mark Galbreath
said so and that shit Craig Mclanahan agreed.


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


LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



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


setUserPrincipal or something like that if u have a selfregistrationbutton.

2003-08-19 Thread Marius Oancea
Hi,
I have a webapp made with struts and securityfilter using BasicAuth.
	All worked like a charm but:
		How can i log in (or authenticate) the user after createUser process 
is complete?
		In other words:
			- I have a button (free registration). The user will enter his data 
and after that I want to automatically login that user. Is that 
possible? I looked for a setUserPrincipal but i'm not able to access 
that form an action.

	Thanx

		Marius Oancea

--
"Why program by hand in five days what you can spend five years of your 
life automating." - Terence Parr

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


SV: Insert arguments into Validator error messages?

2003-08-19 Thread Andreas Lundgren
When I removed the key = "resource" attribute in the message-resource
declaration in the struts-config.xml, hence using the default
Globals.MessageKey it worked... Can anyone please confirm this? All the
error messages and their arguments needs be to set in a resource-bundle
stored in the default Globals.MessageKey? Hence you can't use  when presenting error messages WITH arguments?

Can anyone confirm that this is the case?

Thank you!

/Andreas


-Ursprungligt meddelande-
Från: Andreas Lundgren [mailto:[EMAIL PROTECTED]
Skickat: den 19 augusti 2003 06:22
Till: [EMAIL PROTECTED]
Ämne: Insert arguments into Validator error messages?


Hi,

I trying to insert an argument into a error message using the Validator
framework and I just can't make it work.

The validation itself works and it shows a nice display of my (TEST) error
message also, but the argument is somehow lost.
If I use the resource="false" attribute it works...

What I am missing here?

validation.xml:








My bundle namned "resource":

errors.required={0} TEST is required.
label.name=Name

And the output is (using  )

TEST is required.

And if I use the resource="false" attribute:

label.name TEST is required.

Why is the error message key found but not the argument key (label.name) in
my resource-bundle?

Thankful for your assistance!

/Andreas


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


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



RE: [OT] Session & Context attributes in distributed env [WAS: RE: [OT]Servlet Context/Static Fields]

2003-08-19 Thread Andrew Hill
Im developing on Tomcat, but the application is a product that the customers
deploy on their own appserver - so needs to be container independent (in
theory ;-> Usually we set up an appserver for them). At this stage we arent
doing distributed deployments for the presentation tier so it hasnt been an
issue, but of course its one of those things I know is going to happen
sooner or later so Id like to be ready for it. I think load balancing would
be the main concern. Failover would be important for the business tier ejbs
n'stuff, but for the UI not really vital (though I wouldnt be surprised if
its considered important for marketing purposes!).

At the moment I think Im breaking a fair few of the distributability rules
(such as putting non-serializables into session scope).


It can only be migrated "in between" requests.  When it is migrated, all of
the session attributes (which must be Serializable) are taken along with it.


What you say about the session only being replicated between requests does
take quite a weight of my mind though! Getting rid of the naughty
non-serializables shouldnt be too difficult I hope.

When you say "all of the session attributes" , does that mean literally all
of them or just ones that have had setAttribute() called on them since the
previous replication? (or is this too container dependant) A fair few of
these objects in my app are getting modified internally by layers that know
nothing of the servlet api.

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 20 August 2003 13:19
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: [OT] Session & Context attributes in distributed env [WAS:
RE: [OT]Servlet Context/Static Fields]


On Wed, 20 Aug 2003, Andrew Hill wrote:

> Date: Wed, 20 Aug 2003 11:17:54 +0800
> From: Andrew Hill <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED]
> To: Struts <[EMAIL PROTECTED]>
> Subject: [OT] Session & Context attributes in distributed env [WAS: RE:
> [OT]Servlet Context/Static Fields]
>
> Thanks Craig,
>
> I can see that there is a lot I still have to learn about this area.
>
> Where (other than the spec itself which should of course be my first stop)
> would be a good place to get info on these things?
>

I would immediately go to the developer docs for the particular app server
that you're using, to see what they suggest for ensuring that session
attributes are replicated at appropriate times.  Next, I'd go peruse the
configuration options for that app server, to see what kind of tweaks I'm
able to play with for maximizing performance (well, usually it's an issue
of minimizing the costs of supporting failover :-).

Since this whole area of functionality is platform specific, the only
place you'll find the answers is in platform-specific documentation.

> Its quite alarming to think that if you set a session attribute it might
not
> be available when you process the next request, and if one sets a whole
lot
> of stuff if the context (including the struts config objects) that they
> might only be available on the machine that created them! hehe Im
obviously
> not grokking this at all.
>

There actually is one important rule in the servlet spec that reduces the
amount of uncertainty -- it is not legal for an app server to migrate a
particular session from one system to another while there is a request
being processed against that session.  It can only be migrated "in
between" requests.  When it is migrated, all of the session attributes
(which must be Serializable) are taken along with it.  If you're just
using multiple servers for load balancing, and don't care much about
failover, you really shouldn't have to worry about this particular issue.

But, if you care about failover, the whole name of the game is finding the
right balance between overhead and failover reliability, for your
particular application.  It's hard to provide general advice on that sort
of issue.

Craig


> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 18 August 2003 23:50
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: [OT]Servlet Context/Static Fields
>
>
> On Mon, 18 Aug 2003, Andrew Hill wrote:
>
> > Date: Mon, 18 Aug 2003 17:12:34 +0800
> > From: Andrew Hill <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED]
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: RE: [OT]Servlet Context/Static Fields
> >
> > If your in a distributed environment changes you make to properties of
> those
> > static classes will not be propogated to other JVMS (or indeed other
> > classloaders), whereas the stuff in ServletContext should be (though Id
> love
> > to hear an explanation of how it knows when to do it!).
> >
>
> Propogation in a distributed app server is actually only guaranteed (in
> the J2EE specs) for *HttpSession* attributes, 

struts-user@jakarta.apache.org

2003-08-19 Thread Craig R. McClanahan
On Wed, 20 Aug 2003, Mark Chaimungkalanont wrote:

> Date: Wed, 20 Aug 2003 15:04:46 +1000
> From: Mark Chaimungkalanont <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: [OT] Static variables are evil? (was Question about Servlets &
> Threads)
>
>
>
>
>
> Craig,
>
> Just wanted to pick up on the comment:
>
> "It's fair to warn you, though, that object oriented purists will frown on
> anything like this, because static variables (similar to globals in PHP)
> are the root of all sorts of program bugs :-).  Explicitly passing things
> around creates *much* safer code."
>
> What sorts of problems do static variables cause?

Static variables are accessible from anywhere.  Therefore, they are
updatable from anywhere -- and, if some arbitrary code scribbles on your
global variable, it can be very hard to find the culprit.

> Does this also mean that
> you should avoid GlobalConstants type classes as well?

Global constants are not the same sort of problem, because they cannot be
modified.

>
> On a related note, what're some good sources for such info related how best
> to OO your code? Is it just a matter of sticking to design patterns like a
> glue?
>

Well, that's a good start.  There are many good design patterns books
around -- for Java, I would pay particular attention to the kinds of
patterns that people like Josh Block and Martin Fowler recommend, but they
are by no means the only good role models.

The other thing to think about, though ... I'm not sure that "OO your
code" is something you can effectively do after the fact.  It seems to me
that this is much more an issue that needs to be addressed in the initial
architecture.  The things people love about scripting languages (including
PHP and JavaScript) -- polymorphic variables, globals as the normal way of
sharing information, relatively little emphasis on the concept of an
"object", intermixed business logic and presentation -- tend to be
reflected in the code that gets written in these languages.  It's
definitely possible to write O-O oriented code in PHP, for example, but it
seems to be rare.

If you are looking at migrating from such a platform to Java, you might
want to seriously consider a rewrite rather than a migration.  It's not
always the best answer, but if you're going to have to maintain a
significant application for a long time, you want the features of a
language like Java helping you, not fighting you.

> cheers
>
> MC
>

Craig

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



Re: [OT] Session & Context attributes in distributed env [WAS: RE:[OT]Servlet Context/Static Fields]

2003-08-19 Thread Craig R. McClanahan
On Wed, 20 Aug 2003, Andrew Hill wrote:

> Date: Wed, 20 Aug 2003 11:17:54 +0800
> From: Andrew Hill <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED]
> To: Struts <[EMAIL PROTECTED]>
> Subject: [OT] Session & Context attributes in distributed env [WAS: RE:
> [OT]Servlet Context/Static Fields]
>
> Thanks Craig,
>
> I can see that there is a lot I still have to learn about this area.
>
> Where (other than the spec itself which should of course be my first stop)
> would be a good place to get info on these things?
>

I would immediately go to the developer docs for the particular app server
that you're using, to see what they suggest for ensuring that session
attributes are replicated at appropriate times.  Next, I'd go peruse the
configuration options for that app server, to see what kind of tweaks I'm
able to play with for maximizing performance (well, usually it's an issue
of minimizing the costs of supporting failover :-).

Since this whole area of functionality is platform specific, the only
place you'll find the answers is in platform-specific documentation.

> Its quite alarming to think that if you set a session attribute it might not
> be available when you process the next request, and if one sets a whole lot
> of stuff if the context (including the struts config objects) that they
> might only be available on the machine that created them! hehe Im obviously
> not grokking this at all.
>

There actually is one important rule in the servlet spec that reduces the
amount of uncertainty -- it is not legal for an app server to migrate a
particular session from one system to another while there is a request
being processed against that session.  It can only be migrated "in
between" requests.  When it is migrated, all of the session attributes
(which must be Serializable) are taken along with it.  If you're just
using multiple servers for load balancing, and don't care much about
failover, you really shouldn't have to worry about this particular issue.

But, if you care about failover, the whole name of the game is finding the
right balance between overhead and failover reliability, for your
particular application.  It's hard to provide general advice on that sort
of issue.

Craig


> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 18 August 2003 23:50
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: [OT]Servlet Context/Static Fields
>
>
> On Mon, 18 Aug 2003, Andrew Hill wrote:
>
> > Date: Mon, 18 Aug 2003 17:12:34 +0800
> > From: Andrew Hill <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED]
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: RE: [OT]Servlet Context/Static Fields
> >
> > If your in a distributed environment changes you make to properties of
> those
> > static classes will not be propogated to other JVMS (or indeed other
> > classloaders), whereas the stuff in ServletContext should be (though Id
> love
> > to hear an explanation of how it knows when to do it!).
> >
>
> Propogation in a distributed app server is actually only guaranteed (in
> the J2EE specs) for *HttpSession* attributes, not *ServletContext*
> attributes.  It's certainly possible for a server to offer replication of
> context attributes as well, but you can't rely on that to be portable.
>
> The strategy for knowing when to replicate session attributes (and it
> would probably apply to context attributes as well) is typically a
> configuration option in a server-specfic deployment descriptor.  One could
> imagine doing it on a timed basis, or whenever setAttribute() is called
> again, or having some out-of-band method of signalling the server that
> this attribute has been modified.
>
> Craig
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Indexed property names - the real story

2003-08-19 Thread Richard Mixon
First, sorry for the long posting - it shorter than a few, but not many :).

I've read a number of very good postings on the list on how to handle
indexed properties using the "
  

  Existing Line Items
  
  

  Delete
  
  
  
  
  Act  Inact

  

  
   
 
  

  

  
  
  
 
  
  
  
  

  
  

  

  

...
JSP - fragment - END


FormBean - BEGIN
public class OrderLineForm extends com.ltoj.webapp.form.BaseForm implements
java.io.Serializable {

private OrderForm base = new OrderForm();
private List deleteXMP = new ArrayList();
private List currLineItems = new ArrayList();
private List newLineItems = new ArrayList(1);

public OrderForm getBase() { return base; }

public void setBase(OrderForm subject) { this.base = subject; }

/**
 *  Flags, set if corresponding existing line item should be deleted.
 */
public List getDeleteXMP() { return deleteXMP; }
public String getDeleteXMP(int mpDex) { return
(String)this.deleteXMP.get(mpDex); }

public void setDeleteXMP(List deleteXMP) { this.deleteXMP = deleteXMP; }
public void setDeleteXMP(int mpDex, String deleteXMP) {
this.deleteXMP.add(deleteXMP); }

public List getCurrLineItems() { return this.currLineItems; }
public LineItemsForm getCurrMeasurementParms(int mpDex) { return
(LineItemsForm)this.currLineItems.get(mpDex); }

public void setCurrLineItems( List currLineItems ) { this.currLineItems
= currLineItems; }
public void setCurrMeasurementParms( int mpDex, LineItemsForm
currLineItem ) { this.currLineItems.add(currLineItem); }

public List getNewLineItems() { return this.newLineItems; }
public LineItemsForm getNewMeasurementParms(int mpDex) { return
(LineItemsForm)this.newLineItems.get(mpDex); }

public void setNewLineItems( List newLineItems ) { this.newLineItems =
newLineItems; }
public void setNewMeasurementParms( int mpDex, LineItemsForm
newLineItem ) { this.newLineItems.add(newLineItem); }

public void reset(ActionMapping mapping, HttpServletRequest request) {
  base = new OrderForm();
  deleteXMP = new ArrayList();
  currLineItems = new ArrayList();
  newLineItems = new ArrayList(1);
}
}
FormBean - END



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



Re: Defining inheritance for dynamic action forms in struts-config

2003-08-19 Thread Craig R. McClanahan
On Wed, 20 Aug 2003, Andrew van der Voort wrote:

> Date: Wed, 20 Aug 2003 11:17:56 +1200
> From: Andrew van der Voort <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "Struts-User-Help (E-mail)" <[EMAIL PROTECTED]>
> Subject: Defining inheritance for dynamic action forms in struts-config
>
> We have recently upgraded to Struts 1.1 and are exploring the new features.
> I have dynamic action forms and validator working.
>
> Many of our forms have several attributes in common. In struts 1.0.x we
> defined a class inheriting from ActionForm (MainActionForm), defined those
> attributes in it, and extended our ActionForms from MainActionForm.
>
> With dynamic forms there is no base class. It is all defined in
> struts-config. Can I defined anything in struts-config and have all the
> relevant dynamic forms refer to, or include that base definition?
>
> I know I could define a MainDynaActionForm and add the relevant attributes
> to the hashmap at construction and initialisation time, but then its no
> longer dynamic as I'd have to change code to add or remove one of the
> common attributes.
>
> Can I do what I'm describing above?
>

Not without an enhancement to the current functionality -- maybe something
along the way that Tiles lets you extend other tile definitions.  The best
way to ensure that this gets addressed would be to submit an enhancement
request into our bug tracking system:

  http://nagoya.apache.org/bugzilla/

> Thanks
>
> Andrew
>

Craig

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



[OT] Static variables are evil? (was Question about Servlets & Threads)

2003-08-19 Thread Mark Chaimungkalanont




Craig,

Just wanted to pick up on the comment:

"It's fair to warn you, though, that object oriented purists will frown on
anything like this, because static variables (similar to globals in PHP)
are the root of all sorts of program bugs :-).  Explicitly passing things
around creates *much* safer code."

What sorts of problems do static variables cause? Does this also mean that
you should avoid GlobalConstants type classes as well?

On a related note, what're some good sources for such info related how best
to OO your code? Is it just a matter of sticking to design patterns like a
glue?

cheers

MC




   

  "Craig R.

  McClanahan"  To:   Struts Users Mailing List 
<[EMAIL PROTECTED]>
  <[EMAIL PROTECTED]cc:   [EMAIL PROTECTED]

  org> Subject:  Re: [OT] Question about 
Servlets & Threads
   

  19/08/2003 12:38 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   




On Mon, 18 Aug 2003, Jan Zimmek wrote:

> Date: Mon, 18 Aug 2003 23:47:49 +0200
> From: Jan Zimmek <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED]
> Subject: Re: [OT] Question about Servlets & Threads
>
> Hi,
>
> I know, but I want to have a similar behavior like "global variables" to
> access Request/Response-Object without to pass them as parameter to each
> method I need to access them.
>

One option to consider is to store the current request and response
objects into a static variable of type java.lang.ThreadLocal (perhaps in a
Filter, if you're using Servlet 2.3, or a customized RequestProcessor
implementation that does this in its process() method before executing the
standard processing).

It's fair to warn you, though, that object oriented purists will frown on
anything like this, because static variables (similar to globals in PHP)
are the root of all sorts of program bugs :-).  Explicitly passing things
around creates *much* safer code.

> Does this mailing support attachments ? Else my problem could be a bit
> confusing.
>
> greets
> Jan Zimmek

Craig

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





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



Re: Security and Roles related

2003-08-19 Thread Max Cooper
You can use Struts with SecurityFilter, which is a filter-based system
designed initially to work just like container-managed security, with a few
extensions.

http://www.securityfilter.org/

-Max

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 4:07 AM
Subject: Security and Roles related


> Does STRUTS provide integration with any security framework independent of
> the underlying application server. Basically I am looking at services like
> isUserInRole(), getRole() and the sort.
>
> Regards
> Sreekant G
> @ 98404-65630
>
>
>






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



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



Insert arguments into Validator error messages?

2003-08-19 Thread Andreas Lundgren
Hi,

I trying to insert an argument into a error message using the Validator
framework and I just can't make it work.

The validation itself works and it shows a nice display of my (TEST) error
message also, but the argument is somehow lost.
If I use the resource="false" attribute it works...

What I am missing here?

validation.xml:








My bundle namned "resource":

errors.required={0} TEST is required.
label.name=Name

And the output is (using  )

TEST is required.

And if I use the resource="false" attribute:

label.name TEST is required.

Why is the error message key found but not the argument key (label.name) in
my resource-bundle?

Thankful for your assistance!

/Andreas


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



RE: adding a parameter to html:link with a map

2003-08-19 Thread Greg Ludington
>Okay I can do this:
>
>
>Printer
page
>
>
>seems a bit of a kludge, be nice to just specify an addition rather
than put
>in and take it out of the map.

I am not sure it is recommended practice to mix Map and single params in
the same html:link tag, but, if all you need is to add a print=true to
the end of one of your standard links, this should do the trick:

Printer page

Assuming you have some bean named "myBean" defined, and the value of
that bean is "true", this will add both your Map of parameters and
print=true to the link's query string.

-Greg



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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Max Cooper
This seems likely to yield miserable performance.

> while(t.isAlive());

While I don't agree with the approach of spawning a new thread for each
request (app servers typically pool threads, and you get one of those for
each request already), this might yield (threading pun ;-)) better
performance, and should give the same behavior with less wasted CPU cycles
(be sure to test it for equivalency, though):

t.join();

Holy parenthesized sentence, Batman! Sorry about that.

-Max



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



RE: no getter method found

2003-08-19 Thread Yee, Richard K,,DMDCWEST
Try naming your methods
public String getLastname()
and
public void setLastname()

Regards,

Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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



[OT] Session & Context attributes in distributed env [WAS: RE: [OT]Servlet Context/Static Fields]

2003-08-19 Thread Andrew Hill
Thanks Craig,

I can see that there is a lot I still have to learn about this area.

Where (other than the spec itself which should of course be my first stop)
would be a good place to get info on these things?

Its quite alarming to think that if you set a session attribute it might not
be available when you process the next request, and if one sets a whole lot
of stuff if the context (including the struts config objects) that they
might only be available on the machine that created them! hehe Im obviously
not grokking this at all.

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Monday, 18 August 2003 23:50
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: [OT]Servlet Context/Static Fields


On Mon, 18 Aug 2003, Andrew Hill wrote:

> Date: Mon, 18 Aug 2003 17:12:34 +0800
> From: Andrew Hill <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED]
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: [OT]Servlet Context/Static Fields
>
> If your in a distributed environment changes you make to properties of
those
> static classes will not be propogated to other JVMS (or indeed other
> classloaders), whereas the stuff in ServletContext should be (though Id
love
> to hear an explanation of how it knows when to do it!).
>

Propogation in a distributed app server is actually only guaranteed (in
the J2EE specs) for *HttpSession* attributes, not *ServletContext*
attributes.  It's certainly possible for a server to offer replication of
context attributes as well, but you can't rely on that to be portable.

The strategy for knowing when to replicate session attributes (and it
would probably apply to context attributes as well) is typically a
configuration option in a server-specfic deployment descriptor.  One could
imagine doing it on a timed basis, or whenever setAttribute() is called
again, or having some out-of-band method of signalling the server that
this attribute has been modified.

Craig


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



RE: Should extend any struts components ?

2003-08-19 Thread Andrew Hill
The PlugIn support (in struts 1.1 but not 1.0.2) is also very useful for
this type of thing.

Ive extended the RequestProcessor to do a few application specific things,
and the ActionMappings to take some app specific properties, but in general
there isnt a need to extend most things unless you have a specific reason to
do so.

-Original Message-
From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]
Sent: Monday, 18 August 2003 18:37
To: 'Struts Users Mailing List'
Subject: RE: Should extend any struts components ?



  We needed a sub-class of ActionServlet to set up our JMS subscribers. We
couldn't find  a way to set it up at container start up ( OC4J ). So we had
to extend it to set up everything when the ActionServlet is called in its
init() method. That is our use case.
Mohan

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 10:40 AM
To: Struts Users Mailing List
Subject: Should extend any struts components ?


While developing the J2EE application using struts, should I extend the
ActionServlet, RequestProcessor etc... classes to make them my project
specific?

If yes, which components and what are the advantages one can get?


-Original Message-
From: Robert Leland [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 9:39 AM
To: [EMAIL PROTECTED]
Subject: [Validator] The Validator Wiki needs you !

There is now a Commons Validator Wiki !

Beware this is only a shell to start collecting tips, FAQs, and examples
for using validator. You can make a much needed contribution !

http://nagoya.apache.org/wiki/apachewiki.cgi?ValidatorProjectPages


This is also great opportunity to delete all those old emails you have
been saving !
Come on, there must be hundreds,  and put them on the web !

Then they are instantly available from any web browser:
* At work,
  Your Desk
  Your Co-worker's Desk
* At home
* At a remote site
* Even from that better paying job you have been waiting for !
   No emailing yourself hundreds of emails, just give your Notice ! ;-)

We really do need you !

--
Robert Leland   [EMAIL PROTECTED]
--
Java, J2EE, Struts, Web Application Development

804 N. Kenmore Street   +01-703-525-3580
Arlington VA 22201



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


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



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



Re: [OT] Tree Stucture in STRUTS

2003-08-19 Thread atta-ur rehman
Thanks, Ashok.

I just downloaded the example app added struts stuff to it and got:

java.lang.NoClassDefFoundError: org/apache/struts/taglib/logic/EmptyTag
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at
com.newatlanta.servletexec.ApplClassLoader.loadArchiveClass(ApplClassLoader.
java:363)
at
com.newatlanta.servletexec.ApplClassLoader.loadLibFolderClass(ApplClassLoade
r.java:290)
at
com.newatlanta.servletexec.ApplClassLoader.loadClass(ApplClassLoader.java:44
6)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at
com.newatlanta.servletexec.JSP10DirectiveTag.parseTag(JSP10DirectiveTag.java
:1412)
at
com.newatlanta.servletexec.JSP10DirectiveTag.processTLD(JSP10DirectiveTag.ja
va:1001)
at
com.newatlanta.servletexec.JSP10DirectiveTag.processTagLibDirective(JSP10Dir
ectiveTag.java:755)
at
com.newatlanta.servletexec.JSP10DirectiveTag.parse(JSP10DirectiveTag.java:18
0)
at
com.newatlanta.servletexec.JSP10Servlet.parseFile(JSP10Servlet.java:1380)
at
com.newatlanta.servletexec.JSP10Servlet.createFile(JSP10Servlet.java:1861)
at
com.newatlanta.servletexec.JSP10Servlet.getNewServlet(JSP10Servlet.java:1075
)
at
com.newatlanta.servletexec.JSP10Servlet.getServlet(JSP10Servlet.java:915)
at
com.newatlanta.servletexec.JSP10Servlet.getServlet(JSP10Servlet.java:858)
at com.newatlanta.servletexec.JSP10Servlet.service(JSP10Servlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1
679)
at
com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispa
tcher.java:274)
at
com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j
ava:191)
at
com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInf
o.java:1390)
at
com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo.
java:1243)
at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1235)
at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113)
any thoughts!ATTA- Original Message - 
From: "Ashok Madhavan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 4:25 PM
Subject: Re: [OT] Tree Stucture in STRUTS


> hi,
> see this url
> http://www.keyboardmonkey.com/pilotlight/index.jsp
>
> Aaron Bates, the Tree-Man has a wonderful site which
> explains how to build a nice tree using nested tags.
>
> Thanks a lot Aaron. you have saved my life more than
> once.
>
> regards
> Ashok
>
> --- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > hi all,
> >
> > excuse me if this sounds off topic!
> >
> > can somebody please point to some references on how
> > to incorporate a
> > dynamically built tree-like structure in a struts
> > app? can struts-menu be
> > used for this purpose? any other suggestions?
> >
> > thanks.
> >
> > ATTA
> >
> >
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Defining inheritance for dynamic action forms in struts-config

2003-08-19 Thread Andrew van der Voort
We have recently upgraded to Struts 1.1 and are exploring the new features.
I have dynamic action forms and validator working.

Many of our forms have several attributes in common. In struts 1.0.x we
defined a class inheriting from ActionForm (MainActionForm), defined those
attributes in it, and extended our ActionForms from MainActionForm.

With dynamic forms there is no base class. It is all defined in
struts-config. Can I defined anything in struts-config and have all the
relevant dynamic forms refer to, or include that base definition?

I know I could define a MainDynaActionForm and add the relevant attributes
to the hashmap at construction and initialisation time, but then its no
longer dynamic as I'd have to change code to add or remove one of the
common attributes.

Can I do what I'm describing above?

Thanks

Andrew

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



Re: [OT] Tree Stucture in STRUTS

2003-08-19 Thread Ashok Madhavan
hi,
see this url
http://www.keyboardmonkey.com/pilotlight/index.jsp

Aaron Bates, the Tree-Man has a wonderful site which
explains how to build a nice tree using nested tags.

Thanks a lot Aaron. you have saved my life more than
once.

regards
Ashok

--- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> hi all,
> 
> excuse me if this sounds off topic!
> 
> can somebody please point to some references on how
> to incorporate a
> dynamically built tree-like structure in a struts
> app? can struts-menu be
> used for this purpose? any other suggestions?
> 
> thanks.
> 
> ATTA
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


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



RE: no getter method found

2003-08-19 Thread Kevin Bootz
All,
This is the "source code" that is being referenced and it is correct.
You may have a typo elsewhere in your code ?  Are you sure you've set the
environment per the tutorial instructions ?

http://javaboutique.internet.com/tutorials/Struts/



-Original Message-
From: Paananen, Tero [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 2:35 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


> Last Name: 
>
> and this in my ActionForm subclass
>
> private String lastName = null;
>
>   public String getlastname(){
>  return this.lastName;
>   }
>
>   public void setlastname( String lastName){
>  this.lastName = lastName;
>   }

getLastname()
setLastname()

-TPP

-
This email may contain confidential and privileged material for the sole use
of the intended recipient(s). Any review, use, retention, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact the
sender by reply email and delete all copies of this message.  Also, email is
susceptible to data corruption, interception, tampering, unauthorized
amendment and viruses. We only send and receive emails on the basis that we
are not liable for any such corruption, interception, tampering, amendment
or viruses or any consequence thereof.


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




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



RE: Session expired

2003-08-19 Thread Craig R. McClanahan
On Tue, 19 Aug 2003, Filip Polsakiewicz wrote:

> Date: Tue, 19 Aug 2003 14:12:40 +0200
> From: Filip Polsakiewicz <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: Session expired
>
> My problem is, that I already have something around 60 jsps. Now it would be
> nice to have a workaround so that i don't have to adapt all my jsps and
> actions.
>

If you have followed the recommended Struts design practice of flowing
*all* requests through the controller servlet, then it's really easy to do
this -- subclass RequestProcessor and override one of the processXxx
methods to perform this check for you.

If you have direct hyperlinks to JSP pages, then you can use a Filter if
you're on a Servlet 2.3 or later container; otherwise, you're stuck having
to modify your 60 pages.  If you have to modify things anyway, you're
strongly encouraged to follow the recommended design pattern and flow
things through the controller, so you can do things like this in one
place.

Craig

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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Craig R. McClanahan
On Tue, 19 Aug 2003, Jan Zimmek wrote:

> Date: Tue, 19 Aug 2003 10:17:09 +0200
> From: Jan Zimmek <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: [OT] Question about Servlets & Threads
>
> Hi,
>
> I think you're right, but let me ask a last question please ;-)
>
> here are some source snippets of my classes:
>
> MyServlet (which handles all incoming requests like ActionServlet in struts
> and populates Request/Response and the action to execute to the new created
> WebThread):
> -
> protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException{
> process(arg0, arg1);
> }
>
> protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException{
> process(arg0, arg1);
> }
>
> protected void process(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException{
> WebThread t = new WebThread(request, response, new WebAction());
>
> t.start();
>
> while(t.isAlive());
>
> t.release();
> t = null;
> }
>
> You see all processing is of the request will be done in the "run()" method
> of the new created WebThread instance.
>
> And this is the point why I am not understand, that I can run into complex
> threading issues.
>

Not surprising.  The servlet spec says that request and response objects
are only valid in the thread handed to you by the container.  It's also
totally unclear why you're even bothering, since the container gives you a
thread per request already; but I'm sure there must be a reason.

> Snippet of a WebAction-Object (this is always thread-safe like a struts
> action):
> 
> ---
>
> public void execute(){
> HttpServletResponse response = Globals.response();
>
> try{
> response.getWriter().write("");
> }catch(IOException e){
> e.printStackTrace();
> }
> }
>
>
> And this is the Globals-Object source:
> --
>
> public class Globals{
> private static WebThread current(){
> return (WebThread)Thread.currentThread();
> }
>
> public static HttpServletRequest request(){
> return current().getRequest();
> }
>
> public static HttpServletResponse response(){
> return current().getResponse();
> }
> }
>
> The Globals-class simply returns the Request/Response-Object of the current
> WebThread (subclass of Thread) via "getter"-methods.
> I have tested MyServlet by making multiple concurrent request by an
> application (running 10 thread each making 1000 requests in a loop).
> Each request has been processed correctly.
>
> Hope this message is not so long that you directly drop, because I am very
> occupied with this subject.
>
> Any comments would be very appreciated.
>
> greets
> Jan Zimmek
>

Craig

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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Craig R. McClanahan
On Tue, 19 Aug 2003, Jan Zimmek wrote:

>
> -> "Perhaps you can describe what you are doing in this thread"
>
> The Thread is simply needed, so that the Globals class can return the
> current Request/Response-Object at any time and anywhere within the rest of
> my source, without passing them as parameter.
>

If that's all you want, you do ***not*** need a separate Thread.  All you
need is a ThreadLocal in a static variable:

  public class CurrentObjects {

private static ThreadLocal requests;
private static ThreadLocal responses;

public static void setObjects(HttpServletRequest request,
  HttpServletResponse response) {
  requests.set(request);
  responses.set(response);
}

public static HttpServletRequest getRequest() {
  return ((HttpServletRequest) requests.get();
}

public static HttpServetResponse getResponse() {
  return ((HttpServletResponse) responses.get();
}

  }

Make sure that CurrentObjects.setObjects() is called somewhere early in
the processing of each request (on a Servlet 2.3 container, a Filter makes
sense).  Now, anywhere in your code that you need the current objects,
just say:

  HttpServletRequest request = CurrentObjects.getRequest();
  HttpServletResponse response = CurrentObjects.getResponse();

and you get back the instances for the current thread.

Of course, you're still going to suffer the maintainability problems that
happen with global variables -- there is a reason that object oriented
developers pass things around explicitly :-) -- but you're trying to work
way too hard to accomplish your goal.
>
> What are your opinions about "complex threading issues" mentioned by David ?
>
>
> In the near future we want to port our PHP-driven framework/cms (which has
> been proven in development and production) to JAVA. So I am looking for the
> fastest possible way to do this, without developing anything new from the
> scratch.
>
>

Using your own threads, in the manner you described, is going to be fatal
to the portability of your code (because it breaks the servlet spec), and
also will needlessly harm your performance.  Use ThreadLocal instead,
which does exactly what you need.

For more info, see the Javadocs on java.lang.ThreadLocal.

Craig McClanahan

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



Re: Struts and Jetspeed

2003-08-19 Thread Alex
Mike,

Is there specific portlet available for wrapping existing Struts 
application in Jetspeed framework?  HTML portlet, WebPagePortlet, 
ServletProxyPortlet, WebBrowserPortlet or any other suggestions?

Session information is missing after porting existing Struts application 
to JetSpeed portlet.

Thanks,
Alex
Mainguy, Mike wrote:
I'll agree, if you're already using Turbine, then struts is really a waste
of time and effort.  Just use the turbine framework (it's more complete
anyway IMHO).  

If you really want to use struts for portlets, I'd recommend using struts in
a different servlet context and then wrapping it in a portlet so you don't
end up with a confused mish-mash of technologies.


-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 31, 2003 9:49 AM
To: Struts Users Mailing List
Subject: Re: Struts and Jetspeed

At 22:22 -0600 7/30/03, jakarta-lists wrote:

  Has anyone successfully use Struts with Jetspeed?  I'm looking 
into the possiblilty of having jetspeed do the authentication, 
templating and layout.. while struts will handle the control of the 
app. It sounds like a good idea to me, but I haven't worked with 
struts enough yet to know for sure and I would like to know about 
pitfalls if any.


It doesn't sound like there's much left for Struts to do once you use 
Jetspeed (or Turbine, its underlying framework) for authentication, 
templating, and layout.

Once you're talking about providing content to individual portlets in 
your Jetspeed installation, you can do it with much less work than 
adding Struts in to the mix.

Joe



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


Re: [OT] Question about Servlets & Threads

2003-08-19 Thread David Graham
> 
> In the near future we want to port our PHP-driven framework/cms (which
> has
> been proven in development and production) to JAVA. So I am looking for
> the
> fastest possible way to do this, without developing anything new from
> the
> scratch.

It sounds like you're not using Struts but are trying to come up with
functionality similar to it.  Is this not the slowest way possible to port
an app to what is essentially a Struts type framework?  It's not clear why
you're planning a more complicated approach with threads running all over
the place and replicating Struts features instead of just using the real
thing.

David

> 
> 
> 
> 
> - Original Message - 
> From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 5:41 PM
> Subject: RE: [OT] Question about Servlets & Threads
> 
> 
> > Jan,
> > How long does your thread take to run? Since you are waiting for the
> thread
> > to finish anyway in your servlet, I'm not sure it is very necessary to
> start
> > a new thread to process the request. It adds a bit of overhead to
> process
> > each request since an extra thread is created for every request that
> gets
> > processed. If this is really necessary, then you also might look into
> using
> > a thread pool. I don't see the need for the new thread. Perhaps you
> can
> > describe what you are doing in this thread. As I suggested in my
> previous
> > email, you could use a utility class as an interface between your
> servlet
> > and your business logic or just handle everything in methods in your
> > servlet.
> >
> > One more thing suggestion is to name your parameters with mor
> descriptive
> > names. ie. change this
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse
> arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > to
> >
> > protected void doGet(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException{
> > process(request, response);
> > }
> >
> > (you could also use req and resp instead of request and response)
> >
> > Regards,
> >
> > Richard
> >
> > -Original Message-
> > From: Jan Zimmek [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 19, 2003 1:17 AM
> > To: Struts Users Mailing List
> > Subject: Re: [OT] Question about Servlets & Threads
> >
> >
> > Hi,
> >
> > I think you're right, but let me ask a last question please ;-)
> >
> > here are some source snippets of my classes:
> >
> > MyServlet (which handles all incoming requests like ActionServlet in
> struts
> > and populates Request/Response and the action to execute to the new
> created
> > WebThread):
> > -
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse
> arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > protected void doPost(HttpServletRequest arg0, HttpServletResponse
> arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > protected void process(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException{
> > WebThread t = new WebThread(request, response, new WebAction());
> >
> > t.start();
> >
> > while(t.isAlive());
> >
> > t.release();
> > t = null;
> > }
> >
> > You see all processing is of the request will be done in the "run()"
> method
> > of the new created WebThread instance.
> >
> > And this is the point why I am not understand, that I can run into
> complex
> > threading issues.
> >
> > Snippet of a WebAction-Object (this is always thread-safe like a
> struts
> > action):
> >
>
--
> --
> > ---
> >
> > public void execute(){
> > HttpServletResponse response = Globals.response();
> >
> > try{
> > response.getWriter().write("");
> > }catch(IOException e){
> > e.printStackTrace();
> > }
> > }
> >
> >
> > And this is the Globals-Object source:
> > --
> >
> > public class Globals{
> > private static WebThread current(){
> > return (WebThread)Thread.currentThread();
> > }
> >
> > public static HttpServletRequest request(){
> > return current().getRequest();
> > }
> >
> > public static HttpServletResponse response(){
> > return current().getResponse();
> > }
> > }
> >
> > The Globals-class simply returns the Request/Response-Object of the
> current
> > WebThread (subclass of Thread) via "getter"-methods. I have tested
> MyServlet
> > by making multiple concurrent request by an application (running 10
> thread
> > each making 1000 requests in a loop). Each request has been processed
> > correctly.
> >
> > Hope this message is not so long that you directly drop, because I am
> very
> > occupied with this subject.
> >
> > Any comments w

Re: [OT] get abs path to my web application root context

2003-08-19 Thread Alen Ribic
Thank you all for helpful replies.
I went around using the getRealPath(...) method of ServletContext
successfully.
Originally when I tried this out, null was returned as a result of the above
method execution.
The problem was that I deployed my Struts application in an archived format
MyApp.war on a JBoss server.
I'm not an JBoss expert, but it seemed that my application was running from
within the war archive and the getRealPath(...) method doesn't like that
hence returns null.
I just extracted my war file to MyApp.war directory and that sorted the
problem out.

--Alen


- Original Message -
From: "Claire Suttle" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 10:14 PM
Subject: Re: [OT] get abs path to my web application root context


If you want to get the absolute path from within a Form or Action class,
use:
ServletContext serv = servlet.getServletContext();

String realPath = serv.getRealPath(filepath);

filepath is the relative path from the root i.e. /images/items/path or
/images/items/path/filename.gif

You have inplicit access to servlet, so using these two lines and importing
javax.servlet.ServletContext should be all you need to do.

Claire

--- In [EMAIL PROTECTED], Emerson Cargnin <[EMAIL PROTECTED]> wrote:
> Servlet method :
>   getServletContext().getRealPath("/")
> request has getRealPath, but is depracated.
>
> Don't know how to get this inside an action (besides using the
> depracated method).maybe getting it at init servlet method and saving it
> under application context. Any other ideas...
>
>
> Alen Ribic wrote:
> > Hi All
> >
> > This may be a bit of a silly and of topic question but this is driving
me up
> > the wall. ;)
> > I would like to save uploaded files to my application's
> > %app_root%/images/items/ path.
> > How do I get the absolute path to my web application's root directory?
> > e.g. "c:/tomcat/webapps/myapp_root/"
> >
> > Thanks
> >
> > --Alen
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Emerson Cargnin
> Analista de Sistemas
> Setor de Desenvolvimento de Sistemas - TRE-SC
> tel : (048) - 251-3700 - Ramal 3181
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]





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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Jan Zimmek
Hi,

-> "How long does your thread take to run?"

the thread will internally invoke a WebAction passed as
constructor-parameter, which will do things like a Struts-Action (if the
processing of the WebAction takes a long time, the thread takes a long time
too, but this will be very unusual).

-> "If this is really necessary, then you also might look into using a
thread pool."

First I tried to use a ThreadPool mechanism, but I didn't find a way to
restart a Thread after it has been finished, so a pool would be useless.


-> "Perhaps you can describe what you are doing in this thread"

The Thread is simply needed, so that the Globals class can return the
current Request/Response-Object at any time and anywhere within the rest of
my source, without passing them as parameter.


What are your opinions about "complex threading issues" mentioned by David ?


In the near future we want to port our PHP-driven framework/cms (which has
been proven in development and production) to JAVA. So I am looking for the
fastest possible way to do this, without developing anything new from the
scratch.




- Original Message - 
From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 5:41 PM
Subject: RE: [OT] Question about Servlets & Threads


> Jan,
> How long does your thread take to run? Since you are waiting for the
thread
> to finish anyway in your servlet, I'm not sure it is very necessary to
start
> a new thread to process the request. It adds a bit of overhead to process
> each request since an extra thread is created for every request that gets
> processed. If this is really necessary, then you also might look into
using
> a thread pool. I don't see the need for the new thread. Perhaps you can
> describe what you are doing in this thread. As I suggested in my previous
> email, you could use a utility class as an interface between your servlet
> and your business logic or just handle everything in methods in your
> servlet.
>
> One more thing suggestion is to name your parameters with mor descriptive
> names. ie. change this
> protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException{
> process(arg0, arg1);
> }
>
> to
>
> protected void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException{
> process(request, response);
> }
>
> (you could also use req and resp instead of request and response)
>
> Regards,
>
> Richard
>
> -Original Message-
> From: Jan Zimmek [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 19, 2003 1:17 AM
> To: Struts Users Mailing List
> Subject: Re: [OT] Question about Servlets & Threads
>
>
> Hi,
>
> I think you're right, but let me ask a last question please ;-)
>
> here are some source snippets of my classes:
>
> MyServlet (which handles all incoming requests like ActionServlet in
struts
> and populates Request/Response and the action to execute to the new
created
> WebThread):
> -
> protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException{
> process(arg0, arg1);
> }
>
> protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException{
> process(arg0, arg1);
> }
>
> protected void process(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException{
> WebThread t = new WebThread(request, response, new WebAction());
>
> t.start();
>
> while(t.isAlive());
>
> t.release();
> t = null;
> }
>
> You see all processing is of the request will be done in the "run()"
method
> of the new created WebThread instance.
>
> And this is the point why I am not understand, that I can run into complex
> threading issues.
>
> Snippet of a WebAction-Object (this is always thread-safe like a struts
> action):
> --
--
> ---
>
> public void execute(){
> HttpServletResponse response = Globals.response();
>
> try{
> response.getWriter().write("");
> }catch(IOException e){
> e.printStackTrace();
> }
> }
>
>
> And this is the Globals-Object source:
> --
>
> public class Globals{
> private static WebThread current(){
> return (WebThread)Thread.currentThread();
> }
>
> public static HttpServletRequest request(){
> return current().getRequest();
> }
>
> public static HttpServletResponse response(){
> return current().getResponse();
> }
> }
>
> The Globals-class simply returns the Request/Response-Object of the
current
> WebThread (subclass of Thread) via "getter"-methods. I have tested
MyServlet
> by making multiple concurrent request by an application (running 10 thread
> each making 1000 requests in a loop). Each request has

RE: Exception if no form in my action mapping - why?

2003-08-19 Thread Ditlinger, Steve

If an action is used in a form tag, it is expected that it has a form
attribute defined for it. Otherwise, Struts does not know where to put the
data posted from the form.  In your case, you don't have much of a form or
need to store posted data.  You could redefine as a link rather than a form.

Steve

 -Original Message-
 From: David Thielen [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 19, 2003 8:47 AM
 To: Struts-Users
 Subject: Exception if no form in my action mapping - why?
 
 
 Hi;
 
 When I set an action mapping as this (no form):
 
 
 
 
 It threw an exception. When I added a from like this:
 
 
 
 
 It worked. Any ideas?
 
 In my .jsp I have:
 
 
 
 
 thanks - dave
 


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



2 Jsp's and 1 form bean using tiles !!!! URGENT HELP

2003-08-19 Thread Zhou, Qin (Eric)


I have the same problem Samip described below. The question posted in this list last 
year. Nobody replied it. Can you give me some idea on this question. Thanks. 



Hi Guys, I am using struts and tiles in my project. Here is my problem. I need to put 
2 JSP's in the body of one definition of tiles. My definition looks like below: 
 
 
 

  
 
 
I am using same form bean for both the JSP's. Now the problem is whenever I submit the 
form from the second JSP i.e. "limitsAdd.jsp in above definition", form bean is not 
getting populated. How can we resolve this problem? Does tiles support this 
functionality? Any help will be appreciated. Thanks Samip. 





Eric (Qin) Zhou



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



[OT] Tree Stucture in STRUTS

2003-08-19 Thread atta-ur rehman
hi all,

excuse me if this sounds off topic!

can somebody please point to some references on how to incorporate a
dynamically built tree-like structure in a struts app? can struts-menu be
used for this purpose? any other suggestions?

thanks.

ATTA




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



Re: exception in actionfrom class.

2003-08-19 Thread Jing Zhou
Probably you misunderstood my statements or misunderstood
the capability of the common-beanutils package.

If someone designs a form bean with a non-string property,
say, the contactid as native int property. The common-beanutils
package would not be able to cache the conversion error and
then  re-display the user's original input, if that input is
a invalid integer, say 123A.

More troubles arise when the JSP page has a lot of fields, say,
20 fields, for example, if the contactid get a conversion error
at the very beginning, then the whole form bean would not be
populated appropriately. The user's inputs are wiped out.

It is a well known issue of the ActionForm at the moment.
And it should be addressed in the future Struts releases.

Please be specific and remain context relevant.

Jing


- Original Message - 
From: "Mark Galbreath" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>; "'Jing
Zhou'" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 3:24 PM
Subject: RE: exception in actionfrom class.


Your first statement is not true and this is a shameless marketing plug for
your project.

Mark

-Original Message-
From: Jing Zhou [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 2:06 PM
To: Struts Users Mailing List
Subject: Re: exception in actionfrom class.


The current Struts 1.1 allows you to design form beans (instances of
ActionForm)
using only String properties. This because the common-beanutils package is
not able to cache conversion exceptions and re-display original user's
inputs.

You are responsible to validate the string properties (using whatever
validation
methods) and then invoke the copyProperties() method in the common-beanutils
package to copy and/or convert the string properties to your domain objects,
for example, your ContactInfo objects.

If you really want to catch the conversion exceptions and display them to
screen, check the HyperFormBean class at http://www.netspread.com The hyper
form bean is also an extension of the ActionForm class. But it supports 12
standard types and one custom property interface. It can cache any
conversion exceptions and is able to display original user's inputs in case
of any errors.

The form bean model improves the Struts action form in the following ways:
1) Standard and custom property types are supported. It fits into
the common-beanutils package smoothly.
2) Type conversions are performed only one time. (Struts may need one or
more times to perform type conversions, one in the copyProperties()
method
and another possible one in the validation methods)
3) Reduce the usage of reflection. Therefore it gives higher performance.
4) Tools can be designed for designers to compose such form bean model.
Carrier has a form bean model composer tab pane where designers could
compose whatever form bean model they like, including nested ones.
5) The reset method in the form bean model is view agnostic. You never need
to re-write the reset method anymore, anywhere, even if you change
your web forms.
6) The validate method in the form bean model is also view agnostic. You
could
attach built-in or custom validation rules in addition to the required
and
data type conversion rules. You do not need to re-write the validate
method
even if you change your web forms in the form bean model.
7) The concept of the runtime property name is a very interesting one, I
believe.
The runtime property path to a nested property of the hyper form bean
could
be automatically adapted as needed.
8) The hyper form bean can be persisted and restored systematically. The
default
persistence mechanism implemented in Carrier allows you to prototype web
applications without writing custom codes. It includes CRUD operations
on
nested form beans.

The algorithm that simultaneously achieve above 8 goals is called Wheels. It
is so simple just like a wheel - nothing less and nothing more. If it is
proved to be right, I wish it could be contributed back to Struts as a
contribution package with necessary adaptations for more general
requirements. After all, it is an algorithm built on the shoulders of the
Struts team :-) So we publish the full source codes of Wheels for public
viewers.

Jing
Netspread Carrier
http://www.netspread.com


- Original Message - 
From: "deepaksawdekar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 5:08 AM
Subject: exception in actionfrom class.


I am using the containment design patter for the ActionForm.
My action form will look like this.

public final class ContactForm extends ActionForm {
private ContactInfo contactInfo;

public int getContactid() {
return contactInfo.getContactId();
}

public void setContactid(int ContactId) {
this.contactInfo.setContactId(ContactId);
}

public String getTitle() {
return contactInfo.getContactPersInfo().getNameInfo().getTitle();
}

public void setTit

Re: "attribute" and "name" attributes of ActionMapping

2003-08-19 Thread Emerson Cargnin
> If you use mapping.getName() all the time, you're stuck with storing the
> form bean only under the form bean's name.  That may or may not be a big
> deal to your current app, but I'd suggest using getAttribute() instead to
> protect yourself against future changes (such as, for example, having
> multiple actions that want to use the same form bean in session 
scope, but
> under different attribute names).

thanks craig, now I got it : ) the docs are not very clear regard to 
parameter use. The "Structs in Action" explain it as you did (just found 
it now:)).

Craig R. McClanahan wrote:
On Mon, 18 Aug 2003, Emerson Cargnin wrote:


Date: Mon, 18 Aug 2003 19:10:57 -0300
From: Emerson Cargnin <[EMAIL PROTECTED]>
Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: "attribute" and "name" attributes of ActionMapping
In the struts-example application, the LogonAction uses the "attribute"
attribute to read or delete the formBean
eg : session.removeAttribute(mapping.getAttribute());

If "attribute" is not used (just the name), is it possible to use the
same approache? is it a good technic?


If you look at the implementation of the getAttribute() method in
ActionForm, you'll see that it uses the form name if you don't explicitly
reference something else.  Therefore, using getAttribute() instead of
getName() gives you the *option* to store the form bean under an attribute
different than the form bean name, without having to worry about whether
or not a particular Action really uses this.
If you use mapping.getName() all the time, you're stuck with storing the
form bean only under the form bean's name.  That may or may not be a big
deal to your current app, but I'd suggest using getAttribute() instead to
protect yourself against future changes (such as, for example, having
multiple actions that want to use the same form bean in session scope, but
under different attribute names).
Craig

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



--
Emerson Cargnin
Analista de Sistemas
Setor de Desenvolvimento de Sistemas - TRE-SC
tel : (048) - 251-3700 - Ramal 3181
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


problem with nested tags and form bean

2003-08-19 Thread Juan Alvarado
I have the following scenarion.

A form bean with a private member:
private LineItem item = null;

with appropriate getters and setters.

In one of my actions I call setItem and obviously pass
it a LineItem object.

LineItem is composed of:
private Product product;
private int quantity;
private String productKey;

Again with appropriate getters/setters

In a JSP I am trying to access the properties of
LineItem 
with the following tag:


and I keep on getting:
 [ServletException
in:/jsps/shop/productDetailsPage.jsp] Null property
value for 'item''

I also tried with:

and in this case nothing printed.

I know the form bean is in scope because I tried this:
<%
AddToCartForm form =
(AddToCartForm)session.getAttribute("addto.cart.form");
if( form == null ){
out.println("The form is null");
}
else{
out.println("The form is not null");
LineItem item = form.getItem();
out.println(item.getQuantity() );
}
%>
and the quantity property printed out this time.

If anyone can point me to a solution to this I'd
appreciate it.

Thanks

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Exception if no form in my action mapping - why?

2003-08-19 Thread David Thielen
Hi;

When I set an action mapping as this (no form):




It threw an exception. When I added a from like this:




It worked. Any ideas?

In my .jsp I have:




thanks - dave


RE: adding a parameter to html:link with a map

2003-08-19 Thread Mike Whittaker

>I want to be able to add a literal parameter to a link
>
>but I already successfully use 
>this adds a Map of parameters, but I'd like to be able to add further
>parameters literally (ie not from a bean).
>
>Is there any way I can achieve this, by struts or jstl or anything!?
>

Okay I can do this:


Printer page


seems a bit of a kludge, be nice to just specify an addition rather than put
in and take it out of the map.

--
Mike W


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



Re: list Map iby c:forEach

2003-08-19 Thread Jiri Chaloupka
Thank you, it works now ...
Jiri
Mark Lowe wrote:




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


RE: Why would I want to use the ActionForm validate() method

2003-08-19 Thread David Graham
--- "Mainguy, Mike" <[EMAIL PROTECTED]> wrote:
> The short answer is, you cannot always depend on javascript.  There is a
> small percentage (Probably less than 1% I would expect) of users who
> either
> disable javascript or don't have it in their browser (e.g. lynx).  

Don't forget the hackers that don't use a browser at all.  It's trivial to
write a program that submits a web form and bypass all of the javascript. 
They can enter any data they like without proper server side validations.

David

> In
> these
> cases you will have no validation.  Also there are differences between
> how
> each browser handles the DOM and javascript in general.
> 
> -Original Message-
> From: Madhu Nair [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, August 19, 2003 2:33 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Why would I want to use the ActionForm validate() method
> 
> 
> Hi,
> 
>  Why would I want to use the Struts ActionForm validate() method when I
> can
>  achieve the same functionality using Javascript? I assume that the user
> would never disable javascript.
> 
>  Regards ,
>  Madhu
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> This message and its contents (to include attachments) are the property
> of Kmart Corporation (Kmart) and may contain confidential and
> proprietary information. You are hereby notified that any disclosure,
> copying, or distribution of this message, or the taking of any action
> based on information contained herein is strictly prohibited.
> Unauthorized use of information contained herein may subject you to
> civil and criminal prosecution and penalties. If you are not the
> intended recipient, you should delete this message immediately.
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: exception in actionfrom class.

2003-08-19 Thread Mark Galbreath
Your first statement is not true and this is a shameless marketing plug for
your project.

Mark

-Original Message-
From: Jing Zhou [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:06 PM
To: Struts Users Mailing List
Subject: Re: exception in actionfrom class.


The current Struts 1.1 allows you to design form beans (instances of
ActionForm)
using only String properties. This because the common-beanutils package is
not able to cache conversion exceptions and re-display original user's
inputs.

You are responsible to validate the string properties (using whatever
validation
methods) and then invoke the copyProperties() method in the common-beanutils
package to copy and/or convert the string properties to your domain objects,
for example, your ContactInfo objects.

If you really want to catch the conversion exceptions and display them to
screen, check the HyperFormBean class at http://www.netspread.com The hyper
form bean is also an extension of the ActionForm class. But it supports 12
standard types and one custom property interface. It can cache any
conversion exceptions and is able to display original user's inputs in case
of any errors.

The form bean model improves the Struts action form in the following ways:
1) Standard and custom property types are supported. It fits into
the common-beanutils package smoothly.
2) Type conversions are performed only one time. (Struts may need one or
more times to perform type conversions, one in the copyProperties()
method
and another possible one in the validation methods)
3) Reduce the usage of reflection. Therefore it gives higher performance.
4) Tools can be designed for designers to compose such form bean model.
Carrier has a form bean model composer tab pane where designers could
compose whatever form bean model they like, including nested ones.
5) The reset method in the form bean model is view agnostic. You never need
to re-write the reset method anymore, anywhere, even if you change
your web forms.
6) The validate method in the form bean model is also view agnostic. You
could
attach built-in or custom validation rules in addition to the required
and
data type conversion rules. You do not need to re-write the validate
method
even if you change your web forms in the form bean model.
7) The concept of the runtime property name is a very interesting one, I
believe.
The runtime property path to a nested property of the hyper form bean
could
be automatically adapted as needed.
8) The hyper form bean can be persisted and restored systematically. The
default
persistence mechanism implemented in Carrier allows you to prototype web
applications without writing custom codes. It includes CRUD operations
on
nested form beans.

The algorithm that simultaneously achieve above 8 goals is called Wheels. It
is so simple just like a wheel - nothing less and nothing more. If it is
proved to be right, I wish it could be contributed back to Struts as a
contribution package with necessary adaptations for more general
requirements. After all, it is an algorithm built on the shoulders of the
Struts team :-) So we publish the full source codes of Wheels for public
viewers.

Jing
Netspread Carrier
http://www.netspread.com


- Original Message - 
From: "deepaksawdekar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 5:08 AM
Subject: exception in actionfrom class.


I am using the containment design patter for the ActionForm.
My action form will look like this.

public final class ContactForm extends ActionForm {
private ContactInfo contactInfo;

public int getContactid() {
return contactInfo.getContactId();
}

public void setContactid(int ContactId) {
this.contactInfo.setContactId(ContactId);
}

public String getTitle() {
return contactInfo.getContactPersInfo().getNameInfo().getTitle();
}

public void setTitle(String Title) {
this.contactInfo.getContactPersInfo().getNameInfo().setTitle(Title);
}
.
.
.
.
.
}

the setter methods throughs some exception. Exceptions will be thrown if
there is some format validation error. I want to catch this exception and
would like to display them on the screen, how can i achive this.


Thanks and Regards
deepak

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



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



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



RE: comparators

2003-08-19 Thread Mark Galbreath
Parameter arguments are supplied at runtime; you cannot sort on a method
signature like you propose because the arguments do not exist yet and are
not part of the signature.

Mark

-Original Message-
From: Jagannayakam [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:13 PM
To: Struts Users Mailing List (E-mail)
Subject: comparators


Hi all , 


In a action class i have List of FormBeans. I want to have this formbean
sorted on one of its parameter say String name . 

I have a java comparator say NameComparator which implements comparator
interface so i implemented method compare(Object o1 , Object o2 ) to compare
the name attribute of formbean . 

Then I perform Collections.sort(list , nameComparatorObject )  
where NameComparator nameComparatorObject = new NameComparator();

But still the list of form beans are sorted by name. 

any suggestions ? 

Regards,
Jagan.


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



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



Re: Modules explaination...

2003-08-19 Thread Yann Cébron
There's a short paragraph on the Struts-website:

http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_modules

Yann




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



Re: Struts to EJB interface strategies

2003-08-19 Thread Keith Pemberton
Buy the Oreilly book on Struts.  There are some very good design principles
incorporated into this book using especially some of the J2EE design
patterns.

Keith
- Original Message - 
From: "yan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 7:49 AM
Subject: Struts to EJB interface strategies


Hi,

Firstly, can anyone recommend a good resource that deals with how you
integrate a Web Tier implemented using Struts with the EJB Tier. And also a
resource that has an excellent example of how the Struts framework interacts
with J2EE. I am
looking for more than the basic examples you normally find as they do not
help given the complexity of the application I am working on.

Secondly, what strategies does one use when deciding on how to implement the
ActionClass to Session Bean Inteface?

I am thinking along these lines:
Create a 'Client Helper Interface' that defines all the business methods
that your application will require.  This Helper class will form the
interface between the ActionClasses and the Session Beans.

The ActionClass creates a 'Client Helper Interface' object and calls the
relevant methods within this interface.  The Client Interface then creates a
Session Bean that implements the Client Interface.

The Session Bean creates the Entity Bean that opens the database connection
and returns the relevant data back to the Session Bean.  The Session Bean
returns the required information back to the Client Helper Interface.  The
Client Helper Interface returns to the ActionClass

Should you have a separate Helper Interface for each Session Bean?

many thanks
yan

KickStartESolutions - Intelligent Web Services
[EMAIL PROTECTED]



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



RE: no getter method found

2003-08-19 Thread Jimmy Emmanual
try:

Last Name: 

where the "N" in "name" is cap.

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 2:34 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


Actually, my last email was wrong, they should be:
public String getLastName()
and
public void setLastName();

-Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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

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



RE: [OT] Question about Servlets & Threads

2003-08-19 Thread Yee, Richard K,,DMDCWEST
Jan,
You shouldn't have any threading issues other than the fact that you are
creating an extra thread to service each request when you don't have to.
Essentially, your code is sequential so you don't need to create a new
thread. You could do the same thing with a class like this one:

public class MyWrapper {
private HttpServletRequest request;
private HttpServletResponse response;

MyWrapper(HttpServletRequest req, HttpServletResponse resp) {
request = req;
response = resp;
}

public void doWork() {
/* put code here to call class methods that can access the request
and response member variables */
}

/* implement methods that access the request and response instance vars. */
}

In your servlet's process method just do the following:
protected void process(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException{
 MyWrapper foo = new MyWrapper(request, response);
 foo.doWork();
}

Regards,

Richard

-Original Message-
From: Jan Zimmek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 12:37 PM
To: Struts Users Mailing List
Subject: Re: [OT] Question about Servlets & Threads



- Original Message - 
From: "Jan Zimmek" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 9:02 PM
Subject: Re: [OT] Question about Servlets & Threads


> Hi,
>
> -> "How long does your thread take to run?"
>
> the thread will internally invoke a WebAction passed as 
> constructor-parameter, which will do things like a Struts-Action (if 
> the processing of the WebAction takes a long time, the thread takes a 
> long
time
> too, but this will be very unusual).
>
> -> "If this is really necessary, then you also might look into using a
> thread pool."
>
> First I tried to use a ThreadPool mechanism, but I didn't find a way 
> to restart a Thread after it has been finished, so a pool would be 
> useless.
>
>
> -> "Perhaps you can describe what you are doing in this thread"
>
> The Thread is simply needed, so that the Globals class can return the 
> current Request/Response-Object at any time and anywhere within the 
> rest
of
> my source, without passing them as parameter.
>
>
> What are your opinions about "complex threading issues" mentioned by 
> David
?
>
>
> In the near future we want to port our PHP-driven framework/cms (which 
> has been proven in development and production) to JAVA. So I am 
> looking for
the
> fastest possible way to do this, without developing anything new from 
> the scratch.
>
>
>
>
> - Original Message -
> From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 5:41 PM
> Subject: RE: [OT] Question about Servlets & Threads
>
>
> > Jan,
> > How long does your thread take to run? Since you are waiting for the
> thread
> > to finish anyway in your servlet, I'm not sure it is very necessary 
> > to
> start
> > a new thread to process the request. It adds a bit of overhead to
process
> > each request since an extra thread is created for every request that
gets
> > processed. If this is really necessary, then you also might look 
> > into
> using
> > a thread pool. I don't see the need for the new thread. Perhaps you 
> > can describe what you are doing in this thread. As I suggested in my
previous
> > email, you could use a utility class as an interface between your
servlet
> > and your business logic or just handle everything in methods in your 
> > servlet.
> >
> > One more thing suggestion is to name your parameters with mor
descriptive
> > names. ie. change this
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse 
> > arg1) throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > to
> >
> > protected void doGet(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException{
> > process(request, response);
> > }
> >
> > (you could also use req and resp instead of request and response)
> >
> > Regards,
> >
> > Richard
> >
> > -Original Message-
> > From: Jan Zimmek [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 19, 2003 1:17 AM
> > To: Struts Users Mailing List
> > Subject: Re: [OT] Question about Servlets & Threads
> >
> >
> > Hi,
> >
> > I think you're right, but let me ask a last question please ;-)
> >
> > here are some source snippets of my classes:
> >
> > MyServlet (which handles all incoming requests like ActionServlet in
> struts
> > and populates Request/Response and the action to execute to the new
> created
> > WebThread):
> > -
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse 
> > arg1) throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > protected void doPost(HttpServletRequest arg0, HttpServletResponse 
> > arg1) throws ServletException, IOException{
> > process(arg0, 

RE: [OT] RE: mesage message account

2003-08-19 Thread Chappell, Simon P
You know, it's funny, but I don't know any "African-Americans" that were born in 
Africa, but I do know a non-"African-American" that actually was born in Africa, and 
is lily-white in colour.

Gotta love political correctness. :-)

Simon

>-Original Message-
>From: Mark Galbreath [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 19, 2003 1:07 PM
>To: 'Struts Users Mailing List'
>Subject: [OT] RE: mesage message account 
>
>
>Actually, I'm an African-American pro-Islamic militant 
>revolutionary who is
>on this list only to monitor the secret Zionist elitists 
>disguised as Struts
>developers and gather intelligence for the coming .NET 
>holocaust and world
>domination.
>
>Mark (is only my code name)
>
>-Original Message-
>From: object worlds [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, August 19, 2003 9:42 AM
>
>Did you take my message message account off the list ?
>Is that because that white shit Mark Galbreath
>said so and that shit Craig Mclanahan agreed.
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



RE: Changing application path

2003-08-19 Thread Alex Shneyderman
That is what struts does for you already. You do not need to do
anything. Suppose you do your development in context /app. While you
develop all of your actions will be rendered like /apps/action.do Now
suppose you want to deploy your application, you give it to
administrator and he/she deploys it in some context. Suppose that
context is / all of your actions will be rendered like /action.do. Sure
if he/she deploys the app in context /apps1 all of your actions will be
rendered as /apps1/action.do

This basically has very little to do with struts rather with how
servlets/JSP apps get deployed. Struts just makes the fact that you can
move your app around transparent to you as a developer or to your admin,
given you use the struts tags.

> -Original Message-
> From: java-dude [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 19, 2003 10:09 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Changing application path
> 
> The business requires to put their own URL on the application such
> as :-
> 
> www.somecompany.com/example
> 
> NOT as is currently happening :-
> 
> www.somecompany.com/app/example
> 
> where the app part of the URL is coming from app.war used to deploy
> the app.
> 
> If I can tweak the config of the application so the form action path
> becomes "/example" instead of "/app/example", as currently,  then it
> should be possible for the system administrator to remap the
> application to www.someapp.com/example
> 
> This must be already being done in numerous companies but I don't
> know how we can achieve this at the moment.
> 
> --- In [EMAIL PROTECTED], "Alex Shneyderman" <[EMAIL PROTECTED]> wrote:
> >
> > The way container works is to deploy an application to its own
> content.
> > The way your container knows which application a user request
> refers to
> > is by looking at the prefix of the request. So unless you mount
> your
> > application onto the ROOT content (prefix "/") I can not imagine
> what
> > you are asking for is possible. But then again if some dude will
> come
> > along and remount your app to some /app content ... Suppose you
> develop
> > an app called app1 and have example.do action there. How would you
> > differentiate between /app/example.do and /app1/example.do?
> >
> > HTH,
> > Alex.
> >
> > > -Original Message-
> > > From: java-dude [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 19, 2003 7:23 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Changing application path
> > >
> > > Hi,
> > >
> > > I need to change the base path of my struts application so that
> > > there is no prefix on the form actions.
> > >
> > > For example if my application is deployed in the application
> server
> > > as app.war and I view the source for a jsp with a form on it, say
> > > example.jsp, in internet explorer, I see that the form has an
> action
> > > tag as follows :-
> > >
> > >   action="/app/example.do"
> > >
> > > This is happening even though the jsp is actually coded with
> action
> > > tag as follows :-
> > >
> > >   action="example"
> > >
> > >
> > > Basically I would like the generated source for this page to be
> > > without the base of the path as follows :-
> > >
> > >   action="/example.do"
> > >
> > > I am guessing it may require manipulation of the web.xml and/or
> > > struts-config.xml files but I am not sure, and if so how ?
> > >
> > > Suhel Rizvi
> > >
> > >
> > > -
> 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > ---
> --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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



RE: no getter method found

2003-08-19 Thread Mark Galbreath
BTW: you probably should look at a JavaBean tutorial.  What you state below
is ABSOLUTELY wrong. Providing, of course you don't mean to include the two
methods and have a param arg for set.

Mark

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 4:08 PM

Mark,
I'm not sure which response you are referring to, but getLastname() and
setLastname() is wrong if the member variable is called lastName.



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



Re: Session expired

2003-08-19 Thread Sasha Borodin
log.info("Entering LoginFilter.doFilter().");

HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
HttpSession session = httpRequest.getSession(false);


if(session != null) {

log.info("Sending to log in...");

httpResponse.sendRedirect(login.jsp);
} else {
log.info("Honoring request...");

chain.doFilter(request, response);
}

log.info("Exiting LoginFilter.doFilter().");


On 8/19/03 14:43, "Mike Deegan" <[EMAIL PROTECTED]> wrote:

> Sloan,
> 
> Can you provide example code from
> com.symbol.mc.oms.servlet.SessionFilter
> Or is that asking too much ??
> 
> TIA,
> Mike
> 
> - Original Message -
> From: "Sloan Seaman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 12:17 PM
> Subject: Re: Session expired
> 
> 
>> How about a filter?
>> 
>> That is what I use.  Anything within a certain path first gets checked by
> my
>> filter and if the user doesn't have a valid session object it redirects
> them
>> to the login page...
>> 
>> This way the code doesn't even know it is happening...
>> 
>> You define one in your web.xml like so:
>> 
>> 
>> SessionFilter
>> 
>> com.symbol.mc.oms.servlet.SessionFilter
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> SessionFilter
>> 
>> /app/*
>> 
>> 
>> 
>> 
>> 
>> This way anything within the /app dir goes through the filter first...
>> 
>> - Original Message -
>> From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Sent: Tuesday, August 19, 2003 8:12 AM
>> Subject: RE: Session expired
>> 
>> 
>>> My problem is, that I already have something around 60 jsps. Now it
> would
>> be
>>> nice to have a workaround so that i don't have to adapt all my jsps and
>>> actions.
>>> 
 -Original Message-
 From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 19, 2003 12:58 PM
 To: Struts Users Mailing List
 Subject: Re: Session expired
 
 
 What if you check from your action before redirecting to a  jsp ?
 
 
 Filip Polsakiewicz wrote:
 
> Hi,
> is there any way to redirect y user to a jsp if the session is
> expired
> without checking for an expired session within each single jsp?
> 
> Thanks, Filip
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> 
>>> 
>> 
>> 
>> 
>> This email has been scanned for all viruses by the MessageLabs Email
>> Security System. For more information on a proactive email security
>> service working around the clock, around the globe, visit
>> http://www.messagelabs.com
>> 
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: Adding to a tiles definition at runtime?

2003-08-19 Thread Mike Jasnowski
Have you looked at tiles controllers? They can be defined at the definition
or tile level, and can be used to dynamically include data into a tile at
runtime? Specifically I use them with a small tag lib that populates a view
JavaBean that is then passed to each tile.

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 1:04 PM
To: Struts Mailing List
Subject: Adding to a tiles definition at runtime?


Is there any possible way to add additional variables to a tiles definition
at runtime or to modify them? IE here is a definition:
























And then my menu jsp iterates through that list of menus adding them.  The
problem is I need a seperate tiles definition for every possible menu
configuration, and then if I want an action that forwards to a definition
that could show different menus.. etc etc it gets to be a pain. So would it
be possible to change whats in that list or add to that list in my action
before I forward to a tiles def? *Shrug just trying to get some ideas
together here*.



If that is not possible then my next question is in my baselayout.jsp I have
the

 tag.  In which scope does it search for a
variable named menu?  and if i changed that to  or something of that nature could it change at runtime
based on something in my request/or session scope?

Thanks in advance!


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



RE: no getter method found

2003-08-19 Thread Mark Galbreath
your post stated the method names as "getlastname" with the form property
"lastname." Given your information, the correct JavaBean method signatures
would be getLastname() and setLastname( String name ).

period.

Mark

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 4:08 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


Mark,
I'm not sure which response you are referring to, but getLastname() and
setLastname() is wrong if the member variable is called lastName.

Mehran, basically, the property value of your html:text tag needs to match
the name of the member variable in your form bean. If you have: private
String lastname;

in your form bean, then you should have a getter and setter called
getLastname() and setLastname() and in your jsp you would have 

Since your member variable is called lastName, you should have a getter and
setter called getLastName() and setLastName() and in your jsp you would have


regards,

Richard



-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 11:56 AM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


see my response to your last email

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:34 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


Actually, my last email was wrong, they should be:
public String getLastName()
and
public void setLastName();

-Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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



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

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



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



RE: no getter method found

2003-08-19 Thread Yee, Richard K,,DMDCWEST
Mark,
I'm not sure which response you are referring to, but getLastname() and
setLastname() is wrong if the member variable is called lastName.

Mehran, basically, the property value of your html:text tag needs to match
the name of the member variable in your form bean. If you have:
private String lastname;

in your form bean, then you should have a getter and setter called
getLastname() and setLastname() and in your jsp you would have 

Since your member variable is called lastName, you should have a getter and
setter called getLastName() and setLastName() and in your jsp you would have


regards,

Richard



-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 11:56 AM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


see my response to your last email

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:34 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


Actually, my last email was wrong, they should be:
public String getLastName()
and
public void setLastName();

-Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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



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

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



Re: Session expired

2003-08-19 Thread Sloan Seaman
First off let me state that mine is a bit complicated since it gets some
config info from a static object   I stripped out what I could to make
it more simple...but the whole version of mine gets the redirect url and if
it is enabled or not from a static configuration object that is created via
a plugin that uses Digester

The example below is as simple as it gets.  If a session object does not
exist and the specific object within the session does not exist (in this
case, a user object defined by USER_OBJECT), it redirects to the index.jsp.

Otherwise it just lets the filter continue down the chain of filters(the
correct thing to do if the user is valid).

In writing your own you will prob. want to abstract the page to redirect to
as well as the object to look for in the session to make everything more
configurable

You could also go a step further and check the roles within the user object.
Though I do this on a per action basis within the struts-config.xml file via
a SecureAction object that I've created.  This allows for a lot of cool
tricks like cascading up the action chain to a point where the user finally
has proper access rights

anyway... here is the code:

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.log4j.Logger;

public class SessionFilter
 implements Filter
{

 private static final Logger log = Logger.getLogger(SessionFilter.class);
 private ServletContext context = null;

 /**
 * Initialize the SessionFilter with the FilterConfigurate from the
 * web.xml file
 *
 * @param _filterConfig The Filter Configuration
 */
 public void init(javax.servlet.FilterConfig _filterConfig) {
  context = _filterConfig.getServletContext();
 }

 /**
 * Called when the filter needs to be executed
 *
 * @param _request The ServletRequest
 * @param _response The ServletResponse
 * @param _chain The FilterChain
 */
 public void doFilter(ServletRequest _request, ServletResponse _response,
  FilterChain _chain)
  throws IOException, ServletException
 {
  String redirectFailure = "/index.jsp";

 HttpSession session = ((HttpServletRequest)_request).getSession();

 // the object name to look for should be in the configuration...
 if ((session == null) || (session.getAttribute("USER_OBJECT")== null) )
{
  context.getRequestDispatcher(redirectFailure)
   .forward(_request,_response);
  log.debug("Access denied. Redirecting to "+redirectFailure);
 }
 else {
  _chain.doFilter(_request, _response);
 }
 }

 /**
 * Doesn't do anything
 */
 public void destroy() {}
}



- Original Message - 
From: "Mike Deegan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 3:43 PM
Subject: Re: Session expired


> Sloan,
>
> Can you provide example code from
> com.symbol.mc.oms.servlet.SessionFilter
> Or is that asking too much ??
>
> TIA,
> Mike
>
> - Original Message - 
> From: "Sloan Seaman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 12:17 PM
> Subject: Re: Session expired
>
>
> > How about a filter?
> >
> > That is what I use.  Anything within a certain path first gets checked
by
> my
> > filter and if the user doesn't have a valid session object it redirects
> them
> > to the login page...
> >
> > This way the code doesn't even know it is happening...
> >
> > You define one in your web.xml like so:
> > 
> >
> > SessionFilter
> >
> > com.symbol.mc.oms.servlet.SessionFilter
> >
> > 
> >
> >
> >
> > 
> >
> > SessionFilter
> >
> > /app/*
> >
> > 
> >
> >
> >
> > This way anything within the /app dir goes through the filter first...
> >
> > - Original Message - 
> > From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 19, 2003 8:12 AM
> > Subject: RE: Session expired
> >
> >
> > > My problem is, that I already have something around 60 jsps. Now it
> would
> > be
> > > nice to have a workaround so that i don't have to adapt all my jsps
and
> > > actions.
> > >
> > > > -Original Message-
> > > > From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, August 19, 2003 12:58 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: Session expired
> > > >
> > > >
> > > > What if you check from your action before redirecting to a  jsp ?
> > > >
> > > >
> > > > Filip Polsakiewicz wrote:
> > > >
> > > > >Hi,
> > > > >is there any way to redirect y user to a jsp if the session is
> expired
> > > > >without checking for an expired session within each single jsp?
> > > > >
> > > > >Thanks, Filip
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
>-
> > > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >For additional commands, e-mail:
[EMAIL PROTECTED]
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> -

Re: NoSuchMethodException?

2003-08-19 Thread David Graham
--- Steven Leija <[EMAIL PROTECTED]> wrote:
> I'm using the ActionMessages object to display a confirmation of an
> uploaded file.
>  
> Everything works just fine in my WebSphere Application Developer IDE. 
> When it's deployed to our dev box, i get this message:
>  
> org.apache.struts.util.RequestUtils - Could not find Java 1.4 encode
> method.  Using deprecated version.
> java.lang.NoSuchMethodException: encode
> 
>  
> This is running in WAS 4.0.4.
>  
> Any ideas?

It first tries to use the new Java 1.4 encode method and then falls back
to the 1.3 encode method if it's not found.  The log statement is just
informative, it doesn't mean anything is broken.

David

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


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: mesage message account

2003-08-19 Thread Mainguy, Mike
Only if they involve Microsoft, the CIA, and/or the Oil Cartels...

-Original Message-
From: Bill Chmura [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 4:15 PM
To: 'Struts Users Mailing List'
Subject: RE: mesage message account


I've been off the list for awhile, and just wanted to double check that
conspiracy theorys were still tolerated on fridays...




  > -Original Message-
  > From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 2:19 PM
  > To: 'Struts Users Mailing List'
  > Subject: RE: mesage message account
  > 
  > 
  > I will put money on the fact that nobody on this list wants 
  > to read about your idiotic conspiracy theories.  Please 
  > amuse yourself by trolling on Slashdot or usenet and stop 
  > wasting our time.  
  > 
  > -Original Message-
  > From: object worlds [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 9:42 AM
  > To: [EMAIL PROTECTED]
  > Subject: mesage message account
  > 
  > Did you take my message message account off the list ?
  > Is that because that white shit Mark Galbreath
  > said so and that shit Craig Mclanahan agreed.
  > 
  > _
  > Express yourself with cool emoticons - download MSN 
  > Messenger today! 
  > http://www.msn.co.uk/messenger
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 
  > 
  > This message and its contents (to include attachments) are 
  > the property of Kmart Corporation (Kmart) and may contain 
  > confidential and proprietary information. You are hereby 
  > notified that any disclosure, copying, or distribution of 
  > this message, or the taking of any action based on 
  > information contained herein is strictly prohibited. 
  > Unauthorized use of information contained herein may 
  > subject you to civil and criminal prosecution and 
  > penalties. If you are not the intended recipient, you 
  > should delete this message immediately.
  > 
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 



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


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Joseph Fifield
Given this statement:

> > The Thread is simply needed, so that the Globals class can return the
> > current Request/Response-Object at any time and anywhere within the rest
> of
> > my source, without passing them as parameter.

The ThreadLocal solution mentioned in an earlier post should work fine.
There is no need to create your own Thread, and you get the behavior you are
describing. Read the javadoc for ThreadLocal.

Joe

- Original Message - 
From: "Jan Zimmek" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 3:37 PM
Subject: Re: [OT] Question about Servlets & Threads


>
> - Original Message - 
> From: "Jan Zimmek" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 9:02 PM
> Subject: Re: [OT] Question about Servlets & Threads
>
>
> > Hi,
> >
> > -> "How long does your thread take to run?"
> >
> > the thread will internally invoke a WebAction passed as
> > constructor-parameter, which will do things like a Struts-Action (if the
> > processing of the WebAction takes a long time, the thread takes a long
> time
> > too, but this will be very unusual).
> >
> > -> "If this is really necessary, then you also might look into using a
> > thread pool."
> >
> > First I tried to use a ThreadPool mechanism, but I didn't find a way to
> > restart a Thread after it has been finished, so a pool would be useless.
> >
> >
> > -> "Perhaps you can describe what you are doing in this thread"
> >
> > The Thread is simply needed, so that the Globals class can return the
> > current Request/Response-Object at any time and anywhere within the rest
> of
> > my source, without passing them as parameter.
> >
> >
> > What are your opinions about "complex threading issues" mentioned by
David
> ?
> >
> >
> > In the near future we want to port our PHP-driven framework/cms (which
has
> > been proven in development and production) to JAVA. So I am looking for
> the
> > fastest possible way to do this, without developing anything new from
the
> > scratch.
> >
> >
> >
> >
> > - Original Message - 
> > From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 19, 2003 5:41 PM
> > Subject: RE: [OT] Question about Servlets & Threads
> >
> >
> > > Jan,
> > > How long does your thread take to run? Since you are waiting for the
> > thread
> > > to finish anyway in your servlet, I'm not sure it is very necessary to
> > start
> > > a new thread to process the request. It adds a bit of overhead to
> process
> > > each request since an extra thread is created for every request that
> gets
> > > processed. If this is really necessary, then you also might look into
> > using
> > > a thread pool. I don't see the need for the new thread. Perhaps you
can
> > > describe what you are doing in this thread. As I suggested in my
> previous
> > > email, you could use a utility class as an interface between your
> servlet
> > > and your business logic or just handle everything in methods in your
> > > servlet.
> > >
> > > One more thing suggestion is to name your parameters with mor
> descriptive
> > > names. ie. change this
> > > protected void doGet(HttpServletRequest arg0, HttpServletResponse
arg1)
> > > throws ServletException, IOException{
> > > process(arg0, arg1);
> > > }
> > >
> > > to
> > >
> > > protected void doGet(HttpServletRequest request, HttpServletResponse
> > > response) throws ServletException, IOException{
> > > process(request, response);
> > > }
> > >
> > > (you could also use req and resp instead of request and response)
> > >
> > > Regards,
> > >
> > > Richard
> > >
> > > -Original Message-
> > > From: Jan Zimmek [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 19, 2003 1:17 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: [OT] Question about Servlets & Threads
> > >
> > >
> > > Hi,
> > >
> > > I think you're right, but let me ask a last question please ;-)
> > >
> > > here are some source snippets of my classes:
> > >
> > > MyServlet (which handles all incoming requests like ActionServlet in
> > struts
> > > and populates Request/Response and the action to execute to the new
> > created
> > > WebThread):
> > > -
> > > protected void doGet(HttpServletRequest arg0, HttpServletResponse
arg1)
> > > throws ServletException, IOException{
> > > process(arg0, arg1);
> > > }
> > >
> > > protected void doPost(HttpServletRequest arg0, HttpServletResponse
arg1)
> > > throws ServletException, IOException{
> > > process(arg0, arg1);
> > > }
> > >
> > > protected void process(HttpServletRequest request, HttpServletResponse
> > > response) throws ServletException, IOException{
> > > WebThread t = new WebThread(request, response, new WebAction());
> > >
> > > t.start();
> > >
> > > while(t.isAlive());
> > >
> > > t.release();
> > > t =

RE: no getter method found

2003-08-19 Thread Paananen, Tero
> Last Name: 
> 
> and this in my ActionForm subclass
> 
> private String lastName = null;
> 
>   public String getlastname(){
>  return this.lastName;
>   }
> 
>   public void setlastname( String lastName){
>  this.lastName = lastName;
>   }

getLastname()
setLastname()

-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.


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



[OT] RE: mesage message account

2003-08-19 Thread Mark Galbreath
yes, but you have to let the conspiracy build a bit!  it takes a few days to
get the anthrax to him through the mail.


-Original Message-
From: Bill Chmura [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 4:15 PM
To: 'Struts Users Mailing List'
Subject: RE: mesage message account



I've been off the list for awhile, and just wanted to double check that
conspiracy theorys were still tolerated on fridays...




  > -Original Message-
  > From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 2:19 PM
  > To: 'Struts Users Mailing List'
  > Subject: RE: mesage message account
  > 
  > 
  > I will put money on the fact that nobody on this list wants 
  > to read about your idiotic conspiracy theories.  Please 
  > amuse yourself by trolling on Slashdot or usenet and stop 
  > wasting our time.  
  > 
  > -Original Message-
  > From: object worlds [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 9:42 AM
  > To: [EMAIL PROTECTED]
  > Subject: mesage message account
  > 
  > Did you take my message message account off the list ?
  > Is that because that white shit Mark Galbreath
  > said so and that shit Craig Mclanahan agreed.
  > 
  > _
  > Express yourself with cool emoticons - download MSN 
  > Messenger today! 
  > http://www.msn.co.uk/messenger
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 
  > 
  > This message and its contents (to include attachments) are 
  > the property of Kmart Corporation (Kmart) and may contain 
  > confidential and proprietary information. You are hereby 
  > notified that any disclosure, copying, or distribution of 
  > this message, or the taking of any action based on 
  > information contained herein is strictly prohibited. 
  > Unauthorized use of information contained herein may 
  > subject you to civil and criminal prosecution and 
  > penalties. If you are not the intended recipient, you 
  > should delete this message immediately.
  > 
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 



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



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



RE: mesage message account

2003-08-19 Thread Bill Chmura

I've been off the list for awhile, and just wanted to double check that
conspiracy theorys were still tolerated on fridays...




  > -Original Message-
  > From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 2:19 PM
  > To: 'Struts Users Mailing List'
  > Subject: RE: mesage message account
  > 
  > 
  > I will put money on the fact that nobody on this list wants 
  > to read about your idiotic conspiracy theories.  Please 
  > amuse yourself by trolling on Slashdot or usenet and stop 
  > wasting our time.  
  > 
  > -Original Message-
  > From: object worlds [mailto:[EMAIL PROTECTED] 
  > Sent: Tuesday, August 19, 2003 9:42 AM
  > To: [EMAIL PROTECTED]
  > Subject: mesage message account
  > 
  > Did you take my message message account off the list ?
  > Is that because that white shit Mark Galbreath
  > said so and that shit Craig Mclanahan agreed.
  > 
  > _
  > Express yourself with cool emoticons - download MSN 
  > Messenger today! 
  > http://www.msn.co.uk/messenger
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 
  > 
  > This message and its contents (to include attachments) are 
  > the property of Kmart Corporation (Kmart) and may contain 
  > confidential and proprietary information. You are hereby 
  > notified that any disclosure, copying, or distribution of 
  > this message, or the taking of any action based on 
  > information contained herein is strictly prohibited. 
  > Unauthorized use of information contained herein may 
  > subject you to civil and criminal prosecution and 
  > penalties. If you are not the intended recipient, you 
  > should delete this message immediately.
  > 
  > 
  > 
  > 
  > -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 



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



Re: [OT] get abs path to my web application root context

2003-08-19 Thread Claire Suttle
If you want to get the absolute path from within a Form or Action class, use:
ServletContext serv = servlet.getServletContext();

String realPath = serv.getRealPath(filepath);

filepath is the relative path from the root i.e. /images/items/path or 
/images/items/path/filename.gif

You have inplicit access to servlet, so using these two lines and importing 
javax.servlet.ServletContext should be all you need to do.

Claire

--- In [EMAIL PROTECTED], Emerson Cargnin <[EMAIL PROTECTED]> wrote:
> Servlet method :
>   getServletContext().getRealPath("/")
> request has getRealPath, but is depracated.
> 
> Don't know how to get this inside an action (besides using the 
> depracated method).maybe getting it at init servlet method and saving it 
> under application context. Any other ideas...
> 
> 
> Alen Ribic wrote:
> > Hi All
> > 
> > This may be a bit of a silly and of topic question but this is driving me up
> > the wall. ;)
> > I would like to save uploaded files to my application's
> > %app_root%/images/items/ path.
> > How do I get the absolute path to my web application's root directory?
> > e.g. "c:/tomcat/webapps/myapp_root/"
> > 
> > Thanks
> > 
> > --Alen
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> Emerson Cargnin
> Analista de Sistemas
> Setor de Desenvolvimento de Sistemas - TRE-SC
> tel : (048) - 251-3700 - Ramal 3181
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Re: Changing application path

2003-08-19 Thread Jeff Kyser
I know you can map the 'default' context  ( '/' ) to a particular
context in Tomcat, as we did that on an app I worked on.
Hence, we could access the app as:
http://www.somecompany.com/

and

http://www.somecompany.com/OrderEntry

-jeff

On Tuesday, August 19, 2003, at 09:08  AM, java-dude wrote:

The business requires to put their own URL on the application such
as :-
www.somecompany.com/example

NOT as is currently happening :-

www.somecompany.com/app/example

where the app part of the URL is coming from app.war used to deploy
the app.
If I can tweak the config of the application so the form action path
becomes "/example" instead of "/app/example", as currently,  then it
should be possible for the system administrator to remap the
application to www.someapp.com/example
This must be already being done in numerous companies but I don't
know how we can achieve this at the moment.
--- In [EMAIL PROTECTED], "Alex Shneyderman" <[EMAIL PROTECTED]> wrote:
The way container works is to deploy an application to its own
content.
The way your container knows which application a user request
refers to
is by looking at the prefix of the request. So unless you mount
your
application onto the ROOT content (prefix "/") I can not imagine
what
you are asking for is possible. But then again if some dude will
come
along and remount your app to some /app content ... Suppose you
develop
an app called app1 and have example.do action there. How would you
differentiate between /app/example.do and /app1/example.do?
HTH,
Alex.
-Original Message-
From: java-dude [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 7:23 AM
To: [EMAIL PROTECTED]
Subject: Changing application path
Hi,

I need to change the base path of my struts application so that
there is no prefix on the form actions.
For example if my application is deployed in the application
server
as app.war and I view the source for a jsp with a form on it, say
example.jsp, in internet explorer, I see that the form has an
action
tag as follows :-

	action="/app/example.do"

This is happening even though the jsp is actually coded with
action
tag as follows :-

	action="example"

Basically I would like the generated source for this page to be
without the base of the path as follows :-
	action="/example.do"

I am guessing it may require manipulation of the web.xml and/or
struts-config.xml files but I am not sure, and if so how ?
Suhel Rizvi

-

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


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


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


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


RE: no getter method found

2003-08-19 Thread Ditlinger, Steve

This question comes up often enough that it probably warrants a short lesson
in JavaBeans.

If a property is named "lastname", the corresponding "getter" should be
named getLastname() and the setter should be named setLastname().  What's
more the parameter type for the "setter" must match the return type of the
"getter".  Please note:  the name of the instance variable used for storing
the lastname property value *is irrelevent*.  The property name is derived
from the names of the "getter & setter" methods alone (, unless you write a
BeanInfo class, in which case, you get to make up your own rules.)  For the
sake of clarity, we often name our instance variables with the same name of
the properties, but this is not required.

For instance:

public class MyForm extends ActionForm{
  private String lastName = null;
  
public String getLastname(){
   return this.lastName;
}
  
public void setLastname( String lastName){
   this.lastName = lastName;
}
}

is the same as:

public class MyForm extends ActionForm{
  private String someFreakyName = null;
  
public String getLastname(){
   return this.someFreakyName ;
}
  
public void setLastname( String lastName){
   this.someFreakyName = lastName;
}
}

In both cases, the property name is "lastname", and so the proper tag usage
is .

For reference, see section 8.3 of the JavaBeans specification.
http://java.sun.com/products/javabeans/docs/spec.html

Steve


 -Original Message-
 From: Ditlinger, Steve [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 19, 2003 11:32 AM
 To: 'Struts Users Mailing List'
 Subject: RE: no getter method found
 
 
 public String getLastname(){}  Note the capital "L"
 
  -Original Message-
  From: Mehran Zonouzi [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, August 19, 2003 6:55 AM
  To: [EMAIL PROTECTED]
  Subject: no getter method found
  
  
  I have the below in my jsp page
  
  Last Name: 
  
  and this in my ActionForm subclass
  
  private String lastName = null;
  
public String getlastname(){
   return this.lastName;
}
  
public void setlastname( String lastName){
   this.lastName = lastName;
}
  
  But I keep getting the no gett found error message...
  No getter method for property lastname of bean 
  org.apache.struts.taglib.html.BEAN
  
  
  What should the getter method be called?
  
  
  --
  
  This e-mail may contain confidential and/or privileged 
  information. If you are not the intended recipient (or have 
  received this e-mail in error) please notify the sender 
  immediately and destroy this e-mail. Any unauthorized copying, 
  disclosure or distribution of the material in this e-mail is 
  strictly forbidden.
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: [OT] Question about Servlets & Threads

2003-08-19 Thread Jan Zimmek

- Original Message - 
From: "Jan Zimmek" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 9:02 PM
Subject: Re: [OT] Question about Servlets & Threads


> Hi,
>
> -> "How long does your thread take to run?"
>
> the thread will internally invoke a WebAction passed as
> constructor-parameter, which will do things like a Struts-Action (if the
> processing of the WebAction takes a long time, the thread takes a long
time
> too, but this will be very unusual).
>
> -> "If this is really necessary, then you also might look into using a
> thread pool."
>
> First I tried to use a ThreadPool mechanism, but I didn't find a way to
> restart a Thread after it has been finished, so a pool would be useless.
>
>
> -> "Perhaps you can describe what you are doing in this thread"
>
> The Thread is simply needed, so that the Globals class can return the
> current Request/Response-Object at any time and anywhere within the rest
of
> my source, without passing them as parameter.
>
>
> What are your opinions about "complex threading issues" mentioned by David
?
>
>
> In the near future we want to port our PHP-driven framework/cms (which has
> been proven in development and production) to JAVA. So I am looking for
the
> fastest possible way to do this, without developing anything new from the
> scratch.
>
>
>
>
> - Original Message - 
> From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 5:41 PM
> Subject: RE: [OT] Question about Servlets & Threads
>
>
> > Jan,
> > How long does your thread take to run? Since you are waiting for the
> thread
> > to finish anyway in your servlet, I'm not sure it is very necessary to
> start
> > a new thread to process the request. It adds a bit of overhead to
process
> > each request since an extra thread is created for every request that
gets
> > processed. If this is really necessary, then you also might look into
> using
> > a thread pool. I don't see the need for the new thread. Perhaps you can
> > describe what you are doing in this thread. As I suggested in my
previous
> > email, you could use a utility class as an interface between your
servlet
> > and your business logic or just handle everything in methods in your
> > servlet.
> >
> > One more thing suggestion is to name your parameters with mor
descriptive
> > names. ie. change this
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > to
> >
> > protected void doGet(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException{
> > process(request, response);
> > }
> >
> > (you could also use req and resp instead of request and response)
> >
> > Regards,
> >
> > Richard
> >
> > -Original Message-
> > From: Jan Zimmek [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 19, 2003 1:17 AM
> > To: Struts Users Mailing List
> > Subject: Re: [OT] Question about Servlets & Threads
> >
> >
> > Hi,
> >
> > I think you're right, but let me ask a last question please ;-)
> >
> > here are some source snippets of my classes:
> >
> > MyServlet (which handles all incoming requests like ActionServlet in
> struts
> > and populates Request/Response and the action to execute to the new
> created
> > WebThread):
> > -
> > protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
> > throws ServletException, IOException{
> > process(arg0, arg1);
> > }
> >
> > protected void process(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException{
> > WebThread t = new WebThread(request, response, new WebAction());
> >
> > t.start();
> >
> > while(t.isAlive());
> >
> > t.release();
> > t = null;
> > }
> >
> > You see all processing is of the request will be done in the "run()"
> method
> > of the new created WebThread instance.
> >
> > And this is the point why I am not understand, that I can run into
complex
> > threading issues.
> >
> > Snippet of a WebAction-Object (this is always thread-safe like a struts
> > action):
>
> --
> --
> > ---
> >
> > public void execute(){
> > HttpServletResponse response = Globals.response();
> >
> > try{
> > response.getWriter().write("");
> > }catch(IOException e){
> > e.printStackTrace();
> > }
> > }
> >
> >
> > And this is the Globals-Object source:
> > --
> >
> > public class Globals{
> > private static WebThread current(){
> > return (WebThread)Thread.currentThread();
> > }
> >
> >

Re: Session expired

2003-08-19 Thread Adam Levine
I'm betting it would look something like, depending on your business needs:

 if ( [destination checking, these destionations require a valid session or 
logged in session] )
{
   if ( httpRequest.getSession(false) == null || ( [get the session, check 
for logged in status] == false) )
{[redirect to login/root/expired page]  }

}





From: "Mike Deegan" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Session expired
Date: Tue, 19 Aug 2003 13:43:29 -0600
Sloan,

Can you provide example code from
com.symbol.mc.oms.servlet.SessionFilter
Or is that asking too much ??
TIA,
Mike
- Original Message -
From: "Sloan Seaman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 12:17 PM
Subject: Re: Session expired
> How about a filter?
>
> That is what I use.  Anything within a certain path first gets checked by
my
> filter and if the user doesn't have a valid session object it redirects
them
> to the login page...
>
> This way the code doesn't even know it is happening...
>
> You define one in your web.xml like so:
> 
>
> SessionFilter
>
> com.symbol.mc.oms.servlet.SessionFilter
>
> 
>
>
>
> 
>
> SessionFilter
>
> /app/*
>
> 
>
>
>
> This way anything within the /app dir goes through the filter first...
>
> - Original Message -
> From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 8:12 AM
> Subject: RE: Session expired
>
>
> > My problem is, that I already have something around 60 jsps. Now it
would
> be
> > nice to have a workaround so that i don't have to adapt all my jsps and
> > actions.
> >
> > > -Original Message-
> > > From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 19, 2003 12:58 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Session expired
> > >
> > >
> > > What if you check from your action before redirecting to a  jsp ?
> > >
> > >
> > > Filip Polsakiewicz wrote:
> > >
> > > >Hi,
> > > >is there any way to redirect y user to a jsp if the session is
expired
> > > >without checking for an expired session within each single jsp?
> > > >
> > > >Thanks, Filip
> > > >
> > > >
> > > >
> > > >
> > > 
>-
> > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> 
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
MSN 8: Get 6 months for $9.95/month. 
http://join.msn.com/?page=dept/dialup

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


comparators

2003-08-19 Thread Jagannayakam
Hi all , 


In a action class i have List of FormBeans. I want to have this formbean
sorted on one of its parameter say String name . 

I have a java comparator say NameComparator which implements comparator
interface so i implemented method compare(Object o1 , Object o2 ) to compare
the name attribute of formbean . 

Then I perform Collections.sort(list , nameComparatorObject )  
where NameComparator nameComparatorObject = new NameComparator();

But still the list of form beans are sorted by name. 

any suggestions ? 

Regards,
Jagan.


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



Re: No getter method for property lastName of bean

2003-08-19 Thread Yann Cébron
2 common pitfalls to try out:

1) did you reload your webapp, in other words: was the struts-config.xml
reparsed and your (modified) ActionForm-class reloaded?

2) check your settings for the formbean in the struts-config.xml, is it
attached to the action you're using in your ?

HTH,
Yann




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



Re: Session expired

2003-08-19 Thread Yann Cébron
With Struts 1.1 you can also write your own RequestProcessor and overwrite
the desired processXYZ()-methods to perform checks like these before
executing anything further (e.g. before showing the JSP, before populating a
Form etc.).

I've successfully used processPreprocess() to check whether a session is
still valid and/or a required SessionBean is available in Session-Scope, and
redirect to the login-page if it's not. Ofcourse all of your JSPs must not
be called directly, but rather via a corresponding forward of your Actions.

See the JavaDoc
http://jakarta.apache.org/struts/api/org/apache/struts/action/RequestProcessor.html

Yann




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



Re: exception in actionfrom class.

2003-08-19 Thread Jing Zhou
The current Struts 1.1 allows you to design form beans (instances of
ActionForm)
using only String properties. This because the common-beanutils package is
not
able to cache conversion exceptions and re-display original user's inputs.

You are responsible to validate the string properties (using whatever
validation
methods) and then invoke the copyProperties() method in the common-beanutils
package to copy and/or convert the string properties to your domain objects,
for example, your ContactInfo objects.

If you really want to catch the conversion exceptions and display them to
screen,
check the HyperFormBean class at http://www.netspread.com
The hyper form bean is also an extension of the ActionForm class. But it
supports 12 standard types and one custom property interface. It can cache
any
conversion exceptions and is able to display original user's inputs in case
of any errors.

The form bean model improves the Struts action form in the following ways:
1) Standard and custom property types are supported. It fits into
the common-beanutils package smoothly.
2) Type conversions are performed only one time. (Struts may need one or
more times to perform type conversions, one in the copyProperties()
method
and another possible one in the validation methods)
3) Reduce the usage of reflection. Therefore it gives higher performance.
4) Tools can be designed for designers to compose such form bean model.
Carrier has a form bean model composer tab pane where designers could
compose whatever form bean model they like, including nested ones.
5) The reset method in the form bean model is view agnostic. You never need
to re-write the reset method anymore, anywhere, even if you change
your web forms.
6) The validate method in the form bean model is also view agnostic. You
could
attach built-in or custom validation rules in addition to the required
and
data type conversion rules. You do not need to re-write the validate
method
even if you change your web forms in the form bean model.
7) The concept of the runtime property name is a very interesting one, I
believe.
The runtime property path to a nested property of the hyper form bean
could
be automatically adapted as needed.
8) The hyper form bean can be persisted and restored systematically. The
default
persistence mechanism implemented in Carrier allows you to prototype web
applications without writing custom codes. It includes CRUD operations
on
nested form beans.

The algorithm that simultaneously achieve above 8 goals is called Wheels. It
is
so simple just like a wheel - nothing less and nothing more. If it is proved
to be
right, I wish it could be contributed back to Struts as a contribution
package with
necessary adaptations for more general requirements. After all, it is an
algorithm
built on the shoulders of the Struts team :-) So we publish the full source
codes
of Wheels for public viewers.

Jing
Netspread Carrier
http://www.netspread.com


- Original Message - 
From: "deepaksawdekar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 5:08 AM
Subject: exception in actionfrom class.


I am using the containment design patter for the ActionForm.
My action form will look like this.

public final class ContactForm extends ActionForm {
private ContactInfo contactInfo;

public int getContactid() {
return contactInfo.getContactId();
}

public void setContactid(int ContactId) {
this.contactInfo.setContactId(ContactId);
}

public String getTitle() {
return contactInfo.getContactPersInfo().getNameInfo().getTitle();
}

public void setTitle(String Title) {
this.contactInfo.getContactPersInfo().getNameInfo().setTitle(Title);
}
.
.
.
.
.
}

the setter methods throughs some exception. Exceptions will be thrown if
there is some format validation error. I want to catch this exception and
would like to display them on the screen, how can i achive this.


Thanks and Regards
deepak

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



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



RE: mesage message account

2003-08-19 Thread Mainguy, Mike
I will put money on the fact that nobody on this list wants to read about
your idiotic conspiracy theories.  Please amuse yourself by trolling on
Slashdot or usenet and stop wasting our time.  

-Original Message-
From: object worlds [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 9:42 AM
To: [EMAIL PROTECTED]
Subject: mesage message account

Did you take my message message account off the list ?
Is that because that white shit Mark Galbreath
said so and that shit Craig Mclanahan agreed.

_
Express yourself with cool emoticons - download MSN Messenger today! 
http://www.msn.co.uk/messenger


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


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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



Re: Dealing with images...

2003-08-19 Thread Adam Levine
My personal preference has been to store the images in a specific directory, 
which is defined in an application-specific location, with the image name 
being set to the unique ID (primary key) in the image table.. that's where I 
store the mime type, the size, the dimensions, keywords, title, owner, date 
added, etc.

 Images are delivered with a servlet, either being passed the image id 
(usually encrypted so people can't just retrieve whatever they want) or 
pulling the id out of a session object.  this allows me control over who has 
access to the images, and even manipulation (ie, watermarked copyrights on 
the image).

but, that's just how i do it.

cheers!

From: "Keith Pemberton" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Dealing with images...
Date: Tue, 19 Aug 2003 10:08:43 -0500
I would like to get some input from you guys as to how best to deal with a
group of images.  I want to put up a photo album of sorts but I am unsure as
to how best to access the directory that they are contained in.  I could put
an initial parameter in the web.xml file that points to the directory, I
guess, and just access that parameter.  Or I could do a context
getRealPath(), or maybe even store each location in a database table along
with a description.  Anyway, your feedback on how best to handle this is
much appreciated!
Keith Pemberton
---
"Everything's changing when I turn around all out of my control I'm a
mobile..."
Mobile off the cd Let Go by Avril Lavigne.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Get MSN 8 and enjoy automatic e-mail virus protection.
http://join.msn.com/?page=features/virus

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


Adding to a tiles definition at runtime?

2003-08-19 Thread David Erickson
Is there any possible way to add additional variables to a tiles definition at runtime 
or to modify them? IE here is a definition:
























And then my menu jsp iterates through that list of menus adding them.  The problem is 
I need a seperate tiles definition for every possible menu configuration, and then if 
I want an action that forwards to a definition that could show different menus.. etc 
etc it gets to be a pain. So would it be possible to change whats in that list or add 
to that list in my action before I forward to a tiles def? *Shrug just trying to get 
some ideas together here*.



If that is not possible then my next question is in my baselayout.jsp I have the 

 tag.  In which scope does it search for a variable 
named menu?  and if i changed that to  or something 
of that nature could it change at runtime based on something in my request/or session 
scope?

Thanks in advance!


RE: [OT] get abs path to my web application root context

2003-08-19 Thread Alex Shneyderman
request.getSession ().getServletContext ().getRealPath ("/");

> -Original Message-
> From: Alen Ribic [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 19, 2003 9:10 AM
> To: Struts Users Mailing List
> Subject: [OT] get abs path to my web application root context
> 
> Hi All
> 
> This may be a bit of a silly and of topic question but this is driving
me
> up
> the wall. ;)
> I would like to save uploaded files to my application's
> %app_root%/images/items/ path.
> How do I get the absolute path to my web application's root directory?
> e.g. "c:/tomcat/webapps/myapp_root/"
> 
> Thanks
> 
> --Alen
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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



RE: no getter method found

2003-08-19 Thread Mark Galbreath
see my response to your last email

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:34 PM
To: 'Struts Users Mailing List'
Subject: RE: no getter method found


Actually, my last email was wrong, they should be:
public String getLastName()
and
public void setLastName();

-Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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



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



RE: no getter method found

2003-08-19 Thread Mark Galbreath
getLastname() and setLastname()

-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 9:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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



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



RE: Struts to EJB interface strategies

2003-08-19 Thread Mark Galbreath
Last year I was on a team that developed a complex ecommerce for T-Mobile
that used Struts 1.0.1 and EJB 1.1.  We had the Action classes interfaced
with DAOs, which in turn went through a session façade (a single session
EJB) which in turn called some 40 different entity beans that, depending on
the function, either maintained state from the database or from a cache.
It's difficult to give you examples, but I can send you the source (it's
copyrighted, mind you).

Mark

-Original Message-
From: yan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 8:49 AM
To: [EMAIL PROTECTED]
Subject: Struts to EJB interface strategies


Hi,

Firstly, can anyone recommend a good resource that deals with how you
integrate a Web Tier implemented using Struts with the EJB Tier. And also a
resource that has an excellent example of how the Struts framework interacts
with J2EE. I am looking for more than the basic examples you normally find
as they do not help given the complexity of the application I am working on.

Secondly, what strategies does one use when deciding on how to implement the
ActionClass to Session Bean Inteface?

I am thinking along these lines:
Create a 'Client Helper Interface' that defines all the business methods
that your application will require.  This Helper class will form the
interface between the ActionClasses and the Session Beans.

The ActionClass creates a 'Client Helper Interface' object and calls the
relevant methods within this interface.  The Client Interface then creates a
Session Bean that implements the Client Interface.

The Session Bean creates the Entity Bean that opens the database connection
and returns the relevant data back to the Session Bean.  The Session Bean
returns the required information back to the Client Helper Interface.  The
Client Helper Interface returns to the ActionClass

Should you have a separate Helper Interface for each Session Bean?

many thanks
yan

KickStartESolutions - Intelligent Web Services [EMAIL PROTECTED]



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



[OT] RE: mesage message account

2003-08-19 Thread Mark Galbreath
Actually, I'm an African-American pro-Islamic militant revolutionary who is
on this list only to monitor the secret Zionist elitists disguised as Struts
developers and gather intelligence for the coming .NET holocaust and world
domination.

Mark (is only my code name)

-Original Message-
From: object worlds [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 9:42 AM

Did you take my message message account off the list ?
Is that because that white shit Mark Galbreath
said so and that shit Craig Mclanahan agreed.



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



RE: mesage message account

2003-08-19 Thread Hue Holleran
How can we miss you if you won't go away?

> -Original Message-
> From: object worlds [mailto:[EMAIL PROTECTED]
> Sent: 19 August 2003 14:42
> To: [EMAIL PROTECTED]
> Subject: mesage message account 
> 
> 
> Did you take my message message account off the list ?
> Is that because that white shit Mark Galbreath
> said so and that shit Craig Mclanahan agreed.
> 
> _
> Express yourself with cool emoticons - download MSN Messenger today! 
> http://www.msn.co.uk/messenger
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.511 / Virus Database: 308 - Release Date: 18/08/2003
> 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.511 / Virus Database: 308 - Release Date: 18/08/2003


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



RE: Dealing with images...

2003-08-19 Thread Mark Galbreath
Keith,

I'm not sure, but it seems I remember a photo album example in one of the
Java tutorials at java.sun.com.  If not, I know there are some at
www.gamelan.com.

Mark

-Original Message-
From: Keith Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 11:09 AM
To: [EMAIL PROTECTED]
Subject: Dealing with images...


I would like to get some input from you guys as to how best to deal with a
group of images.  I want to put up a photo album of sorts but I am unsure as
to how best to access the directory that they are contained in.  I could put
an initial parameter in the web.xml file that points to the directory, I
guess, and just access that parameter.  Or I could do a context
getRealPath(), or maybe even store each location in a database table along
with a description.  Anyway, your feedback on how best to handle this is
much appreciated!

Keith Pemberton
---
"Everything's changing when I turn around all out of my control I'm a
mobile..." Mobile off the cd Let Go by Avril Lavigne.



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



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



RE: Changing application path

2003-08-19 Thread Alex Shneyderman
> You are right and I am already using the struts html tag but the
> action is still being remapped.
> 
> My jsp form declaration is as follows :-
> 
> 
> 
> When the application is deployed in app.war it becomes :-
> 
> 
> 
> This would not ordinarily be a problem but /app is not the URL the
> business wishes to see for the application in question. If all my
> application paths refer to root rather than some other path then in
> the app server or web server the application can be remapped to a
> URL of our choice.

You have to deploy your app in the ROOT context, for your business
requirments to be satisfied. If you use tomcat that might be a bit
tricky, so lookup on how to do it in tomcat howtos. Otherwise consult
the docs of the app server you use.

Alex.


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



Re: Session expired

2003-08-19 Thread Mike Deegan
Sloan,

Can you provide example code from
com.symbol.mc.oms.servlet.SessionFilter
Or is that asking too much ??

TIA,
Mike

- Original Message - 
From: "Sloan Seaman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 12:17 PM
Subject: Re: Session expired


> How about a filter?
>
> That is what I use.  Anything within a certain path first gets checked by
my
> filter and if the user doesn't have a valid session object it redirects
them
> to the login page...
>
> This way the code doesn't even know it is happening...
>
> You define one in your web.xml like so:
> 
>
> SessionFilter
>
> com.symbol.mc.oms.servlet.SessionFilter
>
> 
>
>
>
> 
>
> SessionFilter
>
> /app/*
>
> 
>
>
>
> This way anything within the /app dir goes through the filter first...
>
> - Original Message - 
> From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 19, 2003 8:12 AM
> Subject: RE: Session expired
>
>
> > My problem is, that I already have something around 60 jsps. Now it
would
> be
> > nice to have a workaround so that i don't have to adapt all my jsps and
> > actions.
> >
> > > -Original Message-
> > > From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 19, 2003 12:58 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Session expired
> > >
> > >
> > > What if you check from your action before redirecting to a  jsp ?
> > >
> > >
> > > Filip Polsakiewicz wrote:
> > >
> > > >Hi,
> > > >is there any way to redirect y user to a jsp if the session is
expired
> > > >without checking for an expired session within each single jsp?
> > > >
> > > >Thanks, Filip
> > > >
> > > >
> > > >
> > > >
> > > >-
> > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> 
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Adding to a Tiles Definition at runtime?

2003-08-19 Thread David Erickson
Is there any possible way to add additional variables to a tiles definition
at runtime or to modify them? IE here is a definition:
























And then my menu jsp iterates through that list of menus adding them.  The
problem is I need a seperate tiles definition for every possible menu
configuration, and then if I want an action that forwards to a definition
that could show different menus.. etc etc it gets to be a pain. So would it
be possible to change whats in that list or add to that list in my action
before I forward to a tiles def? *Shrug just trying to get some ideas
together here*.



If that is not possible then my next question is in my baselayout.jsp I have
the

 tag.  In which scope does it search for a
variable named menu?  and if i changed that to  or something of that nature could it change at runtime
based on something in my request/or session scope?

Thanks in advance!


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



Re: [OT] get abs path to my web application root context

2003-08-19 Thread Emerson Cargnin
Servlet method :
 getServletContext().getRealPath("/")
request has getRealPath, but is depracated.
Don't know how to get this inside an action (besides using the 
depracated method).maybe getting it at init servlet method and saving it 
under application context. Any other ideas...

Alen Ribic wrote:
Hi All

This may be a bit of a silly and of topic question but this is driving me up
the wall. ;)
I would like to save uploaded files to my application's
%app_root%/images/items/ path.
How do I get the absolute path to my web application's root directory?
e.g. "c:/tomcat/webapps/myapp_root/"
Thanks

--Alen



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



--
Emerson Cargnin
Analista de Sistemas
Setor de Desenvolvimento de Sistemas - TRE-SC
tel : (048) - 251-3700 - Ramal 3181
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: no getter method found

2003-08-19 Thread Ditlinger, Steve
public String getLastname(){}  Note the capital "L"

 -Original Message-
 From: Mehran Zonouzi [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 19, 2003 6:55 AM
 To: [EMAIL PROTECTED]
 Subject: no getter method found
 
 
 I have the below in my jsp page
 
 Last Name: 
 
 and this in my ActionForm subclass
 
 private String lastName = null;
 
   public String getlastname(){
  return this.lastName;
   }
 
   public void setlastname( String lastName){
  this.lastName = lastName;
   }
 
 But I keep getting the no gett found error message...
 No getter method for property lastname of bean 
 org.apache.struts.taglib.html.BEAN
 
 
 What should the getter method be called?
 
 
 --
 
 This e-mail may contain confidential and/or privileged 
 information. If you are not the intended recipient (or have 
 received this e-mail in error) please notify the sender 
 immediately and destroy this e-mail. Any unauthorized copying, 
 disclosure or distribution of the material in this e-mail is 
 strictly forbidden.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: radio buttons in dynamic forms

2003-08-19 Thread Hary
I had a similar problem and this is how I fixed it.

Define a new variable somedata in your parent form
because you want to tie this to one of the values from
your child

e.g OrderForm 
  private String selected;
  private ArrayList orderList;

OrderLine
  OID, price,  



 



..

Hope this helps.
If you find a better way let me know.

Hary

--- Claire Suttle <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am dynamically creating a form, by preopulating a
> DynaActionForm. The form is made from an ArrayList,
> and each object in the array contains the data for
> one row of a table. I need the user, looking at this
> page, to be able to select one and only one row in
> the table - which I am trying to do using radio
> buttons.
> 
> So my table looks something like:
> radiobuttonsomedatasometext (All from
> ArrayList[0])
> radiobuttonsomedatasometext (All from
> ArrayList[1])
> radiobuttonsomedatasometext (All from
> ArrayList[2])
> 
> and I need all these radio buttons to be part of the
> same group, however they are expanded in the jsp
> page to each be in their own group:
> 
> 
> 
> 
> 
> Does anyone know of a way to place all these radio
> buttons in one group? I also somehow need to
> preserve the relationship between each radio button
> and its row of data, so that I know which row has
> been selected.
> 
> Thanks,
> Claire
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: Session expired

2003-08-19 Thread Sloan Seaman
How about a filter?

That is what I use.  Anything within a certain path first gets checked by my
filter and if the user doesn't have a valid session object it redirects them
to the login page...

This way the code doesn't even know it is happening...

You define one in your web.xml like so:


SessionFilter

com.symbol.mc.oms.servlet.SessionFilter







SessionFilter

/app/*





This way anything within the /app dir goes through the filter first...

- Original Message - 
From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 8:12 AM
Subject: RE: Session expired


> My problem is, that I already have something around 60 jsps. Now it would
be
> nice to have a workaround so that i don't have to adapt all my jsps and
> actions.
>
> > -Original Message-
> > From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 19, 2003 12:58 PM
> > To: Struts Users Mailing List
> > Subject: Re: Session expired
> >
> >
> > What if you check from your action before redirecting to a  jsp ?
> >
> >
> > Filip Polsakiewicz wrote:
> >
> > >Hi,
> > >is there any way to redirect y user to a jsp if the session is expired
> > >without checking for an expired session within each single jsp?
> > >
> > >Thanks, Filip
> > >
> > >
> > >
> > >
> > >-
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com


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



Re: staticjavascript.jsp caching?

2003-08-19 Thread Adam Hardy
I think you should also check whether struts is appending no-cache 
headers to the response. In your struts-config.xml, this is set for the 
whole website so:





On 08/19/2003 12:29 PM Fırat TİRYAKİ wrote:
The browser you are dealing with is important here, and also last modified
date of the js file is important (not sure about the second one). To get rid
of these kind of problems you should change the js file name and the src
artribute where you call the js file, to have it updated everywhere.
F.



- Original Message - 
From: "Adolfo Miguelez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 1:16 PM
Subject: staticjavascript.jsp caching?



Pertaining to the staticJavascript.jsp page in the validator, I have to
defend with my boss the position that it is actually cached by the browser
so it is not downloaded for every request. However we have made some tests
and it is actually not cached.
How could I convince my boss? What am I doing wrong?

Adolfo.

_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Why would I want to use the ActionForm validate() method

2003-08-19 Thread Mainguy, Mike
The short answer is, you cannot always depend on javascript.  There is a
small percentage (Probably less than 1% I would expect) of users who either
disable javascript or don't have it in their browser (e.g. lynx).  In these
cases you will have no validation.  Also there are differences between how
each browser handles the DOM and javascript in general.

-Original Message-
From: Madhu Nair [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 2:33 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Why would I want to use the ActionForm validate() method


Hi,

 Why would I want to use the Struts ActionForm validate() method when I can
 achieve the same functionality using Javascript? I assume that the user
would never disable javascript.

 Regards ,
 Madhu


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


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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



RE: mesage message account

2003-08-19 Thread James Childers
Hi!

You are not special. There is not a conspiracy to "get you" because of your skin 
color, religion, or political beliefs. Your paranoid is unjustified, because you just 
aren't that important. You are simply a rude person, and most mailing lists have a low 
tolerance for rudeness. This one is no different.

Thanks for playing! Hope you learn to be nice to people and to not get your feelings 
so easily hurt. Buh-bye!

-= J

> -Original Message-
> From: object worlds [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 19, 2003 8:42 AM
> To: [EMAIL PROTECTED]
> Subject: mesage message account 
> 
> 
> Did you take my message message account off the list ?
> Is that because that white shit Mark Galbreath
> said so and that shit Craig Mclanahan agreed.
> 
> _
> Express yourself with cool emoticons - download MSN Messenger today! 
> http://www.msn.co.uk/messenger
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Dealing with images...

2003-08-19 Thread Keith Pemberton
I would like to get some input from you guys as to how best to deal with a
group of images.  I want to put up a photo album of sorts but I am unsure as
to how best to access the directory that they are contained in.  I could put
an initial parameter in the web.xml file that points to the directory, I
guess, and just access that parameter.  Or I could do a context
getRealPath(), or maybe even store each location in a database table along
with a description.  Anyway, your feedback on how best to handle this is
much appreciated!

Keith Pemberton
---
"Everything's changing when I turn around all out of my control I'm a
mobile..."
Mobile off the cd Let Go by Avril Lavigne.



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



AW: Suggestions for Calendar Popup taglib?

2003-08-19 Thread Ralf E. Stranzenbach
Hi,

this calendar popup looks really great. It would be neat, to integrate this
directly into some form pages. (not as a pop up)



-Ursprüngliche Nachricht-
Von: Kruse, Matt [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 18. August 2003 16:56
An: Struts Users Mailing List (E-mail)
Betreff: Suggestions for Calendar Popup taglib?


I'm going to have some free time soon and I plan to convert my calendar
popup javascript (http://www.mattkruse.com/javascript/calendarpopup) into a
tag lib to be easily used in struts apps.

If anyone has suggestions on how it should work or features it should
support, please let me know!

Also, should it be extending the struts html:input tag, or since those will
one day go away, should I be extending a different taglib? I'm more familiar
with the struts tags (extended them before) but I want the tag to be useable
by the majority of struts developers :)

Matt



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



radio buttons in dynamic forms

2003-08-19 Thread Claire Suttle
Hi,

I am dynamically creating a form, by preopulating a DynaActionForm. The form is made 
from an ArrayList, and each object in the array contains the data for one row of a 
table. I need the user, looking at this page, to be able to select one and only one 
row in the table - which I am trying to do using radio buttons.

So my table looks something like:
radiobuttonsomedatasometext (All from ArrayList[0])
radiobuttonsomedatasometext (All from ArrayList[1])
radiobuttonsomedatasometext (All from ArrayList[2])

and I need all these radio buttons to be part of the same group, however they are 
expanded in the jsp page to each be in their own group:





Does anyone know of a way to place all these radio buttons in one group? I also 
somehow need to preserve the relationship between each radio button and its row of 
data, so that I know which row has been selected.

Thanks,
Claire


RE: [OT] RE: J2EE certified

2003-08-19 Thread Micael
Are you interested in getting yourself or an application certified?  Do you 
mean, for example, that you want to get certified as a knowledgeable person 
or that you have coded an application which for some reason you want to be 
certified as J2EE compliant?  If either is the case, go to www.java.sun.com 
and do the relevant searches to find the right pages on either one.

Good luck.  Pax nabisco!

Micael

At 09:37 AM 8/18/2003 -0400, Mark Galbreath wrote:
Very diplomatic of you, Mark, but I won't be an apologist for a bigot.

Mark

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 9:34 AM
To: Struts Users Mailing List
Subject: Re: [OT] RE: J2EE certified
I'd prefer to know the guys name.

I wouldn't like to make any judgments about "disturbedness", give him a
chance. He could have got off to a bad start, been up against the wire
and trying to get something working when he started out. And forgot
that there are real people at the end of the messages. By the time he
got a response the whole dialogue had started.
Message, can you stop assuming that we're all white racists that all
hate you, and tell us what struts problems your still having? Signing
up with your real name and putting a lid on the dummy-spitting could
help you solve your problem. Even remaining "message message" wouldn't
be a problem, if you just stop giving it the large one. If the english
is a problem please just say so, perhaps an over-reliance on first
language idioms makes things a tad tricky to comprehend.
So did you get your login app running? If not what's going on with it?
Any error messages?
Cheers Mark

On Monday, August 18, 2003, at 02:15 PM, Mark Galbreath wrote:

> already done.  I'd like to see Craig or Ted kick this guy off the
> list. There is absolutely no excuse for racial slurs or personal attacks.
> This
> guy is apparently very disturbed.
>
> Mark
>
> -Original Message-
> From: Jeff Kyser [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 8:56 AM
> To: Struts Users Mailing List
> Subject: Re: [OT] RE: J2EE certified
>
>
> 'the majority of you...' ???
>
> setting up message message filter filter now now...
>
> -jeff
>
> On Monday, August 18, 2003, at 07:51  AM, message message wrote:
>
>>
>> Who wants to know about your theory about girls or beer.
>> I already you know that the majority of you are Racist , low life
>> scum.
>>
>>
>>
>>> From: "message message" <[EMAIL PROTECTED]>
>>> Reply-To: "Struts Users Mailing List"
>>> <[EMAIL PROTECTED]>
>>> To: [EMAIL PROTECTED]
>>> Subject: RE: [OT] RE: J2EE certified
>>> Date: Mon, 18 Aug 2003 16:47:47 +0400
>>>
>>> Why not filter you out.
>>> Perhaps because you are white.
>>> Or perhaps you represent certain interests.
>>>
>>>
>>>
>>>
 From: "Mark Galbreath" <[EMAIL PROTECTED]>
 Reply-To: "Struts Users Mailing List"
 <[EMAIL PROTECTED]>
 To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
 Subject: RE: [OT] RE: J2EE certified
 Date: Mon, 18 Aug 2003 08:05:44 -0400

 Just filter out this message message character; he's been
 argumentative and arrogant since he joined a couple of weeks ago.

 Mark

 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 16, 2003 6:08 AM
 To: Struts Users Mailing List
 Subject: Re: [OT] RE: J2EE certified


 Before you guys on this thread go really overboard with tit-for-tat
 arguments, perhaps you should consider whether that type of
 discussion fits in on a list where people are on first name terms,
 helpfulness and
 consideration are the order of the day, and secretiveness is
 generally
 considered unnecessary.

 It's only through such an attitude shared by all the listers here
 that such a high volume list can remain so productive.

 All the best,
 Adam


 On 08/16/2003 11:47 AM message message wrote:
>
> I should also inform you that I am writing my own product that
> includes marketing. It is none of your business what the product
 is.
>
>> From: "message message" <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List"
>> <[EMAIL PROTECTED]>
>> To: [EMAIL PROTECTED]
>> Subject: Re: [OT] RE: J2EE certified
>> Date: Sat, 16 Aug 2003 13:37:43 +0400
>>
>>
>> There is nothing wonky here apart from your postings.
>> A discussion is going on about verify applications and the
>> consequences.
>>
>> I hardly consider you to be qualified to express an opinion on my
>> posting.
>>
>> To make comments or express opinions about my postings is a
>> qualification you gave yourself but I do not recognise it.
>>
>>
>>> From: "Alen Ribic" <[EMAIL PROTECTED]>
>>> Reply-To: "Struts Users Mailing List"
>>> <[EMAIL PROTECTED]>
>>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>> Subject: Re: [OT

RE: no getter method found

2003-08-19 Thread Yee, Richard K,,DMDCWEST
Actually, my last email was wrong, they should be:
public String getLastName()
and
public void setLastName();

-Richard


-Original Message-
From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 6:55 AM
To: [EMAIL PROTECTED]
Subject: no getter method found


I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean
org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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



Globals forwards with LookupDispatchAction

2003-08-19 Thread Matt Raible
I'm using lookup LookupDispatchAction and to ease development, I've
defined each of my CRUD methods as a global-forward.  For example:



However, the problem is that this doesn't work with i18n.  What I'd like
to do is to have it dynamically substituted in the struts-config.xml
file.  So my forward would look like this:



Is this possible - or am I best off using  with parameters as
part of the link?

Thanks,

Matt





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



no getter method found

2003-08-19 Thread Mehran Zonouzi
I have the below in my jsp page

Last Name: 

and this in my ActionForm subclass

private String lastName = null;

  public String getlastname(){
 return this.lastName;
  }

  public void setlastname( String lastName){
 this.lastName = lastName;
  }

But I keep getting the no gett found error message...
No getter method for property lastname of bean org.apache.struts.taglib.html.BEAN


What should the getter method be called?


--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



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



Re: Changing application path

2003-08-19 Thread java-dude
You are right and I am already using the struts html tag but the 
action is still being remapped. 

My jsp form declaration is as follows :-



When the application is deployed in app.war it becomes :-



This would not ordinarily be a problem but /app is not the URL the 
business wishes to see for the application in question. If all my 
application paths refer to root rather than some other path then in 
the app server or web server the application can be remapped to a 
URL of our choice. 

i.e we want to map the app to a URL like :-

www.someapp.com/example

NOT like :-

www.someapp.com/app/example

which is happening at present and where the app part of the path is 
coming from the name of the war file being deployed.


--- In [EMAIL PROTECTED], Riaan Oberholzer 
<[EMAIL PROTECTED]> wrote:
> If it is purely from a coding point of view, then you
> should (should anyway) use the struts html tags:
> 
> 
> 
> The struts tag implementation will take care of
> inserting the proper prefix.
> 
> 
> 
> --- java-dude <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > I need to change the base path of my struts
> > application so that 
> > there is no prefix on the form actions.
> > 
> > For example if my application is deployed in the
> > application server 
> > as app.war and I view the source for a jsp with a
> > form on it, say 
> > example.jsp, in internet explorer, I see that the
> > form has an action 
> > tag as follows :-
> > 
> > action="/app/example.do"
> > 
> > This is happening even though the jsp is actually
> > coded with action 
> > tag as follows :-
> > 
> > action="example"
> > 
> > 
> > Basically I would like the generated source for this
> > page to be 
> > without the base of the path as follows :-
> > 
> > action="/example.do"
> > 
> > I am guessing it may require manipulation of the
> > web.xml and/or 
> > struts-config.xml files but I am not sure, and if so
> > how ?
> > 
> > Suhel Rizvi
> > 
> > 
> >
> ---
--
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> ---
--
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Struts to EJB interface strategies

2003-08-19 Thread yan
Hi,

Firstly, can anyone recommend a good resource that deals with how you
integrate a Web Tier implemented using Struts with the EJB Tier. And also a resource 
that has an excellent example of how the Struts framework interacts with J2EE. I am
looking for more than the basic examples you normally find as they do not help given 
the complexity of the application I am working on.

Secondly, what strategies does one use when deciding on how to implement the
ActionClass to Session Bean Inteface?

I am thinking along these lines:
Create a 'Client Helper Interface' that defines all the business methods
that your application will require.  This Helper class will form the
interface between the ActionClasses and the Session Beans.

The ActionClass creates a 'Client Helper Interface' object and calls the
relevant methods within this interface.  The Client Interface then creates a
Session Bean that implements the Client Interface.

The Session Bean creates the Entity Bean that opens the database connection
and returns the relevant data back to the Session Bean.  The Session Bean
returns the required information back to the Client Helper Interface.  The
Client Helper Interface returns to the ActionClass

Should you have a separate Helper Interface for each Session Bean?

many thanks
yan

KickStartESolutions - Intelligent Web Services
[EMAIL PROTECTED]


RE: [OT] Question about Servlets & Threads

2003-08-19 Thread Yee, Richard K,,DMDCWEST
Jan,
How long does your thread take to run? Since you are waiting for the thread
to finish anyway in your servlet, I'm not sure it is very necessary to start
a new thread to process the request. It adds a bit of overhead to process
each request since an extra thread is created for every request that gets
processed. If this is really necessary, then you also might look into using
a thread pool. I don't see the need for the new thread. Perhaps you can
describe what you are doing in this thread. As I suggested in my previous
email, you could use a utility class as an interface between your servlet
and your business logic or just handle everything in methods in your
servlet.

One more thing suggestion is to name your parameters with mor descriptive
names. ie. change this
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException{
process(arg0, arg1);
}

to 

protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException{
process(request, response);
}

(you could also use req and resp instead of request and response)

Regards,

Richard

-Original Message-
From: Jan Zimmek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 1:17 AM
To: Struts Users Mailing List
Subject: Re: [OT] Question about Servlets & Threads


Hi,

I think you're right, but let me ask a last question please ;-)

here are some source snippets of my classes:

MyServlet (which handles all incoming requests like ActionServlet in struts
and populates Request/Response and the action to execute to the new created
WebThread):
-
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException{
process(arg0, arg1);
}

protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException{
process(arg0, arg1);
}

protected void process(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException{
WebThread t = new WebThread(request, response, new WebAction());

t.start();

while(t.isAlive());

t.release();
t = null;
}

You see all processing is of the request will be done in the "run()" method
of the new created WebThread instance.

And this is the point why I am not understand, that I can run into complex
threading issues.

Snippet of a WebAction-Object (this is always thread-safe like a struts
action):

---

public void execute(){
HttpServletResponse response = Globals.response();

try{
response.getWriter().write("");
}catch(IOException e){
e.printStackTrace();
}
}


And this is the Globals-Object source:
--

public class Globals{
private static WebThread current(){
return (WebThread)Thread.currentThread();
}

public static HttpServletRequest request(){
return current().getRequest();
}

public static HttpServletResponse response(){
return current().getResponse();
}
}

The Globals-class simply returns the Request/Response-Object of the current
WebThread (subclass of Thread) via "getter"-methods. I have tested MyServlet
by making multiple concurrent request by an application (running 10 thread
each making 1000 requests in a loop). Each request has been processed
correctly.

Hope this message is not so long that you directly drop, because I am very
occupied with this subject.

Any comments would be very appreciated.

greets
Jan Zimmek


- Original Message - 
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 4:38 AM
Subject: Re: [OT] Question about Servlets & Threads


> On Mon, 18 Aug 2003, Jan Zimmek wrote:
>
> > Date: Mon, 18 Aug 2003 23:47:49 +0200
> > From: Jan Zimmek <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED]
> > Subject: Re: [OT] Question about Servlets & Threads
> >
> > Hi,
> >
> > I know, but I want to have a similar behavior like "global 
> > variables" to access Request/Response-Object without to pass them as 
> > parameter to each method I need to access them.
> >
>
> One option to consider is to store the current request and response 
> objects into a static variable of type java.lang.ThreadLocal (perhaps 
> in a Filter, if you're using Servlet 2.3, or a customized 
> RequestProcessor implementation that does this in its process() method 
> before executing the standard processing).
>
> It's fair to warn you, though, that object oriented purists will frown 
> on anything like this, because static variables (similar to globals in 
> PHP) are the root of all sorts of program bugs :-).  Explicitly 
> passing thin

[OT] RE: HTTP 404 Not Found on Actions - SOLVED

2003-08-19 Thread Stephen Brown
You'll need to add a JkMount to your httpd.conf file.

You probably have 

JkMount /*.jsp ajp13

so that your jsps work (this maps *.jsp to the Tomcat ajp13 link).  You'll
need to add something like

JkMount /*.do ajp13

so that your Struts actions work too.

Steve

> -Original Message-
> From: Johan Wasserman - CPX Mngd Services
> [mailto:[EMAIL PROTECTED]
> Sent: August 19, 2003 1:51 AM
> To: Struts Users Mailing List
> Subject: RE: HTTP 404 Not Found on Actions - SOLVED
> 
> 
> Nope, nothing to do with struts!  It's something to do with 
> how Tomcat /
> Apache is set up.  When I try via Tomcat only it works.  I'll have to
> relook the Tomcat/Apache thing (mod_jk), if ANYBODY has a tried and
> trusted way of setting this up, please let me know.
> 
> Tomcat v.  5.0.3
> Apache v. 2.0.46
> 
> Sory for this "out of context".
> 
> Thanks,
> Johan.
> 
> -Original Message-
> From: Koni Roth [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 18, 2003 12:41 PM
> To: Struts Users Mailing List
> Subject: Re: HTTP 404 Not Found on Actions
> 
> 
> Try struts 1.1 final version. Here it works ;-)
> 
> Johan Wasserman - CPX Mngd Services wrote:
> 
> > Hi.
> > I'm running struts 1.1-rc2 and get a 404 when entering an 
> unrecognized
> 
> > username & password on the logon page for struts-example 
> (Mailreader 
> > demo).  It goes to localhost/sruts-example/logon.do but with a 404 
> > Page not found.  I've checked and double checked my web & 
> > struts-config files, I mean they've not been changed from the 
> > download.
> > 
> > Thanks,
> > Johan Wasserman.
> > 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


[OT] ssl connection

2003-08-19 Thread Nagendra Kumar O V S








  hi,
  help me...
   
  i have configured SSL on weblogic 7.0 using the demo cert and its 
  working fine. now i need to make a connection to 3rd party credit card 
  validator URL from my session bean and get the response. how do i do this. 
  i have tried using HttpsURLConnection and its failing in the handshake. i 
  am not sure what's required. as i am already in the https, how can i make 
  a connection to another server. do we have provide the weblogic 
  credentials to the 3rd party. if yes, how
  i am using HttpURLconnection and it giving 
  java.io.IOException: Write Channel Closed, possible SSL handshaking 
  or trust failure
  any ideas??
   TIA
   
   
  Nagendra Kumar O V S
  Member Technical Staff
  ikigo
  470-B, Road No. 36,
  Jubilee Hills,
  Hyderabad 500033
  +91-40-23544671
  +91-98482-41789





	
	
	
	
	
	
	




  IncrediMail - 
Email has finally evolved - Click 
Here



Re: Security and Roles related

2003-08-19 Thread Dan Tran
You can assign a role attribute with multiple role names in the action
configuration.

Underneath, struts uses isUserInRole to check against the list you provided.

However, checking security is better off to let container do it for you.

-D

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 4:07 AM
Subject: Security and Roles related


> Does STRUTS provide integration with any security framework independent of
> the underlying application server. Basically I am looking at services like
> isUserInRole(), getRole() and the sort.
>
> Regards
> Sreekant G
> @ 98404-65630
>
>
>






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

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



RE: Please Guide : STRUTS Versions

2003-08-19 Thread Mainguy, Mike
1.1 is no longer beta.  It has been released since the end of July.  I
haven't heard of any show stopping problems with it and am fairly confident
it is a good choice for any projects going forward.  I think the document
you are referring to is a bit dated.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 5:27 AM
To: [EMAIL PROTECTED]
Subject: Please Guide : STRUTS Versions

Hi All,

I need to make a decision whether to use STRUTS 1.0 or STRUTS 1.1 for the
application that I am going to develop. The application is fairly a large
sized application. I would like to know which would be a better choice out
of your experience. I have gone through the documentation @
http://www.theserverside.com/resources/articles/Struts1_1/article.html
which concludes with the below paragraph

"If your project is a new one, the decision to use Struts 1.1 mainly
depends on the amount of risk your project can take. Struts 1.0 is a proven
technology but Struts 1.1 is still in beta. Besides, migrating backwards is
always more difficult than migrating forwards. Once you start with Struts
1.1, it will involve a lot of hard work to go back to Struts 1.0. While the
extra risk in using Struts 1.1 is generally very low (as the quality of
work from Apache's developer community has been consistently very good), it
is still a non-negligible factor you have to consider."

Regards
Sreekant G



This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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



  1   2   >