Wizard implementation wanted

2005-03-11 Thread Viktar Duzh
Guys,
I have a web application that is built on struts framework. I need to 
implement a couple of wizards within the application. Could anybody 
recommend a robust approach?

Thanks,
- Viktar 

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


Re: Wizard implementation wanted

2005-03-11 Thread Nicolas De Loof
Validator has a built-in support for wizards
You have to include in your pages all form-bean fields (use hidden tag 
for those the user doesn't have to edit in a page)
You also have to add a hidden input named page

Validator rule can use this page param to 'only' validate inputs prior 
to a page numbre. Using this, on the N wizard action, all fields set on 
page 1..N are validated, and on final action (that will commit inputs in 
DB) all fields are validated.

Nico.
Viktar Duzh a crit :
Guys,
I have a web application that is built on struts framework. I need to 
implement a couple of wizards within the application. Could anybody 
recommend a robust approach?

Thanks,
- Viktar
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message contains information that may be privileged or confidential 
and is the property of the Capgemini Group. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient,  you are not 
authorized to read, print, retain, copy, disseminate,  distribute, or use this 
message or any part thereof. If you receive this  message in error, please 
notify the sender immediately and delete all  copies of this message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DataSource........

2005-03-11 Thread Vamsee Kanakala
K Rajesh wrote:
i have one doubt. Connection Pooiling only possible thro' JSTL sql:DataSource
Tag or any other way in JSP. kindly let me know.
 

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
HTH,
Vamsee.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: user management

2005-03-11 Thread Günther Wieser
i for one put the user object into the session, as i have a lot of method
calls against this use object on each page. if you don't use the user object
often, put some identifier in the session to mark that the user has logged
in, eg. key=user, value=username. if you need to access the user data
later on, you can user the value of this session object to retrieve the real
user object from a service or whatever.

but there is nothing like built in support in struts as far as i know.

kr,
guenther


-Original Message-
From: wo_shi_ni_ba_ba [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 12:55 AM
To: user@struts.apache.org
Subject: user management

do struts developers usually store user as an object in session? or does
struts have additional framework for handling user management.
thanks in advance



__
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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




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



Re: using Taglibs

2005-03-11 Thread nitin dubey
Dakota,

Thanx for the reply. I did some elementary development
using Struts framework.  But there I used
DispatchAction and server side validations.  Now we
are writing a CMS app that involves complicated
interfaces.  Hence keeping the developers skill set
into mind I am just wondering if I can drop
Struts/JSTL and use the simple jsps for front end. 
Rest everything will be run by struts.  the team is
comfortable using JSPs.

Now if we decide to go for JSP's how can we access the
from properties in JSP ?

Regards,


Nitin


--- Dakota Jack [EMAIL PROTECTED] wrote:
 You need to use html:form, so the answer is that
 you have to use the
 taglibs unless you do some serious coding changes to
 the framework. 
 Why do you want to use the form but not the taglibs?
  If you just want
 to do that, build your own ActionForm with your own
 autopopulation
 classes, etc.?
 
 What you are trying to do or why is not clear.
 
 Sounds like you are a bit unacquainted with Struts
 and I would
 recommend that you take a closer look before
 deciding what you want to
 do.
 
 Jack
 
 
 On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin
 dubey
 [EMAIL PROTECTED] wrote:
  Hello,
  
  Can we use struts without using its taglibs ?  We
 will
  just write plain JSPs.  If yes how do we get the
  values into and from our ActionForms ?
  
  regards,
  
  Nitin
  
  __
  Do you Yahoo!?
  Yahoo! Small Business - Try our new resources
 site!
  http://smallbusiness.yahoo.com/resources/
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
 
 
 -- 
 You can lead a horse to water but you cannot make
 it float on its back.
 ~Dakota Jack~
 

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



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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



unspecified() not getting called.

2005-03-11 Thread nitin dubey
Hello,

The flow is like this..

Login Page - Generate Site page.

Login Page has, LoginAction extends DispatchAction and
LoginForm and GenerateSite page has GenerateSiteAction
and GenerateSiteForm.

Both the Actions are having unspecified() method
implemented.  When I send the GET request to the Login
page as the dispatch parameter is empty it should call
unspecified() however it does not calls this method
and straightaway displays the content.  Can you tell
me where I am getting wrong ?

I have mentioned parameter=dispatch in my action tag
in struts-config.xml

Regards,


Nitin

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Tile in Tile - possible?

2005-03-11 Thread Hauschel Fred
Hey,

is it possible to extend a Definition and overload a tile by a new
definition?

 

What I want is:

My Base Struts Module should have a simple baseDefinition:



tiles-definitions

definition name=.cpfDefinition path=/cpfLayout.jsp 

  put name=de.sagIchNich.cp.cpfextension
value=/cpfdefault.jsp/

/definition

/tiles-definitions

 

This base should be extended by another Module.

 

tiles-definitions

definition name=de.sagIchNich.cp.topmenue
extends=.cpfDefinition

  put name=de.sagIchNich.cp.cpfextension
value=de.sagIchNich.cp.topmenue.componen/

/definition

 

definition name=de.sagIchNich.cp.topmenue.component
path=/plugins/topmenue/topmenueLayout.jsp 

  put name=de.sagIchNich.cp.topmenue.top
value=/plugins/topmenue/start.jsp/

put name=de.sagIchNich.cp.topmenue.bottom
value=/plugins/topmenue/start.jsp/

/definition

/tiles-definitions

 

But I think that is not possible.

Is there another way to something like this?

 

Maybe:

tiles-definitions

definition name=de.sagIchNich.cp.topmenue
extends=.cpfDefinition

  put name=de.sagIchNich.cp.cpfextension value=subLayout.jsp/

put name=sublayoutTile1 value=first.jsp/

put name=sublayoutTile2 value=second.jsp/

/definition

/tiles-definitions

 

 

Thanks Fredy



Re: user management

2005-03-11 Thread Nicolas De Loof
I'm using SecurityFilter and use the Principal to store the user ID. The 
actions use the J2EE compliant request.getUserPrincipal(). Having 
userId, they can call business objects.

Nico.
Günther Wieser a écrit :
i for one put the user object into the session, as i have a lot of method
calls against this use object on each page. if you don't use the user object
often, put some identifier in the session to mark that the user has logged
in, eg. key=user, value=username. if you need to access the user data
later on, you can user the value of this session object to retrieve the real
user object from a service or whatever.
but there is nothing like built in support in struts as far as i know.
kr,
guenther
-Original Message-
From: wo_shi_ni_ba_ba [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 12:55 AM
To: user@struts.apache.org
Subject: user management

do struts developers usually store user as an object in session? or does
struts have additional framework for handling user management.
thanks in advance
		
__
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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

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

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


Re: using Taglibs

2005-03-11 Thread Viktar Duzh
Jack,
I suppose you are not right. There is no problem of using ordinary form 
HTML tag in a plain JSP. But that form must have a correct url and names of 
the input elements within the page to make the framework pick up right 
action and populate form bean respectively.

I will give a example.
1. Suppose you have the following in your config file:
   action path=/save-customer
   type=com.action.SaveAction
   name=CustomerForm
   forward name=sucess path=/SavePage.jsp/
   /action
2. Your Customer.jsp would be:
...
form action=save-customer.do
   input type=text name=customerName ... /
   input type=submit ... /
/form
3. Your CustomerForm is expected to have the customerName property.
Thus, when a user click on the submit button the request comes in and the 
struts tries to find an action with save-customer path. Having found it, 
it instantiates the CustomerForm object and then tries to populate the 
properties of the bean based on HTT request parameters (customerName here). 
In the end, your class action class has acess to the parameters submitted by 
the ordinary HTML form.

But here is one thing. Customer.jsp usually shows some data. So a deveoper 
should manually set the value of the form's fields. I means it should get a 
bean that holds the customer data and set the value of the customerName 
field by some other tag.

To make clear why some people are trying to do it. An application would be 
built on the struts framework plus jstl tags. Using the jstls tags is taken 
because struts html tags might not cover some attributes of some html 
elements.

Regards,
-- Viktar
- Original Message - 
From: Dakota Jack [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, March 11, 2005 9:56 AM
Subject: Re: using Taglibs


You need to use html:form, so the answer is that you have to use the
taglibs unless you do some serious coding changes to the framework.
Why do you want to use the form but not the taglibs?  If you just want
to do that, build your own ActionForm with your own autopopulation
classes, etc.?
What you are trying to do or why is not clear.
Sounds like you are a bit unacquainted with Struts and I would
recommend that you take a closer look before deciding what you want to
do.
Jack
On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin dubey
[EMAIL PROTECTED] wrote:
Hello,
Can we use struts without using its taglibs ?  We will
just write plain JSPs.  If yes how do we get the
values into and from our ActionForms ?
regards,
Nitin
__
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Struts Business Logic :: Best Practices

2005-03-11 Thread karthikeyan balasubramanian
Hi all,

  Struts DB Access Best Practices thread gave me great insight on how
I should proceed with db operations.

  I have one more question.  Where do you keep your business logic
code.  Right now I am thinking to use

1. Struts(JSP, Actions) 
2. Simple class(Managers) to keep all our business logic code
3. IBATIS for database abstraction.

Actions can call Managers to get the job done and Manager can use
iBATIS to access DB.

Is this a good approach or is there a better approach than this?

Looking forward for your response.

Have a great day.

Karthikeyan B

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



Re: using Taglibs

2005-03-11 Thread nitin dubey
Thanks Viktar,

I am planning to use DispatchAction with which we can
use unspecified() method to populate the ActionForm
properties.  But how to put these properties in JSP
controls ?

Regards,

Nitin

--- Viktar Duzh [EMAIL PROTECTED] wrote:
 Jack,
 
 I suppose you are not right. There is no problem of
 using ordinary form 
 HTML tag in a plain JSP. But that form must have a
 correct url and names of 
 the input elements within the page to make the
 framework pick up right 
 action and populate form bean respectively.
 
 I will give a example.
 
 1. Suppose you have the following in your config
 file:
 
 action path=/save-customer
 type=com.action.SaveAction
 name=CustomerForm
 forward name=sucess
 path=/SavePage.jsp/
 /action
 
 2. Your Customer.jsp would be:
 ...
 form action=save-customer.do
 input type=text name=customerName ... /
 input type=submit ... /
 /form
 
 3. Your CustomerForm is expected to have the
 customerName property.
 
 Thus, when a user click on the submit button the
 request comes in and the 
 struts tries to find an action with save-customer
 path. Having found it, 
 it instantiates the CustomerForm object and then
 tries to populate the 
 properties of the bean based on HTT request
 parameters (customerName here). 
 In the end, your class action class has acess to the
 parameters submitted by 
 the ordinary HTML form.
 
 But here is one thing. Customer.jsp usually shows
 some data. So a deveoper 
 should manually set the value of the form's fields.
 I means it should get a 
 bean that holds the customer data and set the value
 of the customerName 
 field by some other tag.
 
 To make clear why some people are trying to do it.
 An application would be 
 built on the struts framework plus jstl tags. Using
 the jstls tags is taken 
 because struts html tags might not cover some
 attributes of some html 
 elements.
 
 Regards,
 
 -- Viktar
 
 - Original Message - 
 From: Dakota Jack [EMAIL PROTECTED]
 To: Struts Users Mailing List
 user@struts.apache.org
 Sent: Friday, March 11, 2005 9:56 AM
 Subject: Re: using Taglibs
 
 
  You need to use html:form, so the answer is that
 you have to use the
  taglibs unless you do some serious coding changes
 to the framework.
  Why do you want to use the form but not the
 taglibs?  If you just want
  to do that, build your own ActionForm with your
 own autopopulation
  classes, etc.?
 
  What you are trying to do or why is not clear.
 
  Sounds like you are a bit unacquainted with Struts
 and I would
  recommend that you take a closer look before
 deciding what you want to
  do.
 
  Jack
 
 
  On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin
 dubey
  [EMAIL PROTECTED] wrote:
  Hello,
 
  Can we use struts without using its taglibs ?  We
 will
  just write plain JSPs.  If yes how do we get the
  values into and from our ActionForms ?
 
  regards,
 
  Nitin
 
  __
  Do you Yahoo!?
  Yahoo! Small Business - Try our new resources
 site!
  http://smallbusiness.yahoo.com/resources/
 
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
  -- 
  You can lead a horse to water but you cannot make
 it float on its back.
  ~Dakota Jack~
 
 

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

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



__ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

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



Re: using Taglibs

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

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

__
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


RE: using Taglibs

2005-03-11 Thread Rajaneesh
Hi Viktar,

  Having the tags html:form would execute for the tag library classes in
the package
org.apache.struts.taglib.html. Hence html:form and form are quite
different.

Regards
Rajaneesh

-Original Message-
From: Viktar Duzh [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 2:48 PM
To: Struts Users Mailing List; Dakota Jack
Subject: Re: using Taglibs


Jack,

I suppose you are not right. There is no problem of using ordinary form
HTML tag in a plain JSP. But that form must have a correct url and names of
the input elements within the page to make the framework pick up right
action and populate form bean respectively.

I will give a example.

1. Suppose you have the following in your config file:

action path=/save-customer
type=com.action.SaveAction
name=CustomerForm
forward name=sucess path=/SavePage.jsp/
/action

2. Your Customer.jsp would be:
...
form action=save-customer.do
input type=text name=customerName ... /
input type=submit ... /
/form

3. Your CustomerForm is expected to have the customerName property.

Thus, when a user click on the submit button the request comes in and the
struts tries to find an action with save-customer path. Having found it,
it instantiates the CustomerForm object and then tries to populate the
properties of the bean based on HTT request parameters (customerName here).
In the end, your class action class has acess to the parameters submitted by
the ordinary HTML form.

But here is one thing. Customer.jsp usually shows some data. So a deveoper
should manually set the value of the form's fields. I means it should get a
bean that holds the customer data and set the value of the customerName
field by some other tag.

To make clear why some people are trying to do it. An application would be
built on the struts framework plus jstl tags. Using the jstls tags is taken
because struts html tags might not cover some attributes of some html
elements.

Regards,

-- Viktar

- Original Message -
From: Dakota Jack [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, March 11, 2005 9:56 AM
Subject: Re: using Taglibs


 You need to use html:form, so the answer is that you have to use the
 taglibs unless you do some serious coding changes to the framework.
 Why do you want to use the form but not the taglibs?  If you just want
 to do that, build your own ActionForm with your own autopopulation
 classes, etc.?

 What you are trying to do or why is not clear.

 Sounds like you are a bit unacquainted with Struts and I would
 recommend that you take a closer look before deciding what you want to
 do.

 Jack


 On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin dubey
 [EMAIL PROTECTED] wrote:
 Hello,

 Can we use struts without using its taglibs ?  We will
 just write plain JSPs.  If yes how do we get the
 values into and from our ActionForms ?

 regards,

 Nitin

 __
 Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site!
 http://smallbusiness.yahoo.com/resources/

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




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

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



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


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



Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Ted Husted
As to business objects, the usual advice is to use Plain Old Java
Objects (POJOs).

The current MailReader example application is an excellent example of
creating a set of interfaces to represent business logic, then
instantiating a set of classes to implement the business logic.

The MailReader uses a Struts PlugIn to create the business logic beans
in application scope. Another good approach is to use Spring to create
your business objects. Here, you might use a PlugIn to create the
Spring instance in application scope, and then call the Spring
instance to create everything else.

Of course, my favorite way to manage business objects now is as a
Chain of Responsbility. But, to get started, you probably want to use
plain old business beans, as the MailReader does.

All this is to say, option 2. The Actions call the business beans, and
the beans do all the heavy lifiting. (Actions shouldn't know *how* to
do things, just who to ask to get things done.)

The iBATIS DAO layer is cool, but if you don't need a switchable DAO,
you can do the same thing using your own interfaces.

Of course, my favorite way to do business logic now is using the Chain
of Responsiblity. But, that's a bit bleeding edge right now :)

-Ted.

On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
[EMAIL PROTECTED] wrote:
 Hi all,
 
   Struts DB Access Best Practices thread gave me great insight on how
 I should proceed with db operations.
 
   I have one more question.  Where do you keep your business logic
 code.  Right now I am thinking to use
 
 1. Struts(JSP, Actions)
 2. Simple class(Managers) to keep all our business logic code
 3. IBATIS for database abstraction.
 
 Actions can call Managers to get the job done and Manager can use
 iBATIS to access DB.
 
 Is this a good approach or is there a better approach than this?
 
 Looking forward for your response.
 
 Have a great day.
 
 Karthikeyan B
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
HTH, Ted.

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



RE: Tile in Tile - possible?

2005-03-11 Thread hermod . opstvedt
Hi

What you are describing works - I have several apps where I do this sort
of thing

Hermod

-Original Message-
From: Hauschel Fred [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:12 AM
To: Struts Users Mailing List
Subject: Tile in Tile - possible?


Hey,

is it possible to extend a Definition and overload a tile by a new
definition?

 

What I want is:

My Base Struts Module should have a simple baseDefinition:



tiles-definitions

definition name=.cpfDefinition path=/cpfLayout.jsp 

  put name=de.sagIchNich.cp.cpfextension
value=/cpfdefault.jsp/

/definition

/tiles-definitions

 

This base should be extended by another Module.

 

tiles-definitions

definition name=de.sagIchNich.cp.topmenue
extends=.cpfDefinition

  put name=de.sagIchNich.cp.cpfextension
value=de.sagIchNich.cp.topmenue.componen/

/definition

 

definition name=de.sagIchNich.cp.topmenue.component
path=/plugins/topmenue/topmenueLayout.jsp 

  put name=de.sagIchNich.cp.topmenue.top
value=/plugins/topmenue/start.jsp/

put name=de.sagIchNich.cp.topmenue.bottom
value=/plugins/topmenue/start.jsp/

/definition

/tiles-definitions

 

But I think that is not possible.

Is there another way to something like this?

 

Maybe:

tiles-definitions

definition name=de.sagIchNich.cp.topmenue
extends=.cpfDefinition

  put name=de.sagIchNich.cp.cpfextension value=subLayout.jsp/

put name=sublayoutTile1 value=first.jsp/

put name=sublayoutTile2 value=second.jsp/

/definition

/tiles-definitions

 

 

Thanks Fredy



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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



RE: Struts Business Logic :: Best Practices

2005-03-11 Thread Marco Mistroni
Hello Ted,
I am interested in knowing how will you tackle
The  businessLogic issue with CoR..
And how that approach differs from having an interface for your 
Business logic where the implementation is configured via Spring..

Could you clarify your approach with a short sample?

Thanx in advance and regards
Marco



-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 11:03
To: Struts Users Mailing List; karthikeyan balasubramanian
Subject: Re: Struts Business Logic :: Best Practices

As to business objects, the usual advice is to use Plain Old Java
Objects (POJOs).

The current MailReader example application is an excellent example of
creating a set of interfaces to represent business logic, then
instantiating a set of classes to implement the business logic.

The MailReader uses a Struts PlugIn to create the business logic beans
in application scope. Another good approach is to use Spring to create
your business objects. Here, you might use a PlugIn to create the
Spring instance in application scope, and then call the Spring
instance to create everything else.

Of course, my favorite way to manage business objects now is as a
Chain of Responsbility. But, to get started, you probably want to use
plain old business beans, as the MailReader does.

All this is to say, option 2. The Actions call the business beans, and
the beans do all the heavy lifiting. (Actions shouldn't know *how* to
do things, just who to ask to get things done.)

The iBATIS DAO layer is cool, but if you don't need a switchable DAO,
you can do the same thing using your own interfaces.

Of course, my favorite way to do business logic now is using the Chain
of Responsiblity. But, that's a bit bleeding edge right now :)

-Ted.

On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
[EMAIL PROTECTED] wrote:
 Hi all,
 
   Struts DB Access Best Practices thread gave me great insight on how
 I should proceed with db operations.
 
   I have one more question.  Where do you keep your business logic
 code.  Right now I am thinking to use
 
 1. Struts(JSP, Actions)
 2. Simple class(Managers) to keep all our business logic code
 3. IBATIS for database abstraction.
 
 Actions can call Managers to get the job done and Manager can use
 iBATIS to access DB.
 
 Is this a good approach or is there a better approach than this?
 
 Looking forward for your response.
 
 Have a great day.
 
 Karthikeyan B
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
HTH, Ted.

-
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 Business Logic :: Best Practices

2005-03-11 Thread Manfred Wolff
Ted.
+1 to this approach. I prefer leightweight container such as hivemind to 
manage the entrypoints to the business logic. Hivemind is easy to learn 
and you have the benefit, that the lifecycle of the business components 
may be steered too (such as pooled components, singletons etc.). Other 
containers like spring or picocontainer are also well.

-Manfred
Ted Husted wrote:
As to business objects, the usual advice is to use Plain Old Java
Objects (POJOs).
The current MailReader example application is an excellent example of
creating a set of interfaces to represent business logic, then
instantiating a set of classes to implement the business logic.
The MailReader uses a Struts PlugIn to create the business logic beans
in application scope. Another good approach is to use Spring to create
your business objects. Here, you might use a PlugIn to create the
Spring instance in application scope, and then call the Spring
instance to create everything else.
Of course, my favorite way to manage business objects now is as a
Chain of Responsbility. But, to get started, you probably want to use
plain old business beans, as the MailReader does.
All this is to say, option 2. The Actions call the business beans, and
the beans do all the heavy lifiting. (Actions shouldn't know *how* to
do things, just who to ask to get things done.)
The iBATIS DAO layer is cool, but if you don't need a switchable DAO,
you can do the same thing using your own interfaces.
Of course, my favorite way to do business logic now is using the Chain
of Responsiblity. But, that's a bit bleeding edge right now :)
-Ted.
On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
[EMAIL PROTECTED] wrote:
 

Hi all,
 Struts DB Access Best Practices thread gave me great insight on how
I should proceed with db operations.
 I have one more question.  Where do you keep your business logic
code.  Right now I am thinking to use
1. Struts(JSP, Actions)
2. Simple class(Managers) to keep all our business logic code
3. IBATIS for database abstraction.
Actions can call Managers to get the job done and Manager can use
iBATIS to access DB.
Is this a good approach or is there a better approach than this?
Looking forward for your response.
Have a great day.
Karthikeyan B
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   


 


--
===
Dipl.-Inf. Manfred Wolff
Software Engineer
---
http://www.manfred-wolff.de
http://www.struts-it.org
---

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


Re: using Taglibs

2005-03-11 Thread Viktar Duzh
Nothing special. Just pick up your form bean from the scope and use the 
jsp:useBean tag plus JSP expression, say like that:

 jsp:useBean id=customer beanName=customerForm class=CustomerForm/
   and
  %=customer.customerName%
You just need to know where your bean is placed by the framework.
Usually you can find it in the request or session scope under the atribute 
stored with the key that matches the name of you bean in struts-config.xml 
file.

for example,
If you had:
form-bean name=customerForm type=com.bean.CustomerForm/
You could retreive the bean using
 jsp:useBean id=customer beanName=customerForm class=CustomerForm/
Generally speaking you could put all your beans under the same key. You just 
specify the value of the attribute atribute of you action in struts-config:

action path=/edit-customer
   type=com.action.EditAction
  name=CustomerForm
  attribute=com.constants.Glogal.KEY_FORM_BEAN
  
/action
Moreover, you can create constant:
Global
{
 String KEY_FORM_BEAN = com.constants.Glogal.KEY_FORM_BEAN;
}
and use it everyvery in your code.
Say,  jsp:useBean id=customer beanName=%=Global.KEY_FORM_BEAN % 
class=CustomerForm/

Thus you do not need to know on the page names of the form beans in 
struts-config.

Rgards,
-Viktar
- Original Message - 
From: nitin dubey [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, March 11, 2005 11:48 AM
Subject: Re: using Taglibs


Thanks Viktar,
I am planning to use DispatchAction with which we can
use unspecified() method to populate the ActionForm
properties.  But how to put these properties in JSP
controls ?
Regards,
Nitin
--- Viktar Duzh [EMAIL PROTECTED] wrote:
Jack,
I suppose you are not right. There is no problem of
using ordinary form
HTML tag in a plain JSP. But that form must have a
correct url and names of
the input elements within the page to make the
framework pick up right
action and populate form bean respectively.
I will give a example.
1. Suppose you have the following in your config
file:
action path=/save-customer
type=com.action.SaveAction
name=CustomerForm
forward name=sucess
path=/SavePage.jsp/
/action
2. Your Customer.jsp would be:
...
form action=save-customer.do
input type=text name=customerName ... /
input type=submit ... /
/form
3. Your CustomerForm is expected to have the
customerName property.
Thus, when a user click on the submit button the
request comes in and the
struts tries to find an action with save-customer
path. Having found it,
it instantiates the CustomerForm object and then
tries to populate the
properties of the bean based on HTT request
parameters (customerName here).
In the end, your class action class has acess to the
parameters submitted by
the ordinary HTML form.
But here is one thing. Customer.jsp usually shows
some data. So a deveoper
should manually set the value of the form's fields.
I means it should get a
bean that holds the customer data and set the value
of the customerName
field by some other tag.
To make clear why some people are trying to do it.
An application would be
built on the struts framework plus jstl tags. Using
the jstls tags is taken
because struts html tags might not cover some
attributes of some html
elements.
Regards,
-- Viktar
- Original Message - 
From: Dakota Jack [EMAIL PROTECTED]
To: Struts Users Mailing List
user@struts.apache.org
Sent: Friday, March 11, 2005 9:56 AM
Subject: Re: using Taglibs

 You need to use html:form, so the answer is that
you have to use the
 taglibs unless you do some serious coding changes
to the framework.
 Why do you want to use the form but not the
taglibs?  If you just want
 to do that, build your own ActionForm with your
own autopopulation
 classes, etc.?

 What you are trying to do or why is not clear.

 Sounds like you are a bit unacquainted with Struts
and I would
 recommend that you take a closer look before
deciding what you want to
 do.

 Jack


 On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin
dubey
 [EMAIL PROTECTED] wrote:
 Hello,

 Can we use struts without using its taglibs ?  We
will
 just write plain JSPs.  If yes how do we get the
 values into and from our ActionForms ?

 regards,

 Nitin

 __
 Do you Yahoo!?
 Yahoo! Small Business - Try our new resources
site!
 http://smallbusiness.yahoo.com/resources/


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




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



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


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



Re: using Taglibs

2005-03-11 Thread Viktar Duzh
Hi Rajaneesh,
You are right they are completely different. But it is very simple to fire 
struts framework just by making up right url :-)

Regards,
-- Viktar.
- Original Message - 
From: Rajaneesh [EMAIL PROTECTED]
To: 'Struts Users Mailing List' user@struts.apache.org
Sent: Friday, March 11, 2005 12:04 PM
Subject: RE: using Taglibs


Hi Viktar,
 Having the tags html:form would execute for the tag library classes in
the package
org.apache.struts.taglib.html. Hence html:form and form are quite
different.
Regards
Rajaneesh
-Original Message-
From: Viktar Duzh [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 2:48 PM
To: Struts Users Mailing List; Dakota Jack
Subject: Re: using Taglibs
Jack,
I suppose you are not right. There is no problem of using ordinary form
HTML tag in a plain JSP. But that form must have a correct url and names 
of
the input elements within the page to make the framework pick up right
action and populate form bean respectively.

I will give a example.
1. Suppose you have the following in your config file:
   action path=/save-customer
   type=com.action.SaveAction
   name=CustomerForm
   forward name=sucess path=/SavePage.jsp/
   /action
2. Your Customer.jsp would be:
...
form action=save-customer.do
   input type=text name=customerName ... /
   input type=submit ... /
/form
3. Your CustomerForm is expected to have the customerName property.
Thus, when a user click on the submit button the request comes in and the
struts tries to find an action with save-customer path. Having found it,
it instantiates the CustomerForm object and then tries to populate the
properties of the bean based on HTT request parameters (customerName 
here).
In the end, your class action class has acess to the parameters submitted 
by
the ordinary HTML form.

But here is one thing. Customer.jsp usually shows some data. So a deveoper
should manually set the value of the form's fields. I means it should get 
a
bean that holds the customer data and set the value of the customerName
field by some other tag.

To make clear why some people are trying to do it. An application would be
built on the struts framework plus jstl tags. Using the jstls tags is 
taken
because struts html tags might not cover some attributes of some html
elements.

Regards,
-- Viktar
- Original Message -
From: Dakota Jack [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, March 11, 2005 9:56 AM
Subject: Re: using Taglibs

You need to use html:form, so the answer is that you have to use the
taglibs unless you do some serious coding changes to the framework.
Why do you want to use the form but not the taglibs?  If you just want
to do that, build your own ActionForm with your own autopopulation
classes, etc.?
What you are trying to do or why is not clear.
Sounds like you are a bit unacquainted with Struts and I would
recommend that you take a closer look before deciding what you want to
do.
Jack
On Thu, 10 Mar 2005 23:46:40 -0800 (PST), nitin dubey
[EMAIL PROTECTED] wrote:
Hello,
Can we use struts without using its taglibs ?  We will
just write plain JSPs.  If yes how do we get the
values into and from our ActionForms ?
regards,
Nitin
__
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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

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


AW: Tile in Tile - possible?

2005-03-11 Thread Hauschel Fred








Hy,

yes it works, but only for one hierarchy



Base Definition:



tiles-definitions

    definition name=.cpfDefinition
path=/cpfLayout.jsp 

  put
name=de.unknown.cp.cpfextension
value=/cpfdefault.jsp/

    /definition

/tiles-definitions



First hierarchy:

tiles-definitions

    definition
name=de.unknown.cp.topmenue extends=.cpfDefinition

  put name=de.unknown.cp.cpfextension
value=de.unknown.cp.topmenue.component type=definition
/

    /definition



    definition
name=de.unknown.cp.topmenue.component
path=/plugins/topmenue/topmenueLayout.jsp 

      put
name=de.unknown.cp.topmenue.top value=/plugins/topmenue/start.jsp/

  put
name=de.unknown.cp.topmenue.bottom
value=/plugins/topmenue/start.jsp/

    /definition

/tiles-definitions



Second hierarchy:

tiles-definitions



    definition
name=de.unknown.cp.startbildschirm extends=de.unknown.cp.topmenue.component

    put
name=de.unknown.cp.topmenue.bottom
value=de.unknown.cp.startbildschirm.component
type=definition /

    /definition



    definition
name=de.unknown.cp.startbildschirm.component
path=/plugins/startbildschirm/startbildschirmLayout.jsp

      put name=de.unknown.cp.startbildschirm.leftmenue
value=/plugins/startbildschirm/menue.jsp/

    put
name=de.unknown.cp.startbildschrim.content
value=/plugins/startbildschirm/content.jsp/

    /definition



/tiles-definitions



So the definition de.unknown.cp.topmenue
extending .cpfDefinition but delegates to
de.unknown.cp.topmenue.component.

de.unknown.cp.startbildschirm extends
de.unknown.cp.topmenue.component but doestnt know
.cpfDefinition and my Base get lost.

Here a model for better understanding:





Cpf, topmenue and startbildschirm are different independend
Struts Modules.



Any Idea?



Thanks Fredy



-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 11. März 2005 12:04
An: user@struts.apache.org
Betreff: RE: Tile in Tile - possible?



Hi



What you are describing works - I have several apps where I do this
sort

of thing



Hermod



-Original Message-

From: Hauschel Fred [mailto:[EMAIL PROTECTED]

Sent: Friday, March 11, 2005 10:12 AM

To: Struts Users Mailing List

Subject: Tile in Tile - possible?





Hey,



is it possible to extend a Definition and overload a tile by a new

definition?



 



What I want is:



My Base Struts Module should have a simple baseDefinition:







tiles-definitions



    definition name=.cpfDefinition
path=/cpfLayout.jsp 



  put name=de.sagIchNich.cp.cpfextension

value=/cpfdefault.jsp/



    /definition



/tiles-definitions



 



This base should be extended by another Module.



 



tiles-definitions



    definition name=de.sagIchNich.cp.topmenue

extends=.cpfDefinition



  put name=de.sagIchNich.cp.cpfextension

value=de.sagIchNich.cp.topmenue.componen/



    /definition



 



    definition name=de.sagIchNich.cp.topmenue.component

path=/plugins/topmenue/topmenueLayout.jsp 



  put name=de.sagIchNich.cp.topmenue.top

value=/plugins/topmenue/start.jsp/



    put name=de.sagIchNich.cp.topmenue.bottom

value=/plugins/topmenue/start.jsp/



    /definition



/tiles-definitions



 



But I think that is not possible.



Is there another way to something like this?



 



Maybe:



tiles-definitions



    definition name=de.sagIchNich.cp.topmenue

extends=.cpfDefinition



  put name=de.sagIchNich.cp.cpfextension
value=subLayout.jsp/



put name=sublayoutTile1
value=first.jsp/



put name=sublayoutTile2
value=second.jsp/



    /definition



/tiles-definitions



 



 



Thanks Fredy







* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *



This email with attachments is solely for the use of the individual or

entity to whom it is addressed. Please also be aware that the DnB NOR
Group

cannot accept any payment orders or other legally binding
correspondence with

customers as a part of an email. 



This email message has been virus checked by the virus programs used

in the DnB NOR Group.



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *





-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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










Re: Of Struts and Tiles and Portals

2005-03-11 Thread Ted Husted
If you wanted to use conventional portlets with Struts, you're
suppose to able to do that.

* [http://portals.apache.org/]
* [http://portals.apache.org/jetspeed-2/multiproject/portals-bridges-struts/]

-- HTH, Ted.

On Thu, 10 Mar 2005 14:03:27 -0700, Wendy Smoak [EMAIL PROTECTED] wrote:
 My next project looks like it will be a portal-type app to display
 information about our operation.  Different people will be allowed to see or
 will choose different things, based on what they do within the organization.
 
 So I asked Google about Struts and Tiles and Portal, and, well, didn't find
 much.  Is Cedric's page dated 2002 still current enough to work from?
 http://www.lifl.fr/~dumoulin/tiles/
 
 Any suggestions on how to get started with this, or does anyone possibly
 have an example to share?
 
 --
 Wendy Smoak
 
 -
 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 Business Logic :: Best Practices

2005-03-11 Thread Larry Meadors
Yes.

You are describing almost exactly how I write my struts code.

Here are the components I would use to maintain a Customer table:
 - com.myorg.domain.bean.Customer.java
 - com.myorg.domain.dao.CustomerDao.java (interface)
 - com.myorg.domain.service.CustomerService.java (interface)
 - com.myorg.domain.dao.ibatis.mapping.Customer.xml (sql map)
 - com.myorg.domain.dao.ibatis.CustomerDaoImpl.java (DAO implementation)
 - com.myorg.domain.service.impl.CustomerServiceImpl.java (service
implementation)
 - com.myorg.domain.web.customer.CustomerAction.java (DispatchAction)
 - com.myorg.domain.web.customer.CustomerForm.java (includes nested bean)

I would then have 2 jsps (list.jsp and edit.jsp) that are in the
WEB-INF/jsp/customer/ directory.

I make the interfaces between the service and dao layer to simplify
testing. It is super easy to write a faux dao impl for testing your
service class, and equally easy to write one for the service interface
when testing the action.

Larry

On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
[EMAIL PROTECTED] wrote:
 Hi all,
 
   Struts DB Access Best Practices thread gave me great insight on how
 I should proceed with db operations.
 
   I have one more question.  Where do you keep your business logic
 code.  Right now I am thinking to use
 
 1. Struts(JSP, Actions)
 2. Simple class(Managers) to keep all our business logic code
 3. IBATIS for database abstraction.
 
 Actions can call Managers to get the job done and Manager can use
 iBATIS to access DB.
 
 Is this a good approach or is there a better approach than this?
 
 Looking forward for your response.
 
 Have a great day.
 
 Karthikeyan B
 
 -
 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: Of Struts and Tiles and Portals

2005-03-11 Thread NetSQL
Google on Tiles 101 and 201 artilces.
1up.com is a portal done in struts, you can see like 12 tiles per page 
(it has 100s of pages and each of the 12 tiles per page is CMS db 
driven, ex: top 10 games in category)
 It was done open source projeect basicPortal (if you have a big struts 
project and want to save a lot of time).

What I did is uses one action per page, and each page has lots of tiles 
actions.
It's important to unit test each tile, before you put it in a page.
afiak portlets still has technical issues.
Also I assume you do use JSTl when ever possible and other EL syntax.

good luck,
.V
Wendy Smoak wrote:
My next project looks like it will be a portal-type app to display
information about our operation.  Different people will be allowed to see or
will choose different things, based on what they do within the organization.
So I asked Google about Struts and Tiles and Portal, and, well, didn't find
much.  Is Cedric's page dated 2002 still current enough to work from?
http://www.lifl.fr/~dumoulin/tiles/
Any suggestions on how to get started with this, or does anyone possibly
have an example to share?

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


Re: Struts Business Logic :: Best Practices

2005-03-11 Thread NetSQL
I used Hivemind and switch to CoR, which I consider a light weight 
container.
Good article on CoR at onJava.com.

.V
Manfred Wolff wrote:
Ted.
+1 to this approach. I prefer leightweight container such as hivemind to 
manage the entrypoints to the business logic. Hivemind is easy to learn 
and you have the benefit, that the lifecycle of the business components 
may be steered too (such as pooled components, singletons etc.). Other 
containers like spring or picocontainer are also well.

-Manfred

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


Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Leon Rosenberg

Why do you need a container? Or why do I need a container?

Leon

On Fri, 2005-03-11 at 07:27 -0600, NetSQL wrote:
 I used Hivemind and switch to CoR, which I consider a light weight 
 container.
 Good article on CoR at onJava.com.
 
 .V
 
 Manfred Wolff wrote:
  
  Ted.
  
  +1 to this approach. I prefer leightweight container such as hivemind to 
  manage the entrypoints to the business logic. Hivemind is easy to learn 
  and you have the benefit, that the lifecycle of the business components 
  may be steered too (such as pooled components, singletons etc.). Other 
  containers like spring or picocontainer are also well.
  
  -Manfred
  
 
 
 -
 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]



[ANNOUNCEMENT] XDemo petstore 1-0-4

2005-03-11 Thread mario nee
XDemo petstore 1-0-4
Struts + XMoon + Hibernate + JSTL
http://www.demozone.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


html:form question

2005-03-11 Thread Scott Purcell
Hello,
 
I have a login that I call and displays its initial presentation. I am using 
the html:form action=login.do line for when I submit its values.
 
But I want to put in some default values into the initial presentation. So upon 
reading about
html:form it looks like I could use the following:
html:form action=login.do name=loginBean 
type=com.ddi.dealer.bean.LoginForm
 
Because in my struts-config.xml I have the following two sections
 
  form-beans
form-bean name=loginBean type=com.ddi.dealer.bean.LoginForm /
  /form-beans
 
  action
path=/login
input=/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
So I was hoping that that form line would call, create new loginBean and show 
the data in my initial feed.
 
The submitting is good, It was just something I am not understanding.
 
Anyone know why that does not work?
 
Thanks,
Scott
 


Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Ted Husted
Yep. 

Lately, I've started writing inner classes to access the business
logic for a particular transaction script. The inner classes take
input in a way conventient to the client, (say, by passing in an
ActionForm,) use that input to interact with the business classes, and
return the output in a way convenient to the client.

I make these helpers throw-away inner classes so that they can stay
very focused on a particular transaction script. Making them inner
classes eliminates the temptation to try and share them, creating
yet-another-layer. Inner clases also help reduce file-management
bloat.

It boils down to 

[Commands -- Business Rules and Persistence Logic]
  |
[Business-Controller (CoR Catalog)] 
  |
[Helper (inner class)]
  |
[Action/Code-Behind/Backing-Bean]

The Helpers know which Transaction Scripts to call (IDs in the
Catalog), but all the event handlers (Actions, Code-Behind, Backing
Bean)  know to do is call the Helpers.

The Command is where the rubber meets the road. Here I make direct
calls to iBATIS or JDBC or ADO or LDAP or Hibernate, or whatever.
Since I can always replace a Command implementation if any of these
details change, I don't worry about having another layer of
abstraction.

At first, I had the Commands calling gizmos like the iBATIS DAO, but
there didn't seem to be any point. The Catalog is already a logical
abstraction, so I cut to the chase, and now let the Commands call
iBATIS and such directly.

Of course, the Helpers are an example of the Facade pattern. 

-Ted.

On Fri, 11 Mar 2005 05:58:40 -0700, Larry Meadors
[EMAIL PROTECTED] wrote:
 Yes.
 
 You are describing almost exactly how I write my struts code.
 
 Here are the components I would use to maintain a Customer table:
  - com.myorg.domain.bean.Customer.java
  - com.myorg.domain.dao.CustomerDao.java (interface)
  - com.myorg.domain.service.CustomerService.java (interface)
  - com.myorg.domain.dao.ibatis.mapping.Customer.xml (sql map)
  - com.myorg.domain.dao.ibatis.CustomerDaoImpl.java (DAO implementation)
  - com.myorg.domain.service.impl.CustomerServiceImpl.java (service
 implementation)
  - com.myorg.domain.web.customer.CustomerAction.java (DispatchAction)
  - com.myorg.domain.web.customer.CustomerForm.java (includes nested bean)
 
 I would then have 2 jsps (list.jsp and edit.jsp) that are in the
 WEB-INF/jsp/customer/ directory.
 
 I make the interfaces between the service and dao layer to simplify
 testing. It is super easy to write a faux dao impl for testing your
 service class, and equally easy to write one for the service interface
 when testing the action.
 
 Larry
 
 On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
 [EMAIL PROTECTED] wrote:
  Hi all,
 
Struts DB Access Best Practices thread gave me great insight on how
  I should proceed with db operations.
 
I have one more question.  Where do you keep your business logic
  code.  Right now I am thinking to use
 
  1. Struts(JSP, Actions)
  2. Simple class(Managers) to keep all our business logic code
  3. IBATIS for database abstraction.
 
  Actions can call Managers to get the job done and Manager can use
  iBATIS to access DB.
 
  Is this a good approach or is there a better approach than this?
 
  Looking forward for your response.
 
  Have a great day.
 
  Karthikeyan B
 
  -
  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]
 
 


-- 
HTH, Ted.

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



Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Ted Husted
:) Basically, the same reason web applications and struts applications
need a container. :)

Being able to instantiate objects using a XML driven factory is very,
very convenient, and make programing strategies possible that would be
otherwise impractical.

Consider how difficult a Struts application would be to code if you
had to create all the objects in the struts-config through calls to
new. Possible, but, very messy and very verbose.

Also, in practice, you often end up making some (or all) of your
business objects singletons. Containers like Spring give you a quick
and consistent way to create singletons, when you need them, and
instant classes when you don't.

-Ted.

On Fri, 11 Mar 2005 15:38:01 +0100, Leon Rosenberg
[EMAIL PROTECTED] wrote:
 
 Why do you need a container? Or why do I need a container?
 
 Leon
 
 On Fri, 2005-03-11 at 07:27 -0600, NetSQL wrote:
  I used Hivemind and switch to CoR, which I consider a light weight
  container.
  Good article on CoR at onJava.com.
 
  .V
 
  Manfred Wolff wrote:
  
   Ted.
  
   +1 to this approach. I prefer leightweight container such as hivemind to
   manage the entrypoints to the business logic. Hivemind is easy to learn
   and you have the benefit, that the lifecycle of the business components
   may be steered too (such as pooled components, singletons etc.). Other
   containers like spring or picocontainer are also well.
  
   -Manfred
  
 
 
  -
  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]
 
 


-- 
HTH, Ted.

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



Upper case converter in the view

2005-03-11 Thread Brian McGovern
Has anyone tried to use the bean:write tag to convert the output to all Upper 
or all lower case?

Thanks
-B

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



RE: Upper case converter in the view

2005-03-11 Thread Benedict, Paul C
Brian,

I believe the Jakarta-Taglibs Project will be able to do this:
http://jakarta.apache.org/taglibs/doc/string-doc/intro.html

http://jakarta.apache.org/taglibs/doc/string-doc/string-1.1.0/index.html

Thanks,
Paul

-Original Message-
From: Brian McGovern [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:21 AM
To: Struts Users Mailing List
Subject: Upper case converter in the view


Has anyone tried to use the bean:write tag to convert the output to all
Upper or all lower case?

Thanks
-B

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






--
Notice:  This e-mail message, together with any attachments, contains 
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
--

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



Re: Of Struts and Tiles and Portals

2005-03-11 Thread Matt Raible
On that note, how about how to install Jetspeed and deploy a Struts app  
to it? ;-)

http://raibledesigns.com/page/rd? 
anchor=installing_jetspeed_and_deploying_struts

Matt
On Mar 11, 2005, at 5:38 AM, Ted Husted wrote:
If you wanted to use conventional portlets with Struts, you're
suppose to able to do that.
* [http://portals.apache.org/]
*  
[http://portals.apache.org/jetspeed-2/multiproject/portals-bridges- 
struts/]

-- HTH, Ted.
On Thu, 10 Mar 2005 14:03:27 -0700, Wendy Smoak [EMAIL PROTECTED]  
wrote:
My next project looks like it will be a portal-type app to display
information about our operation.  Different people will be allowed to  
see or
will choose different things, based on what they do within the  
organization.

So I asked Google about Struts and Tiles and Portal, and, well,  
didn't find
much.  Is Cedric's page dated 2002 still current enough to work from?
http://www.lifl.fr/~dumoulin/tiles/

Any suggestions on how to get started with this, or does anyone  
possibly
have an example to share?

--
Wendy Smoak
-
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: Upper case converter in the view

2005-03-11 Thread Mark Benussi
Your could use css span style=cant remember the css attributebean:write
//span

-Original Message-
From: Benedict, Paul C [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 15:22
To: 'Struts Users Mailing List'
Subject: RE: Upper case converter in the view

Brian,

I believe the Jakarta-Taglibs Project will be able to do this:
http://jakarta.apache.org/taglibs/doc/string-doc/intro.html

http://jakarta.apache.org/taglibs/doc/string-doc/string-1.1.0/index.html

Thanks,
Paul

-Original Message-
From: Brian McGovern [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:21 AM
To: Struts Users Mailing List
Subject: Upper case converter in the view


Has anyone tried to use the bean:write tag to convert the output to all
Upper or all lower case?

Thanks
-B

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







--
Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New
Jersey, USA 08889), and/or its affiliates (which may be known outside the
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as
Banyu) that may be confidential, proprietary copyrighted and/or legally
privileged. It is intended solely for the use of the individual or entity
named on this message.  If you are not the intended recipient, and have
received this message in error, please notify us immediately by reply e-mail
and then delete it from your system.

--

-
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: Upper case converter in the view

2005-03-11 Thread Benedict, Paul C
Agreed. Good catch Mark! You could also use the text-transform property.

-Original Message-
From: Mark Benussi [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:29 AM
To: 'Struts Users Mailing List'
Subject: RE: Upper case converter in the view


Your could use css span style=cant remember the css attributebean:write
//span

-Original Message-
From: Benedict, Paul C [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 15:22
To: 'Struts Users Mailing List'
Subject: RE: Upper case converter in the view

Brian,

I believe the Jakarta-Taglibs Project will be able to do this:
http://jakarta.apache.org/taglibs/doc/string-doc/intro.html

http://jakarta.apache.org/taglibs/doc/string-doc/string-1.1.0/index.html

Thanks,
Paul

-Original Message-
From: Brian McGovern [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:21 AM
To: Struts Users Mailing List
Subject: Upper case converter in the view


Has anyone tried to use the bean:write tag to convert the output to all
Upper or all lower case?

Thanks
-B

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







--
Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New
Jersey, USA 08889), and/or its affiliates (which may be known outside the
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as
Banyu) that may be confidential, proprietary copyrighted and/or legally
privileged. It is intended solely for the use of the individual or entity
named on this message.  If you are not the intended recipient, and have
received this message in error, please notify us immediately by reply e-mail
and then delete it from your system.

--

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






--
Notice:  This e-mail message, together with any attachments, contains 
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
--

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



Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Leon Rosenberg
 :) Basically, the same reason web applications and struts applications
 need a container. :)

hmm... disagreed. Web applications need a container so they don't need
to handle the http protocol theirself, handle jsps, taglibs and all the
other stuff.
struts itself is a framework, not a container.

 Being able to instantiate objects using a XML driven factory is very,
 very convenient, and make programing strategies possible that would be
 otherwise impractical.

You are describing an abstract factory, which is a well known pattern
and can be implemented with 3 classes. 

 
 Consider how difficult a Struts application would be to code if you
 had to create all the objects in the struts-config through calls to
 new. Possible, but, very messy and very verbose.

See above. Actually I had my own 'struts' for year ago, and moved to
struts because of the taglibs. 

 
 Also, in practice, you often end up making some (or all) of your
 business objects singletons. Containers like Spring give you a quick
 and consistent way to create singletons, when you need them, and
 instant classes when you don't.

I have an eclipse template for that :-)

private static ${enclosing_type} instance;

private ${enclosing_type}(){

}

public static synchronized ${enclosing_type} getInstance(){
if (instance==null){
instance = new ${enclosing_type}();
}
return instance;
}


I'm using a web container because:
I don't want to handle http.
I don't want to compile jsps.
I don't want to provide taglib handling.
The lifecycle of my code is defined by the web-page and very well
implemented in the web container.

I do not use an application container because:
I have none of the above problems there.
I don't want anything to eat away resources.
The lifecycle of the component is defined by application design.

In other words: 
Why should I use a container instead of a framework.

The difference between container and framework as I see it is the flow
of control:
Container defines the lifecycle of a component and the communication
between components.
Framework provides tools to define the lifecycle of a component and
abstraction layers for the communication.
In other words: A container defines how you have to write your code
(e.g. ejb), a framework gives you possibilities to use already written
code.

Am I missing something?

Leon

 
 -Ted.
 
 On Fri, 11 Mar 2005 15:38:01 +0100, Leon Rosenberg
 [EMAIL PROTECTED] wrote:
  
  Why do you need a container? Or why do I need a container?
  
  Leon
  
  On Fri, 2005-03-11 at 07:27 -0600, NetSQL wrote:
   I used Hivemind and switch to CoR, which I consider a light weight
   container.
   Good article on CoR at onJava.com.
  
   .V
  
   Manfred Wolff wrote:
   
Ted.
   
+1 to this approach. I prefer leightweight container such as hivemind to
manage the entrypoints to the business logic. Hivemind is easy to learn
and you have the benefit, that the lifecycle of the business components
may be steered too (such as pooled components, singletons etc.). Other
containers like spring or picocontainer are also well.
   
-Manfred
   
  
  
   -
   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]



Help With Action

2005-03-11 Thread Scott Purcell
Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And 
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting 
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -  
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called on 
LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -  
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel 
that it needs to do a redirect or something, but not sure how that should work. 
Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com 
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 


RE: Help With Action

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
forward name=Failure path=/jsp/login.jsp redirect=true /

?? maybe ??


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:13 AM
To: user@struts.apache.org
Subject: Help With Action

Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
on LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel
that it needs to do a redirect or something, but not sure how that should
work. Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 

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



Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
I've read a number of articles about correct pre-populate forms methods,
including the following:

 

1.  http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html 
2.  http://struts.apache.org/faqs/newbie.html#prepopulate
http://struts.apache.org/faqs/newbie.html#prepopulate 
3.
http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-Ste
p1
http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-St
ep1 

 

I have some questions.

 

The first article does not talk specifics about how Lazy-Loading would be
implemented.

The second doesn't talk about how the actual pre-population would be
implemented in the action.

And the third does it in a way that's different from how others do it.

 

Here's what I've gotten so far...

 

There are two different ways that I see to do it. 

1.  Load the FormBean up in the constructor.

a.  This does not work in Dyna*Forms since there's no actual
implementation
b.  This then moves the logic to the actual form bean which is not where
it's supposed to be.

2.  Load the FormBean in a precursor Action

a.  This works well but every example I've seen then does something like
this:

Request.getSession().setAttribute( 'formBean, bean);

This seems like a bad idea since it places the bean into the session scope.
I've tried doing this by putting it directly into request but of course the
jsp then doesn't have access to it because the request on the Action is not
in the same scope as the 'form'.jsp

 

So I guess I'm at a loss on how best to pre-populate Dyna*Forms. Examples
that have worked from your experience would be appreciated.

 



RE: Help With Action

2005-03-11 Thread Scott Purcell
I guess I could do that, but the docs state that if the validation fails, 
request will go to the input tag. and I do not see how to do a redirect on 
that.

Anyone?

Scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


forward name=Failure path=/jsp/login.jsp redirect=true /

?? maybe ??


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:13 AM
To: user@struts.apache.org
Subject: Help With Action

Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
on LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel
that it needs to do a redirect or something, but not sure how that should
work. Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 

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


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



RE: Help With Action

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
It seems that your input is: /dealer/jsp/login.jsp
And your Failure forward is: /jsp/login.jsp

Is there a reason it's different? Validation is different and happens before
Action.execute where your forward would happen on Failure.


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:22 AM
To: Struts Users Mailing List
Subject: RE: Help With Action

I guess I could do that, but the docs state that if the validation fails,
request will go to the input tag. and I do not see how to do a redirect on
that.

Anyone?

Scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


forward name=Failure path=/jsp/login.jsp redirect=true /

?? maybe ??


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:13 AM
To: user@struts.apache.org
Subject: Help With Action

Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
on LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel
that it needs to do a redirect or something, but not sure how that should
work. Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 

-
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: Help With Action

2005-03-11 Thread Scott Purcell
Yes, they should be the same, I have been changing the paths and watching the 
log. And no matter what I do, the log shows it tries to forward to the path 
under input.

scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:25 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


It seems that your input is: /dealer/jsp/login.jsp
And your Failure forward is: /jsp/login.jsp

Is there a reason it's different? Validation is different and happens before
Action.execute where your forward would happen on Failure.


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:22 AM
To: Struts Users Mailing List
Subject: RE: Help With Action

I guess I could do that, but the docs state that if the validation fails,
request will go to the input tag. and I do not see how to do a redirect on
that.

Anyone?

Scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


forward name=Failure path=/jsp/login.jsp redirect=true /

?? maybe ??


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:13 AM
To: user@struts.apache.org
Subject: Help With Action

Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
on LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel
that it needs to do a redirect or something, but not sure how that should
work. Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 

-
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: Struts Business Logic :: Best Practices

2005-03-11 Thread Duong BaTien
Ted Husted wrote:
As to business objects, the usual advice is to use Plain Old Java
Objects (POJOs).
The current MailReader example application is an excellent example of
creating a set of interfaces to represent business logic, then
instantiating a set of classes to implement the business logic.
The MailReader uses a Struts PlugIn to create the business logic beans
in application scope. Another good approach is to use Spring to create
your business objects. Here, you might use a PlugIn to create the
Spring instance in application scope, and then call the Spring
instance to create everything else.
Of course, my favorite way to manage business objects now is as a
Chain of Responsbility. But, to get started, you probably want to use
plain old business beans, as the MailReader does.
All this is to say, option 2. The Actions call the business beans, and
the beans do all the heavy lifiting. (Actions shouldn't know *how* to
do things, just who to ask to get things done.)
The iBATIS DAO layer is cool, but if you don't need a switchable DAO,
you can do the same thing using your own interfaces.
Of course, my favorite way to do business logic now is using the Chain
of Responsiblity. But, that's a bit bleeding edge right now :)
-Ted.
 

Hello Ted and concerned developers:
I just like to make this piece-meal update on how we use commons-chain 
and hope to get some feedback from gurus out there.

   1) I modify chain CatalogBase and ChainBase to turn CoR Catalog, 
Command, Filter, and Chain into POJO configurable using IoC. This will 
avoid an issue that Vic said about the Rich Client.

   2) Extending the naming approach of Agility, bean references are all 
in names, including the DTO to keep DO and UI objects consistent.

   3) All component services are done with chain Command. I am waiting 
for some de-facto standard of having conditional chain. Have you and 
struts committers set down the best way to do it?

BaTien
DBGROUPS
On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
[EMAIL PROTECTED] wrote:
 

Hi all,
 Struts DB Access Best Practices thread gave me great insight on how
I should proceed with db operations.
 I have one more question.  Where do you keep your business logic
code.  Right now I am thinking to use
1. Struts(JSP, Actions)
2. Simple class(Managers) to keep all our business logic code
3. IBATIS for database abstraction.
Actions can call Managers to get the job done and Manager can use
iBATIS to access DB.
Is this a good approach or is there a better approach than this?
Looking forward for your response.
Have a great day.
Karthikeyan B
-
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: Correct Prepopulate Method

2005-03-11 Thread Hubert Rabago
You would usually do prepopulation in a setup form.  Which scope you
place the form in depends on how you configure the action that the
form will be submitted to.  For example, if you have /showPage.do
and /submitForm.do, where submitForm is configured as:

action path=/submitForm name=myForm .../action

Then in the action for showPage, you'd:

ModuleConfig moduleConfig =
ModuleUtils.getInstance().getModuleConfig(request);
FormBeanConfig formBeanConfig = moduleConfig.findFormBeanConfig(myForm);
DynaActionForm myForm = (DynaActionForm)
formBeanConfig.createActionForm(getServlet());

myForm.set(propName,propValue);
request.getSession().setAttribute(myForm, myForm);


If you want to use request scope, change /submitForm to:
action path=/submitForm name=myForm scope=request.../action

then in showPage:
request.setAttribute(myForm, myForm);


Hubert


On Fri, 11 Mar 2005 09:18:15 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've read a number of articles about correct pre-populate forms methods,
 including the following:
 
 1.  http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 2.  http://struts.apache.org/faqs/newbie.html#prepopulate
 http://struts.apache.org/faqs/newbie.html#prepopulate
 3.
 http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-Ste
 p1
 http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-St
 ep1
 
 I have some questions.
 
 The first article does not talk specifics about how Lazy-Loading would be
 implemented.
 
 The second doesn't talk about how the actual pre-population would be
 implemented in the action.
 
 And the third does it in a way that's different from how others do it.
 
 Here's what I've gotten so far...
 
 There are two different ways that I see to do it.
 
 1.  Load the FormBean up in the constructor.
 
 a.  This does not work in Dyna*Forms since there's no actual
 implementation
 b.  This then moves the logic to the actual form bean which is not where
 it's supposed to be.
 
 2.  Load the FormBean in a precursor Action
 
 a.  This works well but every example I've seen then does something like
 this:
 
 Request.getSession().setAttribute( 'formBean, bean);
 
 This seems like a bad idea since it places the bean into the session scope.
 I've tried doing this by putting it directly into request but of course the
 jsp then doesn't have access to it because the request on the Action is not
 in the same scope as the 'form'.jsp
 
 So I guess I'm at a loss on how best to pre-populate Dyna*Forms. Examples
 that have worked from your experience would be appreciated.
 


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



Typical Struts development team and distribution of tasks?

2005-03-11 Thread Lawrie Gallardo
Do most companies developing Struts applications tend to employ Web 
Designers, or is it more common for Struts development to be undertaken by a 
team consisting solely of Java Developers (who therefore need strong 
knowledge of HTML, Struts Tags, JSTL, CSS, JavaScript, etc as well as J2EE)?

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

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

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

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


Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
Too bad ActionForms were called ActionForms rather than something
like ActionData, ActionState, or ActionContext.  The html pages
are populated, I guess, with data.  If you try to map ActionForms to
html or JSP forms, I think your whole way of looking at the problems
becomes completely skewed.  Think of the form data as data and not as
some ghost of the form.  The term pre-populate, in my opinion, is
not very useful.




On Fri, 11 Mar 2005 09:18:15 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've read a number of articles about correct pre-populate forms methods,
 including the following:
 
 1.  http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 2.  http://struts.apache.org/faqs/newbie.html#prepopulate
 http://struts.apache.org/faqs/newbie.html#prepopulate
 3.
 http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-Ste
 p1
 http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-St
 ep1
 
 I have some questions.
 
 The first article does not talk specifics about how Lazy-Loading would be
 implemented.
 
 The second doesn't talk about how the actual pre-population would be
 implemented in the action.
 
 And the third does it in a way that's different from how others do it.
 
 Here's what I've gotten so far...
 
 There are two different ways that I see to do it.
 
 1.  Load the FormBean up in the constructor.
 
 a.  This does not work in Dyna*Forms since there's no actual
 implementation
 b.  This then moves the logic to the actual form bean which is not where
 it's supposed to be.
 
 2.  Load the FormBean in a precursor Action
 
 a.  This works well but every example I've seen then does something like
 this:
 
 Request.getSession().setAttribute( 'formBean, bean);
 
 This seems like a bad idea since it places the bean into the session scope.
 I've tried doing this by putting it directly into request but of course the
 jsp then doesn't have access to it because the request on the Action is not
 in the same scope as the 'form'.jsp
 
 So I guess I'm at a loss on how best to pre-populate Dyna*Forms. Examples
 that have worked from your experience would be appreciated.
 
 


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

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



RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
I'm not sure I understand the need for the moduleConfig and such for
creating the DynaActionForm.

If we've specified the name=myForm in the action config then shouldn't the
form coming into the execute be and empty version of my form? Thus allowing:

 execute( ActionMapping mapping, ActionForm form ... {
DynaActionForm myForm = (DynaActionForm) form;
 }

(As a matter of fact I know this works :))

Also, using

request.getSession().setAttribute(myForm, myForm);

is exactly the issue. Although it then allows the follow up jsp to gain
access to the formbean during form(html) creation it doesn't determine how
then to remove the form from the session except by explicit removal in the
final update/submit action unless you config the submit as request scope
only. But that doesn't actually remove the formbean from the session scope
that we added it into... it just copies it into the request scope too.

--- so back to sqare one. :P


-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:36 AM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

You would usually do prepopulation in a setup form.  Which scope you
place the form in depends on how you configure the action that the
form will be submitted to.  For example, if you have /showPage.do
and /submitForm.do, where submitForm is configured as:

action path=/submitForm name=myForm .../action

Then in the action for showPage, you'd:

ModuleConfig moduleConfig =
ModuleUtils.getInstance().getModuleConfig(request);
FormBeanConfig formBeanConfig =
moduleConfig.findFormBeanConfig(myForm);
DynaActionForm myForm = (DynaActionForm)
formBeanConfig.createActionForm(getServlet());

myForm.set(propName,propValue);
request.getSession().setAttribute(myForm, myForm);


If you want to use request scope, change /submitForm to:
action path=/submitForm name=myForm scope=request.../action

then in showPage:
request.setAttribute(myForm, myForm);


Hubert


On Fri, 11 Mar 2005 09:18:15 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've read a number of articles about correct pre-populate forms methods,
 including the following:
 
 1.
http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 2.  http://struts.apache.org/faqs/newbie.html#prepopulate
 http://struts.apache.org/faqs/newbie.html#prepopulate
 3.

http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-Ste
 p1

http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-St
 ep1
 
 I have some questions.
 
 The first article does not talk specifics about how Lazy-Loading would be
 implemented.
 
 The second doesn't talk about how the actual pre-population would be
 implemented in the action.
 
 And the third does it in a way that's different from how others do it.
 
 Here's what I've gotten so far...
 
 There are two different ways that I see to do it.
 
 1.  Load the FormBean up in the constructor.
 
 a.  This does not work in Dyna*Forms since there's no actual
 implementation
 b.  This then moves the logic to the actual form bean which is not
where
 it's supposed to be.
 
 2.  Load the FormBean in a precursor Action
 
 a.  This works well but every example I've seen then does something
like
 this:
 
 Request.getSession().setAttribute( 'formBean, bean);
 
 This seems like a bad idea since it places the bean into the session
scope.
 I've tried doing this by putting it directly into request but of course
the
 jsp then doesn't have access to it because the request on the Action is
not
 in the same scope as the 'form'.jsp
 
 So I guess I'm at a loss on how best to pre-populate Dyna*Forms. Examples
 that have worked from your experience would be appreciated.
 


-
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: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
Ok, then what am I missing?

I have a jsp/html form that needs to be 'pre-populated' with dynamic fields
from a table in a database that simply has name-value pairs. I'm willing to
accept that I'm looking at the world the wrong way... what's the right way?


-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:48 AM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

Too bad ActionForms were called ActionForms rather than something
like ActionData, ActionState, or ActionContext.  The html pages
are populated, I guess, with data.  If you try to map ActionForms to
html or JSP forms, I think your whole way of looking at the problems
becomes completely skewed.  Think of the form data as data and not as
some ghost of the form.  The term pre-populate, in my opinion, is
not very useful.




On Fri, 11 Mar 2005 09:18:15 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've read a number of articles about correct pre-populate forms methods,
 including the following:
 
 1.
http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html
 2.  http://struts.apache.org/faqs/newbie.html#prepopulate
 http://struts.apache.org/faqs/newbie.html#prepopulate
 3.

http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-Ste
 p1

http://www.coreservlets.com/Apache-Struts-Tutorial/Struts-Forms.html#Ex1-St
 ep1
 
 I have some questions.
 
 The first article does not talk specifics about how Lazy-Loading would be
 implemented.
 
 The second doesn't talk about how the actual pre-population would be
 implemented in the action.
 
 And the third does it in a way that's different from how others do it.
 
 Here's what I've gotten so far...
 
 There are two different ways that I see to do it.
 
 1.  Load the FormBean up in the constructor.
 
 a.  This does not work in Dyna*Forms since there's no actual
 implementation
 b.  This then moves the logic to the actual form bean which is not
where
 it's supposed to be.
 
 2.  Load the FormBean in a precursor Action
 
 a.  This works well but every example I've seen then does something
like
 this:
 
 Request.getSession().setAttribute( 'formBean, bean);
 
 This seems like a bad idea since it places the bean into the session
scope.
 I've tried doing this by putting it directly into request but of course
the
 jsp then doesn't have access to it because the request on the Action is
not
 in the same scope as the 'form'.jsp
 
 So I guess I'm at a loss on how best to pre-populate Dyna*Forms. Examples
 that have worked from your experience would be appreciated.
 
 


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

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

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



Re: Correct Prepopulate Method

2005-03-11 Thread Hubert Rabago
On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I'm not sure I understand the need for the moduleConfig and such for
 creating the DynaActionForm.

The FormBeanConfig object provides access to the createActionForm()
method.  That's the object you actually need.  You can get to that
through the ModuleConfig for the current module.

 
 If we've specified the name=myForm in the action config then shouldn't the
 form coming into the execute be and empty version of my form? Thus allowing:
 
  execute( ActionMapping mapping, ActionForm form ... {
 DynaActionForm myForm = (DynaActionForm) form;
  }
 
 (As a matter of fact I know this works :))
 

This is true when you're in the action to which the form was
submitted.  In the example I gave, this would be the /submitForm
action.  In a setup action, this mapping may not be available or may
be referring to a different form altogether.

 Also, using
 
 request.getSession().setAttribute(myForm, myForm);
 
 is exactly the issue. Although it then allows the follow up jsp to gain
 access to the formbean during form(html) creation it doesn't determine how
 then to remove the form from the session except by explicit removal in the
 final update/submit action unless you config the submit as request scope
 only. But that doesn't actually remove the formbean from the session scope
 that we added it into... it just copies it into the request scope too.
 
 --- so back to sqare one. :P

You can specify which scope you want the form bean to be in (read the
bottom of my prev email).  Struts uses session scope by default, which
is why that's what I mentioned first.  You can choose to use request
scope.

hth,
Hubert

 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 9:36 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 You would usually do prepopulation in a setup form.  Which scope you
 place the form in depends on how you configure the action that the
 form will be submitted to.  For example, if you have /showPage.do
 and /submitForm.do, where submitForm is configured as:
 
 action path=/submitForm name=myForm .../action
 
 Then in the action for showPage, you'd:
 
 ModuleConfig moduleConfig =
 ModuleUtils.getInstance().getModuleConfig(request);
 FormBeanConfig formBeanConfig =
 moduleConfig.findFormBeanConfig(myForm);
 DynaActionForm myForm = (DynaActionForm)
 formBeanConfig.createActionForm(getServlet());
 
 myForm.set(propName,propValue);
 request.getSession().setAttribute(myForm, myForm);
 
 If you want to use request scope, change /submitForm to:
 action path=/submitForm name=myForm scope=request.../action
 
 then in showPage:
 request.setAttribute(myForm, myForm);
 
 Hubert


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



RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
Thanks... I'll keep playing around using your suggestions.


-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:13 AM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I'm not sure I understand the need for the moduleConfig and such for
 creating the DynaActionForm.

The FormBeanConfig object provides access to the createActionForm()
method.  That's the object you actually need.  You can get to that
through the ModuleConfig for the current module.

 
 If we've specified the name=myForm in the action config then shouldn't
the
 form coming into the execute be and empty version of my form? Thus
allowing:
 
  execute( ActionMapping mapping, ActionForm form ... {
 DynaActionForm myForm = (DynaActionForm) form;
  }
 
 (As a matter of fact I know this works :))
 

This is true when you're in the action to which the form was
submitted.  In the example I gave, this would be the /submitForm
action.  In a setup action, this mapping may not be available or may
be referring to a different form altogether.

 Also, using
 
 request.getSession().setAttribute(myForm, myForm);
 
 is exactly the issue. Although it then allows the follow up jsp to gain
 access to the formbean during form(html) creation it doesn't determine how
 then to remove the form from the session except by explicit removal in the
 final update/submit action unless you config the submit as request scope
 only. But that doesn't actually remove the formbean from the session scope
 that we added it into... it just copies it into the request scope too.
 
 --- so back to sqare one. :P

You can specify which scope you want the form bean to be in (read the
bottom of my prev email).  Struts uses session scope by default, which
is why that's what I mentioned first.  You can choose to use request
scope.

hth,
Hubert

 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 9:36 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 You would usually do prepopulation in a setup form.  Which scope you
 place the form in depends on how you configure the action that the
 form will be submitted to.  For example, if you have /showPage.do
 and /submitForm.do, where submitForm is configured as:
 
 action path=/submitForm name=myForm .../action
 
 Then in the action for showPage, you'd:
 
 ModuleConfig moduleConfig =
 ModuleUtils.getInstance().getModuleConfig(request);
 FormBeanConfig formBeanConfig =
 moduleConfig.findFormBeanConfig(myForm);
 DynaActionForm myForm = (DynaActionForm)
 formBeanConfig.createActionForm(getServlet());
 
 myForm.set(propName,propValue);
 request.getSession().setAttribute(myForm, myForm);
 
 If you want to use request scope, change /submitForm to:
 action path=/submitForm name=myForm scope=request.../action
 
 then in showPage:
 request.setAttribute(myForm, myForm);
 
 Hubert


-
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: Upper case converter in the view

2005-03-11 Thread Jeff Beal
As a side note, be aware that the text-transform CSS property doesn't
change case on letters, they just look upper case.  Our app uses the
text-transform property to put all form fields in upper case, and I've
got a bug to fix because the submitted field value wasn't actually
upper-case values.

-- Jeff


On Fri, 11 Mar 2005 10:31:57 -0500, Benedict, Paul C
[EMAIL PROTECTED] wrote:
 Agreed. Good catch Mark! You could also use the text-transform property.
 
 -Original Message-
 From: Mark Benussi [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:29 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Upper case converter in the view
 
 Your could use css span style=cant remember the css attributebean:write
 //span
 
 -Original Message-
 From: Benedict, Paul C [mailto:[EMAIL PROTECTED]
 Sent: 11 March 2005 15:22
 To: 'Struts Users Mailing List'
 Subject: RE: Upper case converter in the view
 
 Brian,
 
 I believe the Jakarta-Taglibs Project will be able to do this:
 http://jakarta.apache.org/taglibs/doc/string-doc/intro.html
 
 http://jakarta.apache.org/taglibs/doc/string-doc/string-1.1.0/index.html
 
 Thanks,
 Paul
 
 -Original Message-
 From: Brian McGovern [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:21 AM
 To: Struts Users Mailing List
 Subject: Upper case converter in the view
 
 Has anyone tried to use the bean:write tag to convert the output to all
 Upper or all lower case?
 
 Thanks
 -B
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 --
 Notice:  This e-mail message, together with any attachments, contains
 information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New
 Jersey, USA 08889), and/or its affiliates (which may be known outside the
 United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as
 Banyu) that may be confidential, proprietary copyrighted and/or legally
 privileged. It is intended solely for the use of the individual or entity
 named on this message.  If you are not the intended recipient, and have
 received this message in error, please notify us immediately by reply e-mail
 and then delete it from your system.
 
 --
 
 -
 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]
 
 --
 Notice:  This e-mail message, together with any attachments, contains 
 information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New 
 Jersey, USA 08889), and/or its affiliates (which may be known outside the 
 United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
 Banyu) that may be confidential, proprietary copyrighted and/or legally 
 privileged. It is intended solely for the use of the individual or entity 
 named on this message.  If you are not the intended recipient, and have 
 received this message in error, please notify us immediately by reply e-mail 
 and then delete it from your system.
 --
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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



Re: Typical Struts development team and distribution of tasks?

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

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

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

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

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

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

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


Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
There is no right way.  However, if you think Action-centric rather
than page-centric everything is really easy.

If you do this, you won't think of the ActionForm as some sort of
mirror of the JSP/HTML form which stands between the Action and the
form.

Think, rather, of the Action as something that is called, processes
data, and forwards to somewhere.

Think of the data in the ActionForm as data in a repository available
to the Action.  You might want to populate the ActionForm dynamically
or otherwise.  That is not a problem.  A lot of the data you may want
to send to the JSP/HTML form may not come from a page at all.  You
need to remain flexible to do what you need to do.

The ActionForm mechanism is just a way to interface comfortably with
the html:form but should not somehow determine how you handle data. 
Usually my ActionForm relating to an Action itself is related at least
to two different (pre and post) JSP/HTML forms.  So the picture IS
NOT:

form A -- ActionFormA -- Action -- ActionFormB -- form B

but IS:

   Action 
  ^
  |
  v
  ActionForm
 ^
 |
 v

^  ^
|   |
v  v
form A   form B

Know what I mean?  Page-centric thinking is procedural programming.

Jack


SNIP
On Fri, 11 Mar 2005 09:53:01 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 Ok, then what am I missing?
 
 I have a jsp/html form that needs to be 'pre-populated' with dynamic fields
 from a table in a database that simply has name-value pairs. I'm willing to
 accept that I'm looking at the world the wrong way... what's the right way?
/SNIP

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

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



RE: Help With Action

2005-03-11 Thread Scott Purcell
Found the problem thanks to Joe Germuska,

My inputForward was true and this was the cause of my problem.

Read what he sent me. I figure this will probably happen to someone else, so 
here is some great information. Thanks again Joe,

the most common causes of white screens are when the 
processForwardConfig method of RequestProcessor is executed with a 
null ForwardConfig (ActionForward extends ForwardConfig).

This might be happening if your controller element has 
inputForward='true', which is an instruction to treat the value of 
the input element as the name of a forward instead of as a 
servlet-context-relative path to which the request dispatcher could 
forward control.

If you did have controller set up this way, then the value of input 
in your case should be Failure -- except that using a redirect 
after a validation failure would cause any request scoped messages to 
be lost.

Another common cause of white-screen is when there's a JSP level 
error within a tile, at which point Struts can't forward to an error 
processor because the JSP response has already been committed -- but 
it doesn't look like that's your problem.

Any chance you have inputForward set?  Even if you don't, try once 
with inputForward='false' just to see, although it should default 
to false.

Joe





-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:29 AM
To: Struts Users Mailing List
Subject: RE: Help With Action


Yes, they should be the same, I have been changing the paths and watching the 
log. And no matter what I do, the log shows it tries to forward to the path 
under input.

scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:25 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


It seems that your input is: /dealer/jsp/login.jsp
And your Failure forward is: /jsp/login.jsp

Is there a reason it's different? Validation is different and happens before
Action.execute where your forward would happen on Failure.


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:22 AM
To: Struts Users Mailing List
Subject: RE: Help With Action

I guess I could do that, but the docs state that if the validation fails,
request will go to the input tag. and I do not see how to do a redirect on
that.

Anyone?

Scott

-Original Message-
From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Help With Action


forward name=Failure path=/jsp/login.jsp redirect=true /

?? maybe ??


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 9:13 AM
To: user@struts.apache.org
Subject: Help With Action

Hello,
 
I have the following action setup in my struts-config.xml file:
 
 action
path=/login
input=/dealer/jsp/login.jsp
type=com.ddi.dealer.action.LoginAction
name=loginBean
scope=request
validate=true
forward name=Success path=/jsp/welcome.jsp /
forward name=Failure path=/jsp/login.jsp /
  /action
 
I am failing the ActionForm so my request should go to the input tag. And
according to the Logger it does.
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
username=
2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
Validating input form properties
2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
on LoginForm
2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
Validation failed, returning to '/dealer/jsp/login.jsp'
 
But for whatever reason, the page only displays white with no error? I feel
that it needs to do a redirect or something, but not sure how that should
work. Does anyone have any ideas what I am doing wrong?
 
Thanks,


Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
http://www.vertisinc.com/  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 

-
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: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
What would have been ideal would have been to allow Struts
configuration to tie more than one ActionForm to an Action.  Then
page-centric and action-centric thinkers would have had common ground.
 As things stand, you can avoid much of the sophistication in what
Hubert is suggesting by having an ActionForm that services two or more
JSP/html forms.  This is actually advisable or good for other reasons
too.  I am not suggesting that Hubert is wrong.  He is an ace
programmer and architect.  I am just saying that this is a pretty
complicated way to go for a fairly simple problem.


On Fri, 11 Mar 2005 10:15:53 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 Thanks... I'll keep playing around using your suggestions.
 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:13 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
 [EMAIL PROTECTED] wrote:
  I'm not sure I understand the need for the moduleConfig and such for
  creating the DynaActionForm.
 
 The FormBeanConfig object provides access to the createActionForm()
 method.  That's the object you actually need.  You can get to that
 through the ModuleConfig for the current module.
 
 
  If we've specified the name=myForm in the action config then shouldn't
 the
  form coming into the execute be and empty version of my form? Thus
 allowing:
 
   execute( ActionMapping mapping, ActionForm form ... {
  DynaActionForm myForm = (DynaActionForm) form;
   }
 
  (As a matter of fact I know this works :))
 
 
 This is true when you're in the action to which the form was
 submitted.  In the example I gave, this would be the /submitForm
 action.  In a setup action, this mapping may not be available or may
 be referring to a different form altogether.
 
  Also, using
 
  request.getSession().setAttribute(myForm, myForm);
 
  is exactly the issue. Although it then allows the follow up jsp to gain
  access to the formbean during form(html) creation it doesn't determine how
  then to remove the form from the session except by explicit removal in the
  final update/submit action unless you config the submit as request scope
  only. But that doesn't actually remove the formbean from the session scope
  that we added it into... it just copies it into the request scope too.
 
  --- so back to sqare one. :P
 
 You can specify which scope you want the form bean to be in (read the
 bottom of my prev email).  Struts uses session scope by default, which
 is why that's what I mentioned first.  You can choose to use request
 scope.
 
 hth,
 Hubert
 
 
 
  -Original Message-
  From: Hubert Rabago [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 11, 2005 9:36 AM
  To: Struts Users Mailing List
  Subject: Re: Correct Prepopulate Method
 
  You would usually do prepopulation in a setup form.  Which scope you
  place the form in depends on how you configure the action that the
  form will be submitted to.  For example, if you have /showPage.do
  and /submitForm.do, where submitForm is configured as:
 
  action path=/submitForm name=myForm .../action
 
  Then in the action for showPage, you'd:
 
  ModuleConfig moduleConfig =
  ModuleUtils.getInstance().getModuleConfig(request);
  FormBeanConfig formBeanConfig =
  moduleConfig.findFormBeanConfig(myForm);
  DynaActionForm myForm = (DynaActionForm)
  formBeanConfig.createActionForm(getServlet());
 
  myForm.set(propName,propValue);
  request.getSession().setAttribute(myForm, myForm);
 
  If you want to use request scope, change /submitForm to:
  action path=/submitForm name=myForm scope=request.../action
 
  then in showPage:
  request.setAttribute(myForm, myForm);
 
  Hubert
 
 
 -
 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]
 
 


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

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



RE: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Mark Benussi
I agree, a good J2EE developer can take a UI from a designer (A Photoshop
file or the like) and return a pixel perfect html representation as well as
meeting the MVC business requirements.

-Original Message-
From: Radu Badita [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 17:20
To: Struts Users Mailing List
Subject: Re: Typical Struts development team and distribution of tasks?


Good question!

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

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

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

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

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


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



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


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



Re: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Leon Rosenberg

I don't know whether we are typical...

2 senior developers, one mainly responsible for the architecture and
backend (everything behind an action) and another one for frontend
(tiles, taglibs, action-hierarchy, etc).

1 developer / database responsible - the guy who writes sql and
persistence services, since we can't use any frameworks / OR mapper,
because of their bad performance (for example hibernate is a 3-tier
killer:-) )

2 frontend developers specialized on html, css, javascript, but
writing also simple actions and beans.

1 developer who is 50% of time busy maintaining the build / release
process ( we release twice a month, which means quite of administrative
work, since we are never able to release from cvs head) and providing
some level of application support. And we are continuously trying to
improve our processes. 

2 junior developers working on projects, mainly in the presentation
layer. 

1 junior-junior developer, main part is management of text resources and
other values. We have over 40 lookfeels for our site, with different
colours, buttons, layouts and so on.

1 developer, who is performing business inquiries and works on internal
statistic tools.

I don't count project managers, administrators etc.

regards
Leon




On Fri, 2005-03-11 at 16:38 +, Lawrie Gallardo wrote:
 Do most companies developing Struts applications tend to employ Web 
 Designers, or is it more common for Struts development to be undertaken by a 
 team consisting solely of Java Developers (who therefore need strong 
 knowledge of HTML, Struts Tags, JSTL, CSS, JavaScript, etc as well as J2EE)?
 
 Along the same lines... If you are working in a mixed team of Web Designers 
 and Java Developers, what is the best way to divide up Struts (+ Tiles) 
 development between these groups?
 
 The reason I ask these questions is that the vast majority of my previous 
 experience has been in back-end development (EJB, JMS, ORM, RDBMS, etc), and 
 now that I am learning Struts I am more than a little bit confused as to 
 what I'd be expected to know for the average Struts job...
 
 _
 Express yourself instantly with MSN Messenger! Download today - it's FREE! 
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



Re: Help With Action

2005-03-11 Thread Dakota Jack
The color of the page is not that helpful.  Code packed pages can be
white.  Is there any code on the page?  Have you checked the HTML
source code?   What's there?  When you know that, then you have some
data to work with.

Jack




On Fri, 11 Mar 2005 10:22:29 -0600, Scott Purcell
[EMAIL PROTECTED] wrote:
 I guess I could do that, but the docs state that if the validation fails, 
 request will go to the input tag. and I do not see how to do a redirect on 
 that.
 
 Anyone?
 
 Scott
 
 -Original Message-
 From: Schuster Joel M Contr ESC/NDC [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:16 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Help With Action
 
 forward name=Failure path=/jsp/login.jsp redirect=true /
 
 ?? maybe ??
 
 -Original Message-
 From: Scott Purcell [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 9:13 AM
 To: user@struts.apache.org
 Subject: Help With Action
 
 Hello,
 
 I have the following action setup in my struts-config.xml file:
 
  action
 path=/login
 input=/dealer/jsp/login.jsp
 type=com.ddi.dealer.action.LoginAction
 name=loginBean
 scope=request
 validate=true
 forward name=Success path=/jsp/welcome.jsp /
 forward name=Failure path=/jsp/login.jsp /
   /action
 
 I am failing the ActionForm so my request should go to the input tag. And
 according to the Logger it does.
 2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - XXX setting
 username=
 2005-03-11 10:12:12,349 DEBUG org.apache.struts.action.RequestProcessor -
 Validating input form properties
 2005-03-11 10:12:12,349 INFO com.ddi.dealer.bean.LoginForm - Validate called
 on LoginForm
 2005-03-11 10:12:12,350 DEBUG org.apache.struts.action.RequestProcessor -
 Validation failed, returning to '/dealer/jsp/login.jsp'
 
 But for whatever reason, the page only displays white with no error? I feel
 that it needs to do a redirect or something, but not sure how that should
 work. Does anyone have any ideas what I am doing wrong?
 
 Thanks,
 
 Scott K Purcell | Developer | VERTIS |
 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
 314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com
 http://www.vertisinc.com/
 
 Vertis is the premier provider of targeted advertising, media, and
 marketing services that drive consumers to marketers more effectively.
 
 -
 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]
 
 


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

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



Is Struts All right ?

2005-03-11 Thread Diego Espada
Hello ? I'm totally surprised about the current state of the Struts web site...

1) I couldn't find the address to subscribe to this list. I just made
it up, imagining that it would be the same as the Tomcat list.
2) The Mailing list archive functionality is at 20 % at best. You
can't search messages, browse them ordering by subject or other
criteria, or browse certain categories. Almost everything that you do
returns a stack trace.

Is the struts web site being mantained ??
Thanks...

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



Re: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Ted Husted
I still see both. The larger team, the more likely it is that people
start to specialized. But it is not unusual to see teams where
everyone can do everything, from code HTML to code Java to code SQL.

-Ted.

On Fri, 11 Mar 2005 16:38:06 +, Lawrie Gallardo
[EMAIL PROTECTED] wrote:
 Do most companies developing Struts applications tend to employ Web
 Designers, or is it more common for Struts development to be undertaken by a
 team consisting solely of Java Developers (who therefore need strong
 knowledge of HTML, Struts Tags, JSTL, CSS, JavaScript, etc as well as J2EE)?
 
 Along the same lines... If you are working in a mixed team of Web Designers
 and Java Developers, what is the best way to divide up Struts (+ Tiles)
 development between these groups?
 
 The reason I ask these questions is that the vast majority of my previous
 experience has been in back-end development (EJB, JMS, ORM, RDBMS, etc), and
 now that I am learning Struts I am more than a little bit confused as to
 what I'd be expected to know for the average Struts job...
 
 _
 Express yourself instantly with MSN Messenger! Download today - it's FREE!
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
HTH, Ted.

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



RE: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Kelly Harward
You've underscored one of the most compelling aspects of an MVC
architecture. The inherent separation of concerns allows teams to be formed
where members have differing skill sets and yet the architecture helps to
define roles and responsibilities. At the most cursory level, it sounds like
you're in a situation where you can have your Web designers focus on the V
and your Java developers can focus on the M and the C.

I've worked on a few different Struts-based web apps at different
organizations and found in my experience that the Java developers working on
these apps tend to have much further reach into (responsibility for) the
presentation tier than they might like. Even on projects where there are
dedicated Web Designers those people tend to focus on producing graphics
and layout mock ups. Even in cases where these designers have been
responsible for producing HTML/CSS for their designs, that markup usually
has to be refined by a Coder. In my experience, familiarity and competence
with HTML, CSS, JavaScript, tag libraries, JSTL and similar technologies are
pretty indispensable to a valuable Struts developer. Some may say that this
is a result of us not being able to hire the right kind of Web designers to
these teams - and I certainly wouldn't argue with that position. In my
experience it's not an easy hiring task.

If you've got a number of Web Designers who can produce good markup and
know CSS and JavaScript, then they are obviously well suited to take
responsibility for the bulk of the presentation tier. Make it a point to
encourage them to learn and use JSTL. Keep in mind that it still requires a
fair amount of coordination between the Web designers and the Java
developers who are writing Struts Actions (to coordinate on the data that
the Actions are going to expose to the presentation tier). Another big win
in this kind of environment can come from recognizing patterns in your
presentation tier and encapsulating more complex logic in your own tag
libraries.

In my experience, even Java developers who have HTML/CSS/JavaScript skills
are happiest when they're focused on Java code. I've never worked on a
Struts project where the Java developers wouldn't welcome to the team at
least one more competent Web designer at any given moment to allow them to
focus more attention on what they tend to like best.

-Kelly

P.S. I take issue with Leon's comment in this thread regarding Hibernate's
performance. I work on an app that has very intense requirements for
database IO (lots of data going in and out) and even though we've rolled our
own persistence layer framework (for reasons other than performance),
Hibernate is very comparable in performance benchmarks. Hibernate has many
advanced features for performance tuning that most users don't understand or
use. In fact, in rolling our own persistence layer, we've borrowed a lot
from Hibernate and would probably be using it if we could. For the vast
majority of web apps, Hibernate or a similar persistence layer framework is
a huge win and shouldn't be discouraged.


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



Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Ted Husted
Well, a framework is a semi-complete application [Johnson]. A
lightweight container is essentially an object factory, as you
implied.

Struts is more than a framework. It's also a container that manages
the lifecycle of the objects created by the struts-config.

You could, for example, use Spring to load the struts-config instead
of the  Distiller. Right now, I'm using Spring to load my CoR objects.

But, hey, the business-end of the applications someone else writes
might not need or want a container. :) It's not possible for me to say
why someone else needs a container. :)  I can say why my team uses a
container for our business logic objects.

So Why? Because we really, really like writing a handful of base
objects to do 90% of the work and configuring them in XML. Of course,
your mileage may vary. A lot of people decide not to use Struts
because they don't want to do the XML config thing.

In the application in front of me now, we have 13 base objects that we
use to create 51 commands or chains. After lunch, I'll add another 20
commands for editing various database records, but I won't need to add
a single new class. All I need are new elements in the Spring config
to configure old base objects with new details, and the corresponding
datebase statements in the iBATIS config. It's not unlike using Tiles
to create pages, except we're creating chains of business logic.

If anyone is actually interested in IoC containers, check out Rod
Johnson's book, J2EE Development without EJB.  Another good
reference is Matt Raible's WebLog.

[http://raibledesigns.com/page/rd?anchor=appfuse_refactorings_part_ii_spring]

Matt  refactored Appfuse in Anger for Spring and has never looked back :) 

But, at this point, I think we begin to digress ...

-Ted.

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



RE: Is Struts All right ?

2005-03-11 Thread Benedict, Paul C
Diego,

I agree. It is nearly impossible to to find the Struts Mailing list on the
Struts website unless you do some heavy digging. I could only find it after
giving up and relying on google to find it for me.

Anyway, here is the address for the mailing list:
http://struts.apache.org/mail.html

Thanks,
Paul

-Original Message-
From: Diego Espada [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 1:05 PM
To: user@struts.apache.org
Subject: Is Struts All right ?


Hello ? I'm totally surprised about the current state of the Struts web
site...

1) I couldn't find the address to subscribe to this list. I just made
it up, imagining that it would be the same as the Tomcat list.
2) The Mailing list archive functionality is at 20 % at best. You
can't search messages, browse them ordering by subject or other
criteria, or browse certain categories. Almost everything that you do
returns a stack trace.

Is the struts web site being mantained ??
Thanks...

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






--
Notice:  This e-mail message, together with any attachments, contains 
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
--

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



Validator with more than one module

2005-03-11 Thread Diego Espada
Hi

I'm trying to use the validator with one that more Struts module, but
I've found that if you've more than one module, only one of them load
the validation xmls correctly, the others don't.

Having this in the web.xml

/WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml:

Each one loading their own validation.xml (validation-one and
validation-two), only struts-config-two loads the validator correctly.
The other validation is ignored by Struts.

If I switch the order of the files, it works the other way around.

I've seen in the Internet sort of this problem happened in previous
versions of Struts. I've tested this in 1.2.6 beta and 1.2.4 and the
problem is present.

Is there a patch or workaround for this ? 

Thanks

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



Survey on Understanding Code

2005-03-11 Thread Vineet Sinha
Hi,
We are running a set of small surveys, in an attempt to understand 
developers problems when attempting to understand code. Results from 
this survey will be used in refining (open-source) tools that we are 
building.

If you have looked at the code of any of the (Java) projects below, we 
would appreciate you taking a few minutes to fill out as many of the 
respective surveys: Ant, Struts, Geronimo, Cocoon, Xerces, Xalan, 
Tomcat, Derby, Lucene, and Batik.

The survey can be found at:
http://people.csail.mit.edu/people/vineet/pc_apache.html
Please contact me if you have any questions, concerns, or comments!
Thanks!!
Regards,
Vineet Sinha
[EMAIL PROTECTED]
PS: If this is not an appropriate place for posting this message, I will 
appreciate a pointer to the appropriate locations - Thanks!

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


Re: Is Struts All right ?

2005-03-11 Thread Joe Germuska
At 3:04 PM -0300 3/11/05, Diego Espada wrote:
Hello ? I'm totally surprised about the current state of the Struts 
web site...

1) I couldn't find the address to subscribe to this list. I just made
it up, imagining that it would be the same as the Tomcat list.
2) The Mailing list archive functionality is at 20 % at best. You
can't search messages, browse them ordering by subject or other
criteria, or browse certain categories. Almost everything that you do
returns a stack trace.
Is the struts web site being mantained ??
We're in the midst of a considerable reorganization of the source 
code repository, which is also where the documentation is maintained. 
It's been a while, but I believe that James is close to having us 
ready to build the docs, at which time we could refresh the public 
site.

I've never caught on to Eyebrowse, although it's the list archiving 
tool installed on Apache hardware.  I recommend GMane 
http://news.gmane.org/gmane.comp.jakarta.struts.user

Some people like MARC:
http://marc.theaimsgroup.com/?l=struts-user
Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

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


Re: Is Struts All right ?

2005-03-11 Thread Diego Espada
Ok,

the problem with this is that we cannot look for common problems in
the list. It doesn't allow you to search, and, for example, if you
click in by subject in the mailing list, you get this:

VelocityServlet: Error processing the template

General error: Got error 127 from table handler
org.apache.velocity.exception.VelocityException: General error: Got
error 127 from table handler
at org.tigris.eyebrowse.servlets.EyebrowseServlet.handleRequest(Unknown 
Source)
at 
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:396)
at org.tigris.eyebrowse.servlets.EyebrowseServlet.doRequest(Unknown 
Source)
at 
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:355)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)



