Re: Why doesn't ActionForm's constructor have access to HttpServletRequest?

2004-02-03 Thread Michael McGrady
I think you really want something other than an ActionForm if you want to 
do this.  Why anyone would use an ActionForm to do this makes no sense to 
me.  If you want the request object, then it is in the Action.  That is 
where it should be.

At 06:59 PM 2/2/2004, Martin Cooper wrote:
I can't read Craig's mind ;-) , but I would say that the main reason an
ActionForm's constructor doesn't get passed the request (or anything else)
is because it is (intended to be) a form *bean*. One of the primary
characteristics of a JavaBean is that is that it must have a no-args
constructor. That allows it to be instantiated from anywhere. Passing a
request instance to the constructor presupposes that an ActionForm is
constructed only in the context of a request.
A secondary reason, in my mind, is that passing a request to the constructor
would encourage people to stash it away as member data, which would not be
too cool if the bean was created in session scope...
--
Martin Cooper
Jeff Skubick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is the absence of a reference to the HttpServletRequest object that
triggered the creation of a new ActionForm object in its constructor a
historical artifact or oversight, or was it an intentional decision whose
motivation and rationale remains 100% valid and relevant today?
At the moment, I'm in a quandry. I see no way to usefully use nested form
beans to encapsulate administrable users in my web app without somehow
getting a hold of a list of objects representing those administrable users
from the session context of the user who's administering them (the list's
composition depends partially upon the user doing the administration) so I
can prepopulate the list for its initial display.
On the other hand, I'm worried that ActionForm's original creator was
absolutely determined to keep ActionForm's constructor from ever knowing
anything about the user or request that triggered its creation in the first
place for some reason, like Struts casually re-using old ActionForm
instances to satisfy new requests. On the other hand, I know it might just
be a historical artifact that seemed like a good idea at the time, but
doesn't really have any major implications either way.
So... if I implement my own RequestProcessor class that overrides the
default processActionForm method to call my own ActionForm-extending bean's
constructor an explicitly pass it a reference to the HttpServletRequest
object so it can fetch the HttpSession object and find the object that tells
it everything else it needs to know to pre-populate the form bean prior to
display, am I violating any sacred assumption made by other parts of Struts?
Or am I OK?


-
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: Problems when not using html:form

2004-02-03 Thread Mark Lowe
You can just rewrite the path with html:rewrite or c:url, or get the 
context in jstl/scriptlet and add that to the path (like suggested).

form action=c:url value=/Login.do /

or

form action=html:rewite page=/Login .do /

otherwise you can just use an action form.

Cheers Mark

On 2 Feb 2004, at 18:23, Slattery, Tim - BLS wrote:

Yes, but the server would have to find an app with the
web.xml first, right? If my URL is at
http://my.domain.com/mywebapp1/jsp/Login.jsp; and the form
is submitted to form action=/Login.do, it would map to
http://my.domain.com/Login.do;.
Of course if the web app was deployed as the root
application, then the web.xml mapping will kick in.
You're right, I'm wrong.

I see in my app that this tag:

html-el:form  action=/ItemListUpdate.do

Resolves to this HTML:

form name=ItemListBean method=post 
action=/PPI/ItemListUpdate.do

It seems that the html-el:form... tag is prepending the app context 
to the
action value.

--
Tim Slattery
[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: Why doesn't ActionForm's constructor have access to HttpServletRequest?

2004-02-03 Thread Adam Hardy
Have I missed something here? What is wrong with using the reset method 
instead of the constructor? That gives you the mapping and the request 
as parameters.

On 02/03/2004 08:17 AM Michael McGrady wrote:
I think you really want something other than an ActionForm if you want 
to do this.  Why anyone would use an ActionForm to do this makes no 
sense to me.  If you want the request object, then it is in the Action.  
That is where it should be.

At 06:59 PM 2/2/2004, Martin Cooper wrote:

I can't read Craig's mind ;-) , but I would say that the main reason an
ActionForm's constructor doesn't get passed the request (or anything 
else)
is because it is (intended to be) a form *bean*. One of the primary
characteristics of a JavaBean is that is that it must have a no-args
constructor. That allows it to be instantiated from anywhere. Passing a
request instance to the constructor presupposes that an ActionForm is
constructed only in the context of a request.

A secondary reason, in my mind, is that passing a request to the 
constructor
would encourage people to stash it away as member data, which would 
not be
too cool if the bean was created in session scope...

--
Martin Cooper
Jeff Skubick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is the absence of a reference to the HttpServletRequest object that
triggered the creation of a new ActionForm object in its constructor a
historical artifact or oversight, or was it an intentional decision whose
motivation and rationale remains 100% valid and relevant today?
At the moment, I'm in a quandry. I see no way to usefully use nested form
beans to encapsulate administrable users in my web app without somehow
getting a hold of a list of objects representing those administrable 
users
from the session context of the user who's administering them (the list's
composition depends partially upon the user doing the administration) 
so I
can prepopulate the list for its initial display.

On the other hand, I'm worried that ActionForm's original creator was
absolutely determined to keep ActionForm's constructor from ever knowing
anything about the user or request that triggered its creation in the 
first
place for some reason, like Struts casually re-using old ActionForm
instances to satisfy new requests. On the other hand, I know it might 
just
be a historical artifact that seemed like a good idea at the time, but
doesn't really have any major implications either way.

So... if I implement my own RequestProcessor class that overrides the
default processActionForm method to call my own ActionForm-extending 
bean's
constructor an explicitly pass it a reference to the HttpServletRequest
object so it can fetch the HttpSession object and find the object that 
tells
it everything else it needs to know to pre-populate the form bean 
prior to
display, am I violating any sacred assumption made by other parts of 
Struts?
Or am I OK?



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




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



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


Re: Guidelines and steps for architecting a struts application

2004-02-03 Thread Adam Hardy
On 02/02/2004 11:20 PM Al Rathon wrote:
Hi:
I am developing a simple application (basically does
CRUD operations on various entities in the
application). I want to use the Tiles, Validator also.
I would like to know what steps I need to follow to
design the architecture.
Check out 'MVC' architecture. model-view-controller. There must be a 
hundred good references on the struts site.

As for tiles, it provides an excellent framework for seperating HTML (or 
whatever mark-up) for a page into modules, which works very well with 
modern CSS implementation to allow fast and easy design, building  
redesign of the website interface.

Validator automates validation for you - it won't drastically influence 
your design - just make your development time faster.

HTH
Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Why doesn't ActionForm's constructor have access to HttpServletRequest?

2004-02-03 Thread Michael McGrady




At the moment, I'm in a quandry. I see no way to usefully use nested form
beans to encapsulate administrable users in my web app without somehow
getting a hold of a list of objects representing those administrable users
from the session context of the user who's administering them (the list's
composition depends partially upon the user doing the administration) so I
can prepopulate the list for its initial display.
I am having a little trouble seeing what you want to do.  Instead of seeing 
how to do what you want to do with ActionForms, it might be helpful to 
first see what you want to do.  Apparently you want to instrument objects 
representing users in sessions.  That should not be doable enough, 
right?  But, I cannot see why you would want to do that with 
ActionForms.  Wouldn't you rather use something like MBeans or a 
roll-your-own similar or related sort of solution?

Michael



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


R: R: R: request attributes and failed validation

2004-02-03 Thread Leonardo Francalanci
 It's is not there the first time.  Only when it's been sent there 
 by way of a failed validation via the input=/showForm.do attribute.

But you did not specify the form for the showForm action, did you?
Because if you specify it, the controller creates one for you before
the call to execute(..) and puts it in the request.
My problem is that the input action and the action that saves data
have the same form, so I don't think I can use your approach.

Or I am wrong?



 
  [EMAIL PROTECTED] 02/02/04 05:18AM 
 I think that the form is added to the request before
 the call to execute(..).
 Are you sure that (request.getAttribute(myForm) != null)
 is not true the first time you call the page?
 
  -Messaggio originale-
  Da: Ian Joyce [mailto:[EMAIL PROTECTED] 
  Inviato: lunedi 2 febbraio 2004 13.09
  A: [EMAIL PROTECTED] 
  Oggetto: Re: R: request attributes and failed validation
  
  
   [EMAIL PROTECTED] 02/02/04 03:18 AM 
   Using an Action as input sometimes takes more work.  Your 
  action should
   know that it's only redisplaying a form and not reset all form 
  values (or
   else the user will have to reinput everything instead of just 
  correct the
   validation error).  
  
  
  How do you usually do this? Using an hidden parameter?
  
  
  That's one way to do it.  This is how I ended up doing it.
  
  // Validation failed, don't reset the form.
  if (request.getAttribute(myForm) != null) {
return mapping.findForward(success);
  }
  
  -
  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]



extenstions on actions within a webapp

2004-02-03 Thread Bradley Beddoes
Hi All.
 
I wish to have some global forwards invoked as .do others as .do2 (so as
to differentiate what filters get hit with the differing requests), Is
this possible within struts? (Please see struts.conf below)
 
At the moment I have been trialing it and have searched the web without
much luck on how to implement this properly.
 
It seems that after accessing an action (successfully through all steps)
with a .do2 extension that actions with a .do extension seem to
magically change to a .do2 extension which is playing havoc with my
design. Especially between the change_qa_password action(.do) and
change_expired_password / accept_it_facilities_rules  both do2 actions.
 
(All actions are multi step forms, all forms start off with their
correct extension it is only after submitting the first and subsequent
steps that the extension will change)
 
Any help would be appreciated if you can understand what I am trying to
achieve here, I realize this explanation is a touch convoluted but it's
a hard one to get across.
 
Cheers,
Bradley
 
?xml version=1.0?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD
Struts Configuration 1.0//EN
 
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
struts-config
 
  global-forwards
forward name=home
path=qa_account_details.do/
forward name=qaAccountDetails
path=qa_account_details.do/
forward name=changeQaPassword
path=change_qa_password.do/
forward name=physicalAccessList
path=physical_access_list.do/
forward name=accountList
path=account_list.do/
forward name=accountDetails
path=account_details.do/
forward name=retrieveRules
path=it_facilities_rules.do/
forward name=expiredPassword
path=change_expired_password.do2/
forward name=acceptRules
path=accept_it_facilities_rules.do2/
forward name=logout
path=logout.do/
  /global-forwards
 
  action-mappings
action path=/qa_account_details
type=company.action.QaAccountDetailsAction
name=accountDetails
scope=request
validate=false
forward name=qaAccountDetailsPage
path=/accounts/access/index.jsp /
action path=/change_qa_password
type=au.edu.qut.trs.action.ChangeAccountPasswordAction
name=changeAccountPassword
input=/accounts/access/change_password.jsp
validate=true
suffix=.do 
  forward name=changeAccountPasswordPage
path=/accounts/access/change_password.jsp /
/action
action path=/physical_access_list
type=company.action.PhysicalAccessListAction
name=physicalAccessList
scope=request
validate=false
  forward name=physicalAccessListPage
path=/accounts/physical_access/index.jsp /
/action
action path=/account_list
type=company.action.AccountListAction
name=accountList
scope=request
validate=false
  forward name=accountListPage
path=/accounts/other/account_group/index.jsp /
/action
action path=/account_details
type=company.action.AccountDetailsAction
name=accountDetails
scope=request
validate=false
  forward name=accountDetailsPage
path=/accounts/other/account_group/details.jsp /
/action
/action
action path=/it_facilities_rules
type=company.action.RetrieveRulesAction
name=retrieveRules
scope=request
validate=false
  forward name=showITRulesPage
path=/accounts/it_rules/index.jsp /
/action
/action
action path=/accept_it_facilities_rules
type=company.action.AcceptRulesAction
name=acceptRules
input=/unauthenticated/accept_rules/index.jsp
validate=true
  forward name=showAcceptITRulesPage
path=/unauthenticated/accept_rules/index.jsp /
/action
action path=/change_expired_password
type=company.action.ChangeExpiredPasswordAction
name=changeExpiredPassword
 
input=/unauthenticated/expired_password/change_password.jsp
validate=true
  forward name=changeAccountPasswordPage
path=/unauthenticated/expired_password/change_password.jsp /
/action
action path=/logout
type=company.action.LogoutAction/
  /action-mappings
/struts-config


Problem handling error forwards

2004-02-03 Thread Lukas sterreicher
Hello

For some time now I have had a problem when dealing with errors and the resulting 
different forwards:

When action3 generates an error (for instance in the form validator) and forwards
to action2 to deal with it (display it) but this action2 deals with errors and forwards
to action1 then the jsp for action1 is displayed, but not the jsp for action2.

(Those three actions are a process sequence, action1 prepares a page
to enter some data, action2 (and form2) check that data and allow entering
additional data and send it to action3 where the data is saved.)

Why is this?

Here the actions for details:

!-- specify the directory from which to imort sound files --
action   path=/specifysounddirectory
  type=net.morkeleb.yarf.action.SpecifySoundDirectoryAction
  name=addTracksForm
  scope=request
  validate=false
  input=.specifysounddir
  forward name=success  path=.specifysounddir/
  forward name=failure  path=.specifysounddir/
/action

!-- display which files are available in the selected directory
  and allow to select which to import --
action   path=/listaddtracks
  type=net.morkeleb.yarf.action.ListAddTracksAction
  name=addTracksForm
  scope=request
  validate=true
  input=.specifysounddir
  forward name=success  path=.listaddtracks/
  forward name=failure  path=.specifysounddir/
/action

!-- import selected files --
action   path=/addtracks
  type=net.morkeleb.yarf.action.AddTracksAction
  name=addTracksForm
  scope=request
  validate=true
  input=/listaddtracks.do
  forward name=success  path=/listtracks.do/
  forward name=failure  path=/listaddtracks.do/
/action
  /action-mappings

As you see action3 (addtracks) forwards to /listaddtracks.do
(it has to be the action because data the avaiable tracks
have to be prepared for display). If it would forward to the
.listaddtracks tile the error would be correctly displayed
in action2 but the avaiable tracks would not be prepared.

As addtracks forwards to listaddtracks with an error
(only when it occours ofcourse) listaddtracks somehow
recognizes that existing error and thinks: we have an
error, so I have to forward to .specifysounddir to
display it.

Can you help me on this?

Regards,
Lukas sterreicher



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



Re: Problem handling error forwards

2004-02-03 Thread Dirk Markert
Hello Lukas,


***

LÖ Hello

LÖ For some time now I have had a problem when dealing with
LÖ errors and the resulting different forwards:

LÖ When action3 generates an error (for instance in the form validator) and forwards
LÖ to action2 to deal with it (display it) but this action2 deals with errors and 
forwards
LÖ to action1 then the jsp for action1 is displayed, but not the jsp for action2.

LÖ (Those three actions are a process sequence, action1 prepares a page
LÖ to enter some data, action2 (and form2) check that data and allow entering
LÖ additional data and send it to action3 where the data is saved.)

LÖ Why is this?

LÖ Here the actions for details:

LÖ !-- specify the directory from which to imort sound files --
LÖ action   path=/specifysounddirectory
LÖ  
LÖ type=net.morkeleb.yarf.action.SpecifySoundDirectoryAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=false
LÖ   input=.specifysounddir
LÖ   forward name=success  path=.specifysounddir/
LÖ   forward name=failure  path=.specifysounddir/
LÖ /action

LÖ !-- display which files are available in the selected directory
LÖ   and allow to select which to import --
LÖ action   path=/listaddtracks
LÖ   type=net.morkeleb.yarf.action.ListAddTracksAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=true
LÖ   input=.specifysounddir
LÖ   forward name=success  path=.listaddtracks/
LÖ   forward name=failure  path=.specifysounddir/
LÖ /action

LÖ !-- import selected files --
LÖ action   path=/addtracks
LÖ   type=net.morkeleb.yarf.action.AddTracksAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=true
LÖ   input=/listaddtracks.do
LÖ   forward name=success  path=/listtracks.do/
LÖ   forward name=failure  path=/listaddtracks.do/
LÖ /action
LÖ   /action-mappings

LÖ As you see action3 (addtracks) forwards to /listaddtracks.do
LÖ (it has to be the action because data the avaiable tracks
LÖ have to be prepared for display). If it would forward to the
LÖ .listaddtracks tile the error would be correctly displayed
LÖ in action2 but the avaiable tracks would not be prepared.

LÖ As addtracks forwards to listaddtracks with an error
LÖ (only when it occours ofcourse) listaddtracks somehow
LÖ recognizes that existing error and thinks: we have an
It's not the action recognizing the error but your addtrackForm.
Validate is called on forwarding to your action2.
LÖ error, so I have to forward to .specifysounddir to
LÖ display it.

