RE: JSPs past WEB-INF --- Please Help!

2001-12-05 Thread Alexander Jesse

I usually use the same action with two mappings (one with validation,
one without) and the parameter-setting to distinguish between the
two situations...

Yes you get two mappings, but at least the important stuff (java-code)
is reused...

hope this helps
Alexander Jesse

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 9:31 PM
To: [EMAIL PROTECTED]
Subject: JSPs past WEB-INF --- Please Help!


I have been trying to figure this out for a while now, but have had no
luck. Any help would be s greatly appreciated. Here it is:

If you place your jsps past the WEB-INF and do not hit them directly
then what is the easiest way to implement a "first-visit". i.e. the
first time you go to a page it doesn't show the errors, but each other
time it does? I have done this otherwise by having them go directly to
the jsp the first time, and then having them submit to the action, but I
can't send them directly to the JSP if it is past the WEB-INF. I have
also done this by creating a new mapping that set validate="false", but
then there is some duplication as far as the mappings. Is there any
easier way to do it?

Thanks for the help in advance,
dave dandeneau

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




Re: AW: Want to check user is logged in every page server

2001-12-05 Thread antony

Hi

I have used some code similar to your example.  Now a couple of questions

1.  How hard is it for someone to fake a session?  Does tomcat keep 
inside it a valid list of all current sessions and if a fake one turns 
up it throws and exception.
2.  Is there any point in checking in a database or somewhere to check 
to see if the user is currently logged on?   Where else could it 
possibly check if database access is to slow/or big overhead(or is 
it?can it check a java server somewhere perhaps?
3.  Is this the best way to do things from a security point of view? 
What security issues are there?


Cheers

Tony

Mooslechner Martin wrote:

> You can do this with a custom tag
> 
> 
> 
> of course you also need to implement this tag.
> this is what actually does the job:
> public int doEndTag() throws JspException {
> 
>   // Is there a valid user logged on?
>   boolean valid = false;
>   HttpSession session = pageContext.getSession();
>   if ((session != null) && (session.getAttribute(name) != null))
>   valid = true;
> 
>   // Forward control based on the results
>   if (valid)
>   return (EVAL_PAGE);
>   else {
>   try {
>   pageContext.forward(page);
>   } catch (Exception e) {
>   throw new JspException(e.toString());
>   }
>   return (SKIP_PAGE);
>   }
> 
> }
> 
> Take a look at the example Mailserver application that comes with Struts.
> 
> -Ursprungliche Nachricht-
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 20. November 2001 10:42
> An: Struts Users Mailing List
> Betreff: Want to check user is logged in every page server
> 
> 
> Hi
> 
> Everytime a page is served from my Struts application, I want to check 
> to make sure the user is logged in.  If they are not then I want to send 
> them to the login screen.  What is the best way to go about this using 
> Struts?
> 
> Cheers
> 
> Tony
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 




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




height and width in html:image tag

2001-12-05 Thread revivalatgt revivalatgt

Hi,
   I'm sure there's a good reason for this, but how come the height and 
width attributes aren't supported in the html:image tag?

Thanks



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: Design of Business Objects

2001-12-05 Thread Chris Hane



In Ted Husted's scaffold package, he created a utility function that does 
exactly this:

org.apache.scaffold.sql.ResultSetUtils - getCollection(Object bean, 
ResultSet rs).  This function will return a Collection (ArrayList) of beans 
automatically populated from the ResulSet.  Very simple - your done!

Chris

At 12/2/2001 05:41 PM, you wrote:
>Given that the responsiblity of a PropertySearch object would then be to
>return a set of found Properties,  I would have thought the best approach
>would be :
>
>1. Have the PropertySearch query do one database hit which gets all 100 (for
>e.g) rows in to a rowset object.
>2. The PropertySearch object would then be responsible for the creating a
>blank Property object, and mapping the values in the rowset to the
>attributes of the Property object.
>3. Keep the created object in a collection (ArrayList for e.g)
>4. Repeat for all rows in DB rowset
>5. Return collection of Property objects when finished.
>
>Andy
>
>
>- Original Message -
>From: Andrew Myers <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, December 02, 2001 10:45 PM
>Subject: Design of Business Objects
>
>
> > Hi,
> >
> > This is not exactly a question related to Struts as such but it does
>relate to a Struts application I'm building. :)
> >
> > I have a search function that allows users to search for a Property via a
>street address.  The business objects I have to support this are a
>"Property" object and a "PropertySearch" object.  From my action class I
>call a method on the PropertySearch object which then will ultimately return
>an array of Property objects corresponding to those which match the search
>criteria.
> >
> > My question is this:
> >
> > Which object should take responsibility for the population of the Property
>objects with data from the database?  It seems much better from an OO
>viewpoint to be able to pass the primary key into the constructor of the
>Property object and then call a helper method to populate the object.  But
>this is inefficient if the search returns a large number of results.  Eg.
>for 100 results there's 101 database hits (1 to get all the matching primary
>keys, and then 100 to populate each of the objects in turn).  The other
>alternative is to have my initial query return all the data and then have a
>constructor on the Property object which takes about 25 parameters (ugly and
>perhaps not very reusable, but more efficient?)
> >
> > Does anyone have any thoughts on what the best practice is here?
> >
> > Thanks,
> > Andrew.
> > --
> >
> >
> >
> >
> > __
> > Your favorite stores, helpful shopping tools and great gift ideas.
>Experience the convenience of buying online with Shop@Netscape!
>http://shopnow.netscape.com/
> >
> > Get your own FREE, personal Netscape Mail account today at
>http://webmail.netscape.com/
> >
> >
> > --
> > To unsubscribe, e-mail:
>
> > For additional commands, e-mail:
>
> >
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


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




Producing alternating background colours in struts in a table

2001-12-05 Thread antony

Hi

I have a list I am printing out and would like to alternate the 
background colour between each item in the list between light blue and 
light grey.  The list is not in a table at the moment, but if this is 
the best way to go I can put it in a table.  What is the best way to 
acheive this.  The list is currently getting generated in a 
 tag.

Cheers

Antony


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




Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Philip Tong

Matt