On Fri, 11 Mar 2005 12:22:06 -0600, Joe Germuska [EMAIL PROTECTED] wrote:
 At 3:04 PM -0300 3/11/05, Diego Espada wrote:
 Hello ? I'm totally surprised about the current state of the Struts
 web site...
 
 1) I couldn't find the address to subscribe to this list. I just made
 it up, imagining that it would be the same as the Tomcat list.
 2) The Mailing list archive functionality is at 20 % at best. You
 can't search messages, browse them ordering by subject or other
 criteria, or browse certain categories. Almost everything that you do
 returns a stack trace.
 
 Is the struts web site being mantained ??
 
 We're in the midst of a considerable reorganization of the source
 code repository, which is also where the documentation is maintained.
 It's been a while, but I believe that James is close to having us
 ready to build the docs, at which time we could refresh the public
 site.
 
 I've never caught on to Eyebrowse, although it's the list archiving
 tool installed on Apache hardware.  I recommend GMane
 http://news.gmane.org/gmane.comp.jakarta.struts.user
 
 Some people like MARC:
 
 http://marc.theaimsgroup.com/?l=struts-user
 
 Joe
 --
 Joe Germuska
 [EMAIL PROTECTED]
 http://blog.germuska.com
 Narrow minds are weapons made for mass destruction  -The Ex
 
 

Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Leon Rosenberg

 If anyone is actually interested in IoC containers, check out Rod
 Johnson's book, J2EE Development without EJB.  