LÖ Can you help me on this?

LÖ Regards,
LÖ Lukas Österreicher



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



Regards,
Dirk

+--- Quality leads ---+
| Dirk Markert [EMAIL PROTECTED] |
| Dr. Markert Softwaretechnik AG  |
| Joseph-von-Fraunhofer-Str. 20   |
| 44227 Dortmund  |
+-- to success! -+ 


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



action global forward extension

2004-02-03 Thread Bradley Beddoes
Hi All.
 
I wish to have some global forwards invoked as .do others as .do2 (so as
to differentiate what filters get hit with the differing requests), Is
this possible within struts? (Please see struts.conf below)
 
At the moment I have been trialling it and have searched the web without
much luck on how to implement this properly.
 
It seems that after accessing an action (successfully through all steps)
with a .do2 extension that actions with a .do extension seem to
magically change to a .do2 extension which is playing havoc with my
design. Especially between the change_qa_password action(.do) and
change_expired_password / accept_it_facilities_rules  both do2 actions.
 
(All actions are multi step forms, all forms start off with their
correct extension it is only after submitting the first and subsequent
steps that the extension will change)
 
Any help would be appreciated if you can understand what I am trying to
achieve here, I realize this explanation is a touch convoluted but it's
a hard one to get across.

(Apologies if this message got dual postings I received a message back
saying the original was blocked due to some virus detected or other
reasons, scans of my machine show no trace of any virus related problems
so I have tried again, I also scan every piece of outbound email so its
really weird)
 
Cheers,
Bradley
 
?xml version=1.0?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD
Struts Configuration 1.0//EN
 
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
struts-config
 
  global-forwards
forward name=home
path=qa_account_details.do/
forward name=qaAccountDetails path=qa_account_details.do/
forward name=changeQaPassword path=change_qa_password.do/
forward name=physicalAccessList path=physical_access_list.do/
forward name=accountList
path=account_list.do/
forward name=accountDetails
path=account_details.do/
forward name=retrieveRules path=it_facilities_rules.do/
forward name=expiredPassword path=change_expired_password.do2/
forward name=acceptRules path=accept_it_facilities_rules.do2/
forward name=logout
path=logout.do/
  /global-forwards
 
  action-mappings
action path=/qa_account_details
type=company.action.QaAccountDetailsAction
name=accountDetails
scope=request
validate=false
forward name=qaAccountDetailsPage
path=/accounts/access/index.jsp /
action path=/change_qa_password
type=au.edu.qut.trs.action.ChangeAccountPasswordAction
name=changeAccountPassword
input=/accounts/access/change_password.jsp
validate=true
suffix=.do 
  forward name=changeAccountPasswordPage
path=/accounts/access/change_password.jsp /
/action
action path=/physical_access_list
type=company.action.PhysicalAccessListAction
name=physicalAccessList
scope=request
validate=false
  forward name=physicalAccessListPage
path=/accounts/physical_access/index.jsp /
/action
action path=/account_list
type=company.action.AccountListAction
name=accountList
scope=request
validate=false
  forward name=accountListPage
path=/accounts/other/account_group/index.jsp /
/action
action path=/account_details
type=company.action.AccountDetailsAction
name=accountDetails
scope=request
validate=false
  forward name=accountDetailsPage
path=/accounts/other/account_group/details.jsp /
/action
/action
action path=/it_facilities_rules
type=company.action.RetrieveRulesAction
name=retrieveRules
scope=request
validate=false
  forward name=showITRulesPage
path=/accounts/it_rules/index.jsp /
/action
/action
action path=/accept_it_facilities_rules
type=company.action.AcceptRulesAction
name=acceptRules
input=/unauthenticated/accept_rules/index.jsp
validate=true
  forward name=showAcceptITRulesPage
path=/unauthenticated/accept_rules/index.jsp /
/action
action path=/change_expired_password
type=company.action.ChangeExpiredPasswordAction
name=changeExpiredPassword
 
input=/unauthenticated/expired_password/change_password.jsp
validate=true
  forward name=changeAccountPasswordPage
path=/unauthenticated/expired_password/change_password.jsp /
/action
action path=/logout
type=company.action.LogoutAction/
  /action-mappings
/struts-config


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



RE: Regarding Client side Validations

2004-02-03 Thread Ramachandran
Hi,

That is i know, now i am performing like that, but when the cancel
is working means after enterting all the values only it is working, but for
me even with out entering any values it has to work. What i have to do for
that one.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 12:06 PM
To: Struts Users Mailing List
Subject: Re: Regarding Client side Validations


The cancel button's value will be placed on the request iff it was
clicked... so you will test for its presence with something like:

if(request.getParameterValues(cancel) != null)
{
// set your cancel forward mapping eg. clear the form.
}
else
{
// set your submit forward mapping.
}

Hope that helps you.

Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779


This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the use of
e-mail for such purpose.







Ramachandran [EMAIL PROTECTED]
03/02/2004 05:30 PM
Please respond to Struts Users Mailing List


To: Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:Regarding Client side Validations


Hi All,

 I am performing Cleint side validation in an Add Employee form.
Here if i click the cancel button it should goes to the previous page
which
list employees.

 Here on click of sumbit button, i am calling my java script. But
even when i am clicking the cancel button, it is asking me the validations
that i am performed. For example if i give the text field for no it asks
to
enter.

 But i want to goes to the list employees page with out performing
the validation by clicking the Cancel button.

Here I am Callin the Script:

html:form action=AddEmployeeAction
  name=EmployeeForm
  type=com.summit.EmployeeForm onsubmit=return FinalCheck(); 

html:cancel/ button is also inside this form.

In My Action:

if ( isCancelled(request) ) {

  // Cancel pressed back to employee list
  return (mapping.findForward(cancelemp));
}

What i have to do for this one.


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



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





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



Re: Problem handling error forwards

2004-02-03 Thread Lukas sterreicher
Am 03.02.2004 10:48:10, schrieb Dirk Markert [EMAIL PROTECTED]:

It's not the action recognizing the error but your addtrackForm.
Validate is called on forwarding to your action2.

Ah, right. I was half aware of this but now that I thought of this
I found a solution:

at the end of each form validation I have:

if(!errors.isEmpty()) {
logger.debug(There has been an error, setting errors to true);
request.setAttribute(errors, true);
}

As the equest.setAttribute(errors, true); command makes struts
forward to the input page I changed the form to only
validate if no errors were set. This seemed to fix it.

Thanx!

Lukas

Hello Lukas,


***

LÖ Hello

LÖ For some time now I have had a problem when dealing with
LÖ errors and the resulting different forwards:

LÖ When action3 generates an error (for instance in the form validator) and forwards
LÖ to action2 to deal with it (display it) but this action2 deals with errors and 
forwards
LÖ to action1 then the jsp for action1 is displayed, but not the jsp for action2.

LÖ (Those three actions are a process sequence, action1 prepares a page
LÖ to enter some data, action2 (and form2) check that data and allow entering
LÖ additional data and send it to action3 where the data is saved.)

LÖ Why is this?

LÖ Here the actions for details:

LÖ !-- specify the directory from which to imort sound files --
LÖ action   path=/specifysounddirectory
LÖ  
LÖ type=net.morkeleb.yarf.action.SpecifySoundDirectoryAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=false
LÖ   input=.specifysounddir
LÖ   forward name=success  path=.specifysounddir/
LÖ   forward name=failure  path=.specifysounddir/
LÖ /action

LÖ !-- display which files are available in the selected directory
LÖ   and allow to select which to import --
LÖ action   path=/listaddtracks
LÖ   type=net.morkeleb.yarf.action.ListAddTracksAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=true
LÖ   input=.specifysounddir
LÖ   forward name=success  path=.listaddtracks/
LÖ   forward name=failure  path=.specifysounddir/
LÖ /action

LÖ !-- import selected files --
LÖ action   path=/addtracks
LÖ   type=net.morkeleb.yarf.action.AddTracksAction
LÖ   name=addTracksForm
LÖ   scope=request
LÖ   validate=true
LÖ   input=/listaddtracks.do
LÖ   forward name=success  path=/listtracks.do/
LÖ   forward name=failure  path=/listaddtracks.do/
LÖ /action
LÖ   /action-mappings

LÖ As you see action3 (addtracks) forwards to /listaddtracks.do
LÖ (it has to be the action because data the avaiable tracks
LÖ have to be prepared for display). If it would forward to the
LÖ .listaddtracks tile the error would be correctly displayed
LÖ in action2 but the avaiable tracks would not be prepared.

LÖ As addtracks forwards to listaddtracks with an error
LÖ (only when it occours ofcourse) listaddtracks somehow
LÖ recognizes that existing error and thinks: we have an
It's not the action recognizing the error but your addtrackForm.
Validate is called on forwarding to your action2.
LÖ error, so I have to forward to .specifysounddir to
LÖ display it.

LÖ Can you help me on this?

LÖ Regards,
LÖ Lukas Österreicher



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



Regards,
Dirk

+--- Quality leads ---+
| Dirk Markert [EMAIL PROTECTED] |
| Dr. Markert Softwaretechnik AG  |
| Joseph-von-Fraunhofer-Str. 20   |
| 44227 Dortmund  |
+-- to success! -+ 


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