Can I configure action mapping as /controller/* rather than /do/*
Thx.

Philip.

 --- Matt Raible <[EMAIL PROTECTED]> ªº¶l¥ó¤º®e¡G> I did convert the
struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 
> --- "Barry L. Kline" <[EMAIL PROTECTED]> wrote:
> > Did you ever figure out how to do this?  I have seen many messages
> > about how great it is to use /do/ but haven't seen anyone mention how
> > to.  I'm just starting with struts and have been modifying Ted's
> > sample (this same thing) but I'm been unable to get anything back from
> > the browser but a blank screen...
> > 
> > Barry
> > 
> > 
> > Matt Raible wrote:
> > > 
> > > I am trying to convert the struts-example application to use:
> > > 
> > >   
> > > action
> > > /do/*
> > >   
> > > 
> > > And in the index.jsp page, I've change the "tour" link from:
> > > 
> > > 
> > > 
> > > 
> > > 
> > > to:
> > > 
> > > 
> > > 
> > > 
> > > 
> > > And have changed nothing in struts-config.xml.  However, when I try to
> > execute
> > > this link (http://localhost/NASApp/struts-example/do/tour), I get the
> > error:
> > > 
> > > [18/Aug/2001 10:16:53:9] info: --
> > > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > > [18/Aug/2001 10:16:53:9] info: --
> > > [18/Aug/2001 10:16:53:9] info: --
> > > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > > [18/Aug/2001 10:16:53:9] info: --
> > > [18/Aug/2001 10:16:53:9] info: --
> > > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
> /tour
> > > [18/Aug/2001 10:16:53:9] info: --
> > > 
> > > But in my struts-config.xml, there is the entry:
> > > 
> > >  > > forward="/tour.htm">
> > > 
> > > 
> > > Anyone know how to fix this?
> > > 
> > > Thanks,
> > > 
> > > Matt
> > >
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> > 
> 
> 
> __
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>  

_
Do you Yahoo!?
¦æ¸U¨½¸ô http://travel.yahoo.com.hk
Comprehensive travel guide at http://travel.yahoo.com.hk

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




RE: ActionError Header/Foorters - can Global vs Non-Global be dif ferentiated

2001-12-05 Thread David Winterfeldt

I'm not 100% sure if this is what you are asking
about, but the Validator Framework has the concept of
levels of validation errors.  You can setup a
validator to depends on another one.  The 'minlength'
validator depends on the 'required' validator.  So
until this level (required) is completed, the next
level will not occur.






You can find the framework in the Struts nightly
builds in the contrib/validator directory or at the
url below.

http://home.earthlink.net/~dwinterfeldt/

David

--- Greg Callaghan <[EMAIL PROTECTED]> wrote:
> Hi Jon, all
> 
> That might be the easiest way for the moment,
> however it doesn't provide the 
> feature that the user ends back at the previous page
> (depending how 
> important one thinks this is).
> 
> Can I assume the current struts error tags don't
> support what I was 
> suggesting below and that if I wanted to do this I
> would have to make a 
> modification to the struts  tag code?
> 
> Cheers
> Greg
> 
> Original Message Follows
> From: "Jon.Ridgway" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'"
> <[EMAIL PROTECTED]>
> Subject: RE: ActionError Header/Foorters - can
> Global vs Non-Global be dif 
> ferentiated
> Date: Wed, 5 Dec 2001 09:39:09 -
> 
> Hi Greg,
> 
> You could try using the standard Struts
> ActionError's mechanism for
> validation errors. Use the standard J2EE exception
> handling mechanism
> errors.
> 
> To do this add error-page entries to your web.xml;
> one for exceptions and
> another for warnings. Then through two types of
> corresponding user-defined
> exceptions from your code.
> 
> Jon.
> 
> -Original Message-
> From: Greg Callaghan
> [mailto:[EMAIL PROTECTED]]
> Sent: 05 December 2001 07:26
> To: [EMAIL PROTECTED]
> Subject: ActionError Header/Foorters - can Global vs
> Non-Global be
> differentiated
> 
> Hi,
> 
> Noting that one may use an ActionError, and struts
> ErrorTag to display both
> GLOBAL and validation errors (non-GLOBAL).
> 
> Currently the header/footer text I use is focused on
> the non-Global errors
> (ie validation errors in a form).  Is there a way
> with struts to throw the
> errors back such that it would be more like the
> following -:
> 
> * Global Error1 (eg for resource not available
> error)
> * Global Error1
> 
>  eg correct validation errors in form
> before proceeding
> * Validation Error 1 - date should be in dd/mm/
> format
> * Validation Error 2
> 
> 
> Regards
> Greg
> 
> 
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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




RE:

2001-12-05 Thread David Winterfeldt

The equivalent of validator:errors is now 
html:messages in the Struts nightly builds.  The
equivalent of validator:errorsExist is now 
logic:messagesPresent in the Struts nightly builds.  I
consider the most recent releases of the Validator to
be in sync with the nightly builds.  If you look at
the revision info
(http://home.earthlink.net/~dwinterfeldt/revision.html),
you can see what Validator version was built/developed
with what version of Struts.

David

--- Alexander  Jesse <[EMAIL PROTECTED]> wrote:
> Hi Mohammed,
> 
> well I still use Struts 1.0 with David's Framework
> in the July-version.
> 
> If you use Struts 1.0.1 or a nightly build, it can
> be that David's
> tags have been moved either into Struts or into the
> Apache commons-project.
> 
> For the newer versions of Struts I cannot give you a
> final answer...
> regards
> Alexander
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: 
> 
> 
> Hi Alexander,
> 
> I read the Doc of Winterfeldt package . The errot
> tag class has been
> deprecated.
> 
> Mohammed
> - Original Message -
> From: "Alexander Jesse" <[EMAIL PROTECTED]>
> To: "struts-user" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 05, 2001 2:09 PM
> Subject: RE: 
> 
> 
> > Hi Mohammed,
> >
> > I do not know... The Winterfeldt tags also allow
> for more flexible
> formatting.
> > That's why I use only them. And they work also, if
> you do not use David's
> > Validation Framework...
> >
> > Alexander
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 05, 2001 2:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: 
> >
> >
> > Hi Alexander,
> >
> > is there a new version of struts which fixes this
> bug
> >
> >
> > Mohammed
> > - Original Message -
> > From: "Alexander Jesse" <[EMAIL PROTECTED]>
> > To: "struts-user" <[EMAIL PROTECTED]>
> > Sent: Wednesday, December 05, 2001 1:14 PM
> > Subject: RE: 
> >
> >
> > > Hi,
> > >
> > > that's a little bug in the 1.0
> struts-error-tags.
> > > I use the error-tags coming with David
> Winterfeldt's validation
> framework.
> > > The are compatible, allow for more flexible
> formatting and work.
> > >
> > > hope this helps
> > > Alexander Jesse
> > >
> > > -Original Message-
> > > From: Mohammed [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, December 05, 2001 12:48 PM
> > > To: Struts Users Mailing List
> > > Subject: 
> > >
> > >
> > > Hi,
> > >
> > > 1)  In my jsp file I insert two error tags as
> follow:
> > >
> > > 
> > > 
> > >
> > > the registrationerror1 is added if the form
> validating of Action1
> fails.
> > > and the reigstrationerror2 is added in action2
> if inserting the new
> > customer
> > > in the database fails.
> > >
> > > if an error occurs in Action2 I am forwarding to
> Action1 which sendes my
> > jsp
> > > file to the browser.
> > > my problem is when no error under the property
> registrationerroe1 is
> added
> > > in Action1 the Errorheader andErrorfooter
> > > are displayed in the browser.
> > > how can I avoid this?
> > > Is there a way I can check if the number of 
> error of the given property
> > > zero is or not before insertinh the Error Tag?
> > >
> > > Thanks for any hint
> > >
> > > Mohammed
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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




Re: action chaining without resetting action forms

2001-12-05 Thread Paul Devine

Joe

I chain actions the way you describe. When you say the action form is
"reset" before the next action gets to process, do you mean (a) specifically
that your ActionForm object's reset() method is invoked and you have
overridden that method to clear out the form?  Or do you mean (b) the object
goes out of scope and a new one gets constructed by the time the second
action gets to process ?  (or something else you are observing?)   If it's
(a) then I don't know of any in-built mechanisms to solve this, you may need
to write some code to manage that yourself.

- Paul


- Original Message -
From: "Joe Faith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 11:54 AM
Subject: action chaining without resetting action forms


> Hi,
>
> I want to 'chain' actions, by setting the forward of one to be
> 'my_action.do'
> The problem is that this resets the action form before calling the next
> action.
> Is there anyway to prevent this, or am I chaining actions in the wrong
> way?
>
> thanks
>
> --
> Joe Faith
> http://www.runtime-collective.com
> T: (+44) 01273 234294
> M: (+44) 07968 292064
>
>
>

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




Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Barry L. Kline

Matt Raible wrote:
> 
> I did convert the struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 

I downloaded your struts-example.zip file -- this is really great! 
Well documented.  I still am having some problems tho... On any of the
links I keep getting a:

Not Found

URL /struts-example/do/logon was not found on this server.  I'm
perplexed -- I added the lines:


JkMount /*.jsp ajp13
JkMount /*.do  ajp13
JkMount /servlet/* ajp13
JkMount /do/*  ajp13

To my httpd.conf file and restarted it.  Any struts *.do files work
but /do/* doesn't.  Any suggestions?

Barry

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




RE: ActionError Header/Foorters - can Global vs Non-Global be dif ferentiated

2001-12-05 Thread Greg Callaghan

Hi Jon, all

That might be the easiest way for the moment, however it doesn't provide the 
feature that the user ends back at the previous page (depending how 
important one thinks this is).

Can I assume the current struts error tags don't support what I was 
suggesting below and that if I wanted to do this I would have to make a 
modification to the struts  tag code?

Cheers
Greg

Original Message Follows
From: "Jon.Ridgway" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: ActionError Header/Foorters - can Global vs Non-Global be dif 
ferentiated
Date: Wed, 5 Dec 2001 09:39:09 -

Hi Greg,

You could try using the standard Struts ActionError's mechanism for
validation errors. Use the standard J2EE exception handling mechanism
errors.

To do this add error-page entries to your web.xml; one for exceptions and
another for warnings. Then through two types of corresponding user-defined
exceptions from your code.

Jon.

-Original Message-
From: Greg Callaghan [mailto:[EMAIL PROTECTED]]
Sent: 05 December 2001 07:26
To: [EMAIL PROTECTED]
Subject: ActionError Header/Foorters - can Global vs Non-Global be
differentiated

Hi,

Noting that one may use an ActionError, and struts ErrorTag to display both
GLOBAL and validation errors (non-GLOBAL).

Currently the header/footer text I use is focused on the non-Global errors
(ie validation errors in a form).  Is there a way with struts to throw the
errors back such that it would be more like the following -:

* Global Error1 (eg for resource not available error)
* Global Error1

 eg correct validation errors in form before proceeding
* Validation Error 1 - date should be in dd/mm/ format
* Validation Error 2


Regards
Greg



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 




_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Barry L. Kline

Matt Raible wrote:
> 
> I did convert the struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 

Thanks!

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




Re: Reloadable Class

2001-12-05 Thread Robert Parker

In your Tomcat config file - is the reloadble attribute set to true for your
webapp? (In Tomcat 3.x this will be in the server.xml file in the conf
directory)

regards

Rob
- Original Message -
From: "ymsha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 06, 2001 12:43 PM
Subject: Reloadable Class


>
>
> > I am using struts with Tomcat.  Eachtime I build the formbean or
> > an action servlet, I should restart the server and then take
> > the new effect.  It cost me too much time when there are many
> > pages there.  I wonder whether there is a method to solve this
> > problem?
> >
> >
>


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




Re: forwarding question

2001-12-05 Thread Robert Parker

I can think of at least two ways...

(1) - each jsp contains a hidden field or other mechanism identifying
itself. Your action handler could then dispatch based on this value. Note
that this works provided you have identified all the possible dispatch
paths...

(2) - You could have a number of instances of the same action handler
configured with each one dispatching to a different results page. For
example a.jsp posts to a.do, b.jsp post to b.do In this case the a.do and
b.do action handlers are the same class, but different instances mapped
under different names. Again you would need to identify all the dispatch
paths.

(3) - you may be able to be completely dynamic - but thats for another
post...

regards

Rob
- Original Message -
From: "Henrik Chua" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, December 06, 2001 12:33 PM
Subject: RE: forwarding question


> i don't want to be pegged into a single page...
> so if my page of origin is a.jsp... then after the action is performed,
the
> page returns to a.jsp.
> if my page of origin is b.jsp, then after the action is performed, the
page
> returns to b.jsp.
>
> coz by "hardcoding" it in the struts-config.xml I will always be
> forwarded to a.jsp after the said action is perform.
>
> thanx. sorry for the unclear question.
> henrik
>
> -Original Message-
> From: Shri [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 5:33 PM
> To: Struts Users Mailing List
> Subject: RE: forwarding question
>
>
> by mapping a.jsp in your struts-config.xml file like this:
>
> assuming you want to use 'success' as the name of the mapping,
>
> 
>
> Shri
>
>
> -Original Message-
> From: Henrik Chua [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 6 December 2001 12:15 PM
> To: Struts Users Mailing List (E-mail)
> Subject: forwarding question
>
>
> Hi!
>
> How should I set the return type of the perform method of my action class
> such that I get back to the same page before the action is performed?
>
> like if i am on the a.jsp page, then I click on a link that does a perform
> method.  I want to get back to the same page as I was. (without hardcoding
> the filename of the page.)
>
>
> thanx in advance.
>
> henrik
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


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




Reloadable Class

2001-12-05 Thread ymsha



> I am using struts with Tomcat.  Eachtime I build the formbean or 
> an action servlet, I should restart the server and then take
> the new effect.  It cost me too much time when there are many 
> pages there.  I wonder whether there is a method to solve this 
> problem?
> 
> 



Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Matt Raible

I did convert the struts-example to use this mapping.  It can be found at
http://www.icsynergy.com/downloads/index.html#struts-example

Online documentation can be found at
http://www.icsynergy.com/downloads/struts/strutsHowTo.html

Hope this helps.

Matt

--- "Barry L. Kline" <[EMAIL PROTECTED]> wrote:
> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
> 
> Barry
> 
> 
> Matt Raible wrote:
> > 
> > I am trying to convert the struts-example application to use:
> > 
> >   
> > action
> > /do/*
> >   
> > 
> > And in the index.jsp page, I've change the "tour" link from:
> > 
> > 
> > 
> > 
> > 
> > to:
> > 
> > 
> > 
> > 
> > 
> > And have changed nothing in struts-config.xml.  However, when I try to
> execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
> error:
> > 
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path /tour
> > [18/Aug/2001 10:16:53:9] info: --
> > 
> > But in my struts-config.xml, there is the entry:
> > 
> >  > forward="/tour.htm">
> > 
> > 
> > Anyone know how to fix this?
> > 
> > Thanks,
> > 
> > Matt
> >
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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




RE: forwarding question

2001-12-05 Thread Henrik Chua

i don't want to be pegged into a single page... 
so if my page of origin is a.jsp... then after the action is performed, the
page returns to a.jsp.
if my page of origin is b.jsp, then after the action is performed, the page
returns to b.jsp.

coz by "hardcoding" it in the struts-config.xml I will always be
forwarded to a.jsp after the said action is perform.

thanx. sorry for the unclear question.
henrik

-Original Message-
From: Shri [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 5:33 PM
To: Struts Users Mailing List
Subject: RE: forwarding question


by mapping a.jsp in your struts-config.xml file like this:

assuming you want to use 'success' as the name of the mapping,



Shri


-Original Message-
From: Henrik Chua [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 6 December 2001 12:15 PM
To: Struts Users Mailing List (E-mail)
Subject: forwarding question


Hi!

How should I set the return type of the perform method of my action class
such that I get back to the same page before the action is performed?

like if i am on the a.jsp page, then I click on a link that does a perform
method.  I want to get back to the same page as I was. (without hardcoding
the filename of the page.)


thanx in advance.

henrik

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: forwarding question

2001-12-05 Thread Shri

by mapping a.jsp in your struts-config.xml file like this:

assuming you want to use 'success' as the name of the mapping,



Shri


-Original Message-
From: Henrik Chua [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 6 December 2001 12:15 PM
To: Struts Users Mailing List (E-mail)
Subject: forwarding question


Hi!

How should I set the return type of the perform method of my action class
such that I get back to the same page before the action is performed?

like if i am on the a.jsp page, then I click on a link that does a perform
method.  I want to get back to the same page as I was. (without hardcoding
the filename of the page.)


thanx in advance.

henrik

--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




forwarding question

2001-12-05 Thread Henrik Chua

Hi! 

How should I set the return type of the perform method of my action class
such that I get back to the same page before the action is performed?

like if i am on the a.jsp page, then I click on a link that does a perform
method.  I want to get back to the same page as I was. (without hardcoding
the filename of the page.) 


thanx in advance.

henrik

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




RE: action mapping as /do/* rather than *.do

2001-12-05 Thread Phase Communcations

I use this kind of mapping successfully and I prefer it way over *.do. Read
the Ted Husted website under catalog. I follow his suggestions and I have
had great success.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Scott A. Roehrig [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 6:03 PM
To: Struts Users Mailing List
Subject: Re: action mapping as /do/* rather than *.do


I think from another post, the problem lies in that the request is being
redirected rather than forwarded. Upon the redirect, the webserver chokes on
it. Perhaps the answer is to use the subclass of ActionForward that sets
forwarding to true by default.

Haven't had the time to check this. However, I get the same error with
mappings like this.

Scott
- Original Message -
From: "Barry L. Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 7:22 PM
Subject: Re: action mapping as /do/* rather than *.do


> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
>
> Barry
>
>
> Matt Raible wrote:
> >
> > I am trying to convert the struts-example application to use:
> >
> >   
> > action
> > /do/*
> >   
> >
> > And in the index.jsp page, I've change the "tour" link from:
> >
> > 
> > 
> > 
> >
> > to:
> >
> > 
> > 
> > 
> >
> > And have changed nothing in struts-config.xml.  However, when I try to
execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
error:
> >
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
/tour
> > [18/Aug/2001 10:16:53:9] info: --
> >
> > But in my struts-config.xml, there is the entry:
> >
> >  > forward="/tour.htm">
> > 
> >
> > Anyone know how to fix this?
> >
> > Thanks,
> >
> > Matt
> >
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>

--
To unsubscribe, e-mail:

For additional commands, e-mail:





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




Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Scott A. Roehrig

I think from another post, the problem lies in that the request is being
redirected rather than forwarded. Upon the redirect, the webserver chokes on
it. Perhaps the answer is to use the subclass of ActionForward that sets
forwarding to true by default.

Haven't had the time to check this. However, I get the same error with
mappings like this.

Scott
- Original Message -
From: "Barry L. Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 7:22 PM
Subject: Re: action mapping as /do/* rather than *.do


> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
>
> Barry
>
>
> Matt Raible wrote:
> >
> > I am trying to convert the struts-example application to use:
> >
> >   
> > action
> > /do/*
> >   
> >
> > And in the index.jsp page, I've change the "tour" link from:
> >
> > 
> > 
> > 
> >
> > to:
> >
> > 
> > 
> > 
> >
> > And have changed nothing in struts-config.xml.  However, when I try to
execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
error:
> >
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: --
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
/tour
> > [18/Aug/2001 10:16:53:9] info: --
> >
> > But in my struts-config.xml, there is the entry:
> >
> >  > forward="/tour.htm">
> > 
> >
> > Anyone know how to fix this?
> >
> > Thanks,
> >
> > Matt
> >
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>

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




Re: How do I set the value of a "value" tag in jsp file with a bean value.

2001-12-05 Thread antony

Sorry, In my case, userstag is not a bean, it is an iterate reference, 
so when I have tried










it does not work,  my html code which is generated has in it

value="<%userstag.userName%>"

Do I need to use a custom tag?

Cheers

Tony









Alvin Kutttikkat Antony wrote:

> Hello,
> Why don't u try this way? but I have tryed this in property field and it is working! 
> 
>  value="<%=userstag.userName%>"/>
> 
> 
> 
> alvin kuttikkat antony
> Internet und Virtuelle Hochshule
> Directory
> Universität München
> 
> Leopoldstr .3
> 80802 München
> Germany
> 
> Office Tel + 49.89.21025979
> Office Fax + 49.89.21025980
> 
> 
> 
[EMAIL PROTECTED] 12/04/01 01:49am >>>

> Hi
> 
> I want to put a radio button in a form and have the value of the "value" 
> field to come from a bean, only I don't know how to do this.  The 
> incorrect way to writting this is
> 
>  value=" filter="true"/>"
> />
> 
> Which will give problems, how can I set the value of the "value" field 
> to a value in a bean?
> 
> Cheers
> 
> Tony
> 




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




Re: action mapping as /do/* rather than *.do

2001-12-05 Thread Barry L. Kline

Did you ever figure out how to do this?  I have seen many messages
about how great it is to use /do/ but haven't seen anyone mention how
to.  I'm just starting with struts and have been modifying Ted's
sample (this same thing) but I'm been unable to get anything back from
the browser but a blank screen...

Barry


Matt Raible wrote:
> 
> I am trying to convert the struts-example application to use:
> 
>   
> action
> /do/*
>   
> 
> And in the index.jsp page, I've change the "tour" link from:
> 
> 
> 
> 
> 
> to:
> 
> 
> 
> 
> 
> And have changed nothing in struts-config.xml.  However, when I try to execute
> this link (http://localhost/NASApp/struts-example/do/tour), I get the error:
> 
> [18/Aug/2001 10:16:53:9] info: --
> [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> [18/Aug/2001 10:16:53:9] info: --
> [18/Aug/2001 10:16:53:9] info: --
> [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> [18/Aug/2001 10:16:53:9] info: --
> [18/Aug/2001 10:16:53:9] info: --
> [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path /tour
> [18/Aug/2001 10:16:53:9] info: --
> 
> But in my struts-config.xml, there is the entry:
> 
>  forward="/tour.htm">
> 
> 
> Anyone know how to fix this?
> 
> Thanks,
> 
> Matt
>

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




Re: RE: Populating form in the action

2001-12-05 Thread John Ng

The form passed in is a null because that Action is
called the first time I type in the URL (.do), not
after a form has been submited.

In other words, I would like to "pre-populate" the
form before displaying it.

Thanks
John



--- Joey Gibson <[EMAIL PROTECTED]> wrote:
> > 
> > For instance, I create a ActionForm in the perform
> > method of the Action class, and then forward the
> > control to a jsp page.  How does the JSP page know
> > that the form that it gets is the form that just
> get
> > populated in the Action before?  
> 
> Don't create an instance of the form, use the one
> that is passed in to your perform(...) method. You
> will need to cast it, of course.
> 
> Joey
> 
> --
> Sent via jApache.org
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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




RE: Struts 1.1 book available for order

2001-12-05 Thread Robert D. Morse

Turns out, this isn't quite true.  I ordered the book, but now find out that
they won't receive it from the publisher until 4-Jan-2002.  Oh well.

-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 9:26 AM
To: [EMAIL PROTECTED]
Subject: Struts 1.1 book available for order


http://www.atlasbooks.com/marktplc/00670.htm

You can order it today, and it will ship next week.

It will be on Amazon, etc. in a few more weeks, it takes time. This is
the fastest way I know to publish it.

Vic


--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




Test

2001-12-05 Thread gwhite512





RE: Ted's catalog

2001-12-05 Thread Dave J Dandeneau

www.husted.com/struts... 

dave dandeneau

-Original Message-
From: Knee, Jeff [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 4:40 PM
To: 'Struts Users Mailing List'
Subject: Ted's catalog


All,

Alexander Jesse wrote:
> - Ted's "Catalog"

I'm relatively new to the list but a few times on the list, I've seen
mention of "Ted's catalog" without much more info about it... from
context
I'm guessing it is a collection of tips and recipes and best
practices...

Is this a Struts site that the "in club" knows about and I've missed out
on?
Is there a URL?

Is this "Ted" as in "Ted Husted"?

+= Jeff Knee

--
To unsubscribe, e-mail:

For additional commands, e-mail:





RE: Ted's catalog

2001-12-05 Thread Cakalic, James P.

You guessed correctly. His Struts page is here:
http://husted.com/struts/

The catalog in question is here:
http://husted.com/about/scaffolding/catalog.htm

Excellent site to bookmark.
Best regards,
Jim Cakalic

> -Original Message-
> From: Knee, Jeff [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 3:40 PM
> To: 'Struts Users Mailing List'
> Subject: Ted's catalog
> 
> 
> All,
> 
> Alexander Jesse wrote:
> > - Ted's "Catalog"
> 
> I'm relatively new to the list but a few times on the list, I've seen
> mention of "Ted's catalog" without much more info about it... 
> from context
> I'm guessing it is a collection of tips and recipes and best 
> practices...
> 
> Is this a Struts site that the "in club" knows about and I've 
> missed out on?
> Is there a URL?
> 
> Is this "Ted" as in "Ted Husted"?
> 
> += Jeff Knee
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 


Confidentiality Warning:  This e-mail contains information intended 
only for the use of the individual or entity named above.  If the reader of this 
e-mail is not the intended recipient or the employee or agent responsible for 
delivering it to the intended recipient, any dissemination, publication or copying of 
this e-mail is strictly prohibited. The sender does not accept any responsibility for 
any loss, disruption or damage to your data or computer system that may occur while 
using data contained in, or transmitted with, this e-mail.   If you have received this 
e-mail in error, please immediately notify us by return e-mail.  Thank you.




Ted's catalog

2001-12-05 Thread Knee, Jeff

All,

Alexander Jesse wrote:
> - Ted's "Catalog"

I'm relatively new to the list but a few times on the list, I've seen
mention of "Ted's catalog" without much more info about it... from context
I'm guessing it is a collection of tips and recipes and best practices...

Is this a Struts site that the "in club" knows about and I've missed out on?
Is there a URL?

Is this "Ted" as in "Ted Husted"?

+= Jeff Knee

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




CachedRowSet and toCollection() method

2001-12-05 Thread tnist

Hello,

I am using the CachedRowSet object from sun for our data access and
manipulation within Struts.  There is a method on it, "toCollection()" which
according to the documentation should return a collection of the rows.  My
code is generating a valid result set but when I issue the "toCollection()"
method on the CachedRowSet I get the following exception thrown:

java.lang.ClassCastException: java.util.TreeMap
at
sun.jdbc.rowset.CachedRowSet.toCollection(CachedRowSet.java:1057)

The basic code fragment which throws the exception looks like this:

Collection myCollection = null;
CachedRowSet crs = null;

// do necessary setup and obtain valid CachedRowSet;
try{
crs.execute(getCon());
crs.first();
myCollection = crs.toCollection();
}

I am not sure where the "Casting" exception is coming from. 

Any suggestions are greatly appreciated.

Regards,

Todd G. Nist 
Email:   [EMAIL PROTECTED] 

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




Your email was rejected (automatic email filter rule for EXE)

2001-12-05 Thread Frot

Hi,

Your email contained a Executable Attachment. 
I do not accept Executable Attachments.

Regards, 

Frot's Messagebox

P.S. If you think this message is not correct just drop me a line.

P.P.S. This is a generated message


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




RE: Can a form submit to a vector?

2001-12-05 Thread dhay



Hey Alex,

Not sure if I understand your setup.  If I were doing this, I would just have
the iterate at the top of the page, and a form at the bottom.  When the form is
submitted, the action adds the entry to the vector used in the top of the page,
and goes back to the same page.  Am I misunderstanding something?

Cheers,

Dave





"Alex Colic" <[EMAIL PROTECTED]> on 12/04/2001
08:19:25 AM

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

To:   "Struts" <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: Can a form submit to a vector?



Yes,

I want a form when submitted to add a new object to the vector.


IE: I have a class with a getCharging method that returns a vector. The
vector holds charging objects. In the top half of the page I iterate through
the vector and show a table of existing objects. In the bottom half of the
page I want to create a form that when submitted adds another object to the
vector.

Thanks for any help.


Alex

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 1:01 PM
To: Struts Users Mailing List
Subject: Re: Can a form submit to a vector?




Do you mean dynamically?  ie another row added to the vector above it
without a
submit?

Dave





"Alex Colic" <[EMAIL PROTECTED]> on 12/03/2001
12:40:57 PM

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

To:   "Struts" <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Can a form submit to a vector?



Hi,

I have a vector that holds charging objects. The object has properties such
as name and amount.
On a page, at the top I iterate through the charging objects and create a
summary table. The table shows all the charging objects in the charging
vector and outputs their name and amount.

At the bottom of the page I want to create a form that the user can use to
enter the name and amount details for another charging object, hit submit
and have a new charging object added to the vector. Can this be done?

Thanks a lot.

Alex


--
To unsubscribe, e-mail:

For additional commands, e-mail:










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








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




Re: JSPs past WEB-INF --- Please Help!

2001-12-05 Thread Matt Raible

Here is what I did:

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

--- Dave J Dandeneau <[EMAIL PROTECTED]> wrote:
> I have been trying to figure this out for a while now, but have had no
> luck. Any help would be s greatly appreciated. Here it is:
> 
> If you place your jsps past the WEB-INF and do not hit them directly
> then what is the easiest way to implement a "first-visit". i.e. the
> first time you go to a page it doesn't show the errors, but each other
> time it does? I have done this otherwise by having them go directly to
> the jsp the first time, and then having them submit to the action, but I
> can't send them directly to the JSP if it is past the WEB-INF. I have
> also done this by creating a new mapping that set validate="false", but
> then there is some duplication as far as the mappings. Is there any
> easier way to do it?
> 
> Thanks for the help in advance,
> dave dandeneau
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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




JSPs past WEB-INF --- Please Help!

2001-12-05 Thread Dave J Dandeneau

I have been trying to figure this out for a while now, but have had no
luck. Any help would be s greatly appreciated. Here it is:

If you place your jsps past the WEB-INF and do not hit them directly
then what is the easiest way to implement a "first-visit". i.e. the
first time you go to a page it doesn't show the errors, but each other
time it does? I have done this otherwise by having them go directly to
the jsp the first time, and then having them submit to the action, but I
can't send them directly to the JSP if it is past the WEB-INF. I have
also done this by creating a new mapping that set validate="false", but
then there is some duplication as far as the mappings. Is there any
easier way to do it?

Thanks for the help in advance,
dave dandeneau



Struts Simple - Ted Husted

2001-12-05 Thread iT meDic

Hello All,

I am utilizing Ted Husted's struts simple example. I have a specific 
question for the activity1.java file.

I am trying to write the values collected to a text file. i have managed to 
do that with relative ease however, what i really want to do is to write the 
values to the text file once the form has been submitted, (i.e. after the 
last step) here is my code which writes to the text file after every page, i 
know this is pretty straightforward for you, but a bit complex for me, i 
would appreciate any help.

package hfa.register;




import java.io.IOException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;

// import java.sql.SQLException;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import hfa.register.Form;

/**
* Insert, Select, Update, or Delete row from table.
*/
public final class Pubreg1 extends Action {