ok, bought... :-)
Expert One-on-One J2EE Development without EJB

what about
Expert One-to-One J2EE Design and Development ?

regards
Leon




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



replacing attribute in session

2005-03-11 Thread wo_shi_ni_ba_ba
if I do a
request.getSession().setAttribute(name,val1);
then request.getSession().setAttribute(name,val2)
would the val1 get garbage collected?  So if I use
session to store user, I don't really need to
invalidate the session when the user log in again,
right?
thanks




__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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



Re: Correct Prepopulate Method

2005-03-11 Thread Joe Germuska
Hubert has already pretty well described good coding practice for 
getting an ActionForm instance.  Note that the pages you cited may 
have been written before the FormBeanConfig object acted as a 
factory, which is a relatively recent enhancement.

Really, though, I think there should probably be a method like:
getMeTheRightForm(ActionContext ctx, String name, String scope)
which deals with searching scopes, instantiating, and if necessary 
placing the new instance into the right scope.  I'm just not sure 
where to put it.  Perhaps an instance method on the ModuleConfig 
interface?

Joe
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Dakota Jack
Rod Johnson's progress is from the latter book to the former one. 
Spring is in the middle.


On Fri, 11 Mar 2005 19:27:04 +0100, Leon Rosenberg
[EMAIL PROTECTED] wrote:
 
  If anyone is actually interested in IoC containers, check out Rod
  Johnson's book, J2EE Development without EJB.
 
 ok, bought... :-)
 Expert One-on-One J2EE Development without EJB
 
 what about
 Expert One-to-One J2EE Design and Development ?
 
 regards
 Leon
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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