Basic question on /lib/*.jar files

2004-02-03 Thread alvin antony
Hello there,
  
   I am on a search for a  good practice on storing lib-jar files in an J2ee 
development env. Though I know that is not the right place,i used to store it in the 
cvs along with the application unter /WEB-INF/lib . Where do you store  the jar files, 
that are required by different applications in development?
 
Thanks in advance,
 
Alvin
 

Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.

How to deploy a war file in Apache?

2004-02-03 Thread ssrinivasrao
Can anyone guide me in how to deploy a .war file in Apache?

Thanks,
S.Srikanth



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



Re: Basic question on /lib/*.jar files

2004-02-03 Thread Claire Wall
we store them in the common/lib folder. Then all applications running on
that web server have access to the jars and negates the need for them to go
into the separate WEB-INF/lib folders for each application.

cw :)

- Original Message -
From: alvin antony [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 10:58 AM
Subject: Basic question on /lib/*.jar files


 Hello there,

I am on a search for a  good practice on storing lib-jar files in
an J2ee development env. Though I know that is not the right place,i used to
store it in the cvs along with the application unter /WEB-INF/lib . Where do
you store  the jar files, that are required by different applications in
development?

 Thanks in advance,

 Alvin


 Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and
more.Download now.



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



RE: How to deploy a war file in Apache?

2004-02-03 Thread PREETAM Balijepalli
place it in tomcat-webapps and start youre server.its done

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 4:50 PM
To: [EMAIL PROTECTED]
Subject: How to deploy a war file in Apache?


Can anyone guide me in how to deploy a .war file in Apache?

Thanks,
S.Srikanth



-
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: Response not XHTML-comliant when using html:html xhtml='true'

2004-02-03 Thread Andreas Amstutz
Ok folks, thanks for the input on this topic.

The quick and dirty solution for my problem was to download the 
struts source. Changing the xhtml class member's default value 
from 'false' to 'true' and buid it.
Ohh, I really should have done that much earlier!

Andreas


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



File Upload using Struts

2004-02-03 Thread Gandhi, Snehal Kishore (Cognizant)



Hi 
all,
 i'm a new bee of 
struts...
 i want to use the Struts based 
upload option. 
1. What 
should be the data type in my ActionForm?
2. How will 
i get the FileObject in my action class?
and How can 
i pass the file to the Server?
4. if any 
sample upload code using struts would be really very 
helpful?
thanx in 
advance..
--Snehal 


-- Snehal K. Gandhi | Email 
: [EMAIL PROTECTED]Financial Services Group| http://www.cognizant.comCognizant 
Corporation | Ph:91-44-52096000 Mobile : +91 98400 57326 | Xtn:8118, Vnet:48128 
-- The secret to enjoying your job is 
not to change your job but to change your attitude..

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com

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

LookupDispatchAction

2004-02-03 Thread Guilherme Barile
Hi
I have the following DispatchAction working here

public MyDispatchAction extends DispatchAction {
public unspecified(...) {
read_data_from_database();
populate_form();
return(mapping.findForward(renderForm);
}
}

renderForm renders the form (I don't access the jsp directly, just the
action, this way it calls unspecified, which reads data from a database
and populates the form).
I tried converting this to a LookupDispatchAction, making
MyDispatchAction extend LookupDispatchAction and adding

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(button.save, save);
return map;
}

To the code ... the parameter is called action it exists on
struts-config, the message button.save exists on
ApplicationResources.properties but everytime I run it, I get the error
Request[/myform] does not contain handler parameter named action

I *guess* it happens because the first time I accessed this form no
buttons were pressed, so action really doesn't exist (yet) ... problem
is this must happen this way, otherwise I won't be able to read data
from the database to populate the form.

With an ordinary DispatchAction it works fine, but I can't localize my
buttons. Any ideas ?

Thanks in advance

gui


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



RE: File Upload using Struts

2004-02-03 Thread Manjunath Bhat
The struts1.1 distribution contains a file
jakarta-struts-1.1\webapps\struts-upload.war. This will answer all your
queries.
 
Manjunath/
 
-Original Message-
From: Gandhi, Snehal Kishore (Cognizant)
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 03, 2004 5:21 PM
To: [EMAIL PROTECTED]
Subject: File Upload using Struts
 
Hi all,
i'm a new bee of struts...
i want to use the Struts based upload option. 
1. What should be the data type in my ActionForm?
2. How will i get the FileObject in my action class?
and How can i pass the file to the Server?
4. if any sample upload code using struts would be really very helpful?
thanx in advance..
--Snehal
 
-- 
Snehal K. Gandhi | Email : [EMAIL PROTECTED] 
Financial Services Group | http://www.cognizant.com
http://www.cognizant.com/  
Cognizant Corporation| Ph:91-44-52096000 
Mobile : +91 98400 57326 | Xtn:8118, Vnet:48128 
 -- The secret to enjoying your job is not to change your job but to
change your attitude..
 


Modifiable GUI elements inside a collection

2004-02-03 Thread Markus . Malmqvist
  Hi,

 

I have a curious problem. I have a LinkedList which contains records with a
checkbox and some fixed text fields. The value of this checkbox does not
seem to transfer from the browser GUI into server bean. The bean contains
the whole list of elements. All the non-modifiable text fields display
correctly, and if I set the checkbox boolean in the server side the box will
be correctly checked in the browser. Same kind of thing happens with
modifiable text field, information passes from server to browser, but not
from browser to server. I am quite confused, since all seems quite logical,
and it still does not work.

 

  --markus

 



Re: LookupDispatchAction

2004-02-03 Thread Jason Lea
Well, LookUpDispatchAction doesn't call the unspecified action when it 
is no parameter is supplied.
One way would be to override the method that does the lookup and when no 
action parameter is supplied, call the unspecified() parameter.

Another way is to make your initial call to the action provide the 
parameter.  I have done this in some cases by defining some 
global-forwards eg
forward name=rolelist path=/admin/RoleAdmin.do?dispatch=list/

The other thing that needs to be looked at here is that 'list' will not 
be localised.  So in my default ApplicationResources.properties file I 
have a global.list=list, and have map.put(global.list,list); entry 
in the keyMethodMap.  Then make sure you don't localise the global.list 
in the other properties files.  I might have a localised list button eg 
map.put(button.list,list); too, so that the list button appears in 
the correct language.  There is no problem with more than 1 name linking 
to the list method.

Guilherme Barile wrote:

Hi
I have the following DispatchAction working here
public MyDispatchAction extends DispatchAction {
public unspecified(...) {
read_data_from_database();
populate_form();
return(mapping.findForward(renderForm);
}
}
renderForm renders the form (I don't access the jsp directly, just the
action, this way it calls unspecified, which reads data from a database
and populates the form).
I tried converting this to a LookupDispatchAction, making
MyDispatchAction extend LookupDispatchAction and adding
protected Map getKeyMethodMap() {
   Map map = new HashMap();
   map.put(button.save, save);
   return map;
}
To the code ... the parameter is called action it exists on
struts-config, the message button.save exists on
ApplicationResources.properties but everytime I run it, I get the error
Request[/myform] does not contain handler parameter named action
I *guess* it happens because the first time I accessed this form no
buttons were pressed, so action really doesn't exist (yet) ... problem
is this must happen this way, otherwise I won't be able to read data
from the database to populate the form.
With an ordinary DispatchAction it works fine, but I can't localize my
buttons. Any ideas ?
Thanks in advance

gui

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



--
Jason Lea


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


Re: [OT] looking for a method that will be called on application startup

2004-02-03 Thread Otávio Augusto
do you mean a single implementation of a servlet, with methods which fit each 
developer needs, and declaring this servlet in the appropriate place in the web.xml 
file? doesn't this servlet need anything special? I ask that because I've never made a 
ContextListener, and I also need a first time verification in my app.

Thanks

Otávio Augusto

On Mon, 02 Feb 2004 14:07:47 +0100
Marcel Schepers [EMAIL PROTECTED] wrote:

 Hi Arne,
 
 A solution could be create an initialization servlet. Include that
 servlet in your web.xml and make sure you provide a load-on-startup
 parameter.
 
 Marcel
 
 On Mon, 2004-02-02 at 13:59, Arne Brutschy wrote:
  hi,
  
  I'm looking for a method/hook/whatever that will be called from tomcat 
  at application startup. I want to use it to put all my init-stuff (as 
  configuration reading) into it.
  
  At the moment, my authentication filter looks for the presence of these 
  objects in application scope, and if they are not found, they will be 
  created.
  
  Is there another way to do this more nicly?
  
  Regards,
  Arne
  
  
  -
  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]



Struts and Chinese

2004-02-03 Thread Vinicius Carvalho
	Has anyone here used the struts to work with Chinese language? Do I need 
any special library to deal with DoubleByte Chars??

Thanks

Vinicius

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


RE: [OT] looking for a method that will be called on application startup

2004-02-03 Thread Robert Taylor
The ServletContextListener does exactly what you want.
When the web application starts the
ServletContextListener.contextInitialized() is
invoked passing you ServletContextEvent which contains the ServletContext.
These are guaranteed to be invoked before the web application can process
any requests. It's simply an interface which you implement (2 methods) then
define in your
web.xml file.

For more information refer to the Servlet 2.3 spec or higher.
http://java.sun.com/aboutJava/communityprocess/first/jsr053/index.html

robert

 -Original Message-
 From: Otávio Augusto [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 8:39 AM
 To: Struts Users Mailing List
 Subject: Re: [OT] looking for a method that will be called on
 application startup


 do you mean a single implementation of a servlet, with methods
 which fit each developer needs, and declaring this servlet in the
 appropriate place in the web.xml file? doesn't this servlet need
 anything special? I ask that because I've never made a
 ContextListener, and I also need a first time verification in my app.

 Thanks

 Otávio Augusto

 On Mon, 02 Feb 2004 14:07:47 +0100
 Marcel Schepers [EMAIL PROTECTED] wrote:

  Hi Arne,
 
  A solution could be create an initialization servlet. Include that
  servlet in your web.xml and make sure you provide a load-on-startup
  parameter.
 
  Marcel
 
  On Mon, 2004-02-02 at 13:59, Arne Brutschy wrote:
   hi,
  
   I'm looking for a method/hook/whatever that will be called
 from tomcat
   at application startup. I want to use it to put all my init-stuff (as
   configuration reading) into it.
  
   At the moment, my authentication filter looks for the
 presence of these
   objects in application scope, and if they are not found, they will be
   created.
  
   Is there another way to do this more nicly?
  
   Regards,
   Arne
  
  
   -
   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 and Chinese

2004-02-03 Thread Greg Reddin
I've done it before.  Unforetunately, I can't remember everything that 
had to be done.  If my memory serves me correctly, I didn't have to 
change anything within the application or Struts.  I only had to add a 
Servlet filter to set the character encoding of the request before 
Struts ever sees it.  You can probably find it on the web somewhere. 
Search for SetCharacterEncodingFilter.  I no longer have the code.

Greg

Vinicius Carvalho wrote:
Has anyone here used the struts to work with Chinese language? Do I 
need any special library to deal with DoubleByte Chars??

Thanks

Vinicius

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


static variables in actions

2004-02-03 Thread Menke, John
if I have a collection of state names and I don't want to have to retrieve
it over and over again can i
do something like this in my action?


static Collection _collection;

if (collection == null ){
   _collection = getCollectionFromDB();
}

form.setCollection = _collection









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



RE: static variables in actions

2004-02-03 Thread Robert Taylor
John, why not retrieve these from the DB at application start up time
and place them in the ServletContext where they are accessible for
the life time of the application and easily rendered by JSTL or Struts
tags.

robert

 -Original Message-
 From: Menke, John [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 9:36 AM
 To: Struts (E-mail)
 Subject: static variables in actions


 if I have a collection of state names and I don't want to have to retrieve
 it over and over again can i
 do something like this in my action?


 static Collection _collection;

 if (collection == null ){
_collection = getCollectionFromDB();
 }

 form.setCollection = _collection









 -
 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 and Chinese

2004-02-03 Thread Jim Theodoridis
Struts works fine with UTF

More information will have at:

www.anassina.com/struts/i18n/i18n.html

but i u work on a database check if the driver an the database support UTF
I work fine with Greek charakter on UTF

- Original Message -
From: Greg Reddin [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 3:21 PM
Subject: Re: Struts and Chinese


 I've done it before.  Unforetunately, I can't remember everything that
 had to be done.  If my memory serves me correctly, I didn't have to
 change anything within the application or Struts.  I only had to add a
 Servlet filter to set the character encoding of the request before
 Struts ever sees it.  You can probably find it on the web somewhere.
 Search for SetCharacterEncodingFilter.  I no longer have the code.

 Greg

 Vinicius Carvalho wrote:
  Has anyone here used the struts to work with Chinese language? Do I
  need any special library to deal with DoubleByte Chars??
 
  Thanks
 
  Vinicius
 
 
  -
  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: static variables in actions

2004-02-03 Thread Nicolás de Amorrortu
You can also try the Providers Framework that we have posted to the
sourceforge (http://providers.sourceforge.net).
It was developed to solve the problem that you described. With this
framework you define your collections on a XML file, and then you can
use it through select tag (of struts) using de optionsTag provided
with the framework.
The collections could be defined to be retrieved from DataSource or
Fixed Collections.
The DataSource definition is something like ...
provider name=cities 
className=ar.com.koalas.providers.JDBCProvider
set-property property=jndi value=MySqlDS/
set-property property=keyName value=code/
set-property property=description
value=description/
param
param-namequery/param-name
param-valueselect * from cities/param-value
/param
/provider

Then in your JSP you use this collection (named 'cities') like this
select name=selTest
prv:options provider=cities/
/select

Cheers,
Nicolás


-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED] 
Sent: Martes, 03 de Febrero de 2004 11:40 a.m.
To: Struts Users Mailing List
Subject: RE: static variables in actions


John, why not retrieve these from the DB at application start up time
and place them in the ServletContext where they are accessible for the
life time of the application and easily rendered by JSTL or Struts tags.

robert

 -Original Message-
 From: Menke, John [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 9:36 AM
 To: Struts (E-mail)
 Subject: static variables in actions


 if I have a collection of state names and I don't want to have to 
 retrieve it over and over again can i do something like this in my 
 action?


 static Collection _collection;

 if (collection == null ){
_collection = getCollectionFromDB();
 }

 form.setCollection = _collection









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

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



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



RE: Populating a DynaActionForm with a complex object graph

2004-02-03 Thread Doug Dixon
OK, I've starting off down the Map-backed, manual indexing route, and it's
grim... It forces me to have model logic in three places - the JSP (to
create the keys into the map) and the two action classes (prepopulate, then
handle submit).

Is there a more elegant way of doing this stuff? (Or are there any plans to
provide this functionality in future releases?)

Thanks
Doug

-Original Message-
From: Doug Dixon [mailto:[EMAIL PROTECTED]
Sent: 31 January 2004 11:50
To: '[EMAIL PROTECTED]'
Subject: Populating a DynaActionForm with a complex object graph


Hi

I'm trying to populate a DynaActionForm dynamically, using this how-to as a
starting point: http://www.developer.com/java/other/article.php/2233591

Because the number of elements in my form can vary at runtime, I take the
advice near the bottom of the article:

 You can even dynamically specify the size of the form (and 
prepopulate it) at run time [...] by using an Action instead of a 
forward to precreate the form-property value, and leaving the size 
parameter out.  The actual can then create an array of the appropriate 
size and prepopulate values..

So my Action instantiates the right number of beans in the form and then
hands off to the JSP, no problem. 

However, my model isn't a simple array (as in all the examples I can find) -
it's a complex object graph: I have one or more Flights, each of which can
contain one or more Passengers, each of which has multiple properties (name,
etc.)

This means I need another level of iteration, a bit like this (if it
worked!):


c:forEach var=flight items=${myBeanForm.map.flights} 
Flightbr/
c:forEach var=passenger items=${flight.passengers} 
   Passengerbr/
   Name: html:text indexed=true name=passenger property=name
/br/
/c:forEach
/c:forEach


This doesn't work - I just get HTML like this:

Flightbr/

Passengerbr/
Name: input type=text name=passenger[0].name value=Dougbr/


Flightbr/


Passengerbr/
Name: input type=text name=passenger[0].name
value=Elvisbr/


Which obviously won't work I need to end up with something like

Flightbr/

Passengerbr/
Name: input type=text name=flight[0].passenger[0].name
value=Dougbr/


Flightbr/


Passengerbr/
Name: input type=text name=flight[1].passenger[0].name
value=Elvisbr/



Does anyone know if there is some way of doing this with DynaActionForms? Or
am I going to have to do nasty manual indexing with Map or List backed
ActionForms?

Thanks for any help


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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



Using Validator To Avoid Database Trip

2004-02-03 Thread Duggal, Sanjay
Hi All,
I have an Edit Existing Record screen. When the user clicks the Save
button on this screen, I'm supposed to store the changed data in the
database. However there may be a situation where the user leaves the data
unchanged  still presses the Save button. In this case, I want to avoid the
database trip. Can I achieve this using the Validator framework?
Thanks.
Sanjay


This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst  Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised 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]



accessing application.properties from JSP

2004-02-03 Thread Marco Mistroni
Hi all,
Does anyone know how to access application.resources from a JSP?
With best regards
Marco




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



RE: Using Validator To Avoid Database Trip

2004-02-03 Thread Slattery, Tim - BLS
 I have an Edit Existing Record screen. When the user clicks 
 the Save button on this screen, I'm supposed to store the 
 changed data in the database. However there may be a 
 situation where the user leaves the data unchanged  still 
 presses the Save button. In this case, I want to avoid the 
 database trip. Can I achieve this using the Validator 
 framework? 

I can't see how Validator would help. I handle this by including a hidden
element in the page which contains the original value of the data. When the
form is submitted, I can compare that hidden value to the value that was
exposed to the user. If they differ, then the database needs to be updated.

--
Tim Slattery
[EMAIL PROTECTED]


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



Performing validation using Validator

2004-02-03 Thread Ramachandran
Hi all,

 How can i perform validation using validator.xml. For example i
want to check the unique name in Add Employee jsp, how can i use the
validator.xml

If any one knows, please mail your queries regarding this.

Thanx,
Ram


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



Newbie: Problems After Deploying to Tomcat

2004-02-03 Thread Colin Foulkes
Hi,

I'm fairly new to the struts but have been able to get a small struts app working fine 
under the internal Tomcat(4.0.6) in Netbeans. Everything here works fine.

When I try to run the app under a standalone Tomcat (4.1.29) I get two problems with 
my application.

1. I have created an authentication filter that forwards requests to my LoginAction if 
the user isn't logged in. When running in the external Tomcat, this forward fails, 
with a status 404  The requested resource (/LoginAction.do) is not available.


2. When I remove the filter from the web.xml mappings, the application can find the 
LoginAction fine (through my Login.jsp) and I'm happily insise the app. The Second 
problem I have is that the first page I go to after the LoginAction 
(/WEB-INF/jsp/mainmenu.jsp) contains javascript include references
script language=javascript src=/WSClient/scripts/XXX.js/script
These javascript files are not being loaded into my page.

Does anyone have any ideas why these problems are occurring, and have any solutions.

Thanks in advance

Colin

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



An Action doesn't work as expected

2004-02-03 Thread f f
Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from jboss server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]  
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



RE: An Action doesn't work as expected

2004-02-03 Thread Ramachandran
In your Action mapping tag,

u have to give the input=/xx.jsp to redirect the error
to your application. then only it will work.


-Original Message-
From: f f [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 9:21 PM
To: [EMAIL PROTECTED]
Subject: An Action doesn't work as expected


Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from jboss server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

-
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: An Action doesn't work as expected

2004-02-03 Thread Matthew J. Vincent
You don't have the input attribute in your action mapping.

...
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  input=
  scope=request
  unknown=false
  validate=true

...


HTH.

Matt



-Original Message-
From: f f [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 10:51 AM
To: [EMAIL PROTECTED]
Subject: An Action doesn't work as expected


Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from jboss server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]  
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

-
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: An Action doesn't work as expected

2004-02-03 Thread Srinivas Kusunam

Hi Fredrich,

  give the input page in action so that on form validation it forwards 
to this page.

some thing like this::

action path=/OfferWaterBank  type=.OfferWaterBankAction name=OfferWaterBankForm 
scope=request validate=true input=OfferWaterBank.jsp
   --
/action

hope this helps.

Sree.



 [EMAIL PROTECTED] 02/03/04 09:51AM 
Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from jboss server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]  
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/ 

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



Action doesn't work as expected

2004-02-03 Thread f f
Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor] 
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]  
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



RE: An Action doesn't work as expected

2004-02-03 Thread Ramachandran
Hi,

   Who says, u give likr this. Then it will surely work. Bcos it finds
any errors while processing action, it will navigate to this input file.

action path=/LoginAction type=com.summit.LoginAction name=Login
scope=request input=/login.jsp validate=trueforward name=success
path=/Homes.jsp redirect=false //action

-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 9:25 PM
To: Struts Users Mailing List
Subject: RE: An Action doesn't work as expected


You don't have the input attribute in your action mapping.

...
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  input=
  scope=request
  unknown=false
  validate=true

...


HTH.

Matt



-Original Message-
From: f f [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 10:51 AM
To: [EMAIL PROTECTED]
Subject: An Action doesn't work as expected


Hi gurus,

I'm just learning to develop web application with
Struts. All Action works well,
except SubmitCustomerAction. I've tried to find the
problem but I can't find it so far.

Here is some relevant information

on jsp page :

html:form action=/submitCustomer focus=name
onsubmit=return
validateCustomerRegistrationForm(this);
table
tr
!-- more html and jsp tags --
/html:form

on struts-config.xml :

  form-beans
form-bean
  name=CustomerRegistrationForm
  type=proj.web.form.CustomerRegistrationForm
/

!-- more form-beans --
/form-beans

action-mappings
action
  path=/submitCustomer
  type=proj.web.action.SubmitCustomerAction
  name=CustomerRegistrationForm
  scope=request
  unknown=false
  validate=true

  forward
name=success
path=/order/orderSuccess.jsp
redirect=false
  /
  forward
name=failure
path=/common/error.jsp
redirect=false
  /
  forward
name=trySubmitOrder
path=/trySubmitOrder.do
redirect=false
  /
/action
!-- more actions --
/action-mappings

tomcat gives this error :
The server encountered an internal error (No input
attribute for mapping path /submitCustomer)
that prevented it from fulfilling this request.

and from jboss server.log:
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Looking for
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  Creating new
ActionForm instance of type
'proj.web.form.CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.util.RequestUtils]  --
[EMAIL PROTECTED]
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing
ActionForm bean instance in scope 'request' under
attribute key 'CustomerRegistrationForm'
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]
Populating bean properties from this request
2004-02-03 22:01:52,180 DEBUG
[org.apache.struts.action.RequestProcessor]
Validating input form properties
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
getMessage(en,customer.email)
2004-02-03 22:01:52,390 DEBUG
[org.apache.struts.util.PropertyMessageResources]
loadLocale(en)
2004-02-03 22:01:52,431 DEBUG
[org.apache.struts.action.RequestProcessor]
Validation failed but no input form available

I use Jboss 3.2.2,Apache-Tomcat
4.1.27-LE-jdk14,Jakarta-Struts 1.1 and JDK 1.4.0-b92.

Something wrong ? Please help.

Thanks for your help.
Fredrich.


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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

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



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



Re: [OT] looking for a method that will be called on application startup

2004-02-03 Thread Arne Brutschy
Thanks guys! That was exactly what I was looking for - and it works like 
magic. Great, thanks again!

Arne

Robert Taylor wrote:

The ServletContextListener does exactly what you want.
When the web application starts the
ServletContextListener.contextInitialized() is
invoked passing you ServletContextEvent which contains the ServletContext.
These are guaranteed to be invoked before the web application can process
any requests. It's simply an interface which you implement (2 methods) then
define in your
web.xml file.
For more information refer to the Servlet 2.3 spec or higher.
http://java.sun.com/aboutJava/communityprocess/first/jsr053/index.html
robert


-Original Message-
From: Otávio Augusto [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 8:39 AM
To: Struts Users Mailing List
Subject: Re: [OT] looking for a method that will be called on
application startup
do you mean a single implementation of a servlet, with methods
which fit each developer needs, and declaring this servlet in the
appropriate place in the web.xml file? doesn't this servlet need
anything special? I ask that because I've never made a
ContextListener, and I also need a first time verification in my app.
Thanks

Otávio Augusto

On Mon, 02 Feb 2004 14:07:47 +0100
Marcel Schepers [EMAIL PROTECTED] wrote:

Hi Arne,

A solution could be create an initialization servlet. Include that
servlet in your web.xml and make sure you provide a load-on-startup
parameter.
Marcel

On Mon, 2004-02-02 at 13:59, Arne Brutschy wrote:

hi,

I'm looking for a method/hook/whatever that will be called
from tomcat

at application startup. I want to use it to put all my init-stuff (as
configuration reading) into it.
At the moment, my authentication filter looks for the
presence of these

objects in application scope, and if they are not found, they will be
created.
Is there another way to do this more nicly?

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


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


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


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


RE: Newbie: Problems After Deploying to Tomcat

2004-02-03 Thread Colin Foulkes
Ah... I think I see the problem

I need to fully qualify my action names (and script paths) with the name of the 
application (Prototype1) e.g.
script language=javascript src=/Prototype1/WSClient/scripts/XXX.js/script

This was apparently being magically handled by the html:form tag in the login.jsp page.
html:form action=/LoginAction

Is there a tag I could use to accomplish this same magic in my src attribute?

Also, assuming this is the same problem in my filter, is there some recognized way for 
handling the forward in the filter.

Thanks
again

Colin





-Original Message-
From: Colin Foulkes 
Sent: February 3, 2004 9:47 AM
To: Struts Users Mailing List
Subject: Newbie: Problems After Deploying to Tomcat 


Hi,

I'm fairly new to the struts but have been able to get a small struts app working fine 
under the internal Tomcat(4.0.6) in Netbeans. Everything here works fine.

When I try to run the app under a standalone Tomcat (4.1.29) I get two problems with 
my application.

1. I have created an authentication filter that forwards requests to my LoginAction if 
the user isn't logged in. When running in the external Tomcat, this forward fails, 
with a status 404  The requested resource (/LoginAction.do) is not available.


2. When I remove the filter from the web.xml mappings, the application can find the 
LoginAction fine (through my Login.jsp) and I'm happily insise the app. The Second 
problem I have is that the first page I go to after the LoginAction 
(/WEB-INF/jsp/mainmenu.jsp) contains javascript include references
script language=javascript src=/WSClient/scripts/XXX.js/script
These javascript files are not being loaded into my page.

Does anyone have any ideas why these problems are occurring, and have any solutions.

Thanks in advance

Colin

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



validate at least one field

2004-02-03 Thread Alvaro Martinez
I would like to validate a form that contains several fields where at least
one of them should be filled (don't mind what of them)
How can I implement this with validator.xml?
Thanks


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



Re: Newbie: Problems After Deploying to Tomcat

2004-02-03 Thread Shaul Siboni
Hi,

Using JSTL you can:
c:url value=/LoginAction.do var=url
c:param name=param1 value=val1/
c:param name=param2 value=val2/
/c:url
a href=${url}Login/a
HTH
--Shaul
Colin Foulkes wrote:

Ah... I think I see the problem

I need to fully qualify my action names (and script paths) with the name of the 
application (Prototype1) e.g.
script language=javascript src=/Prototype1/WSClient/scripts/XXX.js/script
This was apparently being magically handled by the html:form tag in the login.jsp page.
html:form action=/LoginAction
Is there a tag I could use to accomplish this same magic in my src attribute?

Also, assuming this is the same problem in my filter, is there some recognized way for handling the forward in the filter.

Thanks
again
Colin





-Original Message-
From: Colin Foulkes 
Sent: February 3, 2004 9:47 AM
To: Struts Users Mailing List
Subject: Newbie: Problems After Deploying to Tomcat 

Hi,

I'm fairly new to the struts but have been able to get a small struts app working fine under the internal Tomcat(4.0.6) in Netbeans. Everything here works fine.

When I try to run the app under a standalone Tomcat (4.1.29) I get two problems with my application.

1. I have created an authentication filter that forwards requests to my LoginAction if the user isn't logged in. When running in the external Tomcat, this forward fails, with a status 404  The requested resource (/LoginAction.do) is not available.

2. When I remove the filter from the web.xml mappings, the application can find 
the LoginAction fine (through my Login.jsp) and I'm happily insise the app. The Second 
problem I have is that the first page I go to after the LoginAction 
(/WEB-INF/jsp/mainmenu.jsp) contains javascript include references
script language=javascript src=/WSClient/scripts/XXX.js/script
These javascript files are not being loaded into my page.
Does anyone have any ideas why these problems are occurring, and have any solutions.

Thanks in advance

Colin

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


Struts and Pajes

2004-02-03 Thread Villalba Arias, Fredy [BILBOMATICA]
Hi to yall,

 

Im trying to integrate Pajes (www.apache.org), a Servlet Presentation Framework, with 
Struts. The idea is to use Struts MVC separation (Action, ActionForms, ActionServlet, 
etc) WITHOUT using Struts presentation tools (i.e. no JSP, ergo no JSP Tags), just 
plain XHTML templates (in conjunction with the Pajes framework I just mentioned).

 

Im not interested in an XSLT-based solution (for now).

 

The problem Ive come across:

 

For connecting with Pajes, Ive thought about a Servlet (kind of a View Dispatcher) 
that should be the entry point to all Pajes-related requests. Then, one would do 
things like this:

 

package org.gn.samples.strutspajes.login;

 



 

public class MyFirstAction extends Action {

 

  public ActionForward execute(ActionMapping actionMapping) {

MyFirstActionForm theActionForm = (LoginActionForm) actionForm;

if () {

  return actionMapping.findForward(/some_other_typically_mapped_page);

} else {

  

  ActionForward af = new 
PajeViewActionForwardFactory.generate(fully.qualified.view.generator.pajes.classname,
 theTemplateFilename.html, request);

  return af;

}

  }

}

 

 where the generated ActionForward object points to the aforementioned Servlet, 
including on that URL the corresponding parameters. Examples:

 

/PajeDispatcher?template=Login.htmlfactory=org.gn.samples.strutspajes.login.LoginPageView
 (in case this is the default web application)

 

/webappname/PajeDispatcher?template=ProductCatalog.htmlfactory=org.gn.samples.strutspajes.login.NavigateProductCatalogPageView
 (in case this is not the default web application and the name is webappname)

 

This solves the problem of delegating from Struts to Pajes.

 

HOWEVER, I have not solved yet the data access method part. I NEED TO BE ABLE TO 
RECOVER THE APPROPRIATE ActionForm object FROM THAT Servlet (actually, in a factory 
class, but I dont want to bother you with all the details) so that the 
view-generating class can paint, WITHOUT REPLICATING THE ActionForm Management 
(especially, the scopes management) ALREADY PERFORMED BY Struts. HOW CAN I DO THAT???

 

(1) Is there some method (+ class) that, given an Action class (/classname), 
returns the ActionForm object its currently associated to? (if any)

(2) Whats the minimal information that one needs to retrieve an Actions 
corresponding ActionForm object?

(3) How can I do it from an ordinary Servlet?

 

Note that Im trying to avoid passing it through the Session. My initial idea was to 
take advantage of the classes behind the tag libs that do this, but from what Ive 
seen so far (I mean, its source code), that is not possible (the code is too tied to a 
JSP environment).

 

This is my first effort. Therefore, Im not worried about being able to do 
EVERYTHING that can be done through the tag libs. For now, the only thing I look 
forward is to be able to recover the appropriate ActionForm object associated to that 
Action from where redirection took place (ActionForward, that is).

 

Id really appreciate any thoughts on this matter.

 

Thanx,

Freddy.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 


Plzzz help problem with session invalidate method ...

2004-02-03 Thread Vinay Kumar Munikuntla
Hi

I don;t know if this is the right place to ask this quesion .. ?

After  I invalidate a session using request.getSession().invalidate() I
forward the Login screen to the user.
When the user logs into the application I see that he has the same Session
Id as before the session was invalidated.

But this does not happen if the Browser window is closed and the new browser
window is opened.

How can I get a new session id each time the user logs in?

Vinay Kumar Munikuntla
[EMAIL PROTECTED]


-
This email, including any attachments, is for the designated recipient(s) only and may 
contain confidential, proprietary, and/or legally privileged information.  If you are 
not a designated recipient, or have received it in error, please notify the sender and 
destroy it and all attachments and copies immediately, without distributing, 
disclosing, or using it in any manner.


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



RE: accessing application.properties from JSP

2004-02-03 Thread Marco Mistroni
Hi,
Actually my problem is that I have to make so that a javascript
message can be internationalized, so I must get it from
application.properties.

But it looks like writing a bean:message  inside a javascript method
Does not work.

Any workarounds?

I assume that message resources are stored in servlet context.. if so,
under
Which name?

Thanx and regards
marco

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED] 
Sent: 03 February 2004 15:09
To: Struts Users Mailing List
Subject: Re: accessing application.properties from JSP

The same way it is done in the struts-example.


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (cell)
AIM: jmitchtx
MSN: [EMAIL PROTECTED]



- Original Message - 
From: Marco Mistroni [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 10:06 AM
Subject: accessing application.properties from JSP


 Hi all,
 Does anyone know how to access application.resources from a JSP?
 With best regards
 Marco
 
 
 
 
 -
 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: Newbie: Problems After Deploying to Tomcat

2004-02-03 Thread Yee, Richard K,,DMDCWEST
Colin,
Check out the html:base tag.

-Richard


-Original Message-
From: Colin Foulkes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 03, 2004 8:16 AM
To: Struts Users Mailing List
Subject: RE: Newbie: Problems After Deploying to Tomcat 


Ah... I think I see the problem

I need to fully qualify my action names (and script paths) with the name of
the application (Prototype1) e.g. script language=javascript
src=/Prototype1/WSClient/scripts/XXX.js/script

This was apparently being magically handled by the html:form tag in the
login.jsp page. html:form action=/LoginAction

Is there a tag I could use to accomplish this same magic in my src
attribute?

Also, assuming this is the same problem in my filter, is there some
recognized way for handling the forward in the filter.

Thanks
again

Colin





-Original Message-
From: Colin Foulkes 
Sent: February 3, 2004 9:47 AM
To: Struts Users Mailing List
Subject: Newbie: Problems After Deploying to Tomcat 


Hi,

I'm fairly new to the struts but have been able to get a small struts app
working fine under the internal Tomcat(4.0.6) in Netbeans. Everything here
works fine.

When I try to run the app under a standalone Tomcat (4.1.29) I get two
problems with my application.

1. I have created an authentication filter that forwards requests to my
LoginAction if the user isn't logged in. When running in the external
Tomcat, this forward fails, with a status 404  The requested resource
(/LoginAction.do) is not available.


2. When I remove the filter from the web.xml mappings, the application can
find the LoginAction fine (through my Login.jsp) and I'm happily insise the
app. The Second problem I have is that the first page I go to after the
LoginAction (/WEB-INF/jsp/mainmenu.jsp) contains javascript include
references script language=javascript
src=/WSClient/scripts/XXX.js/script
These javascript files are not being loaded into my page.

Does anyone have any ideas why these problems are occurring, and have any
solutions.

Thanks in advance

Colin


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



Re: Response not XHTML-comliant when using html:html xhtml='true'

2004-02-03 Thread Adam Hardy
On 02/03/2004 12:35 PM Andreas Amstutz wrote:
Ok folks, thanks for the input on this topic.

The quick and dirty solution for my problem was to download the 
struts source. Changing the xhtml class member's default value 
from 'false' to 'true' and buid it.
Ohh, I really should have done that much earlier!

Andreas,
if I remember correctly, I didn't get the error you were getting and I 
suggested a solution but didn't see any feedback.

Did you try it? The html:xhtml / in each tile?

Did you log a bug?

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


Re: Populating a DynaActionForm with a complex object graph

2004-02-03 Thread Adam Hardy
Hi Doug,
your title threw me off the scent a little but I think what you are 
looking for is nested beans.

HTH
Adam
On 02/03/2004 03:58 PM Doug Dixon wrote:
OK, I've starting off down the Map-backed, manual indexing route, and it's
grim... It forces me to have model logic in three places - the JSP (to
create the keys into the map) and the two action classes (prepopulate, then
handle submit).
Is there a more elegant way of doing this stuff? (Or are there any plans to
provide this functionality in future releases?)
Thanks
Doug
-Original Message-
From: Doug Dixon [mailto:[EMAIL PROTECTED]
Sent: 31 January 2004 11:50
To: '[EMAIL PROTECTED]'
Subject: Populating a DynaActionForm with a complex object graph
Hi

I'm trying to populate a DynaActionForm dynamically, using this how-to as a
starting point: http://www.developer.com/java/other/article.php/2233591
Because the number of elements in my form can vary at runtime, I take the
advice near the bottom of the article:
 You can even dynamically specify the size of the form (and 
prepopulate it) at run time [...] by using an Action instead of a 
forward to precreate the form-property value, and leaving the size 
parameter out.  The actual can then create an array of the appropriate 
size and prepopulate values..

So my Action instantiates the right number of beans in the form and then
hands off to the JSP, no problem. 

However, my model isn't a simple array (as in all the examples I can find) -
it's a complex object graph: I have one or more Flights, each of which can
contain one or more Passengers, each of which has multiple properties (name,
etc.)
This means I need another level of iteration, a bit like this (if it
worked!):
c:forEach var=flight items=${myBeanForm.map.flights} 
Flightbr/
c:forEach var=passenger items=${flight.passengers} 
   Passengerbr/
   Name: html:text indexed=true name=passenger property=name
/br/
/c:forEach
/c:forEach
This doesn't work - I just get HTML like this:

Flightbr/

Passengerbr/
Name: input type=text name=passenger[0].name value=Dougbr/


Flightbr/


Passengerbr/
Name: input type=text name=passenger[0].name
value=Elvisbr/

Which obviously won't work I need to end up with something like

Flightbr/

Passengerbr/
Name: input type=text name=flight[0].passenger[0].name
value=Dougbr/


Flightbr/


Passengerbr/
Name: input type=text name=flight[1].passenger[0].name
value=Elvisbr/



Does anyone know if there is some way of doing this with DynaActionForms? Or
am I going to have to do nasty manual indexing with Map or List backed
ActionForms?
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Pajes + Struts (REPOSTED and FORMATTED)

2004-02-03 Thread Villalba Arias, Fredy [BILBOMATICA]
Hi to yall,

 

Im trying to integrate Pajes (www.pajes.org), a Servlet Presentation

Framework, with Struts. The idea is to use Struts MVC separation (Action,

ActionForms, ActionServlet, etc) WITHOUT using Struts presentation tools

(i.e. no JSP, ergo no JSP Tags), just plain XHTML templates (in conjunction

with the Pajes framework I just mentioned).

 

Im not interested in an XSLT-based solution (for now).

 

The problem Ive come across:

 

For connecting with Pajes, Ive thought about a Servlet (kind of a View

Dispatcher) that should be the entry point to all Pajes-related requests.

Then, one would do things like this: 

 

package org.gn.samples.strutspajes.login;

 

. . .

 

public class MyFirstAction extends Action {

 

  public ActionForward execute(ActionMapping actionMapping . . .) {

MyFirstActionForm theActionForm = (LoginActionForm) actionForm;

if (. . .) {

  . . .

  return actionMapping.findForward(/some_other_typically_mapped_page);

} else {

  . . .

  ActionForward af = 

   new PajeViewActionForwardFactory.generate(f.q.view.gen.pajes.classname,

 theTemplateFilename.html,

 request);

  return af;

}

  }

 

}

 

 where the generated ActionForward object points to the aforementioned

Servlet, including on that URL the corresponding parameters. Examples:

 

/PajeDispatcher?template=Login.htmlfactory=org.gn.samples.strutspajes.login.LoginPageView
 (in case this is the default web application)

 

 

/webappname/PajeDispatcher?template=ProductCatalog.htmlfactory=org.gn.samples.strutspajes.login.NavigateProductCatalogPageView
 (in case this is not the default web application and the name is webappname)

 

 

This solves the problem of delegating from Struts to Pajes.

 

HOWEVER, I have not solved yet the data access method part. I MUST

BE ABLE TO RECOVER THE APPROPRIATE ActionForm object FROM THAT Servlet

(actually, in a factory class, but I dont want to bother you with all

the details) so that the view-generating class can paint, WITHOUT

REPLICATING THE ActionForm Management (especially, the scopes management)

ALREADY PERFORMED BY Struts. HOW CAN I DO THAT???

 

(1) Is there some method (+ class) that, given an Action class (/classname),

returns the ActionForm object its currently associated to? (if any)

 

(2) Whats the minimal information that one needs to retrieve an Actions

corresponding ActionForm object?

 

(3) How can I do it from an ordinary Servlet?

 

Note that Im trying to avoid passing it through the Session. My initial

idea was to take advantage of the classes behind the tag libs that do this,

but from what Ive seen so far (I mean, its source code), that is not

possible (the code is too tied to a JSP environment).

 

This is my first effort. Therefore, Im not worried about being able to

do EVERYTHING that can be done through the tag libs. For now, the only

thing I look forward is to be able to recover the appropriate ActionForm

object associated to that Action from where redirection took place

(ActionForward, that is).

 

Id really appreciate any thoughts on this matter.

 

Thanks everybody,

Freddy.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 


Re: LookupDispatchAction

2004-02-03 Thread Guilherme Barile
Hi
I just found out that unspecified() is called, but the parameter you
specified on struts-config must exist, so if you access something like
http://mysite/MyAction.do?action=
it will call unspecified(), because that action does not exist.

Interesting uh ?
On Tue, 2004-02-03 at 23:38, Jason Lea wrote:
 Well, LookUpDispatchAction doesn't call the unspecified action when it 
 is no parameter is supplied.
 One way would be to override the method that does the lookup and when no 
 action parameter is supplied, call the unspecified() parameter.
 
 Another way is to make your initial call to the action provide the 
 parameter.  I have done this in some cases by defining some 
 global-forwards eg
 forward name=rolelist path=/admin/RoleAdmin.do?dispatch=list/
 
 The other thing that needs to be looked at here is that 'list' will not 
 be localised.  So in my default ApplicationResources.properties file I 
 have a global.list=list, and have map.put(global.list,list); entry 
 in the keyMethodMap.  Then make sure you don't localise the global.list 
 in the other properties files.  I might have a localised list button eg 
 map.put(button.list,list); too, so that the list button appears in 
 the correct language.  There is no problem with more than 1 name linking 
 to the list method.
 
 Guilherme Barile wrote:
 
 Hi
  I have the following DispatchAction working here
 
 public MyDispatchAction extends DispatchAction {
  public unspecified(...) {
  read_data_from_database();
  populate_form();
  return(mapping.findForward(renderForm);
  }
 }
 
 renderForm renders the form (I don't access the jsp directly, just the
 action, this way it calls unspecified, which reads data from a database
 and populates the form).
 I tried converting this to a LookupDispatchAction, making
 MyDispatchAction extend LookupDispatchAction and adding
 
 protected Map getKeyMethodMap() {
 Map map = new HashMap();
 map.put(button.save, save);
 return map;
 }
 
 To the code ... the parameter is called action it exists on
 struts-config, the message button.save exists on
 ApplicationResources.properties but everytime I run it, I get the error
 Request[/myform] does not contain handler parameter named action
 
 I *guess* it happens because the first time I accessed this form no
 buttons were pressed, so action really doesn't exist (yet) ... problem
 is this must happen this way, otherwise I won't be able to read data
 from the database to populate the form.
 
 With an ordinary DispatchAction it works fine, but I can't localize my
 buttons. Any ideas ?
 
 Thanks in advance
 
 gui
 
 
 -
 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: Basic question on /lib/*.jar files

2004-02-03 Thread Eric SCHULTZ
Good afternoon...

 From: Claire Wall 
 Date: Tue, 03 Feb 2004 04:25:29 -0800 
 
 we store them in the common/lib folder. Then all applications running 
on that web server have access to the jars and negates the need for  them
to go into the separate WEB-INF/lib folders for each application.

please review section 5.6 of the struts user's guide:
http://jakarta.apache.org/struts/userGuide/configuration.html

struts jar files should go with your application.

also, in order to be able to reproduce exact environments at certain points
in time it is necessary to store the libraries with the code that depends on
them.  

Eric Schultz.

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



Re: Accessing ActionForm from Servlet (was: Pajes + Struts)

2004-02-03 Thread Hubert Rabago
I definitely haven't used Pajes, but if the servlet is on the same web app,
perhaps your servlet can access the form in the request attribute.
More comments below

--- Villalba Arias, Fredy [BILBOMATICA] [EMAIL PROTECTED] wrote:
 HOWEVER, I have not solved yet the data access method part. I MUST
 BE ABLE TO RECOVER THE APPROPRIATE ActionForm object FROM THAT Servlet
 (actually, in a factory class, but I don’t want to bother you with all
 the details) so that the view-generating class can “paint”, WITHOUT
 REPLICATING THE ActionForm Management (especially, the scopes management)
 ALREADY PERFORMED BY Struts. HOW CAN I DO THAT???
  
 (1) Is there some method (+ class) that, given an Action class
 (/classname),
 returns the ActionForm object its currently associated to? (if any)

Not sure this would be possible.  The actual ActionForm in use depends on the
session, and sometimes even the particular request.  I doubt there's a way to
get to the form object actually in use by just specifying the action class.
If it's the *class* of the ActionForm you want, check out the ActionMapping
object for a particular mapping.

 (2) What’s the minimal information that one needs to retrieve an Action’s
 corresponding ActionForm object?

I would say the request object.

 (3) How can I do it from an ordinary Servlet?

request.getAttribute(formName);
or 
session.getAttribute(formName);
 depending on the scope of the form as declared in struts-config.

 Note that I’m trying to avoid passing it through the Session. My initial
 idea was to take advantage of the classes behind the tag libs that do this,
 but from what I’ve seen so far (I mean, its source code), that is not
 possible (the code is too tied to a JSP environment).
 
 This is my first “effort”. Therefore, I’m not worried about being able to
 
 do EVERYTHING that can be done through the tag libs. For now, the only
 
 thing I look forward is to be able to recover the appropriate ActionForm
 
 object associated to that Action from where redirection took place
 
 (ActionForward, that is).
 
  
 
 I’d really appreciate any thoughts on this matter.
 
  
 
 Thanks everybody,
 
 Freddy.
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
  
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



RE: Plzzz help problem with session invalidate method ...

2004-02-03 Thread Gopalakrishnan, Jayesh
Check the HttpServletRequest API, there's a 
getSession(boolean) method that'll get u a new session 
Or an existing session based on true or false parameter. 

Make sure you use the right one in the login process.


hth
-jayash

-Original Message-
From: Vinay Kumar Munikuntla [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 8:59 AM
To: [EMAIL PROTECTED]
Subject: Plzzz help problem with session invalidate method ...


Hi

I don;t know if this is the right place to ask this quesion .. ?

After  I invalidate a session using request.getSession().invalidate() I
forward the Login screen to the user.
When the user logs into the application I see that he has the same Session
Id as before the session was invalidated.

But this does not happen if the Browser window is closed and the new browser
window is opened.

How can I get a new session id each time the user logs in?

Vinay Kumar Munikuntla
[EMAIL PROTECTED]


-
This email, including any attachments, is for the designated recipient(s)
only and may contain confidential, proprietary, and/or legally privileged
information.  If you are not a designated recipient, or have received it in
error, please notify the sender and destroy it and all attachments and
copies immediately, without distributing, disclosing, or using it in any
manner.


-
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: action global forward extension

2004-02-03 Thread Craig R. McClanahan
Quoting Bradley Beddoes [EMAIL PROTECTED]:

 Hi All.
  
 I wish to have some global forwards invoked as .do others as .do2 (so as
 to differentiate what filters get hit with the differing requests), Is
 this possible within struts? (Please see struts.conf below)
  

Struts supports only one mapping to the controller servlet.

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

Since you are using extension mapping, one thing to consider is to create an
artificial directory level in your action paths (/foo/setup.do and
/bar/teardown.do instead of setup.do and teardown.do2).  That way, you
can have different filters on /foo/* and /bar/*.

Craig


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



img tag with action as src

2004-02-03 Thread Greg Blomquist
I apologize in advance if this question has already been answered somewhere.
Looks like basebeans is down so I can't search the struts-user archives.

I'm trying to do the following:
img src=/some/dir/myAction.do

The only problem is that it doesn't like the relative path.  I have to code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;

Which is fine until I move to production.

Is there a way to use a relative path when using an action for the src
attribute of an image tag?

Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined




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



RE: Accessing ActionForm from Servlet (was: Pajes + Struts)

2004-02-03 Thread Villalba Arias, Fredy [BILBOMATICA]
Hi Hubert, thanx for answering!

Read below.

Not sure this would be possible.  The actual ActionForm in use depends on the
session, and sometimes even the particular request.  I doubt there's a way to
get to the form object actually in use by just specifying the action class.
If it's the *class* of the ActionForm you want, check out the ActionMapping
object for a particular mapping.

The doGet method receives the request and response objects. Correct me if
I'm wrong, but the request object is client-specific, and so are the
ActionForm objects, as you clearly mentioned above. Therefore, no matter
which client originated the request, through it you'd be able to access any
attribute stored on that specific request or even on the Session associated
to it. Being Struts already in charge of managing the life-cycle of the
ActionForm-s, I believe there shouldn't be a problem in trying to access the
ActionForm for a given Action (/client) from a separate Servlet, since the
latter won't be able to reach anything the former does not want it to.

This was actually the initial reasoning that led me to the tesis that it
should be absolutely feasible to accomplish this integration. Do u agree?

This said, my question remains: is there some Struts' class that
encapsulates the scope issue (and others as well) and, given a form bean's
name (and maybe the request / Session / something else...), returns it (if
exists)???

I sneaked through the tag libs classes (the source code) and saw something
more or less similar to what I'm looking for; the problem was that it did
additional stuff I don't want to get executed, plus it was tied to JSP (it
used pageContext and other stuff)...


 (3) How can I do it from an ordinary Servlet?

request.getAttribute(formName);
or 
session.getAttribute(formName);
 depending on the scope of the form as declared in struts-config.

Would that be the formName as declared in struts-config?


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 

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



Re: img tag with action as src

2004-02-03 Thread Manfred Wolff
Greg

use the html:base/ Tag. Then Struts appends the base uri like

http://localhost:/MyApp/

to your relative path. Your image might be then

img src=/some/dir/mypicture.jpg

Manfred

Greg Blomquist wrote:

I apologize in advance if this question has already been answered somewhere.
Looks like basebeans is down so I can't search the struts-user archives.
I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.  I have to code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;
Which is fine until I move to production.

Is there a way to use a relative path when using an action for the src
attribute of an image tag?
Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined


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

--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese 
Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



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


RE: accessing application.properties from JSP

2004-02-03 Thread Saul Q Yuan
Using bean:message  inside a javascript should work, cause
bean:message  is processed first on the server. It works for me. It
may help if you post your code here.

Saul


-Original Message-
From: Marco Mistroni [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 03, 2004 12:02 PM
To: 'Struts Users Mailing List'
Subject: RE: accessing application.properties from JSP


Hi,
Actually my problem is that I have to make so that a javascript
message can be internationalized, so I must get it from
application.properties.

But it looks like writing a bean:message  inside a javascript method
Does not work.

Any workarounds?

I assume that message resources are stored in servlet context.. if so,
under Which name?

Thanx and regards
marco

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED] 
Sent: 03 February 2004 15:09
To: Struts Users Mailing List
Subject: Re: accessing application.properties from JSP

The same way it is done in the struts-example.


--
James Mitchell
Software Engineer / Struts Evangelist http://www.struts-atlanta.org
678.910.8017 (cell)
AIM: jmitchtx
MSN: [EMAIL PROTECTED]



- Original Message - 
From: Marco Mistroni [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 10:06 AM
Subject: accessing application.properties from JSP


 Hi all,
 Does anyone know how to access application.resources from a JSP? With 
 best regards Marco
 
 
 
 
 -
 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: accessing application.properties from JSP

2004-02-03 Thread James Mitchell
Serverside jsp processing knows nothing about embedded JavaScript or
anything else.

bean:message .../ works anywhere on your page (if you remember to put the
taglib declaration)


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (cell)
AIM: jmitchtx
MSN: [EMAIL PROTECTED]



- Original Message -
From: Marco Mistroni [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 12:01 PM
Subject: RE: accessing application.properties from JSP


 Hi,
 Actually my problem is that I have to make so that a javascript
 message can be internationalized, so I must get it from
 application.properties.

 But it looks like writing a bean:message  inside a javascript method
 Does not work.

 Any workarounds?

 I assume that message resources are stored in servlet context.. if so,
 under
 Which name?

 Thanx and regards
 marco

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]
 Sent: 03 February 2004 15:09
 To: Struts Users Mailing List
 Subject: Re: accessing application.properties from JSP

 The same way it is done in the struts-example.


 --
 James Mitchell
 Software Engineer / Struts Evangelist
 http://www.struts-atlanta.org
 678.910.8017 (cell)
 AIM: jmitchtx
 MSN: [EMAIL PROTECTED]



 - Original Message -
 From: Marco Mistroni [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 10:06 AM
 Subject: accessing application.properties from JSP


  Hi all,
  Does anyone know how to access application.resources from a JSP?
  With best regards
  Marco
 
 
 
 
  -
  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: Using Validator To Avoid Database Trip

2004-02-03 Thread Dhaliwal, Pritpal (HQP)
Things like Hibernate (ORM layer) might do some of these tricks for you. 

I think it only updates what has been changed and if you use caching, you
are optimizing many other things..

Pritpal Dhaliwal


-Original Message-
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 03, 2004 7:12 AM
To: 'Struts Users Mailing List'
Subject: RE: Using Validator To Avoid Database Trip


 I have an Edit Existing Record screen. When the user clicks
 the Save button on this screen, I'm supposed to store the 
 changed data in the database. However there may be a 
 situation where the user leaves the data unchanged  still 
 presses the Save button. In this case, I want to avoid the 
 database trip. Can I achieve this using the Validator 
 framework? 

I can't see how Validator would help. I handle this by including a hidden
element in the page which contains the original value of the data. When the
form is submitted, I can compare that hidden value to the value that was
exposed to the user. If they differ, then the database needs to be updated.

--
Tim Slattery
[EMAIL PROTECTED]


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



Re: How to deploy a war file in Apache?

2004-02-03 Thread Martin Cooper

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Can anyone guide me in how to deploy a .war file in Apache?

If you're referring to the Apache HTTPD web server, the answer is that you
can't do that, because it's not a Java servlet container. You need to
configure HTTPD to forward the relevant requests to something that knows
what to do with war files, such as Tomcat, Resin, Jetty, etc.

--
Martin Cooper



 Thanks,
 S.Srikanth




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



Re: img tag with action as src

2004-02-03 Thread Greg Blomquist
Thanks for the speedy reply.  However, that doesn't seem to solve the
problem I'm having.  I'm receiving the same error as before after adding the
html:base/ tag to the HEAD section of my page.

Do I need to fill in any attributes to the base tag?

Also, the problem I'm having might be related to the fact that I'm trying to
call an action to generate the image for the img tag.  I'm not directly
referencing an existing .JPG or .GIF file.  Could that play a part in this?

Thanks again...


 Greg


Manfred Wolff [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greg

 use the html:base/ Tag. Then Struts appends the base uri like

 http://localhost:/MyApp/

 to your relative path. Your image might be then

 img src=/some/dir/mypicture.jpg

 Manfred


 Greg Blomquist wrote:

 I apologize in advance if this question has already been answered
somewhere.
 Looks like basebeans is down so I can't search the struts-user archives.
 
 I'm trying to do the following:
 img src=/some/dir/myAction.do
 
 The only problem is that it doesn't like the relative path.  I have to
code
 the absolute path:
 img src=http://localhost:/MyApp/some/dir/myAction.do;
 
 Which is fine until I move to production.
 
 Is there a way to use a relative path when using an action for the src
 attribute of an image tag?
 
 Thanks!
 
 Btw, I'm running WSAD 5.1 and the error message I get when trying a
relative
 path is:
 Virtual Host/WebGroup Not Found : The web group
 /secure/isa/performance/graph.do has not been defined
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -- 
 ===
 Dipl.-Inf. Manfred Wolff
 ---
 phone neusta  : +49 421 20696-27
 phone : +49 421 534522
 mobil : +49 178 49 18 434
 eFax  : +49 1212 6 626 63 965 33
 ---
 
 Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail ist nicht gestattet.

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




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



Re: Struts and Pajes

2004-02-03 Thread Michael McGrady
Struts is not the presentation tools so you are fine.  You can use any 
presentation, or even none.  I do a lot of tunneling things with struts, 
including serving images with Action classes.  Your question is not clear 
to me?  You seem to be conflating mapping (control) and view (presentation) 
issues.  But, I am not sure.  Anyway, if you are not clear, they are 
distinct.  I don't know how much you know, so let me stress that the web 
MVC pattern is really not the classic MVC pattern.  Rather, our own 
beloved Ted Husted has nailed the real pattern, which is to keep the 
connections of each of the MVC to only one of the other three on each side 
(incoming and out going).  It's more of a circle.
 



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


Re: img tag with action as src

2004-02-03 Thread Ben Anderson
if img src=/some/dir/myAction.dodoens't work for you,
then adding an base tag isn't going to help you.
You just need to add your application context in there.  Check out:
http://jakarta.apache.org/struts/userGuide/struts-html.html#img
Also here's another archive site:
http://marc.theaimsgroup.com
-Ben

From: Manfred Wolff [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: img tag with action as src
Date: Tue, 03 Feb 2004 19:27:03 +0100
Greg

use the html:base/ Tag. Then Struts appends the base uri like

http://localhost:/MyApp/

to your relative path. Your image might be then

img src=/some/dir/mypicture.jpg

Manfred

Greg Blomquist wrote:

I apologize in advance if this question has already been answered 
somewhere.
Looks like basebeans is down so I can't search the struts-user archives.

I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.  I have to 
code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;

Which is fine until I move to production.

Is there a way to use a relative path when using an action for the src
attribute of an image tag?
Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a 
relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined



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


--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich 
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder 
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den 
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die 
unbefugte Weitergabe dieser Mail ist nicht gestattet.

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



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Find high-speed ‘net deals — comparison-shop your local providers here. 
https://broadband.msn.com

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


[OT] Ted Husted

2004-02-03 Thread Michael McGrady
Hi, Ted,

'Hope this is appropriate.  I have not received the copy of JUnit you were 
sending me on the drawing.  Don't want to appear ungrateful, but it has 
been a while.

Thanks.

Michael McGrady



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


Re: img tag with action as src

2004-02-03 Thread Ben Anderson
Could that play a part in this?
nope

From: Greg Blomquist [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: img tag with action as src
Date: Tue, 3 Feb 2004 13:38:38 -0500
Thanks for the speedy reply.  However, that doesn't seem to solve the
problem I'm having.  I'm receiving the same error as before after adding 
the
html:base/ tag to the HEAD section of my page.

Do I need to fill in any attributes to the base tag?

Also, the problem I'm having might be related to the fact that I'm trying 
to
call an action to generate the image for the img tag.  I'm not directly
referencing an existing .JPG or .GIF file.  Could that play a part in this?

Thanks again...


 Greg
Manfred Wolff [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greg

 use the html:base/ Tag. Then Struts appends the base uri like

 http://localhost:/MyApp/

 to your relative path. Your image might be then

 img src=/some/dir/mypicture.jpg

 Manfred


 Greg Blomquist wrote:

 I apologize in advance if this question has already been answered
somewhere.
 Looks like basebeans is down so I can't search the struts-user 
archives.
 
 I'm trying to do the following:
 img src=/some/dir/myAction.do
 
 The only problem is that it doesn't like the relative path.  I have to
code
 the absolute path:
 img src=http://localhost:/MyApp/some/dir/myAction.do;
 
 Which is fine until I move to production.
 
 Is there a way to use a relative path when using an action for the src
 attribute of an image tag?
 
 Thanks!
 
 Btw, I'm running WSAD 5.1 and the error message I get when trying a
relative
 path is:
 Virtual Host/WebGroup Not Found : The web group
 /secure/isa/performance/graph.do has not been defined
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 ===
 Dipl.-Inf. Manfred Wolff
 ---
 phone neusta  : +49 421 20696-27
 phone : +49 421 534522
 mobil : +49 178 49 18 434
 eFax  : +49 1212 6 626 63 965 33
 ---
 
 Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail ist nicht gestattet.

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



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
What are the 5 hot job markets for 2004? Click here to find out. 
http://msn.careerbuilder.com/Custom/MSN/CareerAdvice/WPI_WhereWillWeFindJobsIn2004.htm?siteid=CBMSN3006sc_extcmp=JS_wi08_dec03_hotmail1

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


Re: Accessing ActionForm from Servlet (was: Pajes + Struts)

2004-02-03 Thread Joe Germuska
  (2) Whatís the minimal information that one needs to retrieve an Actionís
  corresponding ActionForm object?
ModuleConfig modConf = ModuleUtils.getInstance().getModuleConfig(request);
FormBeanConfig fbc = modConf.findFormBeanConfig(mapping.getName());
(since 2004/01/24):
ActionForm form = RequestUtils.createActionForm(fbc, servlet);
A form must always have a servlet; this is deep in the API of the ActionForm.

These are initial steps towards making it easier 
to get an ActionForm instance for prepopulation 
on the way to the view.  Be warned, this method 
does not use any of the logic for looking up an 
existing form bean in request or session scope 
under any name, either the forms name or the 
'attribute' property of an ActionMapping, since 
as you can see, the method gets neither a request 
or an action mapping.

I have been thinking about adding a method:
RequestUtils.createActionForm(fbc, servlet, 
request, scopeString, attributeString) which 
would integrate that logic as well, but I was 
waiting to make sure that no one objected to what 
I did a few weeks ago.  Actually, I would also 
prefer to use a different method name like 
'findOrCreateActionForm' but I don't love that 
name, so I'm also waiting to come up with a 
method name that I like.

Also, there has been a lot of effort to factor 
certain things out of RequestUtils, so maybe it's 
time to find a different home for these methods. 
FormUtils?

Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
  Imagine if every Thursday your shoes 
exploded if you tied them the usual way.  This 
happens to us all the time with computers, and 
nobody thinks of complaining.
-- Jef Raskin

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


Re: img tag with action as src SOLVED

2004-02-03 Thread Greg Blomquist
That's it!  html:img page=myAction.do/  I knew that struts taglib had a
way to do what I wanted, I just couldn't remember what it was...

Thanks Ben!


Ben Anderson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 if img src=/some/dir/myAction.dodoens't work for you,
 then adding an base tag isn't going to help you.
 You just need to add your application context in there.  Check out:
 http://jakarta.apache.org/struts/userGuide/struts-html.html#img

 Also here's another archive site:
 http://marc.theaimsgroup.com

 -Ben

 From: Manfred Wolff [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: img tag with action as src
 Date: Tue, 03 Feb 2004 19:27:03 +0100
 
 Greg
 
 use the html:base/ Tag. Then Struts appends the base uri like
 
 http://localhost:/MyApp/
 
 to your relative path. Your image might be then
 
 img src=/some/dir/mypicture.jpg
 
 Manfred
 
 
 Greg Blomquist wrote:
 
 I apologize in advance if this question has already been answered
 somewhere.
 Looks like basebeans is down so I can't search the struts-user archives.
 
 I'm trying to do the following:
 img src=/some/dir/myAction.do
 
 The only problem is that it doesn't like the relative path.  I have to
 code
 the absolute path:
 img src=http://localhost:/MyApp/some/dir/myAction.do;
 
 Which is fine until I move to production.
 
 Is there a way to use a relative path when using an action for the src
 attribute of an image tag?
 
 Thanks!
 
 Btw, I'm running WSAD 5.1 and the error message I get when trying a
 relative
 path is:
 Virtual Host/WebGroup Not Found : The web group
 /secure/isa/performance/graph.do has not been defined
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 --
 ===
 Dipl.-Inf. Manfred Wolff
 ---
 phone neusta  : +49 421 20696-27
 phone : +49 421 534522
 mobil : +49 178 49 18 434
 eFax  : +49 1212 6 626 63 965 33
 ---
 
 Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich
 geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder
 diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
 Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
 unbefugte Weitergabe dieser Mail ist nicht gestattet.
 
 This e-mail may contain confidential and/or privileged information. If
you
 are not the intended recipient (or have received this e-mail in error)
 please notify the sender immediately and destroy this e-mail. Any
 unauthorised copying, disclosure or distribution of the material in this
 e-mail is strictly forbidden.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

 _
 Find high-speed 'net deals - comparison-shop your local providers here.
 https://broadband.msn.com




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



RE: Using Catus versus using StrutsTestcase

2004-02-03 Thread Yee, Richard K,,DMDCWEST
Al,
StrutsTestCase, as the name implies, has specific classes and methods for
testing struts applications. It is good for testing actionForwards,
validation errors, and ActionForm submissions with struts. It only does out
of container testing however.
Cactus is used for in-container testing of servlets, JSP's, JSP TagLibs,
filters and EJBs. It does not have the classes that enable Struts-specific
features to be exercised. Basically for a JSP you set up a HTTP request with
input parameters and then are able to check the response object and the
content. You can also check the presence of cookies and session data.

Rgds,

Richard


-Original Message-
From: Al Rathon [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 2:50 PM
To: [EMAIL PROTECTED]
Subject: Using Catus versus using StrutsTestcase


Hi: 
I want to write unit tests for testing the struts
portion of a web-app.I am not sure whether I should be
using Cactus or StrutsTestCase. What are the factors
that I should consider while choosing one application
over the other?

Thanks.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

-
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: img tag with action as src

2004-02-03 Thread vasudevrao gupta

Hi,

Try using
html:rewrite page=/some/dir/myAction.do/

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Greg Blomquist
Sent: 03 February 2004 23:44
To: [EMAIL PROTECTED]
Subject: img tag with action as src


I apologize in advance if this question has already been answered
somewhere.
Looks like basebeans is down so I can't search the struts-user archives.

I'm trying to do the following:
img src=/some/dir/myAction.do

The only problem is that it doesn't like the relative path.  I have to
code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;

Which is fine until I move to production.

Is there a way to use a relative path when using an action for the src
attribute of an image tag?

Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a
relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined




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


Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: img tag with action as src

2004-02-03 Thread Michael McGrady


At 10:13 AM 2/3/2004, Greg Blomquist wrote:
I apologize in advance if this question has already been answered somewhere.
Looks like basebeans is down so I can't search the struts-user archives.
I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.


Your question indicates some misunderstanding is going on.  The path is 
irrelevant, since the controller will take the action no matter what.



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


Hello

2004-02-03 Thread matt


[Filename: message.zip, Content-Type: application/octet-stream]
The file that was attached to this message has been removed by the mail gateway filter 
because it is not permitted by the security policy or may contain a virus.

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

RE: Conventions for indexed properties

2004-02-03 Thread Yee, Richard K,,DMDCWEST
Sunil,
The LazyList class in the commmons-collections.jar file does this already
for you.

Rgds,

Richard


java.lang.Object
  |
  +--org.apache.commons.collections.collection.AbstractCollectionDecorator
|
+--org.apache.commons.collections.list.AbstractListDecorator
  |
  +--org.apache.commons.collections.list.LazyList
All Implemented Interfaces: 
java.util.Collection, java.util.List 




public class LazyList
extends AbstractListDecorator
Decorates another List to create objects in the list on demand. 

When the get(int) method is called with an index greater than the size of
the list, the list will automatically grow in size and return a new object
from the specified factory. The gaps will be filled by null. If a get method
call encounters a null, it will be replaced with a new object from the
factory. Thus this list is unsuitable for storing null objects. 

-Original Message-
From: Sunil Dmonte [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 10:33 PM
To: ^Struts Users Mailing List (E-mail)
Cc: Imran Ali
Subject: RE: Conventions for indexed properties


I Thought I'd reply to my own message with our solution to this issue.
Feedback is most welcome.

Here are the changes we made:

1) We have an indexed getter and setter exactly as per the JavaBean spec
2) A non-indexed List getter and setter as supported by BeanUtils
3) Using our own ExpandableArrayList class instead of a normal ArrayList. 

The code for this class is given below (minus documentation):

***
import java.util.ArrayList;
import java.util.RandomAccess;
import java.util.List;
import java.io.Serializable;

public class ExpandableArrayList extends ArrayList implements List,
RandomAccess, Cloneable, Serializable
{
  private Class beanClass;

  public ExpandableArrayList(Class classType)
  {
super();
beanClass = classType;
  }

  public Object set(int index, Object element)
  {
resizeIfNecessary(index);
return super.set(index, element);
  }

  public Object get(int index)
  {
resizeIfNecessary(index);
return super.get(index);
  }

  private void resizeIfNecessary(int index)
  {
// Extend the size of the list as needed.
if (index = size())
{
  int missingElements = index - size() + 1;
  for (int i = 0; i  missingElements; i++)
  {
try
{
  add(beanClass.newInstance());
}
catch (InstantiationException e)
{
  // log and...
  throw new RuntimeException(e);
}
catch (IllegalAccessException e)
{
  // log and...
  throw new RuntimeException(e);
}
  }
}
  }
}
***

 -Original Message-
 From: Sunil Dmonte [mailto:[EMAIL PROTECTED]
 Sent: Friday, January 23, 2004 11:38
 To: 'Struts Users Mailing List'
 Subject: RE: Conventions for indexed properties
 
 
 Thanks for the responses guys. Does that mean the following
 getter (given at
 http://jakarta.apache.org/struts/faqs/indexedprops.html) is 
 incorrect? It
 doesn't seem to follow the javabean spec for indexed properties:
 
 public java.util.List getStringIndexed(int index) { 
 return java.util.Arrays.asList(strAry);
 }
 
 (If it's taking an index as a parameter, why would it return
 the whole list?
 Is this some additional functionality that BeanUtils provides?)
 
 Regarding the 2 variants for getters and setters - which one
 should I use?
 Both? If I use the whole list variant, then I can't do any 
 index checking
 to prevent an indexing exception (unless I decide to subclass 
 ArrayList and
 override the set(index, object) method). But when I introduce 
 the indexed
 variant, I start getting bean-related JspExceptions like 
 JspException: No
 getter method for property .. even though the property name 
 matches up with
 the getter and setter.
 
 Thanks for your help!
 sunil
 
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
  Sent: Friday, January 23, 2004 11:13
  To: Struts Users Mailing List; John D. Hume
  Cc: Struts Users Mailing List
  Subject: Re: Conventions for indexed properties
  
  
  Quoting John D. Hume [EMAIL PROTECTED]:
  
   I don't have a definitive guide, but here are some examples
  that could
   be helpful.
   
  
  The definitive guide starts with the JavaBeans Specification:
  
http://java.sun.com/products/javabeans/reference/api/index.html
  
  you'll see that there are two variants for indexed properties
  -- one that has
  the getter and setter methods taking an array, and one that 
  has the getter and
  setter methods taking an additional argument for the index.
  
  There's lots of other useful info about what it means to be a
  JavaBean here as
  well.  Just as one example, did you know that 

Re: ChartDirector with Struts

2004-02-03 Thread Nathan Maves
We are using JFreeChart with struts.

On Feb 2, 2004, at 11:32 AM, Andy Engle wrote:

Hi all,

Just curious if anyone has used ChartDirector (from
http://www.advsofteng.com) in any Struts application?
Andy

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


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


RE: action global forward extension

2004-02-03 Thread Bradley Beddoes
Craig,
Thanks a lot, I somehow missed that warning statement on that document,
I had read it before posting here.

Cheers,
Bradley

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 4 February 2004 4:18 AM
To: Struts Users Mailing List
Subject: Re: action global forward extension

Quoting Bradley Beddoes [EMAIL PROTECTED]:

 Hi All.
  
 I wish to have some global forwards invoked as .do others as .do2 (so
as
 to differentiate what filters get hit with the differing requests), Is
 this possible within struts? (Please see struts.conf below)
  

Struts supports only one mapping to the controller servlet.

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

Since you are using extension mapping, one thing to consider is to
create an
artificial directory level in your action paths (/foo/setup.do and
/bar/teardown.do instead of setup.do and teardown.do2).  That way,
you
can have different filters on /foo/* and /bar/*.

Craig


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




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



No action instance for path /...

2004-02-03 Thread Daniel
How can I fix this message ??? 
SEVERE: No action instance for path /wellcome could be created



my  struts-config.xml is:



?xml version=1.0 encoding=UTF-8?

!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts 
Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

struts-config


!-- == Data Source Configuration === --

data-sources /


!-- == Form Bean Definitions == --

form-beans

form-bean name=homeBean type=com.topit.bean.HomeBean / 

form-bean name=indexBean type=com.topit.bean.IndexBean /

/form-beans


!-- == Global Exception Definitions == --

global-exceptions /


!-- == Global Forward Definitions === --

global-forwards /


!-- == Action Mapping Definitions === --

action-mappings

action path=/home type=com.topit.action.HomeAction validate=false

forward name=success path=/home.jsp redirect=true /

/action

action path=/wellcome type=com.topit.action.WellcomeAction validate=false

forward name=success path=/wellcome.jsp redirect=true /

/action


/action-mappings


!-- == Controller Configuration  --

controller /


!-- == Message Resources Definitions  --

message-resources parameter=com.topit.ApplicationResources /


!-- == Plug Ins Configuration = --

/struts-config



and when i tri to access on the browser: http://localhost:8080/appTeste/wellcome.do 
this error apper:
SEVERE: No action instance for path /wellcome could be created


Experienced Hungarian Struts developer wanted

2004-02-03 Thread Zsolt Koppany
Hi,

we search for experienced Hungarian Struts developers. If you are interested
in a job please contact me.

Struts experiences are important and SQL know how is also interesting.


Zsolt Koppany
--
Intland Software GmbH, Schulze-Delitzsch-Strasse 16
D-70565 Stuttgart, Germany
Phone: +49-711-722 1873
Fax: +49-711-722 1835





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



Re: No action instance for path /...

2004-02-03 Thread Max Cooper
Is a compiled com.topit.action.WellcomeAction class file in the classpath
for your web app (WEB-INF/classes or WEB-INF/lib)? It seems to be saying
that it couldn't create an instance of your Action class for that path.

-Max

- Original Message - 
From: Daniel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 1:12 PM
Subject: No action instance for path /...


How can I fix this message ???
SEVERE: No action instance for path /wellcome could be created



my  struts-config.xml is:



?xml version=1.0 encoding=UTF-8?

!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.1//EN
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

struts-config


!-- == Data Source Configuration
=== --

data-sources /


!-- == Form Bean Definitions == --

form-beans

form-bean name=homeBean type=com.topit.bean.HomeBean /

form-bean name=indexBean type=com.topit.bean.IndexBean /

/form-beans


!-- == Global Exception Definitions
== --

global-exceptions /


!-- == Global Forward Definitions
=== --

global-forwards /


!-- == Action Mapping Definitions
=== --

action-mappings

action path=/home type=com.topit.action.HomeAction validate=false

forward name=success path=/home.jsp redirect=true /

/action

action path=/wellcome type=com.topit.action.WellcomeAction
validate=false

forward name=success path=/wellcome.jsp redirect=true /

/action


/action-mappings


!-- == Controller Configuration
 --

controller /


!-- == Message Resources Definitions
 --

message-resources parameter=com.topit.ApplicationResources /


!-- == Plug Ins Configuration = --

/struts-config



and when i tri to access on the browser:
http://localhost:8080/appTeste/wellcome.do this error apper:
SEVERE: No action instance for path /wellcome could be created


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



error- no getter method for property of bean

2004-02-03 Thread Frank Nguyen
Hi,

I'm experimenting a simple form, adding a group (3 fields) to a simple, one
group table database, following some examples from the Struts book by James
Turner. All classes built (with Torque and mysql) and deployed. I couldn't
bring up the form and kept getting the error below. I think something is
wrong w/ my struts setup. Attached are struts config, my jsp, and some
simple java files. Could someone help me on this ? I really appreciate it.

-Frank

Error: 500
Location: /infolink/users/edit_group.jsp
Internal Servlet Error:

javax.servlet.ServletException: No getter method for property group_name of
bean org.apache.struts.taglib.html.BEAN
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:460)
at users.edit_group_1._jspService(edit_group_1.java:550)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:91
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10I
nterceptor.java:176)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:516)
at java.lang.Thread.run(Thread.java:536)
Root cause:
javax.servlet.jsp.JspException: No getter method for property group_name of
bean org.apache.struts.taglib.html.BEAN
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742)
at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:193)
at users.edit_group_1._jspService(edit_group_1.java:241)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:91
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10I
nterceptor.java:176)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:516)
at java.lang.Thread.run(Thread.java:536)
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

!--
 This is the Struts configuration file for the Group! sample application
--

struts-config

!--  Form Bean Definitions === --
form-beans
form-bean name=GroupForm type=infolink.users.GroupForm/
form-property name=group_name type=java.lang.String/
/form-beans

  !-- == Action Mapping Definitions == --
  action-mappings
!-- Say Hello! --
actionpath  = /Group
   type  = infolink.users.GroupAction
   name  = GroupForm
   scope = request
   validate  = true
   input = /edit_group.jsp
 
forward name=home path=/view_groups.jsp  /
/action
  /action-mappings

  !-- == Message Resources Definitions === --

  message-resources parameter=infolink.users.ApplicationResources/

/struts-config

package infolink.users;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.Action;
import org.apache.torque.*;

/**
 * stocktrack.struts.action.NewUserAction class.
 * this class used by Struts Framework process the 
 * stocktrack.struts.form.NewUserForm form.
 * - method invoked by HTTP request is perform()
 * - form name is newUserForm
 * - input page is newUser.jsp
 * - scope name is request
 * - path for this 

Looking for junior Java/Struts developers

2004-02-03 Thread Yibing Li
Folks,

We are actively looking for java/struts/jboss developers here at GNX
(www.gnx.com). If you have one year of experience using java/struts or jboss
and are willing to relocate to Herndon, VA, please send me your resume to
[EMAIL PROTECTED],
The salary is around $50k.

Thanks,

Yibing



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



Re: error- no getter method for property of bean

2004-02-03 Thread hgosper

You will need to change your getter method to getGroup_name()
Struts uses the name of the field when it looks for a getter or setter method. It will assume that the first letter of the field name is capitalised after the get (as per general JavaBean standards). getGroupName will not be recognized as the getter for your property group_name (although it would match a property called groupName

Cheers,
Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155 Fax: +61 (0) 2 62468100
MOB: 0401 611779

This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.








Frank Nguyen [EMAIL PROTECTED]
04/02/2004 08:53 AM
Please respond to Struts Users Mailing List


To:Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:error- no getter method for property of bean


Hi,

I'm experimenting a simple form, adding a group (3 fields) to a simple, one
group table database, following some examples from the Struts book by James
Turner. All classes built (with Torque and mysql) and deployed. I couldn't
bring up the form and kept getting the error below. I think something is
wrong w/ my struts setup. Attached are struts config, my jsp, and some
simple java files. Could someone help me on this ? I really appreciate it.

-Frank

Error: 500
Location: /infolink/users/edit_group.jsp
Internal Servlet Error:

javax.servlet.ServletException: No getter method for property group_name of
bean org.apache.struts.taglib.html.BEAN
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:460)
 at users.edit_group_1._jspService(edit_group_1.java:550)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
 at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
 at org.apache.tomcat.core.Handler.service(Handler.java:235)
 at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:91
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
 at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10I
nterceptor.java:176)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:516)
 at java.lang.Thread.run(Thread.java:536)
Root cause:
javax.servlet.jsp.JspException: No getter method for property group_name of
bean org.apache.struts.taglib.html.BEAN
 at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742)
 at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:193)
 at users.edit_group_1._jspService(edit_group_1.java:241)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
 at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
 at org.apache.tomcat.core.Handler.service(Handler.java:235)
 at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:91
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
 at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10I
nterceptor.java:176)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:516)
 at java.lang.Thread.run(Thread.java:536)



This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL 

RE: error- no getter method for property of bean

2004-02-03 Thread Wendy Smoak
 From: Frank Nguyen [mailto:[EMAIL PROTECTED] 
 javax.servlet.ServletException: No getter method for property 
 group_name of bean org.apache.struts.taglib.html.BEAN

I didn't look at anything you attached, but based on this message I'd
encourage you to stick to property names like 'groupName' and get rid of
the underscores.  You should then have getGroupName() and setGroupName()
methods with exactly the same type (and no other similarly named methods
with different signatures).  For the rest of the rules, read the
JavaBeans specification.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



RE: error- no getter method for property of bean

2004-02-03 Thread hgosper
There is a reason why people choose field names like group_name with 
underscore and no CamelCase: it is to mirror the column names in the 
database. I personally agree with you in general terms but if DBAs insist 
on their of notation (the underscore means of or something 
syntactically similar, so the field means name of group) then if we want 
to keep our code aligned with the database we will have to use 
underscrores in the field names...

Of course, it is not essential to do this and we could stick to the much 
more bean-standard groupName, getGroupName and setGroupName.

In Frank's case I think the easiest solution would be to change the 
accessors though because there are less changes to make... saves tracking 
down references to this field in the jsp and possibly in validation.xml 
(if using struts validator forms) . The main thing is to understand the 
reason why the method call was not recognized. 

Cheers,
Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779

This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Wendy Smoak [EMAIL PROTECTED]
04/02/2004 09:08 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED], 
[EMAIL PROTECTED]
cc: 
Subject:RE: error- no getter method for property of bean


 From: Frank Nguyen [mailto:[EMAIL PROTECTED] 
 javax.servlet.ServletException: No getter method for property 
 group_name of bean org.apache.struts.taglib.html.BEAN

I didn't look at anything you attached, but based on this message I'd
encourage you to stick to property names like 'groupName' and get rid of
the underscores.  You should then have getGroupName() and setGroupName()
methods with exactly the same type (and no other similarly named methods
with different signatures).  For the rest of the rules, read the
JavaBeans specification.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



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





Re-populating form after validate fails

2004-02-03 Thread Paul Barry
I feel bad asking this question because I know it has been asked 1 million times in this group, but I still haven't 
found the answer so I am asking it again.  How do you get a form to re-populate if validation fails?  Here is what I am 
trying.

I have 2 actions:

action path=/myaccount/login type=myapp.struts.actions.ForwardAction 
scope=request
name=LoginForm validate=false 
parameter=/WEB-INF/jsp/myaccount/login.jsp /
action path=/myaccount/loginAction type=myapp.struts.actions.LoginAction 
scope=request
name=LoginForm validate=true input=/myaccount/login.do /
So, the user goes to /myaccount/login.do, and they are presented with a form.  The code for that looks like this:

html:html
  body
   html:form method=POST action=/loginAction.do
  Username:nbsp;html:text property=username/br /
  Password:nbsp;html:password property=password /br /
  html:submit/
/html:form
  /body
/html:html
The code for the LoginForm is simple, getters and setters with a validate method like this:

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
Object form;
if(StringUtil.isEmpty(getUsername())) {
if(log.isDebugEnabled()) {
log.debug(No username was entered.);
}
errors.add(message,
new 
ActionError(myaccount.login.error.missingUsername));
errors.add(username,
new ActionError(myaccount.login.error.label));
return errors;
}

if(StringUtil.isEmpty(getPassword())) {
if(log.isDebugEnabled()) {
log.debug(No password was entered.);
}
errors.add(message,
new 
ActionError(myaccount.login.error.missingPassword));
errors.add(password,
new ActionError(myaccount.login.error.label));
return errors;
}
return errors;
}
What I am struggling with is that when I submit this form, if username is not null, but password is, the username field 
is not populated with the value for username.  I made my own ForwardAction by copying the source code for the struts 1.1 
ForwardAction and adding a few debugging statements.  When I enter a username but no password oand submit the form, I 
get back to the form, but the username field is not filled in.  Here is log:

org.apache.struts.action.RequestProcessor - Processing a 'POST' for path '/myaccount/loginAction'
org.apache.struts.action.RequestProcessor -  Storing ActionForm bean instance in scope 'request' under attribute key 
'LoginForm'
org.apache.struts.action.RequestProcessor -  Populating bean properties from this request
org.apache.struts.action.RequestProcessor -  Validating input form properties
myapp.struts.forms.LoginForm - No password was entered.
org.apache.struts.action.RequestProcessor -  Validation failed, returning to '/myaccount/login.do'
org.apache.struts.action.RequestProcessor -  Delegating via forward to '/myaccount/login.do'
org.apache.struts.action.RequestProcessor - Processing a 'POST' for path '/myaccount/login'
org.apache.struts.action.RequestProcessor -  Storing ActionForm bean instance in scope 'request' under attribute key 
'LoginForm'
org.apache.struts.action.RequestProcessor -  Populating bean properties from this request
org.apache.struts.action.RequestProcessor -  Looking for Action instance for class myapp.struts.actions.ForwardAction
org.apache.struts.action.RequestProcessor -   Returning existing Action instance
myapp.struts.actions.ForwardAction - Path=[/WEB-INF/jsp/myaccount/login.jsp],Form=[Username=dfgfdgfd,Password=]
org.apache.struts.action.RequestProcessor - 
processForwardConfig(ForwardConfig[name=null,path=/WEB-INF/jsp/myaccount/login.jsp,redirect=false,contextRelative=true])

What I don't get is that when I print out the toString of my LoginForm in the debug statement of my ForwardAction, the 
username property is populated.  So why doesn't the html:form populate the html:test field with that value?

And for extra credit, is there any way to not use the path to another action in the input property of an ActionMapping? 
   In the example above, I would rather user a forward titled say login, than hard-code /myaccount/login.do for the 
input of /myaccount/loginAction.







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


RE: Validation problem

2004-02-03 Thread Jiin-Her Lu
This is an interesting thing. Here is the way to avoid Struts calls  validate method 
on ActionForm

This one Struts framework will NOT call validate method on ActionForm

html:cancel value=Cancel /

While this one does 

html:cancel property=mycancelbutton value=Cancel /

The only difference is if you do have property, Struts adds name=your_data. While if 
you don't have property set, Struts add name=org.apache.struts.taglib.html.CANCEL. 

Why these make the difference?



Jiin-Her Lu
(816) 926-2145

 [EMAIL PROTECTED] 01/29/04 05:45PM 
The Struts Validator provides a mechanism to deal with Cancel buttons. A
flag is set in the onclick method for the cancel button in the jsp page. The
validate methods check this flag and if it is set, they skip validation and
just return true.
 
html:cancel onclick=bCancel=true;

If you're not using the Struts Validator, maybe you could try mimicking this
behavior in your validate method ??

Brian Barnett

-Original Message-
From: Nathan Pitts [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 29, 2004 4:16 PM
To: Struts List
Subject: Validation problem

I am wondering how to solve the following problem with a minimal amount 
of recoding, and hope someone can give some input.  I have a form the 
has three html:submit buttons -- Update, Cancel and Delete.   I am 
using a LookupDispatchAction and an ActionForm with the validation in 
the validate() method.  Under normal conditions everything works 
fine..But when a user clicks Update with invalid data on the form, 
the validate method catches the bad data and returns the proper error 
message.  If the user then decides to click Cancel (without changing 
the invalid data), the validate() method is still called and the user 
is returned the same error.


One thing that I might be able to do is to somehow find out what button 
was clicked in the validate() method...??  How would I do that, I 
wonder...



thanks in advance,
-nathan


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

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



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



Re: Looking for junior Java/Struts developers

2004-02-03 Thread Caroline Jen
I would like to give a try.  I live in Manassas, VA. 
Please find my resume in the Word format in the
attachment.

Caroline Jen
Tel: 703-369-3257
--- Yibing Li [EMAIL PROTECTED] wrote:
 Folks,
 
 We are actively looking for java/struts/jboss
 developers here at GNX
 (www.gnx.com). If you have one year of experience
 using java/struts or jboss
 and are willing to relocate to Herndon, VA, please
 send me your resume to
 [EMAIL PROTECTED],
 The salary is around $50k.
 
 Thanks,
 
 Yibing
 
 
 

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


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: img tag with action as src

2004-02-03 Thread Nathan Maves
Were are attempting to do the same thing.  (Have an action return an  
image)  everything works great but we have the following error in the  
server log.

StandardWrapperValve[action]: Servlet.service() for servlet action  
threw exception
java.lang.IllegalStateException: getOutputStream() has already been  
called for this response
at  
org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java: 
836)
at  
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.ja 
va:165)
at  
javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.ja 
va:146)
at  
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:184)
at  
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java: 
176)
at  
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java: 
174)
at  
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF 
actoryImpl.java:204)
at  
org.apache.jasper.runtime.JspFactoryImpl.access$000(JspFactoryImpl.java: 
83)
at  
org.apache.jasper.runtime.JspFactoryImpl$PrivilegedReleasePageContext.ru 
n(JspFactoryImpl.java:132)
at java.security.AccessController.doPrivileged(Native Method)
at  
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm 
pl.java:197)

We are only calling that method one in our action.

Nathan

On Feb 3, 2004, at 11:41 AM, Ben Anderson wrote:

if img src=/some/dir/myAction.dodoens't work for you,
then adding an base tag isn't going to help you.
You just need to add your application context in there.  Check out:
http://jakarta.apache.org/struts/userGuide/struts-html.html#img
Also here's another archive site:
http://marc.theaimsgroup.com
-Ben

From: Manfred Wolff [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: img tag with action as src
Date: Tue, 03 Feb 2004 19:27:03 +0100
Greg

use the html:base/ Tag. Then Struts appends the base uri like

http://localhost:/MyApp/

to your relative path. Your image might be then

img src=/some/dir/mypicture.jpg

Manfred

Greg Blomquist wrote:

I apologize in advance if this question has already been answered  
somewhere.
Looks like basebeans is down so I can't search the struts-user  
archives.

I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.  I have  
to code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;

Which is fine until I move to production.

Is there a way to use a relative path when using an action for the  
src
attribute of an image tag?

Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a  
relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined



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


--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich  
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind  
oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte  
sofort den Absender und vernichten Sie diese Mail. Das unerlaubte  
Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht  
gestattet.

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



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Find high-speed ‘net deals — comparison-shop your local providers  
here. https://broadband.msn.com

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


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


Validator-How to put the fields value in the resulting error message?

2004-02-03 Thread David Erickson
Hey all, still new with the validator.. I'm using the emailAddress validator
and I just want it to put the value of the field in the error message if its
not valid.. ie:
blah!blah.com is not a valid email address.

however I can't seem to make that happen.. here's what I've tried:
form name=/getPassword

field property=userName depends=required

arg0 key=User Name resource=false/

/field

field property=emailAddress depends=required,email

arg0 key=${emailAddress} resource=false/

/field

/form

and in my properties file

errors.email=li{0} is an invalid e-mail address./li



Thanks,

David


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



Re: Re-populating form after validate fails

2004-02-03 Thread hgosper
Just set up an forward for validation failure. You can do this in your 
struts-config.xml file, in fact you can have as many  forwards as you 
like, but for practical purposes most people prefer to have at most three 
or four forwards per Action. For example, you might have a SaveAction that 
forwards to the next screen in a sequence if validation succeeds, an error 
page if it fails, a login page if the session becomes invalidated, and a 
query action if you had a delete button to delete a record.

Just say you query a database to populate your form fields. Then you can 
edit the form and hit Save. In the Form's validate method you fill an 
ActionErrors object.

Then in the SaveAction you will have something like:

// If a message is required, save the specified key(s)
// into the request for use by the struts:errors tag.
if (!errors.isEmpty()) 
{
saveErrors(request, errors);

// Forward control to the appropriate 'failure' URI
forward = mapping.findForward(failure);

} 
 
else
{
// Forward control to the appropriate 'success' URI if no errors
forward = mapping.findForward(success);
} 
 
return forward;

and in your struts-config you will have something like:

action path=/saveAction
type=myproject.actions.SaveAction
name=somethingForm
validate=true
forward name=success path=nextForm/
forward name=failure path=somethingForm/
/action


I hope you can figure out your answer from that... I can't give you a real 
example from my project because of confidentiality so I have to try and 
make it generic.


Cheers,
Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779

This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Paul Barry [EMAIL PROTECTED]
04/02/2004 09:48 AM
Please respond to Struts Users Mailing List

 
To: [EMAIL PROTECTED]
cc: 
Subject:Re-populating form after validate fails


I feel bad asking this question because I know it has been asked 1 million 
times in this group, but I still haven't 
found the answer so I am asking it again.  How do you get a form to 
re-populate if validation fails?  Here is what I am 
trying.

I have 2 actions:

action path=/myaccount/login type=myapp.struts.actions.ForwardAction 
scope=request
 name=LoginForm validate=false 
parameter=/WEB-INF/jsp/myaccount/login.jsp /
action path=/myaccount/loginAction 
type=myapp.struts.actions.LoginAction scope=request
 name=LoginForm validate=true input=/myaccount/login.do 
/

So, the user goes to /myaccount/login.do, and they are presented with a 
form.  The code for that looks like this:

html:html
   body
html:form method=POST action=/loginAction.do
   Username:nbsp;html:text property=username/br /
   Password:nbsp;html:password property=password /br /
   html:submit/
 /html:form
   /body
/html:html

The code for the LoginForm is simple, getters and setters with a validate 
method like this:

 public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest 
request) {
 ActionErrors errors = new ActionErrors();
 Object form;
 if(StringUtil.isEmpty(getUsername())) {
 if(log.isDebugEnabled()) 
{
 log.debug(No username was entered.);
 }
 errors.add(message,
 new 
ActionError(myaccount.login.error.missingUsername));
 errors.add(username,
 new 
ActionError(myaccount.login.error.label));
 return errors;
 }
 
 if(StringUtil.isEmpty(getPassword())) {
 if(log.isDebugEnabled()) 
{
 

Re: Validator-How to put the fields value in the resulting error message?

2004-02-03 Thread hgosper
I think you have to do this in code in your form's validate method.

errors.add(new ActionError(errors.email), emailAddress);

I could be wrong but this is the way that I do it anyway... I'm not sure 
if the struts validator can do this using an expression like you have 
tried to do. 

Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779

This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






David Erickson [EMAIL PROTECTED]
04/02/2004 10:56 AM
Please respond to Struts Users Mailing List

 
To: Struts Mailing List [EMAIL PROTECTED]
cc: 
Subject:Validator-How to put the fields value in the resulting error 
message?


Hey all, still new with the validator.. I'm using the emailAddress 
validator
and I just want it to put the value of the field in the error message if 
its
not valid.. ie:
blah!blah.com is not a valid email address.

however I can't seem to make that happen.. here's what I've tried:
form name=/getPassword

field property=userName depends=required

arg0 key=User Name resource=false/

/field

field property=emailAddress depends=required,email

arg0 key=${emailAddress} resource=false/

/field

/form

and in my properties file

errors.email=li{0} is an invalid e-mail address./li



Thanks,

David


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



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





Re: img tag with action as src

2004-02-03 Thread Michael McGrady
I think I posted the code that works for my application that does 
this.  Are you returning null with your action?

At 03:47 PM 2/3/2004, you wrote:
Were are attempting to do the same thing.  (Have an action return an
image)  everything works great but we have the following error in the
server log.
StandardWrapperValve[action]: Servlet.service() for servlet action
threw exception
java.lang.IllegalStateException: getOutputStream() has already been
called for this response
at
org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java: 836)
at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.ja 
va:165)
at
javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.ja 
va:146)
at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:184)
at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java: 176)
at
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java: 174)
at
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF 
actoryImpl.java:204)
at
org.apache.jasper.runtime.JspFactoryImpl.access$000(JspFactoryImpl.java: 83)
at
org.apache.jasper.runtime.JspFactoryImpl$PrivilegedReleasePageContext.ru 
n(JspFactoryImpl.java:132)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm 
pl.java:197)

We are only calling that method one in our action.

Nathan

On Feb 3, 2004, at 11:41 AM, Ben Anderson wrote:

if img src=/some/dir/myAction.dodoens't work for you,
then adding an base tag isn't going to help you.
You just need to add your application context in there.  Check out:
http://jakarta.apache.org/struts/userGuide/struts-html.html#img
Also here's another archive site:
http://marc.theaimsgroup.com
-Ben

From: Manfred Wolff [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: img tag with action as src
Date: Tue, 03 Feb 2004 19:27:03 +0100
Greg

use the html:base/ Tag. Then Struts appends the base uri like

http://localhost:/MyApp/

to your relative path. Your image might be then

img src=/some/dir/mypicture.jpg

Manfred

Greg Blomquist wrote:

I apologize in advance if this question has already been answered
somewhere.
Looks like basebeans is down so I can't search the struts-user
archives.
I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.  I have
to code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;
Which is fine until I move to production.

Is there a way to use a relative path when using an action for the
src
attribute of an image tag?
Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a
relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined


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

--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind
oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte
sofort den Absender und vernichten Sie diese Mail. Das unerlaubte
Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail
in error) please notify the sender immediately and destroy this
e-mail. Any unauthorised copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Find high-speed ‘net deals — comparison-shop your local providers
here. https://broadband.msn.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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



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

Struts + Frames + Requests

2004-02-03 Thread Dirk Manske (Service Respond)
 Hi,

I am creating a struts web app. In one html page I have to use frames where
you can enter some values in one frame and after submitting the result is
displayed in another frame. Currently this is theory because I experience
two problems:

1. After submit an action is called. The action computes some values and
then forwards a request to a another action class which handles the
navigation. In fact, the request is never populated and I guess this has
something to do with frames because I heard that frames send new requests...
any idea how to fix it?

2. The input of the user gets validated. When an error occurs the form will
be displayed in the origin frame and in the target frame as well! It seems
as when struts cannot figure out which page from which frame has been
submitted and returns the input page to the target frame. Can someone help?

thx,
Dirk


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



Re: img tag with action as src

2004-02-03 Thread Nathan Maves
Perfect!  I remember seeing that but just did not register.  My bad :)

On Feb 3, 2004, at 5:28 PM, Michael McGrady wrote:

I think I posted the code that works for my application that does  
this.  Are you returning null with your action?

At 03:47 PM 2/3/2004, you wrote:
Were are attempting to do the same thing.  (Have an action return an
image)  everything works great but we have the following error in the
server log.
StandardWrapperValve[action]: Servlet.service() for servlet action
threw exception
java.lang.IllegalStateException: getOutputStream() has already been
called for this response
at
org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java 
: 836)
at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade. 
ja va:165)
at
javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper. 
ja va:146)
at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java: 
184)
at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java 
: 176)
at
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java 
: 174)
at
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(Js 
pF actoryImpl.java:204)
at
org.apache.jasper.runtime.JspFactoryImpl.access$000(JspFactoryImpl.jav 
a: 83)
at
org.apache.jasper.runtime.JspFactoryImpl$PrivilegedReleasePageContext. 
ru n(JspFactoryImpl.java:132)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactory 
Im pl.java:197)

We are only calling that method one in our action.

Nathan

On Feb 3, 2004, at 11:41 AM, Ben Anderson wrote:

if img src=/some/dir/myAction.dodoens't work for you,
then adding an base tag isn't going to help you.
You just need to add your application context in there.  Check out:
http://jakarta.apache.org/struts/userGuide/struts-html.html#img
Also here's another archive site:
http://marc.theaimsgroup.com
-Ben

From: Manfred Wolff [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: img tag with action as src
Date: Tue, 03 Feb 2004 19:27:03 +0100
Greg

use the html:base/ Tag. Then Struts appends the base uri like

http://localhost:/MyApp/

to your relative path. Your image might be then

img src=/some/dir/mypicture.jpg

Manfred

Greg Blomquist wrote:

I apologize in advance if this question has already been answered
somewhere.
Looks like basebeans is down so I can't search the struts-user
archives.
I'm trying to do the following:
img src=/some/dir/myAction.do
The only problem is that it doesn't like the relative path.  I have
to code
the absolute path:
img src=http://localhost:/MyApp/some/dir/myAction.do;
Which is fine until I move to production.

Is there a way to use a relative path when using an action for the
src
attribute of an image tag?
Thanks!

Btw, I'm running WSAD 5.1 and the error message I get when trying a
relative
path is:
Virtual Host/WebGroup Not Found : The web group
/secure/isa/performance/graph.do has not been defined


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


--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthlt mglicherweise vertrauliche und/oder rechtlich
geschtzte Informationen. Wenn Sie nicht der richtige Adressat sind
oder diese E-Mail irrtmlich erhalten haben, informieren Sie bitte
sofort den Absender und vernichten Sie diese Mail. Das unerlaubte
Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail
in error) please notify the sender immediately and destroy this
e-mail. Any unauthorised copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.


 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Find high-speed net deals  comparison-shop your local providers
here. https://broadband.msn.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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




RE: error- no getter method for property of bean

2004-02-03 Thread Frank Nguyen
Thanks to Heya and Wendy. I got it worked! I like both of your suggestion.
For DB, I prefer to label the fields as tablename_fieldname as much as
possible for many reasons. Torque is pretty good in conforming bean standard
by creating getter/setters as setGroupName()/getGroupName() in the Base
classes and still preserve the database field name (with underscore) as
class' private members. Since I cloned some of the Base code created by
Torque for my form code, I didn't use the bean-conforming method in the JSP
form. I think it's best to get rid of underscore in the JSP forms but
continue to use underscore in DB (thus Torque) as recommended.

-Frank


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 2:30 PM
 To: Struts Users Mailing List
 Subject: RE: error- no getter method for property of bean


 There is a reason why people choose field names like group_name with
 underscore and no CamelCase: it is to mirror the column names in the
 database. I personally agree with you in general terms but if DBAs insist
 on their of notation (the underscore means of or something
 syntactically similar, so the field means name of group) then
 if we want
 to keep our code aligned with the database we will have to use
 underscrores in the field names...

 Of course, it is not essential to do this and we could stick to the much
 more bean-standard groupName, getGroupName and setGroupName.

 In Frank's case I think the easiest solution would be to change the
 accessors though because there are less changes to make... saves tracking
 down references to this field in the jsp and possibly in validation.xml
 (if using struts validator forms) . The main thing is to understand the
 reason why the method call was not recognized.

 Cheers,
 Heya Gosper
 CSC Australia
 212 Northbourne Ave, Braddon ACT 2612
 Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
 MOB: 0401 611779
 --
 --
 This is a PRIVATE message. If you are not the intended recipient, please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery. NOTE: Regardless of content, this e-mail shall not operate to
 bind CSC to any order or other contract unless pursuant to explicit
 written agreement or government initiative expressly permitting
 the use of
 e-mail for such purpose.
 --
 --





 Wendy Smoak [EMAIL PROTECTED]
 04/02/2004 09:08 AM
 Please respond to Struts Users Mailing List


 To: Struts Users Mailing List
 [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 cc:
 Subject:RE: error- no getter method for property of bean


  From: Frank Nguyen [mailto:[EMAIL PROTECTED]
  javax.servlet.ServletException: No getter method for property
  group_name of bean org.apache.struts.taglib.html.BEAN

 I didn't look at anything you attached, but based on this message I'd
 encourage you to stick to property names like 'groupName' and get rid of
 the underscores.  You should then have getGroupName() and setGroupName()
 methods with exactly the same type (and no other similarly named methods
 with different signatures).  For the rest of the rules, read the
 JavaBeans specification.

 --
 Wendy Smoak
 Application Systems Analyst, Sr.
 ASU IA Information Resources Management



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


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





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



How to set properties on actions?

2004-02-03 Thread Eric SCHULTZ
Good evening...

i'm trying to use set-property on my action, in struts-config.xml i have:
action path=/BillPayment
type=com.elixonline.TECO.ivr.CustomerInformation.BillPayment
set-property property=noTransferDays value=MONDAY/
/action

and my class defines
public void setNoTransferDays(String string) {
noTransferDays = string;
}

but i always get the following error in Tomcat 4.1.27 when i start the
application:
javax.servlet.UnavailableException: Parsing error processing resource path 

if i comment out just the set-property then the application starts no
problem.

any ideas?  i couldn't find anything in the mail archive or the Struts site
(all the set-property references were for plug-ins and datasources).

Eric Schultz.

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



RE: [ANNOUNCE] Struts Console v4.3

2004-02-03 Thread James Holmes
There's not a property for this at the moment, but I will add it to the
TODO list.

Thanks,

James

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 10:18 AM
To: Struts Users Mailing List
Subject: Re: [ANNOUNCE] Struts Console v4.3

Nice one..

Just one question.. Its there a property or something I can set that 
will let me define where the StrutsConfig.cfg lives? I use console as a 
standalone bundled up with jar bundler or whatever its called on OSX. 
The file likes appearing in my home directory, whereas ideally i could 
have it inside the application directory itself.

Many thanks

Mark

On 2 Feb 2004, at 16:01, James Holmes wrote:

 Struts Console version 4.3 is now available.

 http://www.jamesholmes.com/struts/

 Download Now:
 http://www.jamesholmes.com/struts/struts-console-4.3.zip
   -- OR --
 http://www.jamesholmes.com/struts/struts-console-4.3.tar.gz

 Struts Console is FREE software.

 This release has a few bug fixes and some enhancements.

 Changes with Struts Console v4.3

   *) Fixed bug where Form screen was not showing up for Validator
  1.1 config files.

   *) Fixed bug where Field screen was improperly showing bundle
  attribute on Arg0 - Arg3 tabs for Validator 1.1 config files.

   *) Updated Eclipse plugin to recognize read only files.

   *) Updated to support system specified DTDs.

   *) Added support for the variant attribute of formset tags for
  Validator 1.1 config files.

 Thanks,

 -James
 [EMAIL PROTECTED]
 http://www.jamesholmes.com/struts/


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



  1   2   >