 public static final String ACCESS_TASKS = 
"input,insert,select,update,delete,";
 public static int STEP_CONTINUE = 0;
 public static int STEP_FIRST = 1;
 private static int STEP_SECOND  = 2;
 private static int STEP_THIRD  = 3;
 private static int STEP_FOURTH  = 4;
 private static int STEP_FIFTH  = 5;
 private static int STEP_LAST  = 6;
 private static String ACTIVITY = "pubreg1.";


// - Protected 
Methods


/**
 * Prepopulate properties, if needed
 * Return next step
 */
protected int input(int step) {
if (step==STEP_CONTINUE) step = STEP_FIRST;
return step;
}



/**
 * Commit data to model; clear conext
 * Return next step
 */
protected int commit(HttpServletRequest request, ActionMapping mapping) 
{
request.getSession().removeAttribute(mapping.getName());
return STEP_CONTINUE;
}

/**
 * Scroll to next or previous step.
 * Commit data if at last step
 * Return next step
 */
protected int insert(int step, HttpServletRequest request, ActionMapping 
mapping) {
   String submit = request.getParameter("submit");
if ("BACK".equals(submit)) step--;

else {

if ("EDITPUBREG1".equals(submit))
 step = STEP_LAST-6;

  if ("EDITPUBREG2".equals(submit))
 step = STEP_LAST-5;

  if ("EDITPUBREG3".equals(submit))
 step = STEP_LAST-4;

if (step==STEP_LAST)
step = commit(request,mapping);
else step++;
}
return step;
}






// - Public 
Methods
public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {

// -- isCancelled?
if (isCancelled(request)) {
// form.reset(mapping,request);
return (mapping.findForward("cancel"));
}

// -- Prerequesites
ActionErrors errors = new ActionErrors();
String task = mapping.getParameter();
if (task==null)
request.getParameter("task");

// -- Check Parameters
if ((task==null) ||
(ACCESS_TASKS.indexOf(task)<0)) {
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("action.missing.parameter"));
}

// -- Other locals
Form simpleForm = (Form) form;
int step = simpleForm.getPage();

// -- Select database task (but in try .. catch)
if (errors.empty()) {

// -- INPUT --
if ("input".equals(task))
step = input(step);

// -- INSERT --
if ("insert".equals(task))
step = insert(step, request, mapping);

 try {
FileOutputStream outStream = new 
FileOutputStream("C:\\pubreg.txt");
PrintStream printStream = new 
PrintStream(outStream,true);

printStream.println(simpleForm.getPrevious_business());

printStream.println(simpleForm.getTaxpayer_id_number()); //page 2 values


printStream.close();
}
catch (IOException ioex) {
  
System.err.println("HFASyncLogger:initOutput():File=");
}


} // end try

// -- Report any

RE: setting a default bean for logic tags

2001-12-05 Thread Siggelkow, Bill

I believe that the name attribute can take a request-time expression that
you could
use for this purpose.

-Original Message-
From: Mike Hoeffner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: setting a default bean for logic tags



Is it possible to set a default bean for logic tags like it is for form tags
so that they don't have to be named in each logic tag?

If I don't specify the "name" in an  tag, the "name" from the
parent form and its corresponding action tag will be used.  For example, in
the below  tag, fooForm will be used as the "name" from the
parent form since the "name" is not specified.

 
 ...
 

 

Is there a way to do this with logic tags?  I have lots of redundant logic
tags that need to use different beans, but since I have to have a different
value for the "name" on all of them, there's no clean way to reuse the JSP.

Thanks,
Mike


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




Re: RE: Populating form in the action

2001-12-05 Thread Joey Gibson

> 
> For instance, I create a ActionForm in the perform
> method of the Action class, and then forward the
> control to a jsp page.  How does the JSP page know
> that the form that it gets is the form that just get
> populated in the Action before?  

Don't create an instance of the form, use the one that is passed in to your 
perform(...) method. You will need to cast it, of course.

Joey

--
Sent via jApache.org

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




setting a default bean for logic tags

2001-12-05 Thread Mike Hoeffner


Is it possible to set a default bean for logic tags like it is for form tags
so that they don't have to be named in each logic tag?

If I don't specify the "name" in an  tag, the "name" from the
parent form and its corresponding action tag will be used.  For example, in
the below  tag, fooForm will be used as the "name" from the
parent form since the "name" is not specified.

 
 ...
 

 

Is there a way to do this with logic tags?  I have lots of redundant logic
tags that need to use different beans, but since I have to have a different
value for the "name" on all of them, there's no clean way to reuse the JSP.

Thanks,
Mike


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




RE: Populating form in the action

2001-12-05 Thread Siggelkow, Bill

It knows because you access the form via the  tag.

-Original Message-
From: John Ng [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 2:25 PM
To: Struts Users Mailing List
Subject: Populating form in the action 


Hi, I have some questions about how to populate the
form in the action.

For instance, I create a ActionForm in the perform
method of the Action class, and then forward the
control to a jsp page.  How does the JSP page know
that the form that it gets is the form that just get
populated in the Action before?  (Provided the form is
the request scope).

Thanks
John


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




Tiles component Verify Error!!!!

2001-12-05 Thread iT meDic

Hi,

I have come across a very peculiar error.
I have built an application on my computer using Struts/Tiles and it works 
like a charm , however when i move it to another computer i get a very 
strange error message.

My computer is Windows 2000 Professional, running resin v2.0.2. When i move 
it to another Windows 2000 professional computer the site works fine. If i 
move it to Windows XP or Windows Advanced Server or if i try to run it in 
resin 2.0.4 , i get the following error message :-

500 Servlet Exception
java.lang.VerifyError: (class: 
org/apache/struts/tiles/ActionComponentServlet,
method: processValidate signature: 
(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Z)
IncoÂ
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at java.beans.Beans.instantiate(Beans.java:207)
at java.beans.Beans.instantiate(Beans.java:51)
at 
com.caucho.server.http.Application.instantiateServlet(Application.java:2804)
at com.caucho.server.http.Application.createServlet(Application.java:2753)
at com.caucho.server.http.Application.loadServlet(Application.java:2711)
at com.caucho.server.http.Application.initServlets(Application.java:1763)
at com.caucho.server.http.Application.init(Application.java:1698)
at 
com.caucho.server.http.VirtualHost.restartApplication(VirtualHost.java:1340)
at com.caucho.server.http.VirtualHost.getInvocation(VirtualHost.java:992)
at 
com.caucho.server.http.ServletServer.getInvocation(ServletServer.java:935)
at com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:845)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213)
at 
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)



I have searched the message boards, and my page is not big at all(its a 
login screen). All i am using is Cedric's tiles componentdefinitions.xml to 
load my top and submenu's. I have tried everything but it just does not 
work. I have even rebuilt my computer and it works on it perfectly but just 
would not work on any of the production boxes? can anyone help or has a 
similar problem?











_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Populating form in the action

2001-12-05 Thread John Ng

Hi, I have some questions about how to populate the
form in the action.

For instance, I create a ActionForm in the perform
method of the Action class, and then forward the
control to a jsp page.  How does the JSP page know
that the form that it gets is the form that just get
populated in the Action before?  (Provided the form is
the request scope).

Thanks
John


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

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




RE: Indexed tags & iterate tag problems

2001-12-05 Thread Jeff Martin

Along those lines, is there a struts debug var (in the servlet's config
params for example) that will print/log messages when it gets a request
param that it can't map to an ActionForm setter? It seems this would be
very helpful when developing pages. Optimally, output could look
something like:

   populate: request param 'foo' not set. No method "void
setFoo(String)" in class a.b.c
   populate: request param 'bar' not set. No method "String getBar()" in
class a.b.c
   populate: request param 'customer.name' not set. No method "void
setName(String)" in class com.x.Customer
   populate: request param 'internal' not set. Method "void
setInteral(String)" must be public in class a.b.c

Jeff