Re: Struts Business Logic :: Best Practices

2005-03-11 Thread Dakota Jack
SNIP
On Fri, 11 Mar 2005 13:09:58 -0500, Ted Husted [EMAIL PROTECTED] wrote:

 [http://raibledesigns.com/page/rd?anchor=appfuse_refactorings_part_ii_spring]
 
 Matt  refactored Appfuse in Anger for Spring and has never looked back :)
 
/SNIP

What does this mean?  Was AppFuse for something else originally?  Thanks!


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

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



efficiency question

2005-03-11 Thread wo_shi_ni_ba_ba
Are there any difference in performance between the
following two scenarios?
1. creating and storing an attribute in the request in
the action.execute() then use the attribute as a bean
by struts from the jsp
2. creating the attribute store it in the request as
scriplet in the jsp page, then use the attribute as a
bean by struts from the jsp

Are these two procceses essentially the same?
thanks in advance



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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



RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
I've been looking into the RequestProcessor and RequestUtils classes and it
looks like as long as my action mapping specifies a name, even on a setup
action goes through the same process... calling createActionForm().

Thus there is no reason to go through my own ModuleConfig again.


-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 10:13 AM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I'm not sure I understand the need for the moduleConfig and such for
 creating the DynaActionForm.

The FormBeanConfig object provides access to the createActionForm()
method.  That's the object you actually need.  You can get to that
through the ModuleConfig for the current module.

 
 If we've specified the name=myForm in the action config then shouldn't
the
 form coming into the execute be and empty version of my form? Thus
allowing:
 
  execute( ActionMapping mapping, ActionForm form ... {
 DynaActionForm myForm = (DynaActionForm) form;
  }
 
 (As a matter of fact I know this works :))
 

This is true when you're in the action to which the form was
submitted.  In the example I gave, this would be the /submitForm
action.  In a setup action, this mapping may not be available or may
be referring to a different form altogether.

 Also, using
 
 request.getSession().setAttribute(myForm, myForm);
 
 is exactly the issue. Although it then allows the follow up jsp to gain
 access to the formbean during form(html) creation it doesn't determine how
 then to remove the form from the session except by explicit removal in the
 final update/submit action unless you config the submit as request scope
 only. But that doesn't actually remove the formbean from the session scope
 that we added it into... it just copies it into the request scope too.
 
 --- so back to sqare one. :P

You can specify which scope you want the form bean to be in (read the
bottom of my prev email).  Struts uses session scope by default, which
is why that's what I mentioned first.  You can choose to use request
scope.

hth,
Hubert

 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 9:36 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 You would usually do prepopulation in a setup form.  Which scope you
 place the form in depends on how you configure the action that the
 form will be submitted to.  For example, if you have /showPage.do
 and /submitForm.do, where submitForm is configured as:
 
 action path=/submitForm name=myForm .../action
 
 Then in the action for showPage, you'd:
 
 ModuleConfig moduleConfig =
 ModuleUtils.getInstance().getModuleConfig(request);
 FormBeanConfig formBeanConfig =
 moduleConfig.findFormBeanConfig(myForm);
 DynaActionForm myForm = (DynaActionForm)
 formBeanConfig.createActionForm(getServlet());
 
 myForm.set(propName,propValue);
 request.getSession().setAttribute(myForm, myForm);
 
 If you want to use request scope, change /submitForm to:
 action path=/submitForm name=myForm scope=request.../action
 
 then in showPage:
 request.setAttribute(myForm, myForm);
 
 Hubert