-Original Message-
From: Mike Ashamalla [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 2:01 PM
To: Struts Users Mailing List
Subject: RE: Indexed tags & iterate tag problems


Dave,

Thank you very much for the help!!  That seems to have done the trick.
I
won't make that mistake again.  I think the hard part was that Struts
never
generated an error when it couldn't find the appropriate setter.  The
sample
code really helped as well.  Thanks again!

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




RE: Writing to the ActionServlet response

2001-12-05 Thread Greg Lehane

Dave,

  Not sure if this is what you mean, but you can do something like this:

  File fileToExport = new File("some text");

response.setContentType("...");
response.setHeader("...","...");

PrintWriter out = response.getWriter();
out.println(exportFile);
out.close();

  In IE this will open the "save file" dialog prompting users to
download the file or open from current location. You should be able to
write text to out also.

- Greg

-Original Message-
From: Firmin David [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:42 AM
To: '[EMAIL PROTECTED]'
Subject: Writing to the ActionServlet response


Hi All, 
I'm keen to be able to write out a dynamically generated file to the
client.

Is there a way I can write it straight to the ActionServlet response
from
the Struts Action.perform() method I'm in, or is there a better way?
I know I have access to the response in the perform method, but will
writing
straight to it really work??

Thanks and regards
Dave



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




Writing to the ActionServlet response

2001-12-05 Thread Firmin David

Hi All, 
I'm keen to be able to write out a dynamically generated file to the client.

Is there a way I can write it straight to the ActionServlet response from
the Struts Action.perform() method I'm in, or is there a better way?
I know I have access to the response in the perform method, but will writing
straight to it really work??

Thanks and regards
Dave



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


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




RE: Indexed tags & iterate tag problems

2001-12-05 Thread Mike Ashamalla

Dave,

Thank you very much for the help!!  That seems to have done the trick.  I
won't make that mistake again.  I think the hard part was that Struts never
generated an error when it couldn't find the appropriate setter.  The sample
code really helped as well.  Thanks again!

Thank You,


Mike Ashamalla, CEBS
VistaXtreme
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 9:18 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Indexed tags & iterate tag problems




Taking a closer look at your code - first thing to check is capitalization
of
your EmploymentInfoField - it must have a small 'e' - lots of messages about
bean naming scheme in list, eg
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg04762.html.

Cheers,

Dave







"Mike Ashamalla" <[EMAIL PROTECTED]> on
12/04/2001 03:39:25 PM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: Indexed tags & iterate tag problems



Anyone know the answer to this???  It seems that there are two of us with
exactly the same problem (see "iterate tag problems (sorry !!)" from Eddie
Fung [[EMAIL PROTECTED]]).

Bottom line: When using indexed tags inside an iterate tag, the setters
don't seem to be setting the new values.

If this has already been answered elsewhere, please just point us in the
right direction. :)

Thank You,


Mike Ashamalla, CEBS
VistaXtreme
[EMAIL PROTECTED]

-Original Message-
From: Mike Ashamalla [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 6:42 PM
To: Struts-User
Subject: Indexed tags


Hi All!

I apologize if this question has been asked before.  I'm trying to implement
indexed tags and I can't figure out where the values are being set (ie -
where should me setters be and what should they look like).  The form
displays the prompts and values perfectly, but when I submit it the new
values don't seem to be posting to the formbean.  I've read as many posts
and archives as I could find, but still don't see what I'm doing wrong.  One
archived post stated "... this will be translated by struts into a call
ParametersForm.getParameter(0).setValue(value) ...".  The setValue method in
EmploymentInfoField (see below) is not being called, though.  No errors are
being generated either (when I submit the form).  The HTML source that is
produced looks like this: 

BTW - I'm using Struts nightly build from 11/28/2001 and Tomcat 3.2.2

I've seen many posts that didn't have enough information/code for people to
help, so I'm including as much as possible.  Sorry for the long post.  Thank
you in advance!


***
JSP Code:

   

   
  

  
  

  
  
  



***

***
EmploymentInfoForm:

public class EmploymentInfoForm extends ActionForm {

private Vector employmentInfoFieldList = new Vector();

...

public EmploymentInfoField getEmploymentInfoField(int index) {
return (EmploymentInfoField) employmentInfoFieldList.get(index);
}

public Vector getEmploymentInfoFieldList() {
return employmentInfoFieldList;
}

private void addEmploymentInfoField(String dbFieldName,
int dataType,
String labelKey,
String value) {
EmploymentInfoField eField;

eField = new EmploymentInfoField();
eField.setDbFieldName(dbFieldName);
eField.setDataType(dataType);
eField.setLabelKey(labelKey);
eField.initValue(value);
employmentInfoFieldList.add(eField);
}
}

***

***
EmploymentInfoField:

public class EmploymentInfoField {

private int dataType;
private String dbFieldName = null;
private String labelKey = null;
private String value = null;
private boolean valueChanged = false;

/**
 * Return the dataType
 *
 * @return the dataType
 */
public int getDataType() {
return dataType;
}

/**
 * Set the dataType.
 *
 * @param dataType The new dataType
 */
public void setDataType(int dataType) {
  this.dataType = dataType;
}

/**
 * Return the dbFieldName
 *
 * @return the dbFieldName
 */
public String getDbFieldName() {
return dbFie

RE: Business objects as ActionForms

2001-12-05 Thread Jeff Martin

On a similar topic, what is the recommended way to move data from the
form beans [subclass of ActionForm] to my business objects. Is it:

A) in each getter and setter, such as:
No member variables
public String getFirstName() { return customer.getFirstName(); }
public void setFirstName(String value) { customer.setFirstName(value); }

B) populate and dump the ActionForm's data in one go, such as:
private String firstName; /* member variable */
public String getFirstName() { return firstName; }
public void setFirstName(String value) { firstName = value; }
public void saveToCustomer() { customer.setFirstName(firstName); }
public void retrieveFromCustomer() { firstName =
customer.getFirstName(); }

If B, where are saveToCustomer() and retrieveFromCustomer() normally
called?

Thanks

Jeff

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




RE: html:link href to external URL in a

2001-12-05 Thread Rob Breeds

No way to do this with purely Struts tags?

Thanks

Rob Breeds




   
  
"Siggelkow, Bill"  
  
   
irant.com>  cc:
  
Subject: RE: html:link href to 
external URL in a 
05/12/2001 16:17   
  
Please respond to  
  
"Struts Users  
  
Mailing List"  
  
   
  
   
  




You can do this by just coding the link in with an HTML anchor tag as
folows:
">



or use an expression





-Original Message-
From: Rob Breeds [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 11:03 AM
To: Struts Users Mailing List
Subject: html:link href to external URL in a



Hi

This may be in the FAQ/archive but I can't find it!

If I have a dynamically generated external URL available in the
request/session object, e.g. "http://www.banana.com";, how do I write a
 tag such that the link takes the user to that external
URL? (Without using scriptlets?)

I effectively want to do: ">



but can't do nested tags.

How do I dynamically populate the content of the href attribute?

Help please!

Thanks

Rob Breeds




--
To unsubscribe, e-mail:

For additional commands, e-mail:


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





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




action chaining without resetting action forms

2001-12-05 Thread Joe Faith

Hi,

I want to 'chain' actions, by setting the forward of one to be
'my_action.do'
The problem is that this resets the action form before calling the next
action.
Is there anyway to prevent this, or am I chaining actions in the wrong
way?

thanks

--
Joe Faith
http://www.runtime-collective.com
T: (+44) 01273 234294
M: (+44) 07968 292064





RE: HELP with accessing indexed, nested properties in Action

2001-12-05 Thread Tom Klaasen (TeleRelay)

Hi John,

I think you'll like http://www.keyboardmonkey.com/struts: a set of
taglibs for struts that allows better access to indexed and mapped
properties.

hth,
tomK


> -Original Message-
> From: John Kowalik [mailto:[EMAIL PROTECTED]] 
> Sent: woensdag 5 december 2001 17:30
> To: Struts Users Mailing List
> Subject: RE: HELP with accessing indexed, nested properties in Action
> 
> 
> Dave,
> 
>   I still can't get this to work.  I'm not sure which code on 
> that page I
> should be using?  Can you send me your source files from this 
> example?  I
> would REALLY appreciate it.
> 
>   No matter what I seem to do, whenever I sumit the form, the 
> Action can get
> all the 'normal' properties out of the form, but when I try 
> to access the
> Array (or Vector) of beans, it always comes back as non-null, 
> but with a
> size of 0.
> 
> Thanks for any help you can provide,
> --John
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 30, 2001 12:02 PM
> To: Struts Users Mailing List
> Subject: Re: HELP with accessing indexed, nested properties in Action
> 
> 
> 
> 
> I posted working example a while back.  see
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg
> 12084.html
> 
> HTH,
> 
> Dave
> 
> 
> 
> 
> 
> "John Kowalik" <[EMAIL PROTECTED]> on 
> 11/30/2001 09:45:39
> AM
> 
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
> 
> To:   "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  HELP with accessing indexed, nested properties in Action
> 
> 
> 
> 
>   I have search the archive and seen this bounced around, but 
> can't seem to
> find a complete working example. I have:
> 
> FormBean where one property is an Array of SomeBean;
> 
> SomeBean has three properties, two int, one string;
> 
> FormBean inits properly with an Array of SomeBean (via 
> another Action);
> 
> form.jsp iterates over array of SomeBeans, creates indexed 
> text input boxes.
> These display just fine.
> 
> When I submit the form, the Action can't get at (or I don't 
> understand how
> to access) the SomeBean Array.  If I kick back to the form, 
> the other form
> fields keep any changed values, but the SomeBean Array goes null.
> 
>   I've been banging my head on this forever, so I would 
> really appreciate
> any help!  I've got the nightly build from 11/28/01 running
> 
> Thanks,
> --John
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
>  [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: 
> 
> 

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




Application root in javascript

2001-12-05 Thread Thinh Doan

In my app., I have a link ( tag) to call a javascript to open a child
window:

function openit(myjsp) {
winprops = 'scrollbars,resizable,menubar';
win = window.open(myjsp, 'childwin', winprops);
}

The problem I have is window.open takes myjsp from its current path,
eventhough I had set  in my template.  How can I set window.open
to behave like html:base since myjsp.jsp resides in [myapproot]/jsp/?

Thank you very much in advance for your time.

Regards,

Thinh


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




Re: Tomcat 3.2.3+mod_jk

2001-12-05 Thread Martin Samm

have you amended the mod_jk.conf-auto file (after tomcat has started) to 
include the .do mapping:

Change the first JkMount block from 

JkMount /*.jsp ajp12
JkMount /servlet/* ajp12

to 

JkMount /*.jsp ajp12
JkMount /*.do ajp12
JkMount /servlet/* ajp12


On Wednesday 05 Dec 2001 4:56 pm, you wrote:
> Hello all,
>
> Would you give me some advice?
> I try to use struts 1.0 under tomcat 3.2.3 + mod_jk.
> I modified mod_jk.conf to add 'JkMount /*.do ajp13'.
> But .do files are not found.
> I tried Tomcat 3.3 but result was same.
>
> Please let me know how to set up struts with mod_jk.
>
> Regards.
>
> Daiju Kato
> e-mail:[EMAIL PROTECTED]

-- 
Martin Samm
[EMAIL PROTECTED]

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




RE: Cannot find ActionMappings or ActionFormBeans collection

2001-12-05 Thread Chappell, Simon P

I not only stop and restart Tomcat, but I blow away the deployed version
of the app and redeploy.

Anyway, it now looks like my problem are with the struts-config.xml
and/or the web.xml files.

I agree that struts either needs to be friendlier with it's error
messages or much more tolerant of new users and their errors.

Simon

>-Original Message-
>From: Keith Bacon [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 05, 2001 11:00 AM
>To: Struts Users Mailing List
>Subject: Re: Cannot find ActionMappings or ActionFormBeans collection
>
>
>Simon,
>A wild shot but best I can suggest
>When I've recompiled classes, instead of the new class
>loading automatically I start getting struts messages
>(things not found). Restarting Tomcat fixes them - but
>I'm sure you've tried that a million times.
>Please - experts hear this persons plea - I went thru
>similar grief with struts.
>I like software that forgives user errors & doesnt lay
>traps for less experienced users!
>Keith.
>
>
> 
>--- "Chappell, Simon P" <[EMAIL PROTECTED]>
>wrote:
>> I have battled this for a week and searched the
>> Internet high and low
>> for answers. After checking the syntax and
>> correctness of web.xml and
>> struts-config.xml and receiving no errors when I
>> compile and making
>> certain that my classes and JAR files are in the
>> correct directories and
>> that I don't have struts.jar in my classpath, I am
>> now completely stuck.
>> 
>> I am using struts 1.0.1, Tomcat 4.0.1, JDK 1.4.0
>> beta 3, RedHat Linux
>> 7.2. I've also tried a very similar setup using
>> Cygwin on Windows 2000
>> Professional.
>> 
>> The struts-example application works just fine. So I
>> tried to create my
>> own simple test application. Most of my test pages
>> work, a plain HTML
>> page, a simple JSP that uses the  tag
>> works, but when I try
>> to use anything more then I get the famous newbie
>> error:
>> 
>> Cannot find ActionMappings or ActionFormBeans
>> collection
>> 
>> The problem with this newbie error is that there are
>> lots of us asking
>> about it and precious few answers (according to the
>> search results). I
>> am very determined to get the hang of struts, but
>> how many people have
>> been scared off because of this error?
>> 
>> I would like to get some input on what I should
>> check first. I'm willing
>> and able to dive in but need guidance as to where to
>> look first.
>> 
>> All help gratefully appreciated.
>> 
>> Simon
>> 
>>
>-
>> Simon P. Chappell
>> [EMAIL PROTECTED]
>> Web Developer / Programming Specialist  
>> www.landsend.com
>> Lands' End, Inc.  
>> (608) 935-4526
>> 
>> --
>> To unsubscribe, e-mail:  
>> 
>> For additional commands, e-mail:
>> 
>> 
>
>
>__
>Do You Yahoo!?
>Buy the perfect holiday gifts at Yahoo! Shopping.
>http://shopping.yahoo.com
>
>--
>To unsubscribe, e-mail:   

For additional commands, e-mail:



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




Re: Access application resource bundle from an ActionForm

2001-12-05 Thread Bruce Geerdes

Try:

MessageResources resources = getServlet().getResources();
resources.getMessage("emailAddressLabel");

If your bundle is localized, you'll have to get the locale separately
and pass that on to the getMessage.

Locale loc = (Locale)request.getSession().getAttribute(
org.apache.struts.action.Action.LOCALE_KEY);
resources.getMessage(loc, "emailAddressLabel");

Cheers,
Bruce


"Silvert, Stan" wrote:
> 
> I need to access the Struts application resource bundle from an ActionForm.
> Here is why:
> 
> During validation, I want to check for a required field such as email
> address.   In my system, "Email Address" is always referred to from a
> resource bundle so that I can localize properly.
> 
> So, my English language resource bundle looks something like this:
> 
> requiredFieldError = {0} is a required field
> emailAddress = Email Address
> 
> In my ActionForm validate(mapping, request) method, I would like to say
> something like:
> 
> ActionErrors errors = new ActionErrors();
> if (notFilledIn(this.emailAddress)) {
>errors.add("emailAddress",
>   new ActionError("requiredFieldError", !!! resource that
> "emailAddress" points to !!!);
> }
> 
> The question is, how do I get at the resource that "emailAddressLabel"
> points to, so that I can localize my ActionError?
> 
> My solution so far is to subclass ActionServlet and make the
> MessageResources available as a static member.  But, this seems like a hack.
> 
> Is there a better way to get to the MessageResources from an ActionForm?
> 
> Thanks in advance for your help,
> 
> Stan Silvert
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




Re: iterate tag problems (sorry !!)

2001-12-05 Thread dhay



Hi Eddie,

> BTW Dave Hay how does Struts match up the getMyObject method with the
myObjectArray ??

When Struts attempts to populate the form from the request, it takes the name of
the element in the request - in your case say "myObject[0].beanSelected" and
translates this into a call on the form bean getMyObject(0) and then
setBeanSelected(value) on the object that returns. ie
getMyObject(0).setBeanSelected(value).

You could take a look at the working example I just posted and see if you can
find any differences.

Hope that helps,

Dave





Eddie Fung <[EMAIL PROTECTED]> on 12/04/2001
06:40:09 AM

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

To:   [EMAIL PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  iterate tag problems (sorry !!)



I've looked through the archives regarding the iterate tag and have
followed all the suggestions on use of the  tag but still have a
problem getting the form data to be updated. Yes I do have a
getParameter(int index)
method but I still can't get the data updated in the form.

I have:






 /

 /




Where myForm = my ActionForm class

   myObjectArray is an ArrayList of myObjectBean objects

I have the following defined in the myForm ActionForm:

private ArrayList myObjectArray;

public ArrayList getMyObjectArray()
{
 return myObjectArray ;
}

public void setMyObjectArray (ArrayList anArray)
{
 this.myObjectArray = anArray;
}

public myObjectBean getMyObject (int index)
{
 return (myObjectBean) getMyObjectArray.get(index);
}

The myObject class has public getters and setters for all fields.

I can render the page but if I change the beanSelected, postDay, postMth or
postYear
fields the changes are not reflected in the Form.

BTW Dave Hay how does Struts match up the getMyObject method with the
myObjectArray ??

TIA

Eddie





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








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




RE: iterate tag problems (sorry !!)

2001-12-05 Thread dhay



Struts doesn't require this.

Dave





"Tom Klaasen (TeleRelay)" <[EMAIL PROTECTED]> on
12/05/2001 08:16:34 AM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: iterate tag problems (sorry !!)



After a quick look, I think you forgot the setParameter(int index,
YourClass object) method. This enables struts to update the form with
the new values.

hth,
tomK

> -Original Message-
> From: Eddie Fung [mailto:[EMAIL PROTECTED]]
> Sent: dinsdag 4 december 2001 12:40
> To: [EMAIL PROTECTED]
> Subject: iterate tag problems (sorry !!)
>
>
> I've looked through the archives regarding the iterate tag and have
> followed all the suggestions on use of the  tag but
> still have a
> problem getting the form data to be updated. Yes I do have a
> getParameter(int index)
> method but I still can't get the data updated in the form.
>
> I have:
>
>  type="com.fred.data.myObjectBean"
> property="myObjectArray"  indexId="index">
>
>  value="true"
> indexed="true"/>
>
>  maxlength="2"
> indexed="true"/>
>  /
>  maxlength="2"
> indexed="true"/>
>  /
>  maxlength="4"indexed="true"/>
>
> 
>
> Where myForm = my ActionForm class
>
>myObjectArray is an ArrayList of myObjectBean objects
>
> I have the following defined in the myForm ActionForm:
>
> private ArrayList myObjectArray;
>
> public ArrayList getMyObjectArray()
> {
>  return myObjectArray ;
> }
>
> public void setMyObjectArray (ArrayList anArray)
> {
>  this.myObjectArray = anArray;
> }
>
> public myObjectBean getMyObject (int index)
> {
>  return (myObjectBean) getMyObjectArray.get(index);
> }
>
> The myObject class has public getters and setters for all fields.
>
> I can render the page but if I change the beanSelected,
> postDay, postMth or
> postYear
> fields the changes are not reflected in the Form.
>
> BTW Dave Hay how does Struts match up the getMyObject method with the
> myObjectArray ??
>
> TIA
>
> Eddie
>
>
>
>
>
> --
> To unsubscribe, e-mail:
>  [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: 
>
>

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








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




RE: Tomcat 3.2.3+mod_jk

2001-12-05 Thread Phase Communcations

Do you have ajp13 activeated/installed? Try using ajp12 to test it out.
Also, where are you placing your JkMount directive?

-Original Message-
From: Daiju Kato [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 9:56 AM
To: [EMAIL PROTECTED]
Subject: Tomcat 3.2.3+mod_jk


Hello all,

Would you give me some advice?
I try to use struts 1.0 under tomcat 3.2.3 + mod_jk.
I modified mod_jk.conf to add 'JkMount /*.do ajp13'.
But .do files are not found.
I tried Tomcat 3.3 but result was same.

Please let me know how to set up struts with mod_jk.

Regards.

Daiju Kato
e-mail:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:

For additional commands, e-mail:





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




RE: Indexed tags & iterate tag problems

2001-12-05 Thread dhay



Taking a closer look at your code - first thing to check is capitalization of
your EmploymentInfoField - it must have a small 'e' - lots of messages about
bean naming scheme in list, eg
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg04762.html.

Cheers,

Dave







"Mike Ashamalla" <[EMAIL PROTECTED]> on
12/04/2001 03:39:25 PM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: Indexed tags & iterate tag problems



Anyone know the answer to this???  It seems that there are two of us with
exactly the same problem (see "iterate tag problems (sorry !!)" from Eddie
Fung [[EMAIL PROTECTED]]).

Bottom line: When using indexed tags inside an iterate tag, the setters
don't seem to be setting the new values.

If this has already been answered elsewhere, please just point us in the
right direction. :)

Thank You,


Mike Ashamalla, CEBS
VistaXtreme
[EMAIL PROTECTED]

-Original Message-
From: Mike Ashamalla [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 6:42 PM
To: Struts-User
Subject: Indexed tags


Hi All!

I apologize if this question has been asked before.  I'm trying to implement
indexed tags and I can't figure out where the values are being set (ie -
where should me setters be and what should they look like).  The form
displays the prompts and values perfectly, but when I submit it the new
values don't seem to be posting to the formbean.  I've read as many posts
and archives as I could find, but still don't see what I'm doing wrong.  One
archived post stated "... this will be translated by struts into a call
ParametersForm.getParameter(0).setValue(value) ...".  The setValue method in
EmploymentInfoField (see below) is not being called, though.  No errors are
being generated either (when I submit the form).  The HTML source that is
produced looks like this: 

BTW - I'm using Struts nightly build from 11/28/2001 and Tomcat 3.2.2

I've seen many posts that didn't have enough information/code for people to
help, so I'm including as much as possible.  Sorry for the long post.  Thank
you in advance!


***
JSP Code:

   

   
  

  
  

  
  
  



***

***
EmploymentInfoForm:

public class EmploymentInfoForm extends ActionForm {

private Vector employmentInfoFieldList = new Vector();

...

public EmploymentInfoField getEmploymentInfoField(int index) {
return (EmploymentInfoField) employmentInfoFieldList.get(index);
}

public Vector getEmploymentInfoFieldList() {
return employmentInfoFieldList;
}

private void addEmploymentInfoField(String dbFieldName,
int dataType,
String labelKey,
String value) {
EmploymentInfoField eField;

eField = new EmploymentInfoField();
eField.setDbFieldName(dbFieldName);
eField.setDataType(dataType);
eField.setLabelKey(labelKey);
eField.initValue(value);
employmentInfoFieldList.add(eField);
}
}

***

***
EmploymentInfoField:

public class EmploymentInfoField {

private int dataType;
private String dbFieldName = null;
private String labelKey = null;
private String value = null;
private boolean valueChanged = false;

/**
 * Return the dataType
 *
 * @return the dataType
 */
public int getDataType() {
return dataType;
}

/**
 * Set the dataType.
 *
 * @param dataType The new dataType
 */
public void setDataType(int dataType) {
  this.dataType = dataType;
}

/**
 * Return the dbFieldName
 *
 * @return the dbFieldName
 */
public String getDbFieldName() {
return dbFieldName;
}

/**
 * Set the dbFieldName.
 *
 * @param dbFieldName The new dbFieldName
 */
public void setDbFieldName(String dbFieldName) {
  this.dbFieldName = dbFieldName;
}

/**
 * Return the labelKey
 *
 * @return the labelKey
 */
public String getLabelKey() {
return labelKey;
}

/**
 * Set the labelKey.
 *
 * @param labelKey The new labelKey
 */
public void setLabelKey(String labelKey) {
  this.labelKey = labelKey;
}

/**
 * Return the value

RE: Indexed tags & iterate tag problems

2001-12-05 Thread dhay



See working example I just posted, and things to check.  Others have had this
problem in the archives.  It needs carefully checking!

cheers,

Dave





"Mike Ashamalla" <[EMAIL PROTECTED]> on
12/04/2001 03:39:25 PM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: Indexed tags & iterate tag problems



Anyone know the answer to this???  It seems that there are two of us with
exactly the same problem (see "iterate tag problems (sorry !!)" from Eddie
Fung [[EMAIL PROTECTED]]).

Bottom line: When using indexed tags inside an iterate tag, the setters
don't seem to be setting the new values.

If this has already been answered elsewhere, please just point us in the
right direction. :)

Thank You,


Mike Ashamalla, CEBS
VistaXtreme
[EMAIL PROTECTED]

-Original Message-
From: Mike Ashamalla [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 6:42 PM
To: Struts-User
Subject: Indexed tags


Hi All!

I apologize if this question has been asked before.  I'm trying to implement
indexed tags and I can't figure out where the values are being set (ie -
where should me setters be and what should they look like).  The form
displays the prompts and values perfectly, but when I submit it the new
values don't seem to be posting to the formbean.  I've read as many posts
and archives as I could find, but still don't see what I'm doing wrong.  One
archived post stated "... this will be translated by struts into a call
ParametersForm.getParameter(0).setValue(value) ...".  The setValue method in
EmploymentInfoField (see below) is not being called, though.  No errors are
being generated either (when I submit the form).  The HTML source that is
produced looks like this: 

BTW - I'm using Struts nightly build from 11/28/2001 and Tomcat 3.2.2

I've seen many posts that didn't have enough information/code for people to
help, so I'm including as much as possible.  Sorry for the long post.  Thank
you in advance!


***
JSP Code:

   

   
  

  
  

  
  
  



***

***
EmploymentInfoForm:

public class EmploymentInfoForm extends ActionForm {

private Vector employmentInfoFieldList = new Vector();

...

public EmploymentInfoField getEmploymentInfoField(int index) {
return (EmploymentInfoField) employmentInfoFieldList.get(index);
}

public Vector getEmploymentInfoFieldList() {
return employmentInfoFieldList;
}

private void addEmploymentInfoField(String dbFieldName,
int dataType,
String labelKey,
String value) {
EmploymentInfoField eField;

eField = new EmploymentInfoField();
eField.setDbFieldName(dbFieldName);
eField.setDataType(dataType);
eField.setLabelKey(labelKey);
eField.initValue(value);
employmentInfoFieldList.add(eField);
}
}

***

***
EmploymentInfoField:

public class EmploymentInfoField {

private int dataType;
private String dbFieldName = null;
private String labelKey = null;
private String value = null;
private boolean valueChanged = false;

/**
 * Return the dataType
 *
 * @return the dataType
 */
public int getDataType() {
return dataType;
}

/**
 * Set the dataType.
 *
 * @param dataType The new dataType
 */
public void setDataType(int dataType) {
  this.dataType = dataType;
}

/**
 * Return the dbFieldName
 *
 * @return the dbFieldName
 */
public String getDbFieldName() {
return dbFieldName;
}

/**
 * Set the dbFieldName.
 *
 * @param dbFieldName The new dbFieldName
 */
public void setDbFieldName(String dbFieldName) {
  this.dbFieldName = dbFieldName;
}

/**
 * Return the labelKey
 *
 * @return the labelKey
 */
public String getLabelKey() {
return labelKey;
}

/**
 * Set the labelKey.
 *
 * @param labelKey The new labelKey
 */
public void setLabelKey(String labelKey) {
  this.labelKey = labelKey;
}

/**
 * Return the value
 *
 * @return the value
 */
public String getValue() {
return value;
}

/**
 * Initialize the val

RE: HELP with accessing indexed, nested properties in Action

2001-12-05 Thread dhay



Hi John,

Sorry - the code on the page is misleading - the attachment I posted is right at
the bottom, but I am attaching it here again.

Things I would check:
- form bean in session scope
- correct getters / setters, including the getObjectFromList(index i)
- carefully check all naming, including capitalization for appropriate
getters/setters

Let me know if the example doesn't work/help - although I am off for a month
from tomorrow!

Cheers,

Dave
(See attached file: indexedexample.zip)




"John Kowalik" <[EMAIL PROTECTED]> on 12/05/2001 11:30:28 AM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  RE: HELP with accessing indexed, nested properties in Action



Dave,

  I still can't get this to work.  I'm not sure which code on that page I
should be using?  Can you send me your source files from this example?  I
would REALLY appreciate it.

  No matter what I seem to do, whenever I sumit the form, the Action can get
all the 'normal' properties out of the form, but when I try to access the
Array (or Vector) of beans, it always comes back as non-null, but with a
size of 0.

Thanks for any help you can provide,
--John

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 12:02 PM
To: Struts Users Mailing List
Subject: Re: HELP with accessing indexed, nested properties in Action




I posted working example a while back.  see
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12084.html

HTH,

Dave





"John Kowalik" <[EMAIL PROTECTED]> on 11/30/2001 09:45:39
AM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  HELP with accessing indexed, nested properties in Action




  I have search the archive and seen this bounced around, but can't seem to
find a complete working example. I have:

FormBean where one property is an Array of SomeBean;

SomeBean has three properties, two int, one string;

FormBean inits properly with an Array of SomeBean (via another Action);

form.jsp iterates over array of SomeBeans, creates indexed text input boxes.
These display just fine.

When I submit the form, the Action can't get at (or I don't understand how
to access) the SomeBean Array.  If I kick back to the form, the other form
fields keep any changed values, but the SomeBean Array goes null.

  I've been banging my head on this forever, so I would really appreciate
any help!  I've got the nightly build from 11/28/01 running

Thanks,
--John


--
To unsubscribe, e-mail:

For additional commands, e-mail:









--
To unsubscribe, e-mail:

For additional commands, e-mail:





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








indexedexample.zip
Description: .ZIP File

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


RE: Passing several parameters in a html link

2001-12-05 Thread Jon.Ridgway

Hi Frederic,

You will need to add a Map to the html:link. You might also consider using a
custom taglib. I believe the struts-example app has such a taglib.

Jon.

-Original Message-
From: Frédéric Houbie - ABSIS-GROUP [mailto:[EMAIL PROTECTED]] 
Sent: 04 December 2001 08:42
To: Struts-User
Subject: Passing several parameters in a html link

Hi,


I need to build html:link with 2 parameters, one coming from an iterate tag
and one from the request to pass to the following page.

How can I do that ?

Frederic



--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




Re: Cannot find ActionMappings or ActionFormBeans collection

2001-12-05 Thread Keith Bacon

Simon,
A wild shot but best I can suggest
When I've recompiled classes, instead of the new class
loading automatically I start getting struts messages
(things not found). Restarting Tomcat fixes them - but
I'm sure you've tried that a million times.
Please - experts hear this persons plea - I went thru
similar grief with struts.
I like software that forgives user errors & doesnt lay
traps for less experienced users!
Keith.


 
--- "Chappell, Simon P" <[EMAIL PROTECTED]>
wrote:
> I have battled this for a week and searched the
> Internet high and low
> for answers. After checking the syntax and
> correctness of web.xml and
> struts-config.xml and receiving no errors when I
> compile and making
> certain that my classes and JAR files are in the
> correct directories and
> that I don't have struts.jar in my classpath, I am
> now completely stuck.
> 
> I am using struts 1.0.1, Tomcat 4.0.1, JDK 1.4.0
> beta 3, RedHat Linux
> 7.2. I've also tried a very similar setup using
> Cygwin on Windows 2000
> Professional.
> 
> The struts-example application works just fine. So I
> tried to create my
> own simple test application. Most of my test pages
> work, a plain HTML
> page, a simple JSP that uses the  tag
> works, but when I try
> to use anything more then I get the famous newbie
> error:
> 
> Cannot find ActionMappings or ActionFormBeans
> collection
> 
> The problem with this newbie error is that there are
> lots of us asking
> about it and precious few answers (according to the
> search results). I
> am very determined to get the hang of struts, but
> how many people have
> been scared off because of this error?
> 
> I would like to get some input on what I should
> check first. I'm willing
> and able to dive in but need guidance as to where to
> look first.
> 
> All help gratefully appreciated.
> 
> Simon
> 
>
-
> Simon P. Chappell
> [EMAIL PROTECTED]
> Web Developer / Programming Specialist  
> www.landsend.com
> Lands' End, Inc.  
> (608) 935-4526
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

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




Tomcat 3.2.3+mod_jk

2001-12-05 Thread Daiju Kato

Hello all,

Would you give me some advice?
I try to use struts 1.0 under tomcat 3.2.3 + mod_jk.
I modified mod_jk.conf to add 'JkMount /*.do ajp13'.
But .do files are not found.
I tried Tomcat 3.3 but result was same.

Please let me know how to set up struts with mod_jk.

Regards.

Daiju Kato
e-mail:[EMAIL PROTECTED]



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




Alternate Query String Arrangement

2001-12-05 Thread Phase Communcations

Has anyone succefully swapped out the "?" and the "&" in a querystring with
another symbol , such as "/". A problem with various search engine spiders
(not all, but, several) is that they will not move past a ?. It would be
advantagous to allow for the use of a more compatible querystring (a way
around) especially when we  are talking about shopping carts and sites with
dynamic content that is accessed through links and not forms. I have seen
this done with other sites using php :( and it is very effective on the
search engines. I am endeavoring myself to figure a way around the "?" and
"&", using Struts (of course). Yet, if someone has attempted this succefully
I sure would appreciate some wisdom or code (code would be better, I think).
Otherwise, I will embark on my crusade alone.

Thanks ahead of time,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws



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




Multiple Parameters for html:link

2001-12-05 Thread Volker Krebs

Hello,

I've read about a custom tag where I can pass multiple
Parameters to the html:link tag without using HashMap.

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01695.html

Are there any plans including it in struts ?
I think its quite usefull.

Is there a newer version which can handle
<:img> <:property> <:name> ?

Thanks

Volker


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




RE: Cannot find ActionMappings or ActionFormBeans collection

2001-12-05 Thread Chappell, Simon P

Well bless my cotton socks. After your suggestions, I stopped Tomcat,
removed all the log files, removed everything except the shipped
examples and restarted Tomcat. I observed the log files and not a sign
of an error (that's good in shipping code I suspect :-)

I added my application WAR file and repeated the above procedure and
voila! An error raised it's head. I get a load() exception while struts
is parsing my struts-config.xml file. Looks like the structure wasn't as
clean as I thought it was.

Here's the struts-config.xml (if it's looks familiar, it's a copy and
edit from the struts-example):



http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>










   



-->























I hope that you can see the error in this file.

Simon


>-Original Message-
>From: Stephen Owens [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 05, 2001 10:03 AM
>To: Struts Users Mailing List
>Subject: RE: Cannot find ActionMappings or ActionFormBeans collection
>
>
>Simon,
>
>Do you see the action mappings messages when you start the server?
>Things of the form:
>
>Call
>org.apache.struts.action.ActionMapping.addForward(ActionForward[send])
>
>If not it really sounds like the action servlet isn't finding the
>struts-config.xml file, or isn't parsing it. Perhaps if you posted the
>relevant sections from your web.xml file, and the startup log output
>from Tomcat it would help.
>
>regards,
>
>Stephen Owens
>Corner Software
>
>-Original Message-
>From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 05, 2001 10:56 AM
>To: Struts mailing list (E-mail)
>Subject: Cannot find ActionMappings or ActionFormBeans collection
>
>
>I have battled this for a week and searched the Internet high and low
>for answers. After checking the syntax and correctness of web.xml and
>struts-config.xml and receiving no errors when I compile and making
>certain that my classes and JAR files are in the correct 
>directories and
>that I don't have struts.jar in my classpath, I am now 
>completely stuck.
>
>I am using struts 1.0.1, Tomcat 4.0.1, JDK 1.4.0 beta 3, RedHat Linux
>7.2. I've also tried a very similar setup using Cygwin on Windows 2000
>Professional.
>
>The struts-example application works just fine. So I tried to create my
>own simple test application. Most of my test pages work, a plain HTML
>page, a simple JSP that uses the  tag works, but when I try
>to use anything more then I get the famous newbie error:
>
>Cannot find ActionMappings or ActionFormBeans collection
>
>The problem with this newbie error is that there are lots of us asking
>about it and precious few answers (according to the search results). I
>am very determined to get the hang of struts, but how many people have
>been scared off because of this error?
>
>I would like to get some input on what I should check first. 
>I'm willing
>and able to dive in but need guidance as to where to look first.
>
>All help gratefully appreciated.
>
>Simon
>
>-
>Simon P. Chappell [EMAIL PROTECTED]
>Web Developer / Programming Specialist   www.landsend.com
>Lands' End, Inc.   (608) 935-4526
>
>--
>To unsubscribe, e-mail:
>
>For additional commands, e-mail:
>
>
>
>--
>To unsubscribe, e-mail:   

For additional commands, e-mail:



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




RE: HELP with accessing indexed, nested properties in Action

2001-12-05 Thread John Kowalik

Dave,

  I still can't get this to work.  I'm not sure which code on that page I
should be using?  Can you send me your source files from this example?  I
would REALLY appreciate it.

  No matter what I seem to do, whenever I sumit the form, the Action can get
all the 'normal' properties out of the form, but when I try to access the
Array (or Vector) of beans, it always comes back as non-null, but with a
size of 0.

Thanks for any help you can provide,
--John

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 12:02 PM
To: Struts Users Mailing List
Subject: Re: HELP with accessing indexed, nested properties in Action




I posted working example a while back.  see
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12084.html

HTH,

Dave





"John Kowalik" <[EMAIL PROTECTED]> on 11/30/2001 09:45:39
AM

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

To:   "Struts Users Mailing List"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  HELP with accessing indexed, nested properties in Action




  I have search the archive and seen this bounced around, but can't seem to
find a complete working example. I have:

FormBean where one property is an Array of SomeBean;

SomeBean has three properties, two int, one string;

FormBean inits properly with an Array of SomeBean (via another Action);

form.jsp iterates over array of SomeBeans, creates indexed text input boxes.
These display just fine.

When I submit the form, the Action can't get at (or I don't understand how
to access) the SomeBean Array.  If I kick back to the form, the other form
fields keep any changed values, but the SomeBean Array goes null.

  I've been banging my head on this forever, so I would really appreciate
any help!  I've got the nightly build from 11/28/01 running

Thanks,
--John


--
To unsubscribe, e-mail:

For additional commands, e-mail:









--
To unsubscribe, e-mail:

For additional commands, e-mail:





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




Form beans in tag library

2001-12-05 Thread Anthony Chater

Can I  get a handle on my form beans in my own tag library?


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




RE: Access application resource bundle from an ActionForm

2001-12-05 Thread Silvert, Stan

Thanks for the suggestion, but unfortunately the RequestUtils.message
methods need a PageContext.  I don't have access to a PageContext during
ActionForm validation.

Stan

> -Original Message-
> From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 11:10 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Access application resource bundle from an ActionForm
> 
> 
> Hi Silvert,
> 
> You could try the org.apache.struts.util.RequestUtils.message 
> method(s). 
> 
> Jon.
> 
> 
> -Original Message-
> From: Silvert, Stan [mailto:[EMAIL PROTECTED]] 
> Sent: 05 December 2001 15:39
> To: Struts Users Mailing List (E-mail)
> Subject: Access application resource bundle from an ActionForm
> 
> I need to access the Struts application resource bundle from 
> an ActionForm.
> Here is why:
> 
> During validation, I want to check for a required field such as email
> address.   In my system, "Email Address" is always referred to from a
> resource bundle so that I can localize properly.
> 
> So, my English language resource bundle looks something like this:
> 
> requiredFieldError = {0} is a required field
> emailAddress = Email Address
> 
> In my ActionForm validate(mapping, request) method, I would 
> like to say
> something like:
> 
> ActionErrors errors = new ActionErrors();
> if (notFilledIn(this.emailAddress)) {
>errors.add("emailAddress", 
>   new ActionError("requiredFieldError", !!! 
> resource that
> "emailAddress" points to !!!);
> }
> 
> 
> The question is, how do I get at the resource that "emailAddressLabel"
> points to, so that I can localize my ActionError?  
> 
> My solution so far is to subclass ActionServlet and make the
> MessageResources available as a static member.  But, this 
> seems like a hack.
> 
> Is there a better way to get to the MessageResources from an 
> ActionForm?
> 
> Thanks in advance for your help,
> 
> Stan Silvert
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   

For additional commands, e-mail:


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




RE: html:link href to external URL in a

2001-12-05 Thread Siggelkow, Bill

You can do this by just coding the link in with an HTML anchor tag as
folows:
">



or use an expression





-Original Message-
From: Rob Breeds [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 11:03 AM
To: Struts Users Mailing List
Subject: html:link href to external URL in a 



Hi

This may be in the FAQ/archive but I can't find it!

If I have a dynamically generated external URL available in the
request/session object, e.g. "http://www.banana.com";, how do I write a
 tag such that the link takes the user to that external
URL? (Without using scriptlets?)

I effectively want to do: ">



but can't do nested tags.

How do I dynamically populate the content of the href attribute?

Help please!

Thanks

Rob Breeds




--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: Access application resource bundle from an ActionForm

2001-12-05 Thread Jon.Ridgway

Hi Silvert,

You could try the org.apache.struts.util.RequestUtils.message method(s). 

Jon.


-Original Message-
From: Silvert, Stan [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 15:39
To: Struts Users Mailing List (E-mail)
Subject: Access application resource bundle from an ActionForm

I need to access the Struts application resource bundle from an ActionForm.
Here is why:

During validation, I want to check for a required field such as email
address.   In my system, "Email Address" is always referred to from a
resource bundle so that I can localize properly.

So, my English language resource bundle looks something like this:

requiredFieldError = {0} is a required field
emailAddress = Email Address

In my ActionForm validate(mapping, request) method, I would like to say
something like:

ActionErrors errors = new ActionErrors();
if (notFilledIn(this.emailAddress)) {
   errors.add("emailAddress", 
  new ActionError("requiredFieldError", !!! resource that
"emailAddress" points to !!!);
}


The question is, how do I get at the resource that "emailAddressLabel"
points to, so that I can localize my ActionError?  

My solution so far is to subclass ActionServlet and make the
MessageResources available as a static member.  But, this seems like a hack.

Is there a better way to get to the MessageResources from an ActionForm?

Thanks in advance for your help,

Stan Silvert

--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: Cannot find ActionMappings or ActionFormBeans collection

2001-12-05 Thread Stephen Owens

Simon,

Do you see the action mappings messages when you start the server?
Things of the form:

Call
org.apache.struts.action.ActionMapping.addForward(ActionForward[send])

If not it really sounds like the action servlet isn't finding the
struts-config.xml file, or isn't parsing it. Perhaps if you posted the
relevant sections from your web.xml file, and the startup log output
from Tomcat it would help.

regards,

Stephen Owens
Corner Software

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:56 AM
To: Struts mailing list (E-mail)
Subject: Cannot find ActionMappings or ActionFormBeans collection


I have battled this for a week and searched the Internet high and low
for answers. After checking the syntax and correctness of web.xml and
struts-config.xml and receiving no errors when I compile and making
certain that my classes and JAR files are in the correct directories and
that I don't have struts.jar in my classpath, I am now completely stuck.

I am using struts 1.0.1, Tomcat 4.0.1, JDK 1.4.0 beta 3, RedHat Linux
7.2. I've also tried a very similar setup using Cygwin on Windows 2000
Professional.

The struts-example application works just fine. So I tried to create my
own simple test application. Most of my test pages work, a plain HTML
page, a simple JSP that uses the  tag works, but when I try
to use anything more then I get the famous newbie error:

Cannot find ActionMappings or ActionFormBeans collection

The problem with this newbie error is that there are lots of us asking
about it and precious few answers (according to the search results). I
am very determined to get the hang of struts, but how many people have
been scared off because of this error?

I would like to get some input on what I should check first. I'm willing
and able to dive in but need guidance as to where to look first.

All help gratefully appreciated.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Web Developer / Programming Specialist   www.landsend.com
Lands' End, Inc.   (608) 935-4526

--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




html:link href to external URL in a

2001-12-05 Thread Rob Breeds


Hi

This may be in the FAQ/archive but I can't find it!

If I have a dynamically generated external URL available in the
request/session object, e.g. "http://www.banana.com";, how do I write a
 tag such that the link takes the user to that external
URL? (Without using scriptlets?)

I effectively want to do: ">



but can't do nested tags.

How do I dynamically populate the content of the href attribute?

Help please!

Thanks

Rob Breeds




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




Cannot find ActionMappings or ActionFormBeans collection

2001-12-05 Thread Chappell, Simon P

I have battled this for a week and searched the Internet high and low
for answers. After checking the syntax and correctness of web.xml and
struts-config.xml and receiving no errors when I compile and making
certain that my classes and JAR files are in the correct directories and
that I don't have struts.jar in my classpath, I am now completely stuck.

I am using struts 1.0.1, Tomcat 4.0.1, JDK 1.4.0 beta 3, RedHat Linux
7.2. I've also tried a very similar setup using Cygwin on Windows 2000
Professional.

The struts-example application works just fine. So I tried to create my
own simple test application. Most of my test pages work, a plain HTML
page, a simple JSP that uses the  tag works, but when I try
to use anything more then I get the famous newbie error:

Cannot find ActionMappings or ActionFormBeans collection

The problem with this newbie error is that there are lots of us asking
about it and precious few answers (according to the search results). I
am very determined to get the hang of struts, but how many people have
been scared off because of this error?

I would like to get some input on what I should check first. I'm willing
and able to dive in but need guidance as to where to look first.

All help gratefully appreciated.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Web Developer / Programming Specialist   www.landsend.com
Lands' End, Inc.   (608) 935-4526

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




Global Forwards

2001-12-05 Thread Dave J Dandeneau

Can a global forward point to a file in the WEB-INF directory?

Thanks,
dave



Re: object sharing

2001-12-05 Thread Chris Opacki

Are you're JSPs in a different JVM than your Action
class?

--- Luca Biolcati <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I would like to share a generic object between an
> Action class and a JSP. It seemed obvious putting it
> in the session or in the request scope but in both
> ways I can't see them on the JSP side. The
> HttpSession and HttpServletRequest objects are
> different.
> I've also tried putting it in the request using the
> redirect attribute, but I've had no results anyway.
> Any suggests?
> 
> Thanx, luca
> 


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

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




RE: Action an overkill ??

2001-12-05 Thread Jon.Ridgway

Hi Andrej,

Point one below, you a right. I don't think the suggestion is to sort in the
JSP, Taglib or Action. The sorting should be delegated via a taglib or jsp
to a business class.

Point two, the Business Delegate pattern suggests that you should use a
simple JavaBean to access all services, such as EJBs, WebServices, COBRA
Services etc. This way you can hide the tricky bits of creating the service
away from your clients (ie TagLib or Action class). You can also change the
type of the service from say an EJB to a WebService without impacting your
clients.

Jon.

-Original Message-
From: Sobkowski, Andrej [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 15:27
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??

Hello,

two comments/questions:
- in my opinion, sorting data is somehow business processing. Suppose that
you have a long list of results that is paged (ie. retrieved in chunks from
the data store). Sorting the data using a different criteria may involve
re-accessing the data store to retrieve a different page of data.. and this
should not be handled by a JSP. All this to say that I personally see the
sorting/resorting in the Action/Model layers.

- I've seen a few messages related to using a business delegate to call an
EJB. Isn't an EJB a Business Delegate itself? In my case, the EJBs are
relatively simple for now, only things like UserEJB.create(UserValueObject)
and similar. And I'm calling them directly from my Actions (using a
ServiceLocator). I'm not sure I see the advantage of using both a Business
Delegate and an EJB... aren't EJBs "better" in the sense that the app server
supports/provides many more services (transactions, object pooling,
security, ...)?

Thanks.

Andrej

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:14 AM
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??


Hi Abhishek,

My previous answer was a bit vague as it depends on the specific context. If
for example you whished to check that the users details had been fetched
before accessing a page then a taglib that uses a business delegate to
access an ejb would be a good choice. 

If however you wanted to process the user's details, an action would be a
better choice (indeed form submits should clearly be handled by an action).

Some choices are not so clear cut. Sorting a table for instance could be
handled by a taglib or a repost to an action that sorts and forwards back to
the jsp. I guess I would favor the taglib option here, as I might (heaven
forbid) use a framework other than struts in the future.

Jon Ridgway

-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 10:53
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??

Thanks for your reply,

There is a debate in my team these days on the use of Jsp Tags versus
Actions.

Some jsp developers feel that ejbs should be accessed via tag libraries,
databases should be accessed via tag libraries and for simple rendering
things like sorting a table jsp tag libraries should be used. While others
like to use Actions for all the things mentioned above.

Is there a document somewhere which describes what tasks are better suited
for actions and what tasks are better suited for tag libraries.

Technically, things mentioned above can be done easily by either as action
or as jsp tags.But I want to make a consistent decision through out the
application.

regards,
Abhishek.


A ship in harbor is safe, but that is not what ships are built for.
John A. Shedd

* * Abhishek Srivastava
***  /_  __ *** Hewlett-Packard - Solutions Organization
**  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
***/*** phone +91 80 2251554 Extn:1532
* * mailto:[EMAIL PROTECTED]

>> -Original Message-
>> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 4:05 PM
>> To: struts-user
>> Subject: RE: Action an overkill ??
>>
>>
>> Hi,
>>
>> going through the action hides the
>> presentation-implementation from the user's eyes.
>>
>> For example, the user will only see ".../do/showTable" (or
>> ".../showTable.do") in
>> the browser's address line and therefor not be able to
>> bookmark the jsp-file, when
>> you use an action.
>>
>> The action also allows you to change more implementation
>> details without having
>> to change the presentation (JSP-file)...
>>
>> I advocate strict use of actions in every case...
>> => NEVER use a jsp-link, ALWAYS use an action
>>
>> just my two cents...
>> Alexander Jesse
>>
>> -Original Message-
>> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 10:54 AM
>> To: Struts-User (E-mail)
>> Subject: Action an overkill ??
>>
>>
>> Hello All,
>>
>> I render a table through my jsp page. The user can sort the table by
>> clicking on each of the column

RE: Action an overkill ??

2001-12-05 Thread Jon.Ridgway

Hi Ted,

Yes, very good point. It would indeed be the best place to sort

Jon.

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 15:36
To: Struts Users Mailing List
Subject: Re: Action an overkill ??

"Jon.Ridgway" wrote:
> Some choices are not so clear cut. Sorting a table for instance could be
> handled by a taglib or a repost to an action that sorts and forwards back
to
> the jsp. I guess I would favor the taglib option here, as I might (heaven
> forbid) use a framework other than struts in the future.

Why not have the delegate do the sorting, as you might (heaven forbid)
use something other that taglibs in the future? 

;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: Sending the actionformbean to the next JSP page

2001-12-05 Thread Sobkowski, Andrej

Hi,

are you sure it's



and not (note the change "getModel" -> "model")



I guess you want to call yourBean.getModel.setTitle(..). My 2c..

HTH

Andrej


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:45 AM
To: [EMAIL PROTECTED]
Subject: Sending the actionformbean to the next JSP page



Someone please tell me if this is bad.

I have a form, when the action suceeds it stores the actionform bean in 
the session.  It then goes to the next JSP page that tries to retrieve 
it and print out things that were submitted.  

Basically the flow is:

Form Page -> Review Page -> if you find a mistake you can go back to the 
first form page.

If you like it, click okay and it goes to an action that moves the info 
to a business bean then removes the actionformbean from the session

Basically I did not think it was logical to populate another bean and 
send it to the display.

When I try it, I cannot get the JSp page to find the bean, or when I 
move things around - it cannot find the properties I want off the 
bean...


yes, I know - I suck


Here is a code frag from my perform routine that stores the info
-
HttpSession session = request.getSession();
session.putValue("thisCr", form);
-

Here is the JSP that starts the bean
--

---

Lastly, here is the code to get a property
---




Bill Chmura
Ensign-Bickford Industries, Inc.
Information Technologies Department



--
To unsubscribe, e-mail:

For additional commands, e-mail:




Access application resource bundle from an ActionForm

2001-12-05 Thread Silvert, Stan

I need to access the Struts application resource bundle from an ActionForm.
Here is why:

During validation, I want to check for a required field such as email
address.   In my system, "Email Address" is always referred to from a
resource bundle so that I can localize properly.

So, my English language resource bundle looks something like this:

requiredFieldError = {0} is a required field
emailAddress = Email Address

In my ActionForm validate(mapping, request) method, I would like to say
something like:

ActionErrors errors = new ActionErrors();
if (notFilledIn(this.emailAddress)) {
   errors.add("emailAddress", 
  new ActionError("requiredFieldError", !!! resource that
"emailAddress" points to !!!);
}


The question is, how do I get at the resource that "emailAddressLabel"
points to, so that I can localize my ActionError?  

My solution so far is to subclass ActionServlet and make the
MessageResources available as a static member.  But, this seems like a hack.

Is there a better way to get to the MessageResources from an ActionForm?

Thanks in advance for your help,

Stan Silvert

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




Sending the actionformbean to the next JSP page

2001-12-05 Thread wbchmura


Someone please tell me if this is bad.

I have a form, when the action suceeds it stores the actionform bean in 
the session.  It then goes to the next JSP page that tries to retrieve 
it and print out things that were submitted.  

Basically the flow is:

Form Page -> Review Page -> if you find a mistake you can go back to the 
first form page.

If you like it, click okay and it goes to an action that moves the info 
to a business bean then removes the actionformbean from the session

Basically I did not think it was logical to populate another bean and 
send it to the display.

When I try it, I cannot get the JSp page to find the bean, or when I 
move things around - it cannot find the properties I want off the 
bean...


yes, I know - I suck


Here is a code frag from my perform routine that stores the info
-
HttpSession session = request.getSession();
session.putValue("thisCr", form);
-

Here is the JSP that starts the bean
--

---

Lastly, here is the code to get a property
---




Bill Chmura
Ensign-Bickford Industries, Inc.
Information Technologies Department



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




Re: Action an overkill ??

2001-12-05 Thread Ted Husted

"Jon.Ridgway" wrote:
> Some choices are not so clear cut. Sorting a table for instance could be
> handled by a taglib or a repost to an action that sorts and forwards back to
> the jsp. I guess I would favor the taglib option here, as I might (heaven
> forbid) use a framework other than struts in the future.

Why not have the delegate do the sorting, as you might (heaven forbid)
use something other that taglibs in the future? 

;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

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




RE: Action an overkill ??

2001-12-05 Thread Sobkowski, Andrej

Hello,

two comments/questions:
- in my opinion, sorting data is somehow business processing. Suppose that
you have a long list of results that is paged (ie. retrieved in chunks from
the data store). Sorting the data using a different criteria may involve
re-accessing the data store to retrieve a different page of data.. and this
should not be handled by a JSP. All this to say that I personally see the
sorting/resorting in the Action/Model layers.

- I've seen a few messages related to using a business delegate to call an
EJB. Isn't an EJB a Business Delegate itself? In my case, the EJBs are
relatively simple for now, only things like UserEJB.create(UserValueObject)
and similar. And I'm calling them directly from my Actions (using a
ServiceLocator). I'm not sure I see the advantage of using both a Business
Delegate and an EJB... aren't EJBs "better" in the sense that the app server
supports/provides many more services (transactions, object pooling,
security, ...)?

Thanks.

Andrej

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:14 AM
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??


Hi Abhishek,

My previous answer was a bit vague as it depends on the specific context. If
for example you whished to check that the users details had been fetched
before accessing a page then a taglib that uses a business delegate to
access an ejb would be a good choice. 

If however you wanted to process the user's details, an action would be a
better choice (indeed form submits should clearly be handled by an action).

Some choices are not so clear cut. Sorting a table for instance could be
handled by a taglib or a repost to an action that sorts and forwards back to
the jsp. I guess I would favor the taglib option here, as I might (heaven
forbid) use a framework other than struts in the future.

Jon Ridgway

-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 10:53
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??

Thanks for your reply,

There is a debate in my team these days on the use of Jsp Tags versus
Actions.

Some jsp developers feel that ejbs should be accessed via tag libraries,
databases should be accessed via tag libraries and for simple rendering
things like sorting a table jsp tag libraries should be used. While others
like to use Actions for all the things mentioned above.

Is there a document somewhere which describes what tasks are better suited
for actions and what tasks are better suited for tag libraries.

Technically, things mentioned above can be done easily by either as action
or as jsp tags.But I want to make a consistent decision through out the
application.

regards,
Abhishek.


A ship in harbor is safe, but that is not what ships are built for.
John A. Shedd

* * Abhishek Srivastava
***  /_  __ *** Hewlett-Packard - Solutions Organization
**  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
***/*** phone +91 80 2251554 Extn:1532
* * mailto:[EMAIL PROTECTED]

>> -Original Message-
>> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 4:05 PM
>> To: struts-user
>> Subject: RE: Action an overkill ??
>>
>>
>> Hi,
>>
>> going through the action hides the
>> presentation-implementation from the user's eyes.
>>
>> For example, the user will only see ".../do/showTable" (or
>> ".../showTable.do") in
>> the browser's address line and therefor not be able to
>> bookmark the jsp-file, when
>> you use an action.
>>
>> The action also allows you to change more implementation
>> details without having
>> to change the presentation (JSP-file)...
>>
>> I advocate strict use of actions in every case...
>> => NEVER use a jsp-link, ALWAYS use an action
>>
>> just my two cents...
>> Alexander Jesse
>>
>> -Original Message-
>> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 10:54 AM
>> To: Struts-User (E-mail)
>> Subject: Action an overkill ??
>>
>>
>> Hello All,
>>
>> I render a table through my jsp page. The user can sort the table by
>> clicking on each of the column headers. When the user clicks
>> on the column
>> header, an Action is invoked and the data that is used to
>> render the table
>> is sorted accordingly and placed back into the session. Now
>> the control is
>> forwarded to the jsp that renders the table with sorted data/
>>
>> I have got some feedback that using Action for things like
>> sorting a table
>> is an overkill. what is suggested that each table column
>> should point to a
>> jsp which should use a custom tag library to sort the table.
>>
>> I am unable to decide which approach to take and why.
>>
>> Can someone help me on this.
>>
>> regards,
>> Abhishek.
>>
>>
>> A ship in harbor is safe, but that is not what ships are built for.
>> John A. Shedd
>>
>> * *

using String[] for an ActionForm value

2001-12-05 Thread Andras Balogh

Hi Struts users,

I have a from in wich i generate with logic:iterate textfields with the
same name, let say 'desc'. 

In the corresponding ActionForm i have created a String array and two
methods

public void setDesc(String d[])
{
 desc=d;
} 

public String[] getDesc()
{
 return desc;
}

Struts populates the desc String array with the correct values, but it
can't redisplay them correctly (i can understand why because it only
support String values not String arrays)
So i have made the following methods:

public String[] getDesc()
{
 return null;
}

public String getOneDesc()
{
  if(desc_index>=desc.length) desc_index=0;
  String s=desc[desc_index];
  desc_index++;
  return s;  
}

and in my form


This way my textfields are populated correctly but i fill like i am
forcing something.

I have looked upon the indexed property but i can't see how can help in
my situation.
Has anybody have an example of using the indexed property?
How does the corresponding ActionForm look like?
In general how should an ActionForm deal with form elements generated
dynamically?


Thanx,

Andras.






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




RE: object sharing

2001-12-05 Thread Jon.Ridgway

Hi Luca,

What you are trying to do is standard stuff that works. If it is not working
you must be doing something wrong. Post the Java code that puts the object
on the request/session and the JSP snippet that tries to access the object.

Jon.

-Original Message-
From: Luca Biolcati [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 15:08
To: Struts User Mailing List
Cc: augusto vezzaro
Subject: object sharing

Hello,

I would like to share a generic object between an Action class and a JSP. It
seemed obvious putting it in the session or in the request scope but in both
ways I can't see them on the JSP side. The HttpSession and
HttpServletRequest objects are different.
I've also tried putting it in the request using the redirect attribute, but
I've had no results anyway. Any suggests?

Thanx, luca

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




Re: Connections & Transactions

2001-12-05 Thread Kyle Brown

Yes.  That's the way EJB transaction swork.  They are thread  based.  If a
transaction is associated with a particular thread it doesn't matter where
(in which object) the connection is created or used -- it's enlisted in the
transaction.

Kyle
---
Kyle Brown
Executive Java Architect
IBM Software services for WebSphere


[EMAIL PROTECTED] on 12/04/2001 11:58:34 PM

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

To:   [EMAIL PROTECTED]
cc:
Subject:  Connections & Transactions



Hi all,

I have a question. If I have a DAO that is implemented as a simple java
class. I make a connection object at my session bean and pass it to the DAO
object. And the DAO object does all its operations on that connection
object. Then will the DAO come into the same transaction scope as the
session bean

This is really urgent. Would appreciate any help,

Thanks
Aneesha


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




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




RE: Action an overkill ??

2001-12-05 Thread Jon.Ridgway

Hi Abhishek,

My previous answer was a bit vague as it depends on the specific context. If
for example you whished to check that the users details had been fetched
before accessing a page then a taglib that uses a business delegate to
access an ejb would be a good choice. 

If however you wanted to process the user's details, an action would be a
better choice (indeed form submits should clearly be handled by an action).

Some choices are not so clear cut. Sorting a table for instance could be
handled by a taglib or a repost to an action that sorts and forwards back to
the jsp. I guess I would favor the taglib option here, as I might (heaven
forbid) use a framework other than struts in the future.

Jon Ridgway

-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 10:53
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??

Thanks for your reply,

There is a debate in my team these days on the use of Jsp Tags versus
Actions.

Some jsp developers feel that ejbs should be accessed via tag libraries,
databases should be accessed via tag libraries and for simple rendering
things like sorting a table jsp tag libraries should be used. While others
like to use Actions for all the things mentioned above.

Is there a document somewhere which describes what tasks are better suited
for actions and what tasks are better suited for tag libraries.

Technically, things mentioned above can be done easily by either as action
or as jsp tags.But I want to make a consistent decision through out the
application.

regards,
Abhishek.


A ship in harbor is safe, but that is not what ships are built for.
John A. Shedd

* * Abhishek Srivastava
***  /_  __ *** Hewlett-Packard - Solutions Organization
**  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
***/*** phone +91 80 2251554 Extn:1532
* * mailto:[EMAIL PROTECTED]

>> -Original Message-
>> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 4:05 PM
>> To: struts-user
>> Subject: RE: Action an overkill ??
>>
>>
>> Hi,
>>
>> going through the action hides the
>> presentation-implementation from the user's eyes.
>>
>> For example, the user will only see ".../do/showTable" (or
>> ".../showTable.do") in
>> the browser's address line and therefor not be able to
>> bookmark the jsp-file, when
>> you use an action.
>>
>> The action also allows you to change more implementation
>> details without having
>> to change the presentation (JSP-file)...
>>
>> I advocate strict use of actions in every case...
>> => NEVER use a jsp-link, ALWAYS use an action
>>
>> just my two cents...
>> Alexander Jesse
>>
>> -Original Message-
>> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 10:54 AM
>> To: Struts-User (E-mail)
>> Subject: Action an overkill ??
>>
>>
>> Hello All,
>>
>> I render a table through my jsp page. The user can sort the table by
>> clicking on each of the column headers. When the user clicks
>> on the column
>> header, an Action is invoked and the data that is used to
>> render the table
>> is sorted accordingly and placed back into the session. Now
>> the control is
>> forwarded to the jsp that renders the table with sorted data/
>>
>> I have got some feedback that using Action for things like
>> sorting a table
>> is an overkill. what is suggested that each table column
>> should point to a
>> jsp which should use a custom tag library to sort the table.
>>
>> I am unable to decide which approach to take and why.
>>
>> Can someone help me on this.
>>
>> regards,
>> Abhishek.
>>
>>
>> A ship in harbor is safe, but that is not what ships are built for.
>> John A. Shedd
>>
>> * * Abhishek Srivastava
>> ***  /_  __ *** Hewlett-Packard - Solutions Organization
>> **  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
>> ***/*** phone +91 80 2251554 Extn:1532
>> * * mailto:[EMAIL PROTECTED]
>>
>>
>> --
>> To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: Connections & Transactions

2001-12-05 Thread Cakalic, James P.

This may, in part, depend on how your session bean acquires the connection.
On my project we are using WebSphere (currently 3.5.x) and Oracle 8i. When
the project started, Oracle's JDBC drivers were not fully JTA compliant so
WebSphere could not use them in two phase commit operations. As the project
was being implemented by a geographically distributed team without a clear
architectural consensus, some parts of the system were developed using
entity beans extensively and others were developed using entirely JDBC. The
problem arose when both forms of database access were used within a single
container-managed transaction. The reason was that the CMP entity beans and
the JDBC data access code were both acquiring their connections from a
common WebSphere managed DataSource. It appeared that WebSphere could (and
would) attempt to manage all activity across multiple connections using it's
managed DataSources. This resulted in TransactionRollbackExceptions all
across the system. The solution at that point in time was to acquire JDBC
connections from an alternate source. First the DriverManager directly to
prove it would work and then an OraclePooledDataSource for performance.
Since WebSphere was not aware of these connections, it would not attempt to
include them in its transactions.

The point of my (rather long-winded) story is that "it depends". My
assumption would be that if the container knows about the use of the
connection in a transaction -- either because it acquired it for CMP
persistence or you acquired it from one of its defined data sources -- then
all operations performed on the connection become part of the transaction
scope managed by the container. If you acquire the connection by another
means then the container will not be involved. The best bet is to "drive a
spike" to test this hypothesis in your environment. 

Best regards,
Jim Cakalic

> -Original Message-
> From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 4:49 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Connections & Transactions
> 
> 
> HI Aneesha,
> 
> I think it depends on if you are using declarative 
> transactions within your
> stateless bean. If you are and set your transaction attribute 
> to start a new
> transaction, then the answer is yes. If you are not using declarative
> transactions then it will be up to you to start a new 
> transaction, either in
> the DOA or the stateless session bean.
> 
> Jon Ridgway
> 
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] 
> Sent: 05 December 2001 04:59
> To: [EMAIL PROTECTED]
> Subject: Connections & Transactions
> 
> Hi all,
> 
> I have a question. If I have a DAO that is implemented as a 
> simple java
> class. I make a connection object at my session bean and pass 
> it to the DAO
> object. And the DAO object does all its operations on that connection
> object. Then will the DAO come into the same transaction scope as the
> session bean
> 
> This is really urgent. Would appreciate any help,
> 
> Thanks
> Aneesha
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 


Confidentiality Warning:  This e-mail contains information intended 
only for the use of the individual or entity named above.  If the reader of this 
e-mail is not the intended recipient or the employee or agent responsible for 
delivering it to the intended recipient, any dissemination, publication or copying of 
this e-mail is strictly prohibited. The sender does not accept any responsibility for 
any loss, disruption or damage to your data or computer system that may occur while 
using data contained in, or transmitted with, this e-mail.   If you have received this 
e-mail in error, please immediately notify us by return e-mail.  Thank you.




object sharing

2001-12-05 Thread Luca Biolcati

Hello,

I would like to share a generic object between an Action class and a JSP. It seemed 
obvious putting it in the session or in the request scope but in both ways I can't see 
them on the JSP side. The HttpSession and HttpServletRequest objects are different.
I've also tried putting it in the request using the redirect attribute, but I've had 
no results anyway. Any suggests?

Thanx, luca



Re: Hi

2001-12-05 Thread William Willis

Thanks for the virus


>From: "Scott Fitzgerald" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts-User" <[EMAIL PROTECTED]>
>Subject: Hi
>Date: Tue, 4 Dec 2001 15:43:43 -0330
>
>How are you ?
>When I saw this screen saver, I immediately thought about you
>I am in a harry, I promise you will love it!
><< gone.scr >>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




RE: Action an overkill ??

2001-12-05 Thread Jon.Ridgway

Hi Abhishek,

As you have suggested, you can access your EJB via a Taglib or an Action.
Both are valid options. You should however access the EJB via a Business
Delegate, ie a standard JavaBean that hides the EJB lookup. The Business
Delegate can then be use by an Action or a TagLib. 

A rule of thumb might be to use a TagLib if you need to check/validate/fetch
data on multiple pages and an action to fetch/process data for another page.

Jon Ridgway


-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 12:00
To: 'Struts Users Mailing List'
Subject: RE: Action an overkill ??

Ted's Catalog was useful in this regard as it clearly say no linking to
jsps so no more sorting a table by jsp as it leads to a jsp making a
hyperlink to itself rather than an action.

Wish I could find something on the access of Ejbs via jsp-tags vs. Actions
also.

The feeling here is that use of Tag libraries is not mixing jsp code with
business logic. instead it is regarded as a way or creating reusable code
across jsp pages without mixing java with jsp code. which also appears to be
true for Actions.
The only issue seems to be which one should be used as a standard.

Thanks a lot for your reply and help.

regards,
Abhishek.

A ship in harbor is safe, but that is not what ships are built for.
John A. Shedd

* * Abhishek Srivastava
***  /_  __ *** Hewlett-Packard - Solutions Organization
**  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
***/*** phone +91 80 2251554 Extn:1532
* * mailto:[EMAIL PROTECTED]

>> -Original Message-
>> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 4:47 PM
>> To: struts-user
>> Subject: RE: Action an overkill ??
>>
>>
>> You're welcome...
>>
>> Documents...
>> - The archtectural papers for Struts (and other web-frameworks)
>> - Ted's "Catalog"
>> - the javaworld-article (have no url ready...) on Model 2
>> - Jason Hunters ranting "against" JSP
>> - common sense (at least for a huge number of
>> web-application programmers)
>> all dictate never to mix JSP with business-logic.
>>
>> I think it boils down to: Do I want to have a separation of
>> concerns as
>> mandated by OO-style and the MVC-pattern, or do I want to
>> have the least possible
>> number of components?
>>
>> Following the MVC-style (one of the Struts-goodies) mandates
>> the use of
>> action and a restricted use of business-logic-custom tags.
>>
>> hope this helps
>> Alexander Jesse
>>
>> -Original Message-
>> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, December 05, 2001 11:53 AM
>> To: 'Struts Users Mailing List'
>> Subject: RE: Action an overkill ??
>>
>>
>> Thanks for your reply,
>>
>> There is a debate in my team these days on the use of Jsp Tags versus
>> Actions.
>>
>> Some jsp developers feel that ejbs should be accessed via
>> tag libraries,
>> databases should be accessed via tag libraries and for
>> simple rendering
>> things like sorting a table jsp tag libraries should be
>> used. While others
>> like to use Actions for all the things mentioned above.
>>
>> Is there a document somewhere which describes what tasks are
>> better suited
>> for actions and what tasks are better suited for tag libraries.
>>
>> Technically, things mentioned above can be done easily by
>> either as action
>> or as jsp tags.But I want to make a consistent decision
>> through out the
>> application.
>>
>> regards,
>> Abhishek.
>>
>>
>> A ship in harbor is safe, but that is not what ships are built for.
>> John A. Shedd
>>
>> * * Abhishek Srivastava
>> ***  /_  __ *** Hewlett-Packard - Solutions Organization
>> **  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
>> ***/*** phone +91 80 2251554 Extn:1532
>> * * mailto:[EMAIL PROTECTED]
>>
>> >> -Original Message-
>> >> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
>> >> Sent: Wednesday, December 05, 2001 4:05 PM
>> >> To: struts-user
>> >> Subject: RE: Action an overkill ??
>> >>
>> >>
>> >> Hi,
>> >>
>> >> going through the action hides the
>> >> presentation-implementation from the user's eyes.
>> >>
>> >> For example, the user will only see ".../do/showTable" (or
>> >> ".../showTable.do") in
>> >> the browser's address line and therefor not be able to
>> >> bookmark the jsp-file, when
>> >> you use an action.
>> >>
>> >> The action also allows you to change more implementation
>> >> details without having
>> >> to change the presentation (JSP-file)...
>> >>
>> >> I advocate strict use of actions in every case...
>> >> => NEVER use a jsp-link, ALWAYS use an action
>> >>
>> >> just my two cents...
>> >> Alexander Jesse
>> >>
>> >> -Original Message-
>> >> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
>> >> Sent: Wednesday, December 05, 2001 10:54 AM
>> >> To: Struts-User (E-mail)
>> >> Subject: 

Filling fiels in a form after validinf error?

2001-12-05 Thread Mohammed

Hi,

How can a let the form hold the old user inputs when a validing Error occurs
and the form is sent by the ActionServlet again to the Browser?


Mohammed


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




RE: First visit to a form

2001-12-05 Thread Alexander Jesse

Hi,

sending them to an action first hides the JSP-detail and lets you 
prepopulate the form (if ever need arises). Also there has been a thread
on problems when the user wanders off and returns to your form, if you pass
by the action you can reset the form when entering...

Especially the possibility to prepopulate makes me advocate to use
action always. I think we never know if the business does not want from 
one moment to another "now we want some values prefilled...". Also 
Ted's catalog states "...never link to a jsp directly...".

You can use the same action as the one which validates and processes the
form by using the parameter-attribute in struts-config.xml. I do it all the
time...

hope this helps
Alexander

-Original Message-
From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 4:29 PM
To: Struts Users Mailing List
Subject: First visit to a form


When using the validator framework is it best to visit the action on the
first visit or to send the user to a jsp which submits to an action
which then goes back the the jsp if there are errors? The other option
would be to sent them directly to the jsp on the first attempt.

Thanks,
dave

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




RE: Test application.resources file

2001-12-05 Thread Keith Bacon

you could  have a message like 
'application.resources.changed=application resources
change 20 Nov 01 10:30'
& display it on some page - manually changing that
message when updating app resources(yuk!).
I have no time to do it but I'd like to create a file
object on the app resources file & call lastModified()
on it to display the real date it was changed.
Keith


--- Stephen Owens <[EMAIL PROTECTED]> wrote:
> Beth,
> 
> You could test for the load of the
> application.resources file using a
>  in a jsp file,
> where message.hello
> is a valid key in your application.resources file.
> 
> -Original Message-
> From: Strichartz, Beth
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 04, 2001 5:34 PM
> To: Struts Users Mailing List
> Subject: Test application.resources file
> 
> 
> Hi,
> Can anyone tell me how to test that I am actually
> reading\loading the
> application.resources file.
> 
> or
> 
> How to test is action errors exist in my form (or
> action) after I save
> them.
> 
> Beth.
> 
> 
> This message contains information which may be
> confidential and
> privileged.
> Unless you are the addressee  (or authorized to
> receive for the
> addressee),
> you may not use, copy or disclose to anyone the
> message or any
> information
> contained in the message.  If you have received the
> message in error,
> please
> advise the sender by reply e-mail, and delete or
> destroy the message. 
> 
> Thank you.
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

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




Re: Action an overkill ??

2001-12-05 Thread Ted Husted

It's my personal opinion that presentation pages should be as dumb as
possible. It should not have to "think" about the data, just render it
as it has been given. 

Conversely, the business layer should be as smart as possible, and
provide whatever alternatives the rest of the application needs to do it
job. If the dataset needs to be ordered in a certain way, then it is up
to the business layer to provide that ordering. 

It wouldn't know how to write a HTML table, but it should now how to get
the dataset ordered in the way the HTML table wants it. Ordering data is
business logic, shoving in the 's is the presentation's job.

The critical question, I think, is to ask -- "OK, what if we wanted to
do this with something other that a JSP. Say a printed report or another
templating system, like Velocity? Do we have everything we need on the
business tier to make this work?"

If business logic, like the alternative ways data is ordered, is
expressed in the tag extensions, then it is not available to another
presentation system. Like say, a report rendered as a PDF. 

So, IMHO, ordering is not something the Action does, or something a tag
extension does, is something the business layer does. The Action may
select which ordering has been requested by the client, but when the
data comes back, it just passes it along. Ordering data is business
logic, and custom code that does that should not be in any framework
component, including the tag extensions.

It may be that you need another set of beans between the EJBs and the
rest of your application. Many times EJBs end up representing the
resource layer, and only partially represent the business layer. So the
solution here may be a JavaBean wrapper that did the sorting, so all the
presentation page need do is call an iterator. Which ordering to use
would be a property on this (business layer) JavaBean, that the Action
might set to the way to the page. And submitting a request for a
different order would probably go back to the same Action (since it
already knows how to select an order).

If the data is being cached in the session, then it would be the
Action's job to get it back, and maybe call a method to change to the
default sort order. But the ordering would take place on the business
layer, the Action would just known enough to call the right method.

If the data need be presented to another device, like a PDF renderer,
the same JavaBean could be passed to that component. This provides
resuse not only between JavaServer Pages, but between all presentation
components.

In the end, pretty much the same code is going to get written either
way. The question is whether it can get more reuse in a tag extension or
in the JavaBean that the tag exposes.

HTH, Ted.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/


Abhishek Srivastava wrote:
> 
> Hello All,
> 
> I render a table through my jsp page. The user can sort the table by
> clicking on each of the column headers. When the user clicks on the column
> header, an Action is invoked and the data that is used to render the table
> is sorted accordingly and placed back into the session. Now the control is
> forwarded to the jsp that renders the table with sorted data/
> 
> I have got some feedback that using Action for things like sorting a table
> is an overkill. what is suggested that each table column should point to a
> jsp which should use a custom tag library to sort the table.
> 
> I am unable to decide which approach to take and why.
> 
> Can someone help me on this.
> 
> regards,
> Abhishek.
> 
> A ship in harbor is safe, but that is not what ships are built for.
> John A. Shedd
> 
> * * Abhishek Srivastava
> ***  /_  __ *** Hewlett-Packard - Solutions Organization
> **  / / /_/  ** 19 Cunningham Road. Bangalore -560052.
> ***/*** phone +91 80 2251554 Extn:1532
> * * mailto:[EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




RE: Test application.resources file

2001-12-05 Thread Stephen Owens

Beth,

You could test for the load of the application.resources file using a
 in a jsp file, where message.hello
is a valid key in your application.resources file.

-Original Message-
From: Strichartz, Beth [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 5:34 PM
To: Struts Users Mailing List
Subject: Test application.resources file


Hi,
Can anyone tell me how to test that I am actually reading\loading the
application.resources file.

or

How to test is action errors exist in my form (or action) after I save
them.

Beth.


This message contains information which may be confidential and
privileged.
Unless you are the addressee  (or authorized to receive for the
addressee),
you may not use, copy or disclose to anyone the message or any
information
contained in the message.  If you have received the message in error,
please
advise the sender by reply e-mail, and delete or destroy the message. 

Thank you.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Can a form submit to a vector?

2001-12-05 Thread Jon.Ridgway

Hi Alex,

Have a look at the struts-example web-app. This contains an example of what
you are trying to do. So yes it's possible. 

Jon.

-Original Message-
From: Alex Colic [mailto:[EMAIL PROTECTED]] 
Sent: 03 December 2001 17:41
To: Struts
Subject: Can a form submit to a vector?

Hi,

I have a vector that holds charging objects. The object has properties such
as name and amount.
On a page, at the top I iterate through the charging objects and create a
summary table. The table shows all the charging objects in the charging
vector and outputs their name and amount.

At the bottom of the page I want to create a form that the user can use to
enter the name and amount details for another charging object, hit submit
and have a new charging object added to the vector. Can this be done?

Thanks a lot.

Alex


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: ActionError Header/Foorters - can Global vs Non-Global be differentiated

2001-12-05 Thread Jon.Ridgway

Hi Greg,

You could try using the standard Struts ActionError's mechanism for
validation errors. Use the standard J2EE exception handling mechanism
errors.

To do this add error-page entries to your web.xml; one for exceptions and
another for warnings. Then through two types of corresponding user-defined
exceptions from your code.

Jon.

-Original Message-
From: Greg Callaghan [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 07:26
To: [EMAIL PROTECTED]
Subject: ActionError Header/Foorters - can Global vs Non-Global be
differentiated

Hi,

Noting that one may use an ActionError, and struts ErrorTag to display both 
GLOBAL and validation errors (non-GLOBAL).

Currently the header/footer text I use is focused on the non-Global errors 
(ie validation errors in a form).  Is there a way with struts to throw the 
errors back such that it would be more like the following -:

* Global Error1 (eg for resource not available error)
* Global Error1

 eg correct validation errors in form before proceeding
* Validation Error 1 - date should be in dd/mm/ format
* Validation Error 2


Regards
Greg



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: Connections & Transactions

2001-12-05 Thread Jon.Ridgway

HI Aneesha,

I think it depends on if you are using declarative transactions within your
stateless bean. If you are and set your transaction attribute to start a new
transaction, then the answer is yes. If you are not using declarative
transactions then it will be up to you to start a new transaction, either in
the DOA or the stateless session bean.

Jon Ridgway

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2001 04:59
To: [EMAIL PROTECTED]
Subject: Connections & Transactions

Hi all,

I have a question. If I have a DAO that is implemented as a simple java
class. I make a connection object at my session bean and pass it to the DAO
object. And the DAO object does all its operations on that connection
object. Then will the DAO come into the same transaction scope as the
session bean

This is really urgent. Would appreciate any help,

Thanks
Aneesha


--
To unsubscribe, e-mail:

For additional commands, e-mail:


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




RE: logic:notPresent tag doesn't work

2001-12-05 Thread Stephen Owens

I've used this tag successfully so I know it works. Any chance you're
missing the tag library definition for the struts logic tags in the jsp
file?

Stephen Owens
Corner Software

-Original Message-
From: Anthony Chater [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 3:36 AM
To: '[EMAIL PROTECTED]'
Subject: logic:notPresent tag doesn't work



In the Struts-example application the logic:notPresent tag is used in
index.jsp to check whether the Application resources file was loaded.
However I've tested this and it doesn't work. You still get a bunch of
missing key error messages .
Any suggestions


--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




RE: Can a form submit to a vector?

2001-12-05 Thread Tom Klaasen (TeleRelay)

One cool (although for the OO purists not entirely koosjer):

in your ActionForm, add the method
setAddChargingObject(String dummy)

in the jsp, construct the button like this:
Add

When the button is pressed, the method is called, and there you can add
another element to your vector.

hth,
tomK


> -Original Message-
> From: Alex Colic [mailto:[EMAIL PROTECTED]] 
> Sent: dinsdag 4 december 2001 14:19
> To: Struts
> Subject: RE: Can a form submit to a vector?
> 
> 
> Yes,
> 
> I want a form when submitted to add a new object to the vector.
> 
> 
> IE: I have a class with a getCharging method that returns a 
> vector. The
> vector holds charging objects. In the top half of the page I 
> iterate through
> the vector and show a table of existing objects. In the 
> bottom half of the
> page I want to create a form that when submitted adds another 
> object to the
> vector.
> 
> Thanks for any help.
> 
> 
> Alex
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 03, 2001 1:01 PM
> To: Struts Users Mailing List
> Subject: Re: Can a form submit to a vector?
> 
> 
> 
> 
> Do you mean dynamically?  ie another row added to the vector above it
> without a
> submit?
> 
> Dave
> 
> 
> 
> 
> 
> "Alex Colic" <[EMAIL PROTECTED]> 
> on 12/03/2001
> 12:40:57 PM
> 
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
> 
> To:   "Struts" <[EMAIL PROTECTED]>
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  Can a form submit to a vector?
> 
> 
> 
> Hi,
> 
> I have a vector that holds charging objects. The object has 
> properties such
> as name and amount.
> On a page, at the top I iterate through the charging objects 
> and create a
> summary table. The table shows all the charging objects in 
> the charging
> vector and outputs their name and amount.
> 
> At the bottom of the page I want to create a form that the 
> user can use to
> enter the name and amount details for another charging 
> object, hit submit
> and have a new charging object added to the vector. Can this be done?
> 
> Thanks a lot.
> 
> Alex
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
>  [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: 
> 
> 

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




  1   2   >