-
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: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
I may be wrong, Joel, but I think Joe and Hubert are thinking of you
instantiating a form that is not listed in your action mapping.  You
can readily figure out why they think this way.  You can, as you seem
to want to, avoid this complication that actually sort of takes you
out of the reason for the Struts framework by having your ActionForm
encompass the data in both the pre-Action and post-Action JSP/HTML
forms.

Jack


On Fri, 11 Mar 2005 11:57:33 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've been looking into the RequestProcessor and RequestUtils classes and it
 looks like as long as my action mapping specifies a name, even on a setup
 action goes through the same process... calling createActionForm().
 
 Thus there is no reason to go through my own ModuleConfig again.
 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:13 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
 [EMAIL PROTECTED] wrote:
  I'm not sure I understand the need for the moduleConfig and such for
  creating the DynaActionForm.
 
 The FormBeanConfig object provides access to the createActionForm()
 method.  That's the object you actually need.  You can get to that
 through the ModuleConfig for the current module.
 
 
  If we've specified the name=myForm in the action config then shouldn't
 the
  form coming into the execute be and empty version of my form? Thus
 allowing:
 
   execute( ActionMapping mapping, ActionForm form ... {
  DynaActionForm myForm = (DynaActionForm) form;
   }
 
  (As a matter of fact I know this works :))
 
 
 This is true when you're in the action to which the form was
 submitted.  In the example I gave, this would be the /submitForm
 action.  In a setup action, this mapping may not be available or may
 be referring to a different form altogether.
 
  Also, using
 
  request.getSession().setAttribute(myForm, myForm);
 
  is exactly the issue. Although it then allows the follow up jsp to gain
  access to the formbean during form(html) creation it doesn't determine how
  then to remove the form from the session except by explicit removal in the
  final update/submit action unless you config the submit as request scope
  only. But that doesn't actually remove the formbean from the session scope
  that we added it into... it just copies it into the request scope too.
 
  --- so back to sqare one. :P
 
 You can specify which scope you want the form bean to be in (read the
 bottom of my prev email).  Struts uses session scope by default, which
 is why that's what I mentioned first.  You can choose to use request
 scope.
 
 hth,
 Hubert
 
 
 
  -Original Message-
  From: Hubert Rabago [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 11, 2005 9:36 AM
  To: Struts Users Mailing List
  Subject: Re: Correct Prepopulate Method
 
  You would usually do prepopulation in a setup form.  Which scope you
  place the form in depends on how you configure the action that the
  form will be submitted to.  For example, if you have /showPage.do
  and /submitForm.do, where submitForm is configured as:
 
  action path=/submitForm name=myForm .../action
 
  Then in the action for showPage, you'd:
 
  ModuleConfig moduleConfig =
  ModuleUtils.getInstance().getModuleConfig(request);
  FormBeanConfig formBeanConfig =
  moduleConfig.findFormBeanConfig(myForm);
  DynaActionForm myForm = (DynaActionForm)
  formBeanConfig.createActionForm(getServlet());
 
  myForm.set(propName,propValue);
  request.getSession().setAttribute(myForm, myForm);
 
  If you want to use request scope, change /submitForm to:
  action path=/submitForm name=myForm scope=request.../action
 
  then in showPage:
  request.setAttribute(myForm, myForm);
 
  Hubert
 
 
 -
 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]
 
 


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

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



Re: Is Struts All right ?

2005-03-11 Thread Joe Germuska
At 3:26 PM -0300 3/11/05, Diego Espada wrote:
Ok,
the problem with this is that we cannot look for common problems in
the list. It doesn't allow you to search, and, for example, if you
click in by subject in the mailing list, you get this:
The problem with which?  You are searching using Eyebrowse.  I don't 
recommend using Eyebrowse.  Presumably no one has had the time or 
energy to make it work right, but why bother when GMane has such a 
nice interface?

  I've never caught on to Eyebrowse, although it's the list archiving
 tool installed on Apache hardware.  I recommend GMane
 http://news.gmane.org/gmane.comp.jakarta.struts.user
 Some people like MARC:
 http://marc.theaimsgroup.com/?l=struts-user
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

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


Re: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Neil Erdwien
We don't even try to have the development people do the web page.  In 
theory the process is:

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

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

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

Mark Benussi wrote:
I agree, a good J2EE developer can take a UI from a designer (A Photoshop
file or the like) and return a pixel perfect html representation as well as
meeting the MVC business requirements.
-Original Message-
From: Radu Badita [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 17:20
To: Struts Users Mailing List
Subject: Re: Typical Struts development team and distribution of tasks?

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

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

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

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

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
Computing and Network Services, Kansas State University
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Is Struts All right ?

2005-03-11 Thread Diego Espada
so is not using anymore ??
THAT i didn't know !!
Thanks !!


On Fri, 11 Mar 2005 12:59:13 -0600, Joe Germuska [EMAIL PROTECTED] wrote:
 At 3:26 PM -0300 3/11/05, Diego Espada wrote:
 Ok,
 
 the problem with this is that we cannot look for common problems in
 the list. It doesn't allow you to search, and, for example, if you
 click in by subject in the mailing list, you get this:
 
 The problem with which?  You are searching using Eyebrowse.  I don't
 recommend using Eyebrowse.  Presumably no one has had the time or
 energy to make it work right, but why bother when GMane has such a
 nice interface?
 
I've never caught on to Eyebrowse, although it's the list archiving
   tool installed on Apache hardware.  I recommend GMane
   http://news.gmane.org/gmane.comp.jakarta.struts.user
 
   Some people like MARC:
 
   http://marc.theaimsgroup.com/?l=struts-user
 
 --
 Joe Germuska
 [EMAIL PROTECTED]
 http://blog.germuska.com
 Narrow minds are weapons made for mass destruction  -The Ex
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: efficiency question

2005-03-11 Thread Jeff Beal
I cannot imagine there being a significant performance difference in
the two scenarios.  They are practically the same thing.


On Fri, 11 Mar 2005 10:51:22 -0800 (PST), wo_shi_ni_ba_ba
[EMAIL PROTECTED] wrote:
 Are there any difference in performance between the
 following two scenarios?
 1. creating and storing an attribute in the request in
 the action.execute() then use the attribute as a bean
 by struts from the jsp
 2. creating the attribute store it in the request as
 scriplet in the jsp page, then use the attribute as a
 bean by struts from the jsp
 
 Are these two procceses essentially the same?
 thanks in advance
 
 __
 Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site!
 http://smallbusiness.yahoo.com/resources/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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



Re: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Jeff Beal
 In practice, there are mutliple iterations of this, and I couldn't
 conceive of it working unless the framework person and the developer
 person work well together and are close both in the organization chart
 and geographically.

You can't get any closer than the two being the same person!  :-)  

We have three Java/Web/SQL developers.  We all pretty much have our
hands in all of the layers of the application code, from SQL and
PL/SQL all the way to HTML and JavaScript.

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

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



RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
Ok, I understand. I'm just really trying to understand this.

http://resonus.net/wiki/uploads/strutsq.jpg

Here's a link to a little picture that I put together because that happens
to be how I think.

Please tell me what I'm missing in my understanding of what struts is all
about. 

1. Standard login process.
a) request to website from browser, we redirect to the login.jsp via
an action or forward.
b) Submit is clicked and system encapsulates the data from the
request into a form which is then given to the action.execute which
c) then determines if the values are correct and forwards to the
right place depending.

2. Now, If I want to have the main menu simply go from one screen to another
then I have a link. But the second screen needs to be 'populated' (for lack
of a better word) with data. 

3. To do it the struts 'way' is to link to an action instead. This action
fills the framework provided form (because it is defined in the mapping) and
forwards to the edit screen.

4. The update action uses the same form which is now filled with changed
values from the jsp.

--- I keep getting the impression that I've missed something in my
understanding of how and more importantly why --- I want to understand, not
just do things blindly.

I understand that the ActionForm is intended to STORE and VALIDATE
USER-ENTERED data (off the struts page)... but then there seems to be a big
hole in the functionality of struts. How do you get to the point of having a
person select inventory and purchase it if you can't first display that
inventory?

- Joel


-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 12:02 PM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

I may be wrong, Joel, but I think Joe and Hubert are thinking of you
instantiating a form that is not listed in your action mapping.  You
can readily figure out why they think this way.  You can, as you seem
to want to, avoid this complication that actually sort of takes you
out of the reason for the Struts framework by having your ActionForm
encompass the data in both the pre-Action and post-Action JSP/HTML
forms.

Jack


On Fri, 11 Mar 2005 11:57:33 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 I've been looking into the RequestProcessor and RequestUtils classes and
it
 looks like as long as my action mapping specifies a name, even on a setup
 action goes through the same process... calling createActionForm().
 
 Thus there is no reason to go through my own ModuleConfig again.
 
 
 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:13 AM
 To: Struts Users Mailing List
 Subject: Re: Correct Prepopulate Method
 
 On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
 [EMAIL PROTECTED] wrote:
  I'm not sure I understand the need for the moduleConfig and such for
  creating the DynaActionForm.
 
 The FormBeanConfig object provides access to the createActionForm()
 method.  That's the object you actually need.  You can get to that
 through the ModuleConfig for the current module.
 
 
  If we've specified the name=myForm in the action config then shouldn't
 the
  form coming into the execute be and empty version of my form? Thus
 allowing:
 
   execute( ActionMapping mapping, ActionForm form ... {
  DynaActionForm myForm = (DynaActionForm) form;
   }
 
  (As a matter of fact I know this works :))
 
 
 This is true when you're in the action to which the form was
 submitted.  In the example I gave, this would be the /submitForm
 action.  In a setup action, this mapping may not be available or may
 be referring to a different form altogether.
 
  Also, using
 
  request.getSession().setAttribute(myForm, myForm);
 
  is exactly the issue. Although it then allows the follow up jsp to gain
  access to the formbean during form(html) creation it doesn't determine
how
  then to remove the form from the session except by explicit removal in
the
  final update/submit action unless you config the submit as request scope
  only. But that doesn't actually remove the formbean from the session
scope
  that we added it into... it just copies it into the request scope too.
 
  --- so back to sqare one. :P
 
 You can specify which scope you want the form bean to be in (read the
 bottom of my prev email).  Struts uses session scope by default, which
 is why that's what I mentioned first.  You can choose to use request
 scope.
 
 hth,
 Hubert
 
 
 
  -Original Message-
  From: Hubert Rabago [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 11, 2005 9:36 AM
  To: Struts Users Mailing List
  Subject: Re: Correct Prepopulate Method
 
  You would usually do prepopulation in a setup form.  Which scope you
  place the form in depends on how you configure the action that the
  form will be submitted to.  For example, if you have /showPage.do
  and /submitForm.do, where submitForm is configured 

Re: Is Struts All right ?

2005-03-11 Thread Simon Chappell
Does that mean that we only eliminate the lazy idiots from joining?
The fact that I got through shows a quality control issue right there!
;-)


On Fri, 11 Mar 2005 10:54:44 -0800, Dakota Jack [EMAIL PROTECTED] wrote:
 They have made the Struts mailing lists hard to find on purpose,
 believe it or not.  The rationale is on the lists.
 
 Jack
 
 
 On Fri, 11 Mar 2005 15:04:35 -0300, Diego Espada [EMAIL PROTECTED] wrote:
  Hello ? I'm totally surprised about the current state of the Struts web 
  site...
 
  1) I couldn't find the address to subscribe to this list. I just made
  it up, imagining that it would be the same as the Tomcat list.
  2) The Mailing list archive functionality is at 20 % at best. You
  can't search messages, browse them ordering by subject or other
  criteria, or browse certain categories. Almost everything that you do
  returns a stack trace.
 
  Is the struts web site being mantained ??
  Thanks...
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 --
 You can lead a horse to water but you cannot make it float on its back.
 ~Dakota Jack~
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
(The Lands' End guy is now using GMail to keep the clutter out of his
work inbox)

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



Re: Correct Prepopulate Method

2005-03-11 Thread Jesse Clark
Joel,
Here is a short description from the FAQ that starts to describe the 
alternative that Jack mentioned below: 
http://struts.apache.org/faqs/newbie.html#prepopulate.

This approach basically means that you end up with two actions per 
form/jsp which will increase your maintenance work a little but it 
provides clean entry points into the work flow and clearly illustrates 
what responsibilities an action has by its naming scheme. In the FAQ 
their example actions are called /editFoo and /saveFoo but when I use 
this approach I usually name my action DisplayFooAction and 
ProcessFooAction where Foo indicates the primary function of the 
jsp/form that these actions handle, i.e DisplayEditProfileAction and 
ProcessEditProfileAction for my editProfile.jsp and EditProfileForm.

Then the DisplayFooAction is responsible for gathering the data needed 
to prepopulate the Form from the business service, populating the Form 
and placing it in scope for the jsp. I request that a business service 
prepare the View necessary for the Foo page and then either, populate 
the Form from POJOs in the view or use collections from the view 
directly in the jsp to populate drop-down lists  etc. The Form is 
already available to you in the Action because it is declared in the 
action mapping for both the DisplayFoo and ProcessFoo actions.

Just to qualify my advice, I am still relatively new to this myself and 
this approach seemed like the simplest way to go for now, but I kinda 
feel like having 2 actions per page might end up being too much extra 
baggage and there might be other implications of which I am not yet aware.

Hope this helps, anyhow,
-Jesse
Schuster Joel M Contr ESC/NDC wrote:
Ok, I understand. I'm just really trying to understand this.
http://resonus.net/wiki/uploads/strutsq.jpg
Here's a link to a little picture that I put together because that happens
to be how I think.
Please tell me what I'm missing in my understanding of what struts is all
about. 

1. Standard login process.
a) request to website from browser, we redirect to the login.jsp via
an action or forward.
b) Submit is clicked and system encapsulates the data from the
request into a form which is then given to the action.execute which
c) then determines if the values are correct and forwards to the
right place depending.
2. Now, If I want to have the main menu simply go from one screen to another
then I have a link. But the second screen needs to be 'populated' (for lack
of a better word) with data. 

3. To do it the struts 'way' is to link to an action instead. This action
fills the framework provided form (because it is defined in the mapping) and
forwards to the edit screen.
4. The update action uses the same form which is now filled with changed
values from the jsp.
--- I keep getting the impression that I've missed something in my
understanding of how and more importantly why --- I want to understand, not
just do things blindly.
I understand that the ActionForm is intended to STORE and VALIDATE
USER-ENTERED data (off the struts page)... but then there seems to be a big
hole in the functionality of struts. How do you get to the point of having a
person select inventory and purchase it if you can't first display that
inventory?
- Joel
-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 12:02 PM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method

I may be wrong, Joel, but I think Joe and Hubert are thinking of you
instantiating a form that is not listed in your action mapping.  You
can readily figure out why they think this way.  You can, as you seem
to want to, avoid this complication that actually sort of takes you
out of the reason for the Struts framework by having your ActionForm
encompass the data in both the pre-Action and post-Action JSP/HTML
forms.
Jack
On Fri, 11 Mar 2005 11:57:33 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 

I've been looking into the RequestProcessor and RequestUtils classes and
   

it
 

looks like as long as my action mapping specifies a name, even on a setup
action goes through the same process... calling createActionForm().
Thus there is no reason to go through my own ModuleConfig again.
-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 10:13 AM
To: Struts Users Mailing List
Subject: Re: Correct Prepopulate Method
On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
   

I'm not sure I understand the need for the moduleConfig and such for
creating the DynaActionForm.
 

The FormBeanConfig object provides access to the createActionForm()
method.  That's the object you actually need.  You can get to that
through the ModuleConfig for the current module.
   

If we've specified the name=myForm in the action config then shouldn't
 

the
   

form coming into the execute be and empty version of my form? Thus

Using validwhen with jdeveloper 10g

2005-03-11 Thread Reddy, Ajith
Hello,

We have had problems using struts validwhen validator with jdeveloper
10g all last week. Traditionally jdeveloper 10g is shipped with struts
1.1 but after reading that validwhen is what we should be using
instead of requiredif we decided to plugin sturts 1.2.4 into jdev 10g
and this works fine.

Our problem is that we have a checkbox(ChangeAddredd) called check here
to enter and change address. Once this is checked there are some
address fields that need to be entered. We want error messages to be
displayed when user enters address fields without checking the checkbox
and also vice versa. I understand that  Only two items may be joined
with and or or . I tried using you suggestion elsewhere( you suggested
to use something like the following):

!DOCTYPE form-validation PUBLIC
-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN 
http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd  
form-validation
  formset
form name=PF_Report_1_Bean
  field property=ChangeAddress depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ChangeAddress/
var
  var-nametest/var-name
  var-value
  ((*this* != null) OR 
  ((NameRev == null) AND
  ((Address1Rev == null) AND
  ((CityRev == null) AND
   (ZipcodeRev == null)
  )
  )
  )
  )
/var-value
/var
  /field
  field property=NameRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.NameRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=Address1Rev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.Address1Rev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=CityRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.CityRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=ZipcodeRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ZipcodeRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
/form
  /formset
/form-validation




Struts Flow: parallel JS files

2005-03-11 Thread Timo -Blazko- Boewing
Hello List,

I plan to use Struts Flow plugin in order to realise a wizard for a
survey tool. However, the survey tool can handle different survey
definitions (depending on an URL parameter) at once. Thus, using a
simple flow control file (the server side JavaScript) is not that ideal,
because the wizard flow mat be very different per survey.

In the struts config, there is a hard wired survey parameter pointing to
the JavaScript, so there is no way of dynamically forking to different
scripts depending on a user's session parameter that tells what survey
he/she is participating.
So, is there a good way of forking elsewhere? E.g. making the JS that is
referenced by the Struts config a forker?

The Struts cfg should not change over the time, so to add several plugin
definitions per survey is not goog, the only customising part should be
to add JavaScripts.

Thank you for any hints!

Greetings,

Timo

-- 
greetings,   |  /\ 
 |  \ /  ASCII-Ribbon-Campaign
Timo |   X Against HTML Mail
 |  / \ 



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



BRANCH: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Leon Rosenberg
 P.S. I take issue with Leon's comment in this thread 
 regarding Hibernate's performance. I work on an app that has 
 very intense requirements for database IO (lots of data going 
 in and out) and even though we've rolled our own persistence 
 layer framework (for reasons other than performance), 
 Hibernate is very comparable in performance benchmarks. 
 Hibernate has many advanced features for performance tuning 
 that most users don't understand or use. In fact, in rolling 
 our own persistence layer, we've borrowed a lot from 
 Hibernate and would probably be using it if we could. For the 
 vast majority of web apps, Hibernate or a similar persistence 
 layer framework is a huge win and shouldn't be discouraged.

What are your response times? 





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



BRANCH: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Leon Rosenberg
 P.S. I take issue with Leon's comment in this thread 
 regarding Hibernate's performance. I work on an app that has 
 very intense requirements for database IO (lots of data going 
 in and out) and even though we've rolled our own persistence 
 layer framework (for reasons other than performance), 
 Hibernate is very comparable in performance benchmarks. 
 Hibernate has many advanced features for performance tuning 
 that most users don't understand or use. In fact, in rolling 
 our own persistence layer, we've borrowed a lot from 
 Hibernate and would probably be using it if we could. For the 
 vast majority of web apps, Hibernate or a similar persistence 
 layer framework is a huge win and shouldn't be discouraged.

What are your response times? 





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



RE: Correct Prepopulate Method

2005-03-11 Thread Joe Germuska
--- I keep getting the impression that I've missed something in my
understanding of how and more importantly why --- I want to understand, not
just do things blindly.
I understand that the ActionForm is intended to STORE and VALIDATE
USER-ENTERED data (off the struts page)... but then there seems to be a big
hole in the functionality of struts. How do you get to the point of having a
person select inventory and purchase it if you can't first display that
inventory?
No, I think that in trying to provide a more general answer, Hubert 
and I may have overcomplicated things.  It's also hard sometimes 
after doing something for a long time to remember which parts are 
less than obvious to a new user.

Jack wrote:
I may be wrong, Joel, but I think Joe and Hubert are thinking of you
instantiating a form that is not listed in your action mapping.  You
can readily figure out why they think this way.
Yes, I've been harping about what I think are insufficiencies in how 
Struts helps you set up pages for a while, which again, is part of 
why I overcomplicated things for you.  In the case where you have an 
input form with one kind of data (say, a search form), and on the 
destination page, you want to prepare a form with different kind of 
data (say, an edit details form), then you need a form that isn't 
listed in your action mapping for the prepopulation.

However, in your diagram, it appears that you're talking about a 
simpler case.  In this case, just set up action elements that have 
the right name (linking to a form-bean) and then the ActionForm 
which is passed to your action's execute will be the one you need to 
populate.

Remember that the way that html:form identifies a bean to use to 
back form fields is to look up the action mapping for the form's 
destination.  Therefore, this mapping should have the same name 
attribute as your setup action mapping.

I don't know if that clarifies things in any fashion.  I hope so!
Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

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


using the validwhen validator

2005-03-11 Thread Reddy, Ajith
Sorry for my previous incomplete mail.
 
Here is the problem again:
 
Our problem is that we have a checkbox(ChangeAddredd) called check here
to enter and change address. Once this is checked there are some
address fields that need to be entered. We want error messages to be
displayed when user enters address fields without checking the checkbox
and also vice versa. I understand that  Only two items may be joined
with and or or . I tried using an older suggestion and wrote my
validations.xml as: 
 
For now I have the using a textbox in place of checkBox just to make it
work. Buit even when I donot enter anything I get all the errors. Please
advise.

!DOCTYPE form-validation PUBLIC
-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN 
 http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd
http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd  
form-validation
  formset
form name=PF_Report_1_Bean
  field property=ChangeAddress depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ChangeAddress/
var
  var-nametest/var-name
  var-value
  ((*this* != null) OR 
  ((NameRev == null) AND
  ((Address1Rev == null) AND
  ((CityRev == null) AND
   (ZipcodeRev == null)
  )
  )
  )
  )
/var-value
/var
  /field
  field property=NameRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.NameRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=Address1Rev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.Address1Rev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=CityRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.CityRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=ZipcodeRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ZipcodeRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
/form
  /formset
/form-validation


I also get these parse errors :

05/03/11 15:41:57 line 1:19: unexpected token: OR

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.join(ValidWhenPars
er.java:442)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.joinedExpression(V
alidWhenParser.java:410)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expr(ValidWhenPars
er.java:383)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expression(ValidWh
enParser.java:369)

05/03/11 15:41:57  at

Any suggestions please.

-Ajith



two struts-config.xml

2005-03-11 Thread Carl Smith

In my application I have two configuration file (1) struts-config.xml and (2) 
struts-app1.xml. I have this entry in the web.xml

servlet-mapping

servlet-nameaction/servlet-name

url-pattern/*.app1/url-pattern

/servlet-mapping

 

When using this approach, I have a strange issue: For almost all the form 
submit, in the url the action will automatically apend .app1, example when 
submitted, I see this in the url

 

https://www.mypath/submitAction.app1, I want to see 
https://www.mypath/submitAction.do instead.

Thanks.



-
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 

Struts ActionForward to HTML A NAME=xxx anchor

2005-03-11 Thread Brian Bezanson
I'd like to know if it is possible to get a ActionForward to scroll my
target page to an anchor on the page created with the a
name=xxx/a.

Problem Description
--
I have a page in struts (rather large form) where I have a drop-down
menu near the bottom with some choices. (AKA html:select and
html:optionsCollection)

When a user selects from that menu, I have a javascript.submit() that
occurs where my page action retrieves data based on the menu change
and populates another text block on the page below the pop-up. On the
page being 'refreshed' it has set the scroll position to the top of
the page -- which is the normal behavior.

I'd like to return to a named anchor on the page by the drop-down
menu. My Action.java code returns a return
(mapping.findForward(myMessage));

In my struts-config.xml I also have the following: forward
name=myMessage path=/Main/SomePage.jsp#name_reference/

In the JSP page (SomePage.jsp) I have:

html:link linkName=name_reference/html:link

But of course when I try and execute things, I get a 404 error::

HTTP Status 404 - /Main/SomePage.jsp#name_reference

type Status report

message /Main/SomePage.jsp#name_reference

description The requested resource
(/Main/SomePage.jsp#name_reference) is not available.
Apache Tomcat/5.0.28

Removing the #name_reference from the struts-config.xml file gets
things working again -- just no scrolling to my anchor point.

Thanks in advance,

Brian

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



Re: Validator with more than one module

2005-03-11 Thread Corey Probst
By adding a comma separated list of struts config files, you are not
specifying multiple *modules*, just multiple config files. 
ValidatorResources are stored in the ServletContext after being read
by the plugin.  So, when struts-config-two is read, it overwrites the
info stored for struts-config-one.

To specify multiple modules you need to declare in the ActionServlet
init params something like this...
init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config-one.xml/param-value
/init-param
init-param
   param-nameconfig/module1/param-name
   param-value/WEB-INF/struts-config-two.xml/param-value
/init-param

Corey

This link describes both ways (multiple config files and modules)...
http://struts.apache.org/userGuide/configuration.html

 I'm trying to use the validator with one that more Struts module, but
 I've found that if you've more than one module, only one of them load
 the validation xmls correctly, the others don't.
 
 Having this in the web.xml
 
 /WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml:

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



Substring of bean:write

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
I can't seem to find a clean way of getting a substring of bean:write...
suggestions?

 



RE: Struts ActionForward to HTML A NAME=xxx anchor

2005-03-11 Thread Scott Piker
I don't think you can do it quite in the manner that you're attempting,
but you can achieve this behavior by doing the following:

- in your action class, populate a request attribute when this page
refresh occurs 
- forward back to your jsp as normal
- in your jsp, check for the existence of this request attribute.
- if it exists, call a javascript function that sets the
window.location.hash value to your anchor name.

HTH,
- Scott

-Original Message-
From: Brian Bezanson [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 4:42 PM
To: user@struts.apache.org
Subject: Struts ActionForward to HTML A NAME=xxx anchor

I'd like to know if it is possible to get a ActionForward to scroll my
target page to an anchor on the page created with the a
name=xxx/a.

Problem Description
--
I have a page in struts (rather large form) where I have a drop-down
menu near the bottom with some choices. (AKA html:select and
html:optionsCollection)

When a user selects from that menu, I have a javascript.submit() that
occurs where my page action retrieves data based on the menu change and
populates another text block on the page below the pop-up. On the page
being 'refreshed' it has set the scroll position to the top of the page
-- which is the normal behavior.

I'd like to return to a named anchor on the page by the drop-down menu.
My Action.java code returns a return
(mapping.findForward(myMessage));

In my struts-config.xml I also have the following: forward
name=myMessage path=/Main/SomePage.jsp#name_reference/

In the JSP page (SomePage.jsp) I have:

html:link linkName=name_reference/html:link

But of course when I try and execute things, I get a 404 error::

HTTP Status 404 - /Main/SomePage.jsp#name_reference

type Status report

message /Main/SomePage.jsp#name_reference

description The requested resource
(/Main/SomePage.jsp#name_reference) is not available.
Apache Tomcat/5.0.28

Removing the #name_reference from the struts-config.xml file gets things
working again -- just no scrolling to my anchor point.

Thanks in advance,

Brian

-
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: BRANCH: Typical Struts development team and distribution of tasks?

2005-03-11 Thread Kelly Harward
Not sure that there is a lot of value in throwing around any kind of
empirical numbers since they will certainly vary greatly depending on
numerous factors (the query you're executing, network latency, the actual
RDBMS underneath, the amount of data in the database, proper use of indexes,
etc.). However, in benchmark scenarios we have worked on, it's more common
than not with Hibernate to see response times on par with straight JDBC. The
thing one may be tempted to discount in these kind of comparison benchmarks
is that in a plain ol' JDBC scenario you still have to marshal the JDBC
ResultSet to your domain objects (typically POJOs) if you really want to
compare apples to apples. Remember, Hibernate gives you collections of Java
objects - not a JDBC ResultSet (which, in my view, is a huge win in more
complex J2EE architectures). Granted, there may very well be some of your
existing queries that will appear slower with a generic Hibernate
implementation. We picked a few of our nastiest ones and found that after
some tuning we can get performance from Hibernate that is on par with
straight JDBC.

I'm not trying to make the case that Hibernate (or similar frameworks) will
always be the best persistence solution for every J2EE app. Rather, I think
it's a mistake to discourage their use as a rule on the grounds that these
frameworks are not performant.

HTH,
-Kelly

-Original Message-
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 1:24 PM
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: BRANCH: Typical Struts development team and distribution of tasks?

What are your response times? 


-
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: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
SNIP
On Fri, 11 Mar 2005 12:09:25 -0800, Jesse Clark [EMAIL PROTECTED] wrote:
 Joel,
 
 Here is a short description from the FAQ that starts to describe the
 alternative that Jack mentioned below:
 http://struts.apache.org/faqs/newbie.html#prepopulate.
 
 This approach basically means that you end up with two actions per
 form/jsp which will increase your maintenance work a little but it
 provides clean entry points into the work flow and clearly illustrates
 what responsibilities an action has by its naming scheme.
/SNIP

This is definitely not what I am talking about.  This is a
page-centric perspective that I am suggesting is not helpful.

What I am talking about does not use multiple actions per form.  There
is no increase in maintenance at all.
-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



Re: two struts-config.xml

2005-03-11 Thread Joe Germuska
Struts has to know how to rewrite action URLs, and it can only do 
that by using the url-pattern.  Do you have a different 
servlet-mapping which points /*.do to a different servlet 
configured with the other XML file?

For what you're trying to do, Modules are probably the closest Struts 
feature which supports this.  On the other hand, you can also have a 
single module which uses any number of struts-config.xml files, and I 
find this more straightforward than the module functionality, which 
imposes more strict separation between the modules than fits the 
compartmentalization model that I have in my head.

Here's the official doc on modules:
http://struts.apache.org/userGuide/configuration.html#dd_config_modules
That section also links to this
http://struts.apache.org/userGuide/configuration.html#dd_config_servlet
as a reference for using multiple struts-config.xml files with a 
single module and a single servlet.

Joe
At 1:35 PM -0800 3/11/05, Carl Smith wrote:
In my application I have two configuration file (1) 
struts-config.xml and (2) struts-app1.xml. I have this entry in the 
web.xml

servlet-mapping
servlet-nameaction/servlet-name
url-pattern/*.app1/url-pattern
/servlet-mapping

When using this approach, I have a strange issue: For almost all the 
form submit, in the url the action will automatically apend .app1, 
example when submitted, I see this in the url


https://www.mypath/submitAction.app1, I want to see 
https://www.mypath/submitAction.do instead.

Thanks.

-
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site!

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

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


Re: using the validwhen validator

2005-03-11 Thread Niall Pemberton
Does this help?

http://www.mail-archive.com/user@struts.apache.org/msg22433.html

Niall

- Original Message - 
From: Reddy, Ajith [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Friday, March 11, 2005 8:45 PM
Subject: using the validwhen validator


Sorry for my previous incomplete mail.
 
Here is the problem again:
 
Our problem is that we have a checkbox(ChangeAddredd) called check here
to enter and change address. Once this is checked there are some
address fields that need to be entered. We want error messages to be
displayed when user enters address fields without checking the checkbox
and also vice versa. I understand that  Only two items may be joined
with and or or . I tried using an older suggestion and wrote my
validations.xml as: 
 
For now I have the using a textbox in place of checkBox just to make it
work. Buit even when I donot enter anything I get all the errors. Please
advise.

!DOCTYPE form-validation PUBLIC
-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN 
 http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd
http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd  
form-validation
  formset
form name=PF_Report_1_Bean
  field property=ChangeAddress depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ChangeAddress/
var
  var-nametest/var-name
  var-value
  ((*this* != null) OR 
  ((NameRev == null) AND
  ((Address1Rev == null) AND
  ((CityRev == null) AND
   (ZipcodeRev == null)
  )
  )
  )
  )
/var-value
/var
  /field
  field property=NameRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.NameRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=Address1Rev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.Address1Rev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=CityRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.CityRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
  field property=ZipcodeRev depends=validwhen
msg name=validwhen
key=validation.error.PF_Report_1.ZipcodeRev.miss/
var
  var-nametest/var-name
  var-value((*this* != null) OR (ChangeAddress ==
N))/var-value
/var
  /field
/form
  /formset
/form-validation


I also get these parse errors :

05/03/11 15:41:57 line 1:19: unexpected token: OR

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.join(ValidWhenPars
er.java:442)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.joinedExpression(V
alidWhenParser.java:410)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expr(ValidWhenPars
er.java:383)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expression(ValidWh
enParser.java:369)

05/03/11 15:41:57  at

Any suggestions please.

-Ajith




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



Re: Substring of bean:write

2005-03-11 Thread Rick Reumann
Schuster Joel M Contr ESC/NDC wrote the following on 3/11/2005 4:50 PM:
I can't seem to find a clean way of getting a substring of bean:write...
suggestions?
Use JSTL instead. There really are no advantages I can think of to use 
bean:write vs c:out (Or just use a more recent servlet container like 
Tomcat 5 and then you can use EL expressions ie ${yourBeanVal} directly.)

${fn:substring(stringVar, beginIndex, endIndex)}
Can use with c:out also if not using JSP2.0
c:out value=${fn:substring(stringVar, beginIndex, endIndex)}/
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
As an aside and merely as a suggestion, Joel, you might want to cut
out parts of the emails that are not relevant to your point.  This
cuts down on the size of the output stream and makes things easier to
read too.  See within:

SNIP
On Fri, 11 Mar 2005 12:39:49 -0700, Schuster Joel M Contr ESC/NDC
[EMAIL PROTECTED] wrote:
 Ok, I understand. I'm just really trying to understand this.
 
 http://resonus.net/wiki/uploads/strutsq.jpg
/SNIP

Cool.

Let me stress that I am not trying to say that you or anyone else is
missing in understanding.  I am trying to say that there is a
page-centric view of things that makes Struts hard to use, because it
really is not page-centric.  Sometimes I think that Craig went to
page-centric JSF not merely because it was a great career move but
because people could not easily or generally follow the depth of what
was intended by Struts which is anythning but page-centric in my
opinion.

SNIP
 Here's a link to a little picture that I put together because that happens
 to be how I think.
 
 Please tell me what I'm missing in my understanding of what struts is all
 about.
/SNIP

I am not going to tell you anything, but here are my thoughts.


SNIP
 1. Standard login process.
 a) request to website from browser, we redirect to the login.jsp via
 an action or forward.
/SNIP

To be complete, which is not necessary (but why not) the opening HTML
page is built by the response of a login servlet provided by a JSP
page.  The point is that you begin with a login page.  Nothing unusual
here.  The login page has a form for various fields and a submit
button.  Standard smandard and nothing related to Struts here.

SNIP
 b) Submit is clicked 
/SNIP

The form is sent with a URL invoking a Struts protocol to use an
action (i,e., Login.do) to process the request.  This Action,
apparently, is mapped in the struts-config.xml to an ActionForm called
LoginForm.  This means, too, that Login.jsp had html:form etc  in
the JSP and uses Taglibs to automatically inialize the LoginForm from
the entries on the Login.jsp page.

SNIP
 and system encapsulates the data from the
 request into a form 
/SNIP

Into an ActionForm, yes, but not really a form and it is misleading
to think of this as a form.  This is just a class that can be
created and initialized by reflection because it follows the Java Bean
Pattern.  Also, this class will only need to access the data from the
request which was specifically directed to this class via the Taglibs
mentioned above.  We might want some input items to be html related
and some not.  We may use the ActionForm to retrieve only part of the
data and use other classes to retrieve other data.  We also may build
the ActionForm so it can utilize and work with data having nothing to
do with the Login.jsp page.  It is important to state just what
something really is and to not be banboozled by naming habits.

SNIP
which is then given to the action.execute 
/SNIP

The action which is referenced by Login.do, which you don't even have
in your diagram, is then automatically created adn the execute method
is called and the input parameters of that method intialized with the
request object, the response object, the LoginForm object, and the
ActionMapping object created by the action tag in the
struts-config.xml.  It is really telling, I think, that the most
important part of the whole business, the Actions, are completely
missing from your diagram.

SNIP
 which
 c) then determines if the values are correct 
/SNIP

This is correct if you bypassed the input parameter of your mapping
with inputForward.  I assume you did, since you are saying this.

SNIP
and forwards to the
 right place depending.
/SNIP

The options for forwarding in the struts-config.xml action mapping are
merely aids to standard forwards which you can change in the xml but
they do not necessarily indicate where the forwarding will go to.  You
can programmatically do anything inside the execute(...) method.  We
can discuss what happens here in depth, but I am going to follow your
bouncing ball and assume you succeeded and when to the main.jsp which
means that you returned the browser an HTML page that the servlet
created by the main.jsp page built with its response object.

SNIP
 
 2. Now, If I want to have the main menu simply go from one screen to another
 then I have a link. But the second screen needs to be 'populated' (for lack
 of a better word) with data.
/SNIP

What I don't understand here is what you want to do at the Main.jsp
page.  Presumably you are going to be friendly and say, Hi, Dakota
or something acknowledging the recent activity of your successful
client?  Why did you not ask how to populate the Main.jsp page with
data?  Instead, you are asking about the next page.  But, let's follow
your example and assume that Main might as well as been Main.html.  So
far, nothing you have said shows why Main.jsp is not Main.html.

SNIP
 3. To do it the struts 'way' is to link to an action 

Re: Is Struts All right ?

2005-03-11 Thread Dakota Jack
Good point!  ///;-)


On Fri, 11 Mar 2005 13:52:20 -0600, Simon Chappell
[EMAIL PROTECTED] wrote:
 Does that mean that we only eliminate the lazy idiots from joining?
 The fact that I got through shows a quality control issue right there!
 ;-)
 
 
 On Fri, 11 Mar 2005 10:54:44 -0800, Dakota Jack [EMAIL PROTECTED] wrote:
  They have made the Struts mailing lists hard to find on purpose,
  believe it or not.  The rationale is on the lists.
 
  Jack

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

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



  1   2   >