Re: how to use controllerclasses with tiles?

2004-07-15 Thread Mark Mandel
Fahd,

I've successfully implemented heaps of controller classes, but I'm
having trouble visualising what you have done.

Any chance of a code example?

Mark

On Fri, 16 Jul 2004 10:35:13 +0500, Fahd Ahmed <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am trying to use a controllerClass with Tiles. I am mentioning the
> controllerClass in one of my definition tags. The controller does nothing
> but put a varible in ComponentContext. On the JSP I just use the
> importAttribute tag to get that value. But when i access the page, I keep on
> getting the following error.
> 
> [ServletException in:/layouts/threeColumnLayout.jsp] Error - Illegal class
> access :Class org.apache.struts.tiles.ComponentDefinition can not access a
> member of class com.usersmarts.sam.tilescontroller.TestTileController with
> modifiers ""
> 
> threeColumnlayout is my layout JSP and TestTileController is the controller
> class I am associating with the definition tag.
> 
> Anyone who can think of a reason???
> 
> Regards
> Fahd


-- 
E: [EMAIL PROTECTED]
W: www.compoundtheory.com
ICQ: 3094740

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



how to use controllerclasses with tiles?

2004-07-15 Thread Fahd Ahmed
Hi,

I am trying to use a controllerClass with Tiles. I am mentioning the
controllerClass in one of my definition tags. The controller does nothing
but put a varible in ComponentContext. On the JSP I just use the
importAttribute tag to get that value. But when i access the page, I keep on
getting the following error.

[ServletException in:/layouts/threeColumnLayout.jsp] Error - Illegal class
access :Class org.apache.struts.tiles.ComponentDefinition can not access a
member of class com.usersmarts.sam.tilescontroller.TestTileController with
modifiers ""

threeColumnlayout is my layout JSP and TestTileController is the controller
class I am associating with the definition tag.

Anyone who can think of a reason???

Regards
Fahd


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



regular expression

2004-07-15 Thread subramaniam . o




Hi,
  I want to validate an attribute, the rule is that the input should
not start with 'Test',
 how to write the regular expression for this validation. Please help me
guys.

Thanks and regards
Subramaniam Olaganthan
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.


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

Re: About datasource

2004-07-15 Thread Koon Yue Lam
Thanks so much !!
u really helps and quick response !!

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



Re: About datasource

2004-07-15 Thread Craig McClanahan
Koon Yue Lam wrote:
Hi !
I have successfully use struts to connect MySql but I wonder do I
using the database connection pool, or just a new connection for each
request??
All I did is very simple stuffs and I follow strict to the database
How-To section of struts doc.
How can I know I am actually using a connection pool ??
 

If you are using an object whose class implements javax.sql.DataSource, 
you are indeed using a connection pool.  The number of connections in 
the pool is determined by your configuration properties, and the 
getConnection() method will reuse an existing connection from the pool 
(if there is one), only creating new connections when necessary -- and 
when the total number of connections you specify has not yet been reached.

A very important consideration when using connection pools is to ensure 
that you *always* return the connection to the pool, even when an 
exception is encountered.  One pattern I like to follow that ensures 
this is to use a "try ... finally" block, something like this:

   Connection conn = null;
   DataSource ds = ...; // Get a reference to your data source
   try {
   conn = ds.getConnection(); // Allocate a connection from the pool
   ... use the connection as necessary ...
   } catch (SQLException e) {
   ... deal with exceptions as needed ...
   } finally {
   // If you got a connection from the pool, the close() method
   // does *not* close the physical connection; it returns this one
   // to the available pool
   if (conn != null) {
   conn.close();
   }
   }
The "finally" block is always executed (even if an exception occurs), so 
this design idiom ensures that there's no way for me to forget to return 
a connection when I am done with it.

Regards
 

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


About datasource

2004-07-15 Thread Koon Yue Lam
Hi !
I have successfully use struts to connect MySql but I wonder do I
using the database connection pool, or just a new connection for each
request??
All I did is very simple stuffs and I follow strict to the database
How-To section of struts doc.
How can I know I am actually using a connection pool ??

Regards

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



Re: calling request.getInputStream() within Action

2004-07-15 Thread Craig McClanahan
Robert Shields wrote:
Hi Craig,
Yes, I thought as much.
Do you know if it's possible to exactly recreate the binary HTTP body from parsed parameters, or elsewhere for that matter?
 

The only thing I could think of would be a Filter -- requires Servlet 
2.3 or later -- that would be able to scrape a copy of the incoming 
request, yet still provide getInputStream() and getReader() methods that 
would let the actual servlet being invoked operate normally.

You'll also have to watch out for the complexity that a servlet can call 
*either* getInputStream() *or* getReader() on any single call.  That 
means, among other things, that you'll need to create a request wrapper 
that not only does the copying for you, but also fakes the getReader() 
method, since you'll have already called getInputStream() on the real 
underlying request.

I'm writing a web proxy using HttpClient - currently I've only tested a urlencoded 
form, which works fine with the following code. I wonder how it will fair when it 
encounters a mutipart form - I haven't tested yet.
HttpClient client = new HttpClient();
...
if (request.getMethod().toLowerCase().equals("post"))
{
   HttpMethod method = new PostMethod(url.toString());
   PostMethod postMethod = (PostMethod)method;
   // populate form parameters
   Enumeration paramEnum = request.getParameterNames();
   while (paramEnum.hasMoreElements()) {
   String key = ((String) paramEnum.nextElement());
   String[] values = request.getParameterValues(key);
   String value = "";
   for(int i=0; i
   value += values[i] + (i < values.length-1 ? "," : "");
   postMethod.addParameter(key, value);
   }
}
Sorry for the HTML email - outlook web access :)
 

You'll probably need to check the content type as well ... the above 
works for how browsers normally post data (content type 
"application/x-www-form-urlencoded"), but multipart uploads use 
something different.

On the other hand, if you never call getParameterXxx() type methods in 
your servlet, you should have been able to copy the input stream as in 
your original approach -- you might want to double check that you're not 
doing that.

Rob
 

Craig
	-Original Message- 
	From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
	Sent: Thu 15/07/2004 17:50 
	To: Struts Users Mailing List 
	Cc: 
	Subject: Re: calling request.getInputStream() within Action
	
	

	Robert Shields wrote:
	
	>Hi Bill
	>
	>Thanks for your response.
	>I've tried with a servlet too, but even without calling
	>request.getParameter the stream is still empty:
	>
	> 
	>
	One way to paint yourself into this particular corner is if you're
	trying this on a POST request.  As soon as you call a method like
	request.getParameter(), the container has to read the content of the
	input stream (since that is where the key/value pairs are), so trying to
	read the stream after that is not going to work.
	
	Craig
	
	
	-
	To unsubscribe, e-mail: [EMAIL PROTECTED]
	For additional commands, e-mail: [EMAIL PROTECTED]
	
	
	This e-mail has been scanned for all viruses by Star Internet. The
	service is powered by MessageLabs. For more information on a proactive
	anti-virus service working around the clock, around the globe, visit:
	http://www.star.net.uk
	_
	

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


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


Re: Struts Sample / Best Practices for Database access

2004-07-15 Thread Vic Cekvenich
http://www.reumann.net/do/struts/ibatisLesson1
Richard Reyes wrote:
Hi Guys,
Newbie question, where can i get struts sample application using 
database components like DAO, JDO or Hibernate samples.

Thanks
Richard

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


RE: Missing message for key "welcome.title"

2004-07-15 Thread Venkat Maddipati
Make sure that the properties file (Resource Bundle file) is set properly in
the struts configuration file (usually, struts-config.xml) and check that
welcome.title property is defined in the resources file.

The entry for the Message Resources looks like the following in the struts
config file:




Also, check that this resources file is in the classpath.

Thanks,
Venkat

-Original Message-
From: Krishna Garimella [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 15, 2004 4:10 PM
To: [EMAIL PROTECTED]
Subject: Missing message for key "welcome.title"


Hi,

I have downloaded jakarta-struts-1.1 and installed it as per the 
installation instructions. When I try to run the tutorial I get the 
following message Missing message for key "welcome.title". I did search 
the archives and tried all the fixes available for this problem, but 
nothing works. Any help is appreciated.

Thanks,

Krishna


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






If you have received this e-mail in error, please delete it and notify the sender as 
soon as possible. The contents of this e-mail may be confidential and the unauthorized 
use, copying, or dissemination of it and any attachments to it, is prohibited. 

Internet communications are not secure and Hyperion does not, therefore, accept legal 
responsibility for the contents of this message nor for any damage caused by viruses.  
The views expressed here do not necessarily represent those of Hyperion.

For more information about Hyperion, please visit our Web site at www.hyperion.com

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



Missing message for key "welcome.title"

2004-07-15 Thread Krishna Garimella
Hi,
   I have downloaded jakarta-struts-1.1 and installed it as per the 
installation instructions. When I try to run the tutorial I get the 
following message Missing message for key "welcome.title". I did search 
the archives and tried all the fixes available for this problem, but 
nothing works. Any help is appreciated.

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


Text search not available for this list

2004-07-15 Thread Eliot Stock
When I try to search the archives for this list at:

http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]

I intermittently get this message:

Text search not available for this list

which must be a bad error message, because I'm sure I've searched it before.

Also, it looks like the mailing list moved from
[EMAIL PROTECTED] to [EMAIL PROTECTED] a few months
ago, but the archives link on this page:

http://struts.apache.org/learning.html

is still to the [EMAIL PROTECTED] list.

Cheers,

Eliot.

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



RE: webapp deployment

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Phyl [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 3:04 PM
> To: Struts Users Mailing List
> Subject: Re: webapp deployment
> 
> 
> 
>   Hi,
> 
> I tried adding a context parameter to web.xml:
> 
> testparam
> hello
>  
> 
> and access it in a jsp:
> 
> 
> <%
> 
> out.print(getServletContext().getInitParameter("testparam"));
> %>
> 
> 
> 
> 
>  The result of this print was a "null" value, but struts isn't even 
> involved in this code so maybe struts is not the problem after all.
> perhaps web.xml isn't being loaded... (!?) any thoughts?

If the web.xml isn't being loaded, then you're web app would not only not work, it 
would not technically exist on the server.
It's possible that you're xml file is not configured quite right... and the web app 
would still function if the server is not picky about things like valid xml.  Try 
validating your xml and see what happens.

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



Re: webapp deployment

2004-07-15 Thread Phyl
 Hi,
I tried adding a context parameter to web.xml:
   
   testparam
   hello


and access it in a jsp:
   
   
   <%
   
out.print(getServletContext().getInitParameter("testparam"));
   %>
   
   

The result of this print was a "null" value, but struts isn't even 
involved in this code so maybe struts is not the problem after all.
perhaps web.xml isn't being loaded... (!?) any thoughts?

  Thanks in advance,
  Phyl

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


RE: calling request.getInputStream() within Action

2004-07-15 Thread Robert Shields
Hi Craig,
 
Yes, I thought as much.
Do you know if it's possible to exactly recreate the binary HTTP body from parsed 
parameters, or elsewhere for that matter?
 
I'm writing a web proxy using HttpClient - currently I've only tested a urlencoded 
form, which works fine with the following code. I wonder how it will fair when it 
encounters a mutipart form - I haven't tested yet.
 
HttpClient client = new HttpClient();

...

if (request.getMethod().toLowerCase().equals("post"))

{

HttpMethod method = new PostMethod(url.toString());

PostMethod postMethod = (PostMethod)method;

// populate form parameters

Enumeration paramEnum = request.getParameterNames();

while (paramEnum.hasMoreElements()) {

String key = ((String) paramEnum.nextElement());

String[] values = request.getParameterValues(key);

String value = "";

for(int i=0; imailto:[EMAIL PROTECTED] 
Sent: Thu 15/07/2004 17:50 
To: Struts Users Mailing List 
Cc: 
Subject: Re: calling request.getInputStream() within Action



Robert Shields wrote:

>Hi Bill
>
>Thanks for your response.
>I've tried with a servlet too, but even without calling
>request.getParameter the stream is still empty:
>
> 
>
One way to paint yourself into this particular corner is if you're
trying this on a POST request.  As soon as you call a method like
request.getParameter(), the container has to read the content of the
input stream (since that is where the key/value pairs are), so trying to
read the stream after that is not going to work.

Craig


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


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



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

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



Re:

2004-07-15 Thread Andrew Close
All right, i'm a real idiot.
it was a javascript issue.  after i check to make sure the dropdown
value wasn't -1, i set it to -1 and then submit the form.  must've
been one of those hasty cut & paste mistakes...

everythings fine.  nothing to see here.  move along...

On Thu, 15 Jul 2004 16:06:21 -0500, Andrew Close <[EMAIL PROTECTED]> wrote:
> Blah!  it works fine with a submit button. :)
> i guess i'll have to find another way to make the onchange work...
> 
> 
> 
> On Thu, 15 Jul 2004 15:49:05 -0500, Andrew Close <[EMAIL PROTECTED]> wrote:
> > ahh.  yeah, i added just plain  > didn't work.  i'll see if i can get rid of the javascript and just
> > submit with a button to test this out...
> >
> > Thanks Jim
> >
> > andy
> >
> >
> >
> > On Thu, 15 Jul 2004 13:43:18 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: Andrew Close [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, July 15, 2004 1:40 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: 
> > > >
> > > >
> > > > -- Jim wrote:
> > > > > I don't think there is a better way, I'm just suggesting
> > > > maybe hardcoding those to drop downs for testing purposes,
> > > > and eliminate the JS.  You're JSP looks right, and I'm
> > > > assuming that your form bean has the return values as arrays
> > > > if their multi-select, or single strings and they're
> > > > otherwise set up exactly the same.
> > > > > Technically you're submitting the same form twice, so it
> > > > should be working.  I'm wondering if it will work without the
> > > > javascript based on the theory of boiling down the problem to
> > > > it's aboslute basics, and that would be: are you in fact set
> > > > up correctly to submit 2 select tags at once.
> > > >
> > > >
> > > > hmm.  i see what you're saying.
> > > > my form bean does have two string values with getters and setters, one
> > > > for each dropdown.  i'll try hard coding one and removing the other
> > > > and see what happens.  if this works then i still have to figure out
> > > > if the issue lies in the form/action or if it's in the
> > > >  > >
> > > Close, I'm suggesting that you leav out the JS, keep the JSP and action form the 
> > > same, and maybe add a submit button to the page.  You might want to try using 
> > >  > > action.
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>

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



Re: html:image question

2004-07-15 Thread Michael McGrady
At 11:53 AM 7/15/2004, you wrote:
It make little sense to do it the Husted way and have multiple image
bean buttons to represent which html:image
was selected. IMHO, that approach is too much like hard coding.

I for one cannot imagine why you would want a button value to be dynamic 
other than to present i18n options or other image issues.  I cannot, that 
is, imagine why you would not want the issue of whether it was a "submit" 
or "reset" or "clear" etc. button to be dynamic.  Maybe you have a use case 
I am not thinking about.  IMHO that the only thing you need to have dynamic 
is the content, not the function of the button, e.g. to make what the 
button looks like dynamic but what the button does static.  I think this 
was Ted's approach too.  I mean I think Ted and I have the same approach on 
that, even though this solution is a lot more convoluted than Ted's.  I 
should say that I am not sure which of Ted's solutions you are talking 
about.  He has more than one.  Some use JavaScript, etc.

Michael

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


Re: html:image question

2004-07-15 Thread Michael McGrady
At 02:26 PM 7/15/2004, you wrote:


Re: html:image question

2004-07-15 Thread Michael McGrady
At 11:53 AM 7/15/2004, you wrote:
How can I pass parameters in a 
http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript 

If you do the coding on this one time, you merely have to add a new button 
when you want one in command class ButtonOperation.  After a while, you 
will have to do no coding at all.  Actually, I have built a taglib 
utilizing this Multiple Image Button "scenario" that looks like the 
following on the page:



This something like what you are interested in?

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


Re:

2004-07-15 Thread Andrew Close
Blah!  it works fine with a submit button. :)
i guess i'll have to find another way to make the onchange work...

On Thu, 15 Jul 2004 15:49:05 -0500, Andrew Close <[EMAIL PROTECTED]> wrote:
> ahh.  yeah, i added just plain  didn't work.  i'll see if i can get rid of the javascript and just
> submit with a button to test this out...
> 
> Thanks Jim
> 
> andy
> 
> 
> 
> On Thu, 15 Jul 2004 13:43:18 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > > -Original Message-
> > > From: Andrew Close [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 15, 2004 1:40 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: 
> > >
> > >
> > > -- Jim wrote:
> > > > I don't think there is a better way, I'm just suggesting
> > > maybe hardcoding those to drop downs for testing purposes,
> > > and eliminate the JS.  You're JSP looks right, and I'm
> > > assuming that your form bean has the return values as arrays
> > > if their multi-select, or single strings and they're
> > > otherwise set up exactly the same.
> > > > Technically you're submitting the same form twice, so it
> > > should be working.  I'm wondering if it will work without the
> > > javascript based on the theory of boiling down the problem to
> > > it's aboslute basics, and that would be: are you in fact set
> > > up correctly to submit 2 select tags at once.
> > >
> > >
> > > hmm.  i see what you're saying.
> > > my form bean does have two string values with getters and setters, one
> > > for each dropdown.  i'll try hard coding one and removing the other
> > > and see what happens.  if this works then i still have to figure out
> > > if the issue lies in the form/action or if it's in the
> > >  >
> > Close, I'm suggesting that you leav out the JS, keep the JSP and action form the 
> > same, and maybe add a submit button to the page.  You might want to try using 
> >  >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

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



Re:

2004-07-15 Thread Andrew Close
ahh.  yeah, i added just plain  wrote:
> 
> 
> 
> 
> > -Original Message-
> > From: Andrew Close [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 15, 2004 1:40 PM
> > To: Struts Users Mailing List
> > Subject: Re: 
> >
> >
> > -- Jim wrote:
> > > I don't think there is a better way, I'm just suggesting
> > maybe hardcoding those to drop downs for testing purposes,
> > and eliminate the JS.  You're JSP looks right, and I'm
> > assuming that your form bean has the return values as arrays
> > if their multi-select, or single strings and they're
> > otherwise set up exactly the same.
> > > Technically you're submitting the same form twice, so it
> > should be working.  I'm wondering if it will work without the
> > javascript based on the theory of boiling down the problem to
> > it's aboslute basics, and that would be: are you in fact set
> > up correctly to submit 2 select tags at once.
> >
> >
> > hmm.  i see what you're saying.
> > my form bean does have two string values with getters and setters, one
> > for each dropdown.  i'll try hard coding one and removing the other
> > and see what happens.  if this works then i still have to figure out
> > if the issue lies in the form/action or if it's in the
> >  
> Close, I'm suggesting that you leav out the JS, keep the JSP and action form the 
> same, and maybe add a submit button to the page.  You might want to try using 
>  
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



RE:

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 1:40 PM
> To: Struts Users Mailing List
> Subject: Re: 
> 
> 
> -- Jim wrote:
> > I don't think there is a better way, I'm just suggesting 
> maybe hardcoding those to drop downs for testing purposes, 
> and eliminate the JS.  You're JSP looks right, and I'm 
> assuming that your form bean has the return values as arrays 
> if their multi-select, or single strings and they're 
> otherwise set up exactly the same.
> > Technically you're submitting the same form twice, so it 
> should be working.  I'm wondering if it will work without the 
> javascript based on the theory of boiling down the problem to 
> it's aboslute basics, and that would be: are you in fact set 
> up correctly to submit 2 select tags at once.
> 
> 
> hmm.  i see what you're saying.
> my form bean does have two string values with getters and setters, one
> for each dropdown.  i'll try hard coding one and removing the other
> and see what happens.  if this works then i still have to figure out
> if the issue lies in the form/action or if it's in the
> 

Re:

2004-07-15 Thread Andrew Close
-- Jim wrote:
> I don't think there is a better way, I'm just suggesting maybe hardcoding those to 
> drop downs for testing purposes, and eliminate the JS.  You're JSP looks right, and 
> I'm assuming that your form bean has the return values as arrays if their 
> multi-select, or single strings and they're otherwise set up exactly the same.
> Technically you're submitting the same form twice, so it should be working.  I'm 
> wondering if it will work without the javascript based on the theory of boiling down 
> the problem to it's aboslute basics, and that would be: are you in fact set up 
> correctly to submit 2 select tags at once.


hmm.  i see what you're saying.
my form bean does have two string values with getters and setters, one
for each dropdown.  i'll try hard coding one and removing the other
and see what happens.  if this works then i still have to figure out
if the issue lies in the form/action or if it's in the


RE:

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 1:08 PM
> To: Struts Users Mailing List
> Subject: Re: 
> 
> 
> On Thu, 15 Jul 2004 12:10:49 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
> > Just to make sure I understand what's happening.
> > You display a page, user selects from first list, the page 
> submits, the action does it's thing,  and populates the 
> second list, then the user selects from that list, submits 
> and at that point you only have the first selection and not 
> the second.  In addition the javascript seems to know what's 
> going on, but the form bean doesn't.
> 
> close. :)  i display a page with two dropdowns.  the first one is
> populated.  after selecting a value from the first dropdown my action
> should get that dropdowns value out of the form and use that value to
> get the contents of the other dropdown and then return to the same
> JSP.
> the javascript that i'm using to submit the form checks to make sure
> the dropdown value isn't = -1.  then it submits the form.  i've added
> an alert to the javascript and am able to see the value of the
> dropdown there.
> however, in the action when i try to get the dropdowns value out of
> the form i only get -1, the initial value.
> the form is able to get textfield values from the JSP, but not the
> select values...
> 
> > 
> > I would try a dummy action that would fill both lists, then 
> select from both lists and get that working, then I would try 
> doing it your way.  I have a sneaking suspicion that there is 
> something funky going on with the javascript, but don't know 
> what it would be.  Eliminating it and getting the basic 
> operations working first would be a good start.
> > 
> 
> the second dropdown relies on the selected value of the first
> dropdown.  using the javascript to submit the form was the only option
> i could think of since i could use the onchange event to resubmit the
> form.  is there a better way to to that?  i really don't think the
> javascript is causing the problem since i'm able to display both the
> value of the dropdown and textfield in alert boxes when submitting. 
> but for some reason the form or action doesn't pick up the selected
> value of the dropdown...

I don't think there is a better way, I'm just suggesting maybe hardcoding those to 
drop downs for testing purposes, and eliminate the JS.  You're JSP looks right, and 
I'm assuming that your form bean has the return values as arrays if their 
multi-select, or single strings and they're otherwise set up exactly the same.
Technically you're submitting the same form twice, so it should be working.  I'm 
wondering if it will work without the javascript based on the theory of boiling down 
the problem to it's aboslute basics, and that would be: are you in fact set up 
correctly to submit 2 select tags at once.

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



Re: How to use roles with Struts

2004-07-15 Thread Hubert Rabago
Ron,

You can associate roles with each action mapping so that only users with
certain roles can access that action.



Hubert

--- ron1 <[EMAIL PROTECTED]> wrote:
> Thanx Jim :-)
> Am I wrong on that one canonly  configure web.xml roles on a servlet 
> base? which will mean, I set roles for a servlet mapping? so all my 
> struts actions will map to the same Permission...
> Or did I miss something in the web.xml?
> Cheers,
> Ron
> 
> 
> 
> Jim Barrows wrote:
> > 
> >>-Original Message-
> >>From: news [mailto:[EMAIL PROTECTED] Behalf Of ron1
> >>Sent: Thursday, July 15, 2004 11:51 AM
> >>To: [EMAIL PROTECTED]
> >>Subject: How to use roles with Struts
> >>
> >>
> >>Hi all :-)
> >>I am wondering how some of the experienced users use roles 
> >>with struts.
> >>I saw there is a query for roles in the API (getRoles()), but 
> >>could not 
> >>figure out how to configure ACLs with struts, or more 
> >>specific: where to 
> >>define which action is allowed for which role, and, and I 
> >>guess that is 
> >>done through Java, how to set the user's role in, for 
> >>example, after ge 
> >>logs in.
> >>
> >>My application will use 3 roles, and perhaps an additional admin role:
> >>some actions / pages will have unlimited access ( guest or visitor)
> >>some others will need a log in (user)
> >>and some others will need a privelege (priveleged user).
> >>
> >>Could you share your experience?
> > 
> > 
> > 2 approaches, the declartive security that is part of web.xml or roll
> your own.
> > 
> > With roll your own there are two approaches:
> > 1) A base action the checks roles and other authorization before doing
> anything, and your other
> > actions inherit from that. (or you can just hard code the authorization
> check in each class)
> > 2) Use Filters.
> > 
> > I like using filters for applications that must be secure, since I can
> choose a default deny approach, rather then the more permissive default
> allow that the declaritive security provides.  In addition, as your access
> rules and authorization methodologies change, you can change with them
> without having to wait for your server to change too..
> > 
> > On the other hand for a public side website, I prefer the web.xml version
> because I'm lazy and don't want to think about security for the most part. 
> The public side is usually better to have default allow becasue you want
> most people to view the entire site.  Its easier to specify what to protect
> then what to allow in such cases.
> > 
> > 
> >>What I currently imagine as to be a good solution is a Permission 
> >>setting on the action configuration (e.g. at struts-config.xml) which 
> >>will be automatically checked at the controller instance, and forward 
> >>users to login / not permitted pages.
> >>
> >>Cheers and thanx advance,
> >>Ron
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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



Re:

2004-07-15 Thread Andrew Close
On Thu, 15 Jul 2004 12:10:49 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:

> Just to make sure I understand what's happening.
> You display a page, user selects from first list, the page submits, the action does 
> it's thing,  and populates the second list, then the user selects from that list, 
> submits and at that point you only have the first selection and not the second.  In 
> addition the javascript seems to know what's going on, but the form bean doesn't.

close. :)  i display a page with two dropdowns.  the first one is
populated.  after selecting a value from the first dropdown my action
should get that dropdowns value out of the form and use that value to
get the contents of the other dropdown and then return to the same
JSP.
the javascript that i'm using to submit the form checks to make sure
the dropdown value isn't = -1.  then it submits the form.  i've added
an alert to the javascript and am able to see the value of the
dropdown there.
however, in the action when i try to get the dropdowns value out of
the form i only get -1, the initial value.
the form is able to get textfield values from the JSP, but not the
select values...

> 
> I would try a dummy action that would fill both lists, then select from both lists 
> and get that working, then I would try doing it your way.  I have a sneaking 
> suspicion that there is something funky going on with the javascript, but don't know 
> what it would be.  Eliminating it and getting the basic operations working first 
> would be a good start.
> 

the second dropdown relies on the selected value of the first
dropdown.  using the javascript to submit the form was the only option
i could think of since i could use the onchange event to resubmit the
form.  is there a better way to to that?  i really don't think the
javascript is causing the problem since i'm able to display both the
value of the dropdown and textfield in alert boxes when submitting. 
but for some reason the form or action doesn't pick up the selected
value of the dropdown...

andy

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



RE: Configuring plug-ins using

2004-07-15 Thread Geeta Ramani
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 3:35 PM
> To: Struts Users Mailing List
> Subject: RE: Configuring plug-ins using  struts-config.xml)
> 
> > > 
> > P.S> I can see now why writing to the list before googling is 
> > so tempting..!
> 
> It is but then you can end up with a bunch of suggestions you 
> have already tried, when you're looking for something you 
> haven't tried :)


yeah, like maybe read what the doc says rather than make it up as you go along..!

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



RE: Configuring plug-ins using

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 12:21 PM
> To: Struts Users Mailing List
> Subject: RE: Configuring plug-ins using  struts-config.xml)
> 
> 
> Jim:
> 
> Yes that worked. I actually read ".. which will 
> all have been called before the init() method is invoked." as 
> "which will have to be called before the init() method is 
> invoked." and got stumped.. 
> 

*LOL* If you're in arizona you need the fried="true" tag.

> 
> Thank you so much!
> Geeta
> 
> P.S> I can see now why writing to the list before googling is 
> so tempting..!

It is but then you can end up with a bunch of suggestions you have already tried, when 
you're looking for something you haven't tried :)

> 
> 
> > From
> > http://struts.apache.org/api/org/apache/struts/action/PlugIn.html
> > I read:
> > Configuration can be accomplished by providing standard 
> > JavaBeans property setter methods, which will all have been 
> > called before the init() method is invoked.
> > 
> > I can assume that something like this would work:
> > 
> > public class SomeLogicalClassName implements Plugin {
> > private String aWellNamedPropertyFieldYouWantToSet;
> > public void get...
> > public void set...
> > }
> > 
> > and in your config:
> > 
> >  > property="aWellNamedPropertyFieldYouWantToSet" value="A 
> > configuration value" />
> > 
> > 
> > and voila! your plugin is configured.  Maybe... I could be 
> > talking out of my hat here.  But that seems logical.
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE:

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 12:30 PM
> To: Struts Users Mailing List
> Subject: Re: 
> 
> 
> the weird thing is that i just added a textfield to the form and my
> form/action picks that up.  so what do you have to do to get
>  read by a form?

Virgin sacrifice sometimes works...

> 
> andy
> 
> 
> On Thu, 15 Jul 2004 13:56:48 -0500, Andrew Close 
> <[EMAIL PROTECTED]> wrote:
> > sl_getGroups is being called.  i printed out alerts when i 
> was writing
> > it.  and i have Sys.outs in the action.  besides, my JSP 
> wouldn't show
> > up if it wasn't :)
> > 
> > the javascript is fairly simple:  (i know there is a more 
> Strutsy way
> > to do this, i'm getting there...)
> > 
> > function sl_getGroups(frm) {
> > if 
> (frm.selectedShoppingList.options[frm.selectedShoppingList.sel
> ectedIndex].value
> > != "-1") {
> >   
> frm.selectedShoppingList.options[frm.selectedShoppingList.sele
> ctedIndex].value
> > = "-1";
> >   frm.action += "?step=getGroups";
> >   frm.submit();
> >  }
> > }
> > 
> > the javascript just checks to see that the 
> selectedShoppingList is not
> > "-1", the initial value.  it then appends my step parameter to the
> > action.  this is working.  what is funny is that the javascript
> > recognizes that the selectedShoppingList is not "-1", but the form
> > doesn't pick that up...
> > 
> > any suggestions?
> > 
> > andy
> > 
> > 
> > 
> > 
> > On Thu, 15 Jul 2004 14:36:14 -0400, Bill Siggelkow
> > <[EMAIL PROTECTED]> wrote:
> > > Hmmm ... looks pretty darn hairy. You didn't show the 
> JavaScript thats
> > > called by the onchange --  I would verify first that 
> "getGroups" is
> > > being called.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Configuring plug-ins using

2004-07-15 Thread Geeta Ramani
Jim:

Yes that worked. I actually read ".. which will all have been called 
before the init() method is invoked." as "which will have to be called before the 
init() method is invoked." and got stumped.. 


Thank you so much!
Geeta

P.S> I can see now why writing to the list before googling is so tempting..!


> From
> http://struts.apache.org/api/org/apache/struts/action/PlugIn.html
> I read:
> Configuration can be accomplished by providing standard 
> JavaBeans property setter methods, which will all have been 
> called before the init() method is invoked.
> 
> I can assume that something like this would work:
> 
> public class SomeLogicalClassName implements Plugin {
>   private String aWellNamedPropertyFieldYouWantToSet;
>   public void get...
>   public void set...
> }
> 
> and in your config:
> 
>property="aWellNamedPropertyFieldYouWantToSet" value="A 
> configuration value" />
> 
> 
> and voila! your plugin is configured.  Maybe... I could be 
> talking out of my hat here.  But that seems logical.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re:

2004-07-15 Thread Andrew Close
the weird thing is that i just added a textfield to the form and my
form/action picks that up.  so what do you have to do to get
 read by a form?

andy


On Thu, 15 Jul 2004 13:56:48 -0500, Andrew Close <[EMAIL PROTECTED]> wrote:
> sl_getGroups is being called.  i printed out alerts when i was writing
> it.  and i have Sys.outs in the action.  besides, my JSP wouldn't show
> up if it wasn't :)
> 
> the javascript is fairly simple:  (i know there is a more Strutsy way
> to do this, i'm getting there...)
> 
> function sl_getGroups(frm) {
> if (frm.selectedShoppingList.options[frm.selectedShoppingList.selectedIndex].value
> != "-1") {
>   frm.selectedShoppingList.options[frm.selectedShoppingList.selectedIndex].value
> = "-1";
>   frm.action += "?step=getGroups";
>   frm.submit();
>  }
> }
> 
> the javascript just checks to see that the selectedShoppingList is not
> "-1", the initial value.  it then appends my step parameter to the
> action.  this is working.  what is funny is that the javascript
> recognizes that the selectedShoppingList is not "-1", but the form
> doesn't pick that up...
> 
> any suggestions?
> 
> andy
> 
> 
> 
> 
> On Thu, 15 Jul 2004 14:36:14 -0400, Bill Siggelkow
> <[EMAIL PROTECTED]> wrote:
> > Hmmm ... looks pretty darn hairy. You didn't show the JavaScript thats
> > called by the onchange --  I would verify first that "getGroups" is
> > being called.

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



RE: How to use roles with Struts

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of ron1
> Sent: Thursday, July 15, 2004 12:08 PM
> To: [EMAIL PROTECTED]
> Subject: Re: How to use roles with Struts
> 
> 
> Thanx Jim :-)
> Am I wrong on that one canonly  configure web.xml roles on a servlet 
> base? which will mean, I set roles for a servlet mapping? so all my 
> struts actions will map to the same Permission...
> Or did I miss something in the web.xml?

Ayup... in the ballpark though it's called   not servlet mapping.  
The security is URI based, from:
http://java.sun.com/webservices/docs/1.3/tutorial/doc/index.html
Chapter 24, Section Specifying Security Constraints.
Any URI works, even if you don't have it mapped to a servlet.  I have been known to 
make all my actions follow the pattern /context/role/action.do, and then in the 
url-pattern use /role/* just coz I'm lazy.  Can't always do that, but it is nice when 
you can.


> Cheers,
> Ron
> 
> 
> 
> Jim Barrows wrote:
> > 
> >>-Original Message-
> >>From: news [mailto:[EMAIL PROTECTED] Behalf Of ron1
> >>Sent: Thursday, July 15, 2004 11:51 AM
> >>To: [EMAIL PROTECTED]
> >>Subject: How to use roles with Struts
> >>
> >>
> >>Hi all :-)
> >>I am wondering how some of the experienced users use roles 
> >>with struts.
> >>I saw there is a query for roles in the API (getRoles()), but 
> >>could not 
> >>figure out how to configure ACLs with struts, or more 
> >>specific: where to 
> >>define which action is allowed for which role, and, and I 
> >>guess that is 
> >>done through Java, how to set the user's role in, for 
> >>example, after ge 
> >>logs in.
> >>
> >>My application will use 3 roles, and perhaps an additional 
> admin role:
> >>some actions / pages will have unlimited access ( guest or visitor)
> >>some others will need a log in (user)
> >>and some others will need a privelege (priveleged user).
> >>
> >>Could you share your experience?
> > 
> > 
> > 2 approaches, the declartive security that is part of 
> web.xml or roll your own.
> > 
> > With roll your own there are two approaches:
> > 1) A base action the checks roles and other authorization 
> before doing anything, and your other
> > actions inherit from that. (or you can just hard code the 
> authorization check in each class)
> > 2) Use Filters.
> > 
> > I like using filters for applications that must be secure, 
> since I can choose a default deny approach, rather then the 
> more permissive default allow that the declaritive security 
> provides.  In addition, as your access rules and 
> authorization methodologies change, you can change with them 
> without having to wait for your server to change too..
> > 
> > On the other hand for a public side website, I prefer the 
> web.xml version because I'm lazy and don't want to think 
> about security for the most part.  The public side is usually 
> better to have default allow becasue you want most people to 
> view the entire site.  Its easier to specify what to protect 
> then what to allow in such cases.
> > 
> > 
> >>What I currently imagine as to be a good solution is a Permission 
> >>setting on the action configuration (e.g. at 
> struts-config.xml) which 
> >>will be automatically checked at the controller instance, 
> and forward 
> >>users to login / not permitted pages.
> >>
> >>Cheers and thanx advance,
> >>Ron
> >>
> >>
> >>
> -
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Configuring plug-ins using

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 12:01 PM
> To: Struts Users Mailing List (E-mail)
> Subject: Configuring plug-ins using  struts-config.xml)
> 
> 
> Hi all:
> 
> I have a question regarding the use of plug-ins. According to 
> the docs,
> 
> "For PlugIns that require configuration themselves, the 
> nested  element is available."
> 
> My question is simply this: how do I retrieve the value that 
> I set in a set-property tag? I am sure this is dead simple to 
> most of you, but even after googling for two hours and 
> looking at the source code for the tiles plug-in I seem to be 
> going nowhere...(:(
From
http://struts.apache.org/api/org/apache/struts/action/PlugIn.html
I read:
Configuration can be accomplished by providing standard JavaBeans property setter 
methods, which will all have been called before the init() method is invoked.

I can assume that something like this would work:

public class SomeLogicalClassName implements Plugin {
private String aWellNamedPropertyFieldYouWantToSet;
public void get...
public void set...
}

and in your config:




and voila! your plugin is configured.  Maybe... I could be talking out of my hat here. 
 But that seems logical.


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



Re: How to use roles with Struts

2004-07-15 Thread ron1
Thanx Jim :-)
Am I wrong on that one canonly  configure web.xml roles on a servlet 
base? which will mean, I set roles for a servlet mapping? so all my 
struts actions will map to the same Permission...
Or did I miss something in the web.xml?
Cheers,
Ron


Jim Barrows wrote:

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of ron1
Sent: Thursday, July 15, 2004 11:51 AM
To: [EMAIL PROTECTED]
Subject: How to use roles with Struts
Hi all :-)
I am wondering how some of the experienced users use roles 
with struts.
I saw there is a query for roles in the API (getRoles()), but 
could not 
figure out how to configure ACLs with struts, or more 
specific: where to 
define which action is allowed for which role, and, and I 
guess that is 
done through Java, how to set the user's role in, for 
example, after ge 
logs in.

My application will use 3 roles, and perhaps an additional admin role:
some actions / pages will have unlimited access ( guest or visitor)
some others will need a log in (user)
and some others will need a privelege (priveleged user).
Could you share your experience?

2 approaches, the declartive security that is part of web.xml or roll your own.
With roll your own there are two approaches:
1) A base action the checks roles and other authorization before doing anything, and 
your other
actions inherit from that. (or you can just hard code the authorization check in each 
class)
2) Use Filters.
I like using filters for applications that must be secure, since I can choose a 
default deny approach, rather then the more permissive default allow that the 
declaritive security provides.  In addition, as your access rules and authorization 
methodologies change, you can change with them without having to wait for your server 
to change too..
On the other hand for a public side website, I prefer the web.xml version because I'm 
lazy and don't want to think about security for the most part.  The public side is 
usually better to have default allow becasue you want most people to view the entire 
site.  Its easier to specify what to protect then what to allow in such cases.

What I currently imagine as to be a good solution is a Permission 
setting on the action configuration (e.g. at struts-config.xml) which 
will be automatically checked at the controller instance, and forward 
users to login / not permitted pages.

Cheers and thanx advance,
Ron
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Configuring plug-ins using

2004-07-15 Thread Geeta Ramani
Hi all:

I have a question regarding the use of plug-ins. According to the docs,

"For PlugIns that require configuration themselves, the nested  element 
is available."

My question is simply this: how do I retrieve the value that I set in a set-property 
tag? I am sure this is dead simple to most of you, but even after googling for two 
hours and looking at the source code for the tiles plug-in I seem to be going 
nowhere...(:(

Thanks in advance for any help!
Geeta



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



RE:

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 11:57 AM
> To: Struts Users Mailing List
> Subject: Re: 
> 
> 
> sl_getGroups is being called.  i printed out alerts when i was writing
> it.  and i have Sys.outs in the action.  besides, my JSP wouldn't show
> up if it wasn't :)
> 
> the javascript is fairly simple:  (i know there is a more Strutsy way
> to do this, i'm getting there...)
> 
> function sl_getGroups(frm) {
> if 
> (frm.selectedShoppingList.options[frm.selectedShoppingList.sel
> ectedIndex].value
> != "-1") {
>   
> frm.selectedShoppingList.options[frm.selectedShoppingList.sele
> ctedIndex].value
> = "-1";
>   frm.action += "?step=getGroups";
>   frm.submit();
>  }
> }
> 
> the javascript just checks to see that the selectedShoppingList is not
> "-1", the initial value.  it then appends my step parameter to the
> action.  this is working.  what is funny is that the javascript
> recognizes that the selectedShoppingList is not "-1", but the form
> doesn't pick that up...
> 
> any suggestions?

Just to make sure I understand what's happening.
You display a page, user selects from first list, the page submits, the action does 
it's thing,  and populates the second list, then the user selects from that list, 
submits and at that point you only have the first selection and not the second.  In 
addition the javascript seems to know what's going on, but the form bean doesn't.

I would try a dummy action that would fill both lists, then select from both lists and 
get that working, then I would try doing it your way.  I have a sneaking suspicion 
that there is something funky going on with the javascript, but don't know what it 
would be.  Eliminating it and getting the basic operations working first would be a 
good start.

> 
> andy
> 
> 
> On Thu, 15 Jul 2004 14:36:14 -0400, Bill Siggelkow
> <[EMAIL PROTECTED]> wrote:
> > Hmmm ... looks pretty darn hairy. You didn't show the 
> JavaScript thats
> > called by the onchange --  I would verify first that "getGroups" is
> > being called.
> > 
> > 
> > 
> > Andrew Close wrote:
> > 
> > > alrighty,  i've got this half figured out.  i can populate my
> > > dropdowns, but my form doesn't seem to be scrapping the 
> values back
> > > off the page.
> > > i have an action that gets a collection of beans and puts them in
> > > session for the JSP to use.  the JSP renders and displays those
> > > objects correctly in the dropdowns.  when the first dropdown is
> > > changed an onchange event fires off the previous action 
> to populate
> > > the second dropdown.  however, the selected value in the first
> > > dropdown doesn't show up in my Action or the Form.
> > >
> > > here's part of the JSP:
> > >
> > > 
> > >   property="selectedShoppingList"
> > > onchange="sl_getGroups(this.form);" >
> > >   - Please Select A List -
> > >   
> > >  
> > >  
> > >   > > property="selectedShoppingListGroup"
> > > onchange="sl_getItems(this.form);" >
> > >   
> > >- Please Select A List -
> > >   
> > >   
> > >- Please Select A Group 
> -
> > >- All Groups -
> > >
> > >   
> > >  
> > > 
> > >
> > > and i have an ActionForm created named shoppingListForm 
> containing two
> > > Strings: selectedShoppingList and selectedShoppingListGroup with
> > > initial values set at "-1".  ShoppingListForm contains 
> basic getters
> > > and setters for these attributes.
> > >
> > > so i'm guessing my problem lies within my Action.  i'm extending
> > > DispatchAction and the getGroups method forwards to the 
> above JSP on
> > > "success".
> > >
> > > public ActionForward getGroups (
> > >
> > > 
> > >
> > > try {
> > > HttpSession session = request.getSession(false);
> > > ShoppingListForm slForm = (ShoppingListForm)form;
> > >
> > > if (slForm == null) {
> > > session.setAttribute("selectedShoppingList", "-1");
> > > session.setAttribute("selectedShoppingListGroup", "-1");
> > > } else {
> > > session.setAttribute("selectedShoppingList",
> > > slForm.getSelectedShoppingList());
> > > session.setAttribute("selectedShoppingListGroup",
> > > slForm.getSelectedShoppingListGroup());
> > >
> > > System.out.println("\n\nShopping List Form...");
> > > System.out.println("Shopping List: " +
> > > slForm.getSelectedShoppingList());
> > > System.out.println("Shopping List Group: " +
> > > slForm.getSelectedShoppingListGroup() + "\n\n\n");
> > > }
> > >
> > > ... go on to populate collection for lists, etc...
> > >
> > > the first time through the form will be null because this 
> action is
> > > called from another page.  the action populates 'lists' 
> and forwards
> > > to the above JSP.  onchange in the JSP calls this same action and
> > > should pass it my ShoppingListForm, in which should be 
> found the value
> > > to selectedShoppingList.  however this value remains "-1".
> > > on success the same JSP is displayed...
> > >
> > > here is t

Re: Re: The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Eliot Stock
That's it - it works. Thanks very much.

So the docs at http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
are wrong, or at least very misleading, because they use
struts.apache.org. They do say to use the uris above, but everyone is
going to do what I did and just cut and paste, then wonder why the uri
doesn't resolve.

Eliot Stock.

On Thu, 15 Jul 2004 13:10:42 -0400, Paul Spencer <[EMAIL PROTECTED]> wrote:
> Eric,
> I am using Struts 1.1 and use the following:
> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html" %>
> 
> Notice the host is jakarta.apache.org not struts.apache.org.
> 
> Paul Spencer
> 
> 
> 
> 
> Eliot Stock wrote:
> 
> > Hello.
> >
> > I'm trying to do what the Struts docs mention here (scroll down to
> > section 5.4.3.1):
> >
> > http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
> >
> > which is, do away with declaring the struts taglibs in my web.xml
> > altogether and just use an absolute URI for the taglib declaration in
> > ths JSP like so:
> >
> > <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>
> >
> > I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.
> >
> > I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
> > get a 500:
> >
> > org.apache.jasper.JasperException: The absolute uri:
> > http://struts.apache.org/tags-html cannot be resolved in either
> > web.xml or the jar files deployed with this application
> >
> > This same mechanism is working perfectly well for JSTL, that is:
> >
> > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> >
> > is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.
> >
> > Any clues anyone?
> >
> > Cheers,
> >
> > Eliot Stock.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



RE: How to use roles with Struts

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of ron1
> Sent: Thursday, July 15, 2004 11:51 AM
> To: [EMAIL PROTECTED]
> Subject: How to use roles with Struts
> 
> 
> Hi all :-)
> I am wondering how some of the experienced users use roles 
> with struts.
> I saw there is a query for roles in the API (getRoles()), but 
> could not 
> figure out how to configure ACLs with struts, or more 
> specific: where to 
> define which action is allowed for which role, and, and I 
> guess that is 
> done through Java, how to set the user's role in, for 
> example, after ge 
> logs in.
> 
> My application will use 3 roles, and perhaps an additional admin role:
> some actions / pages will have unlimited access ( guest or visitor)
> some others will need a log in (user)
> and some others will need a privelege (priveleged user).
> 
> Could you share your experience?

2 approaches, the declartive security that is part of web.xml or roll your own.

With roll your own there are two approaches:
1) A base action the checks roles and other authorization before doing anything, and 
your other
actions inherit from that. (or you can just hard code the authorization check in each 
class)
2) Use Filters.

I like using filters for applications that must be secure, since I can choose a 
default deny approach, rather then the more permissive default allow that the 
declaritive security provides.  In addition, as your access rules and authorization 
methodologies change, you can change with them without having to wait for your server 
to change too..

On the other hand for a public side website, I prefer the web.xml version because I'm 
lazy and don't want to think about security for the most part.  The public side is 
usually better to have default allow becasue you want most people to view the entire 
site.  Its easier to specify what to protect then what to allow in such cases.

> 
> What I currently imagine as to be a good solution is a Permission 
> setting on the action configuration (e.g. at struts-config.xml) which 
> will be automatically checked at the controller instance, and forward 
> users to login / not permitted pages.
> 
> Cheers and thanx advance,
> Ron
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re:

2004-07-15 Thread Andrew Close
sl_getGroups is being called.  i printed out alerts when i was writing
it.  and i have Sys.outs in the action.  besides, my JSP wouldn't show
up if it wasn't :)

the javascript is fairly simple:  (i know there is a more Strutsy way
to do this, i'm getting there...)

function sl_getGroups(frm) {
if (frm.selectedShoppingList.options[frm.selectedShoppingList.selectedIndex].value
!= "-1") {
  frm.selectedShoppingList.options[frm.selectedShoppingList.selectedIndex].value
= "-1";
  frm.action += "?step=getGroups";
  frm.submit();
 }
}

the javascript just checks to see that the selectedShoppingList is not
"-1", the initial value.  it then appends my step parameter to the
action.  this is working.  what is funny is that the javascript
recognizes that the selectedShoppingList is not "-1", but the form
doesn't pick that up...

any suggestions?

andy


On Thu, 15 Jul 2004 14:36:14 -0400, Bill Siggelkow
<[EMAIL PROTECTED]> wrote:
> Hmmm ... looks pretty darn hairy. You didn't show the JavaScript thats
> called by the onchange --  I would verify first that "getGroups" is
> being called.
> 
> 
> 
> Andrew Close wrote:
> 
> > alrighty,  i've got this half figured out.  i can populate my
> > dropdowns, but my form doesn't seem to be scrapping the values back
> > off the page.
> > i have an action that gets a collection of beans and puts them in
> > session for the JSP to use.  the JSP renders and displays those
> > objects correctly in the dropdowns.  when the first dropdown is
> > changed an onchange event fires off the previous action to populate
> > the second dropdown.  however, the selected value in the first
> > dropdown doesn't show up in my Action or the Form.
> >
> > here's part of the JSP:
> >
> > 
> >   > onchange="sl_getGroups(this.form);" >
> >   - Please Select A List -
> >   
> >  
> >  
> >   > property="selectedShoppingListGroup"
> > onchange="sl_getItems(this.form);" >
> >   
> >- Please Select A List -
> >   
> >   
> >- Please Select A Group -
> >- All Groups -
> >
> >   
> >  
> > 
> >
> > and i have an ActionForm created named shoppingListForm containing two
> > Strings: selectedShoppingList and selectedShoppingListGroup with
> > initial values set at "-1".  ShoppingListForm contains basic getters
> > and setters for these attributes.
> >
> > so i'm guessing my problem lies within my Action.  i'm extending
> > DispatchAction and the getGroups method forwards to the above JSP on
> > "success".
> >
> > public ActionForward getGroups (
> >
> > 
> >
> > try {
> > HttpSession session = request.getSession(false);
> > ShoppingListForm slForm = (ShoppingListForm)form;
> >
> > if (slForm == null) {
> > session.setAttribute("selectedShoppingList", "-1");
> > session.setAttribute("selectedShoppingListGroup", "-1");
> > } else {
> > session.setAttribute("selectedShoppingList",
> > slForm.getSelectedShoppingList());
> > session.setAttribute("selectedShoppingListGroup",
> > slForm.getSelectedShoppingListGroup());
> >
> > System.out.println("\n\nShopping List Form...");
> > System.out.println("Shopping List: " +
> > slForm.getSelectedShoppingList());
> > System.out.println("Shopping List Group: " +
> > slForm.getSelectedShoppingListGroup() + "\n\n\n");
> > }
> >
> > ... go on to populate collection for lists, etc...
> >
> > the first time through the form will be null because this action is
> > called from another page.  the action populates 'lists' and forwards
> > to the above JSP.  onchange in the JSP calls this same action and
> > should pass it my ShoppingListForm, in which should be found the value
> > to selectedShoppingList.  however this value remains "-1".
> > on success the same JSP is displayed...
> >
> > here is the action-mapping for this particular action:
> >
> >  >  parameter="step"
> >  type="sl.controllers.SLMainAction"
> >  name="shoppingListForm"
> >  validate="true">
> >   
> >   
> > 
> >
> > thanks for any help
> > andy

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



How to use roles with Struts

2004-07-15 Thread ron1
Hi all :-)
I am wondering how some of the experienced users use roles with struts.
I saw there is a query for roles in the API (getRoles()), but could not 
figure out how to configure ACLs with struts, or more specific: where to 
define which action is allowed for which role, and, and I guess that is 
done through Java, how to set the user's role in, for example, after ge 
logs in.

My application will use 3 roles, and perhaps an additional admin role:
some actions / pages will have unlimited access ( guest or visitor)
some others will need a log in (user)
and some others will need a privelege (priveleged user).
Could you share your experience?
What I currently imagine as to be a good solution is a Permission 
setting on the action configuration (e.g. at struts-config.xml) which 
will be automatically checked at the controller instance, and forward 
users to login / not permitted pages.

Cheers and thanx advance,
Ron
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


html:image question

2004-07-15 Thread Jeff Stewart
How can I pass parameters in a 
I have four of these that will basically do the same thing, issue a 
query. But, the query is parameterized.
It make little sense to do it the Husted way and have multiple image  
bean buttons to represent which html:image
was selected. IMHO, that approach is too much like hard coding. Any 
suggestions would be greatly appreciated.

Thanks in advance.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re:

2004-07-15 Thread Bill Siggelkow
Hmmm ... looks pretty darn hairy. You didn't show the JavaScript thats 
called by the onchange --  I would verify first that "getGroups" is 
being called.

Andrew Close wrote:
alrighty,  i've got this half figured out.  i can populate my
dropdowns, but my form doesn't seem to be scrapping the values back
off the page.
i have an action that gets a collection of beans and puts them in
session for the JSP to use.  the JSP renders and displays those
objects correctly in the dropdowns.  when the first dropdown is
changed an onchange event fires off the previous action to populate
the second dropdown.  however, the selected value in the first
dropdown doesn't show up in my Action or the Form.
here's part of the JSP:

 
  - Please Select A List -
  
 
 
 
  
   - Please Select A List -
  
  
   - Please Select A Group -
   - All Groups -
   
  
 

and i have an ActionForm created named shoppingListForm containing two
Strings: selectedShoppingList and selectedShoppingListGroup with
initial values set at "-1".  ShoppingListForm contains basic getters
and setters for these attributes.
so i'm guessing my problem lies within my Action.  i'm extending
DispatchAction and the getGroups method forwards to the above JSP on
"success".
public ActionForward getGroups (

try {
HttpSession session = request.getSession(false);
ShoppingListForm slForm = (ShoppingListForm)form;

if (slForm == null) {
session.setAttribute("selectedShoppingList", "-1");
session.setAttribute("selectedShoppingListGroup", "-1");
} else {
session.setAttribute("selectedShoppingList",
slForm.getSelectedShoppingList());
session.setAttribute("selectedShoppingListGroup",
slForm.getSelectedShoppingListGroup());

System.out.println("\n\nShopping List Form...");
System.out.println("Shopping List: " +
slForm.getSelectedShoppingList());
System.out.println("Shopping List Group: " +
slForm.getSelectedShoppingListGroup() + "\n\n\n");
}
... go on to populate collection for lists, etc...
the first time through the form will be null because this action is
called from another page.  the action populates 'lists' and forwards
to the above JSP.  onchange in the JSP calls this same action and
should pass it my ShoppingListForm, in which should be found the value
to selectedShoppingList.  however this value remains "-1".
on success the same JSP is displayed...
here is the action-mapping for this particular action:

 type="sl.controllers.SLMainAction"
 name="shoppingListForm"
 validate="true">
  
  


thanks for any help
andy

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


Re: Parameterizing form JSPs with tags

2004-07-15 Thread Erik Weber

Rick Reumann wrote:
On Mon, 12 Jul 2004 10:31:29 -0400, Erik Weber 
<[EMAIL PROTECTED]>  wrote:

(speaking of "add" form versus "update" form that are similar but not 
exactly the same . . )  I'd reuse the same form, even if it means 
some  JSTL 
I need a little help understanding how to do this.
I am parameterizing the handling of a few actions in a single action 
class, and I decided to go with a single, shared form JSP, because it's 
a big form. So I need to use a switch of some type to set the "action" 
parameter of my html:form tag depending on the current usecase, and also 
to conditionally render or omit a couple of fields of the form.

For example, if the action that led to the form page is 
"/usecase/viewadd" then the user gets a blank form, and I need to set 
the form action parameter to be "/usecase/add" If the action was 
"/usecase/viewedit" instead, then the user gets a prepopulated form, and 
I need to set the form action parameter to be "/usecase/save". You get 
the idea. The part I need help with is building the JSP switch.

How does the JSP tag access the current "use case", or command 
parameter? Do you have to manually set request attributes? What object 
does "userAction" refer to in the above example?

Also, is there a Struts tag that will do the same thing? I don't have JSTL.
Thanks,
Erik

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


user@struts.apache.org

2004-07-15 Thread Andrew Close
alrighty,  i've got this half figured out.  i can populate my
dropdowns, but my form doesn't seem to be scrapping the values back
off the page.
i have an action that gets a collection of beans and puts them in
session for the JSP to use.  the JSP renders and displays those
objects correctly in the dropdowns.  when the first dropdown is
changed an onchange event fires off the previous action to populate
the second dropdown.  however, the selected value in the first
dropdown doesn't show up in my Action or the Form.

here's part of the JSP:


 
  - Please Select A List -
  
 
 
 
  
   - Please Select A List -
  
  
   - Please Select A Group -
   - All Groups -
   
  
 


and i have an ActionForm created named shoppingListForm containing two
Strings: selectedShoppingList and selectedShoppingListGroup with
initial values set at "-1".  ShoppingListForm contains basic getters
and setters for these attributes.

so i'm guessing my problem lies within my Action.  i'm extending
DispatchAction and the getGroups method forwards to the above JSP on
"success".

public ActionForward getGroups (



try {
HttpSession session = request.getSession(false);
ShoppingListForm slForm = (ShoppingListForm)form;

if (slForm == null) {
session.setAttribute("selectedShoppingList", "-1");
session.setAttribute("selectedShoppingListGroup", "-1");
} else {
session.setAttribute("selectedShoppingList",
slForm.getSelectedShoppingList());
session.setAttribute("selectedShoppingListGroup",
slForm.getSelectedShoppingListGroup());

System.out.println("\n\nShopping List Form...");
System.out.println("Shopping List: " +
slForm.getSelectedShoppingList());
System.out.println("Shopping List Group: " +
slForm.getSelectedShoppingListGroup() + "\n\n\n");
}

... go on to populate collection for lists, etc...

the first time through the form will be null because this action is
called from another page.  the action populates 'lists' and forwards
to the above JSP.  onchange in the JSP calls this same action and
should pass it my ShoppingListForm, in which should be found the value
to selectedShoppingList.  however this value remains "-1".
on success the same JSP is displayed...

here is the action-mapping for this particular action:


  
  


thanks for any help
andy

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



[OT] browser properties

2004-07-15 Thread Sergey Livanov
How can I switch usual buttons, address line and references off?




regards,

 Sergey  mailto:[EMAIL PROTECTED]


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



RE: Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Josh Holtzman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 10:30 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Tiles, Validation and reuse of HTML Form
> 
> 
> Brian,
> 
> I agree.
> 
> In our case, the site is actually designed in that there is 
> one page that
> functions as both the catalog and item page.  Don't ask...

Don't need to... in fact if you look at the way Tiles allows you to list a series of 
jsp pages, you can do 
that as well.  By default I usually just add that capability into my default jsp 
layout for maximum flexibility, especially on a 3 column layout.


> 
> But yes, /showItem.do?item=1 is a better approach in my opinion than 6
> action mappings.
> 
> I think we have resolved our issue, simply by taking a better 
> approach.
> 
> Thank you for all your responses.

You're welcome, glad I could help.

> 
> Josh Holtzman
> 
>  
> 
> AMERICAN DATA COMPANY
> 
> Developing and Supporting your Online Applications
> 
>  
> 
> [EMAIL PROTECTED]
> 
> Voice: (310) 470-1257
> 
> Fax:(310) 362-8454
> 
>  
> 
> Sun Microsystems iForce Partner
> 
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 15, 2004 10:09 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: Tiles, Validation and reuse of HTML Form
> 
> 
> 
> > -Original Message-
> > From: Bryan Hunt [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 15, 2004 10:03 AM
> > To: Struts Users Mailing List
> > Subject: Re: Tiles, Validation and reuse of HTML Form
> > 
> > 
> > I do it with a separate action for each use case. I find it 
> > tedious but 
> > have not found a better way.
> 
> Just curious...
> How is this more then one use case?  Namely, the "Browse 
> Catalog" use case?
> I mean... if you have 6 sure you can code each page... but if you have
> 600 yikes.
> Actions could be something like:
> /showCatalogPage.do?page=1   ShowCatalogPage
> /showItem.do?item=1ShowCatalogItem
> 
> > 
> > --b
> > 
> > Josh Holtzman wrote:
> > 
> > >Hello All,
> > >
> > > 
> > >
> > >I've tried to search the list archives for previous threads 
> > on this topic,
> > >but it appears the search feature is not working.
> > >
> > > 
> > >
> > >We are building a simple website that offers about a half 
> > dozen products for
> > >sale. 
> > >
> > > 
> > >
> > >We have one dedicated page layout (the product page) that 
> > contains a photo
> > >and description of the product.  On this page there is also 
> > a list of the
> > >other 5 products.  By clicking on any one of these products, 
> > the page is
> > >refreshed, and the new product information appears in the 
> > same layout.  Also
> > >on this page is an HTML form that is used to add items to 
> > the shopping cart.
> > >>From this form a user can choose any one of the 6 products 
> > from a select
> > >menu, type a quantity, and submit the form.. To add items to 
> > the shopping
> > >cart.  This form is the same on all the product pages.
> > >
> > > 
> > >
> > >For the sake of GUI reuse and maintenance, we have 
> > implemented the site with
> > >tiles.  For this particular page we have created a base 
> > template named
> > >"website.product" containing the header, footer, body 
> > layout, and html form
> > >tiles.  For each of the 6 products we have extended this 
> > base template, and
> > >added a tile with the product photo, description, and price.
> > >
> > > 
> > >
> > >In the struts config file we created an Action element for 
> > each of the 6
> > >product pages.  For instance:
> > >
> > > 
> > >
> > > > >
> > >path="/products/lazydazy"
> > >
> > >   parameter="website.product.lazydazy"
> > >
> > >   scope="request"
> > >
> > >   type="org.apache.struts.actions.ForwardAction"
> > >
> > >   validate="false">
> > >
> > >
> > >
> > > 
> > >
> > >And
> > >
> > > 
> > >
> > > > >
> > >path="/products/sallysue"
> > >
> > >   parameter="website.product.sallysue"
> > >
> > >   scope="request"
> > >
> > >   type="org.apache.struts.actions.ForwardAction"
> > >
> > >   validate="false">
> > >
> > >
> > >
> > > 
> > >
> > >The following is our dilemma:
> > >
> > > 
> > >
> > >We are using the same tile containing the html form (which 
> > we declared in
> > >the base template) for all these pages.  This doesn't 
> > present any problem,
> > >except when validation fails.  When the validation fails, 
> Struts must
> > >determine which page to return and display the error 
> > message.  But our
> > >problem is, the Action element requires we specify a 
> single location.
> > >
> > > 
> > >
> > > > >
> > >path="/addtocart"
> > >
> > >  input="website.product.lazydazy"
> > >
> > >  name="addToCartForm"
> > >
> > >  scope="request"
> > >
> > >  type="com.americandatacorp.struts.action.cart.Add"
> > >
> > >  validate="true">
> > >
> > >   > >redirect="true"/>
> > >
> > >
> > >
> > > 
> > >
> > >But if an ite

Re: More fun with forms...

2004-07-15 Thread Andrew Close
ron1, Jim

thank you for your help.

i think part of my problem was that i was trying to use a
DynaActionForm instead of just creating and using my own ActionForm. 
now it appears to be working... for the most part. :)

andy


On Wed, 14 Jul 2004 12:02:27 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Andrew Close [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, July 14, 2004 11:53 AM
> > To: Struts Users Mailing List
> > Subject: Re: More fun with forms...
> >
> >
> > 
> >
> > > > i do know what fields will be returned, just not how many.  so i
> > > > wasn't sure if i could use ActionForms or if i had to
> > come up with a
> > > > custom solution.
> > > > i'll see if i can find info on MapBackedForm.
> > > > Thanks Jim
> > >
> > > Oh, you mean rows, not columns.  In that case you want a
> > list of objects, where >each object is a row.  You grab each
> > field from the resultSet, stuff it into a bean, >and then
> > stuff the bean into a collection.  Then you put the
> > collection in the >scope of your choice.
> >
> > well, yes.  that's the first part of it.  getting the data from the DB
> > to the page to be displayed.  so i have my collection.  now i'm going
> > to iterate thorugh the collection and build a form:
> >
> >
> > //JSP...
> > 
> > 
> 
>  id="oneOfABunchOStuff"
> 
> 
> 
> public class MyForm blah blah {
> private String[] element;
> private Collection bunchOStuff; //you can also put this into your favorite 
> scope
> ...
> appropriate getter and setters
> }
> 
> >
> > for (int i =0; i > 
> > //some tds...
> >   //my editable field
> > 
> > }
> > 
> > 
> > 
> >
> > so now i have a form being displayed with let's say 25 rows in it.
> > that's 25 editable textfields (assume they have unique id's or
> > something).
> > now my user views this, makes a couple of changes to some of the
> > editable textfields and hits submit.  the action receives the call and
> > begins to process the form.  BUT, how is the ActionForm or
> > DynaActionForm laid out so the Action can grab all the fields off of
> > it since we didn't know there would be 25 editable textboxes when we
> > started?
> >
> > 
> >   
> >
> > how do i denote my 'X' editable fields here?
> >
> >  > type=java.lang.String[] />
> >
> > would that be what i want?
> >
> >   
> > 
> >
> >
> > Thanks again,
> > andy
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]

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



RE: Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Josh Holtzman
Brian,

I agree.

In our case, the site is actually designed in that there is one page that
functions as both the catalog and item page.  Don't ask...

But yes, /showItem.do?item=1 is a better approach in my opinion than 6
action mappings.

I think we have resolved our issue, simply by taking a better approach.

Thank you for all your responses.

Josh Holtzman

 

AMERICAN DATA COMPANY

Developing and Supporting your Online Applications

 

[EMAIL PROTECTED]

Voice: (310) 470-1257

Fax:(310) 362-8454

 

Sun Microsystems iForce Partner


-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 15, 2004 10:09 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Tiles, Validation and reuse of HTML Form



> -Original Message-
> From: Bryan Hunt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 10:03 AM
> To: Struts Users Mailing List
> Subject: Re: Tiles, Validation and reuse of HTML Form
> 
> 
> I do it with a separate action for each use case. I find it 
> tedious but 
> have not found a better way.

Just curious...
How is this more then one use case?  Namely, the "Browse Catalog" use case?
I mean... if you have 6 sure you can code each page... but if you have
600 yikes.
Actions could be something like:
/showCatalogPage.do?page=1   ShowCatalogPage
/showItem.do?item=1  ShowCatalogItem

> 
> --b
> 
> Josh Holtzman wrote:
> 
> >Hello All,
> >
> > 
> >
> >I've tried to search the list archives for previous threads 
> on this topic,
> >but it appears the search feature is not working.
> >
> > 
> >
> >We are building a simple website that offers about a half 
> dozen products for
> >sale. 
> >
> > 
> >
> >We have one dedicated page layout (the product page) that 
> contains a photo
> >and description of the product.  On this page there is also 
> a list of the
> >other 5 products.  By clicking on any one of these products, 
> the page is
> >refreshed, and the new product information appears in the 
> same layout.  Also
> >on this page is an HTML form that is used to add items to 
> the shopping cart.
> >>From this form a user can choose any one of the 6 products 
> from a select
> >menu, type a quantity, and submit the form.. To add items to 
> the shopping
> >cart.  This form is the same on all the product pages.
> >
> > 
> >
> >For the sake of GUI reuse and maintenance, we have 
> implemented the site with
> >tiles.  For this particular page we have created a base 
> template named
> >"website.product" containing the header, footer, body 
> layout, and html form
> >tiles.  For each of the 6 products we have extended this 
> base template, and
> >added a tile with the product photo, description, and price.
> >
> > 
> >
> >In the struts config file we created an Action element for 
> each of the 6
> >product pages.  For instance:
> >
> > 
> >
> > >
> >path="/products/lazydazy"
> >
> >   parameter="website.product.lazydazy"
> >
> >   scope="request"
> >
> >   type="org.apache.struts.actions.ForwardAction"
> >
> >   validate="false">
> >
> >
> >
> > 
> >
> >And
> >
> > 
> >
> > >
> >path="/products/sallysue"
> >
> >   parameter="website.product.sallysue"
> >
> >   scope="request"
> >
> >   type="org.apache.struts.actions.ForwardAction"
> >
> >   validate="false">
> >
> >
> >
> > 
> >
> >The following is our dilemma:
> >
> > 
> >
> >We are using the same tile containing the html form (which 
> we declared in
> >the base template) for all these pages.  This doesn't 
> present any problem,
> >except when validation fails.  When the validation fails, Struts must
> >determine which page to return and display the error 
> message.  But our
> >problem is, the Action element requires we specify a single location.
> >
> > 
> >
> > >
> >path="/addtocart"
> >
> >  input="website.product.lazydazy"
> >
> >  name="addToCartForm"
> >
> >  scope="request"
> >
> >  type="com.americandatacorp.struts.action.cart.Add"
> >
> >  validate="true">
> >
> >   >redirect="true"/>
> >
> >
> >
> > 
> >
> >But if an item is added to the cart from the 
> "website.product.sallysue"
> >template, and validation fails, the user is returned to the
> >"website.product.lazydazy" page with the error displayed.
> >
> > 
> >
> >Does anyone have any suggestions, other than having to 
> create a seperate
> >"addtocart" action for every page?
> >
> > 
> >
> >Thank you for your assistance in advance.
> >
> > 
> >
> >Josh Holtzman
> >
> > 
> >
> >AMERICAN DATA COMPANY
> >
> >Developing and Supporting your Online Applications
> >
> > 
> >
> >[EMAIL PROTECTED]
> >
> >Voice: (310) 470-1257
> >
> >Fax:(310) 362-8454
> >
> > 
> >
> >Sun Microsystems iForce Partner
> >
> > 
> >
> >
> >  
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--

Re: The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Paul Spencer
Eric,
I am using Struts 1.1 and use the following:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html" %>
Notice the host is jakarta.apache.org not struts.apache.org.
Paul Spencer
Eliot Stock wrote:
Hello.
I'm trying to do what the Struts docs mention here (scroll down to
section 5.4.3.1):
http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
which is, do away with declaring the struts taglibs in my web.xml
altogether and just use an absolute URI for the taglib declaration in
ths JSP like so:
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>
I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.
I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
get a 500:
org.apache.jasper.JasperException: The absolute uri:
http://struts.apache.org/tags-html cannot be resolved in either
web.xml or the jar files deployed with this application
This same mechanism is working perfectly well for JSTL, that is:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.
Any clues anyone?
Cheers,
Eliot Stock.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


RE: Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Bryan Hunt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 10:03 AM
> To: Struts Users Mailing List
> Subject: Re: Tiles, Validation and reuse of HTML Form
> 
> 
> I do it with a separate action for each use case. I find it 
> tedious but 
> have not found a better way.

Just curious...
How is this more then one use case?  Namely, the "Browse Catalog" use case?
I mean... if you have 6 sure you can code each page... but if you have 600 yikes.
Actions could be something like:
/showCatalogPage.do?page=1   ShowCatalogPage
/showItem.do?item=1  ShowCatalogItem

> 
> --b
> 
> Josh Holtzman wrote:
> 
> >Hello All,
> >
> > 
> >
> >I've tried to search the list archives for previous threads 
> on this topic,
> >but it appears the search feature is not working.
> >
> > 
> >
> >We are building a simple website that offers about a half 
> dozen products for
> >sale. 
> >
> > 
> >
> >We have one dedicated page layout (the product page) that 
> contains a photo
> >and description of the product.  On this page there is also 
> a list of the
> >other 5 products.  By clicking on any one of these products, 
> the page is
> >refreshed, and the new product information appears in the 
> same layout.  Also
> >on this page is an HTML form that is used to add items to 
> the shopping cart.
> >>From this form a user can choose any one of the 6 products 
> from a select
> >menu, type a quantity, and submit the form.. To add items to 
> the shopping
> >cart.  This form is the same on all the product pages.
> >
> > 
> >
> >For the sake of GUI reuse and maintenance, we have 
> implemented the site with
> >tiles.  For this particular page we have created a base 
> template named
> >"website.product" containing the header, footer, body 
> layout, and html form
> >tiles.  For each of the 6 products we have extended this 
> base template, and
> >added a tile with the product photo, description, and price.
> >
> > 
> >
> >In the struts config file we created an Action element for 
> each of the 6
> >product pages.  For instance:
> >
> > 
> >
> > >
> >path="/products/lazydazy"
> >
> >   parameter="website.product.lazydazy"
> >
> >   scope="request"
> >
> >   type="org.apache.struts.actions.ForwardAction"
> >
> >   validate="false">
> >
> >
> >
> > 
> >
> >And
> >
> > 
> >
> > >
> >path="/products/sallysue"
> >
> >   parameter="website.product.sallysue"
> >
> >   scope="request"
> >
> >   type="org.apache.struts.actions.ForwardAction"
> >
> >   validate="false">
> >
> >
> >
> > 
> >
> >The following is our dilemma:
> >
> > 
> >
> >We are using the same tile containing the html form (which 
> we declared in
> >the base template) for all these pages.  This doesn't 
> present any problem,
> >except when validation fails.  When the validation fails, Struts must
> >determine which page to return and display the error 
> message.  But our
> >problem is, the Action element requires we specify a single location.
> >
> > 
> >
> > >
> >path="/addtocart"
> >
> >  input="website.product.lazydazy"
> >
> >  name="addToCartForm"
> >
> >  scope="request"
> >
> >  type="com.americandatacorp.struts.action.cart.Add"
> >
> >  validate="true">
> >
> >   >redirect="true"/>
> >
> >
> >
> > 
> >
> >But if an item is added to the cart from the 
> "website.product.sallysue"
> >template, and validation fails, the user is returned to the
> >"website.product.lazydazy" page with the error displayed.
> >
> > 
> >
> >Does anyone have any suggestions, other than having to 
> create a seperate
> >"addtocart" action for every page?
> >
> > 
> >
> >Thank you for your assistance in advance.
> >
> > 
> >
> >Josh Holtzman
> >
> > 
> >
> >AMERICAN DATA COMPANY
> >
> >Developing and Supporting your Online Applications
> >
> > 
> >
> >[EMAIL PROTECTED]
> >
> >Voice: (310) 470-1257
> >
> >Fax:(310) 362-8454
> >
> > 
> >
> >Sun Microsystems iForce Partner
> >
> > 
> >
> >
> >  
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re: Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Bryan Hunt
I do it with a seperate action for each use case. I find it tedious but 
have not found a better way.

--b
Josh Holtzman wrote:
Hello All,

I've tried to search the list archives for previous threads on this topic,
but it appears the search feature is not working.

We are building a simple website that offers about a half dozen products for
sale. 


We have one dedicated page layout (the product page) that contains a photo
and description of the product.  On this page there is also a list of the
other 5 products.  By clicking on any one of these products, the page is
refreshed, and the new product information appears in the same layout.  Also
on this page is an HTML form that is used to add items to the shopping cart.
From this form a user can choose any one of the 6 products from a select
menu, type a quantity, and submit the form.. To add items to the shopping
cart.  This form is the same on all the product pages.

For the sake of GUI reuse and maintenance, we have implemented the site with
tiles.  For this particular page we have created a base template named
"website.product" containing the header, footer, body layout, and html form
tiles.  For each of the 6 products we have extended this base template, and
added a tile with the product photo, description, and price.

In the struts config file we created an Action element for each of the 6
product pages.  For instance:


path="/products/lazydazy"
  parameter="website.product.lazydazy"
  scope="request"
  type="org.apache.struts.actions.ForwardAction"
  validate="false">


And


path="/products/sallysue"
  parameter="website.product.sallysue"
  scope="request"
  type="org.apache.struts.actions.ForwardAction"
  validate="false">


The following is our dilemma:

We are using the same tile containing the html form (which we declared in
the base template) for all these pages.  This doesn't present any problem,
except when validation fails.  When the validation fails, Struts must
determine which page to return and display the error message.  But our
problem is, the Action element requires we specify a single location.


path="/addtocart"
 input="website.product.lazydazy"
 name="addToCartForm"
 scope="request"
 type="com.americandatacorp.struts.action.cart.Add"
 validate="true">
 


But if an item is added to the cart from the "website.product.sallysue"
template, and validation fails, the user is returned to the
"website.product.lazydazy" page with the error displayed.

Does anyone have any suggestions, other than having to create a seperate
"addtocart" action for every page?

Thank you for your assistance in advance.

Josh Holtzman

AMERICAN DATA COMPANY
Developing and Supporting your Online Applications

[EMAIL PROTECTED]
Voice: (310) 470-1257
Fax:(310) 362-8454

Sun Microsystems iForce Partner

 

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


Re: [faked-from] RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Craig McClanahan
B.S.Narayana wrote:
tell me the url for JDeveloper.
 

http://www.google.com/search?q=jdeveloper
:-)
JDeveloper is an Oracle product (http://www.oracle.com).
Craig
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: calling request.getInputStream() within Action

2004-07-15 Thread Craig McClanahan
Robert Shields wrote:
Hi Bill
Thanks for your response.
I've tried with a servlet too, but even without calling
request.getParameter the stream is still empty:
 

One way to paint yourself into this particular corner is if you're 
trying this on a POST request.  As soon as you call a method like 
request.getParameter(), the container has to read the content of the 
input stream (since that is where the key/value pairs are), so trying to 
read the stream after that is not going to work.

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


RE: Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Jim Barrows


> -Original Message-
> From: Josh Holtzman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 9:43 AM
> To: 'Struts Users Mailing List'
> Subject: Tiles, Validation and reuse of HTML Form
> 


> 
> 
> In the struts config file we created an Action element for 
> each of the 6
> product pages.  For instance:

6 pages?  Here I believe your problem lies.  Why not 1 page for all 6 rather then 6 
seperate pages?  That makes returning back much easier, otherwise you are right... you 
will have to create a seperate action for each for the validation errors to return 
properly without doing some handwaving.  You might be able to do something the 
validation( blah ) method of the form, and redirect from there rather then depend on 
what struts does. However, that means you can't do client side validation. 



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



Tiles, Validation and reuse of HTML Form

2004-07-15 Thread Josh Holtzman
Hello All,

 

I've tried to search the list archives for previous threads on this topic,
but it appears the search feature is not working.

 

We are building a simple website that offers about a half dozen products for
sale. 

 

We have one dedicated page layout (the product page) that contains a photo
and description of the product.  On this page there is also a list of the
other 5 products.  By clicking on any one of these products, the page is
refreshed, and the new product information appears in the same layout.  Also
on this page is an HTML form that is used to add items to the shopping cart.
>From this form a user can choose any one of the 6 products from a select
menu, type a quantity, and submit the form.. To add items to the shopping
cart.  This form is the same on all the product pages.

 

For the sake of GUI reuse and maintenance, we have implemented the site with
tiles.  For this particular page we have created a base template named
"website.product" containing the header, footer, body layout, and html form
tiles.  For each of the 6 products we have extended this base template, and
added a tile with the product photo, description, and price.

 

In the struts config file we created an Action element for each of the 6
product pages.  For instance:

 





 

And

 





 

The following is our dilemma:

 

We are using the same tile containing the html form (which we declared in
the base template) for all these pages.  This doesn't present any problem,
except when validation fails.  When the validation fails, Struts must
determine which page to return and display the error message.  But our
problem is, the Action element requires we specify a single location.

 



  



 

But if an item is added to the cart from the "website.product.sallysue"
template, and validation fails, the user is returned to the
"website.product.lazydazy" page with the error displayed.

 

Does anyone have any suggestions, other than having to create a seperate
"addtocart" action for every page?

 

Thank you for your assistance in advance.

 

Josh Holtzman

 

AMERICAN DATA COMPANY

Developing and Supporting your Online Applications

 

[EMAIL PROTECTED]

Voice: (310) 470-1257

Fax:(310) 362-8454

 

Sun Microsystems iForce Partner

 



Re: Re: The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Eliot Stock
I did actually have them lying around there, but with them there or
not, it still fails.

I'm using struts 1.1

On Thu, 15 Jul 2004 12:09:30 -0400, Bill Siggelkow
<[EMAIL PROTECTED]> wrote:
> Well, I have the TLDs in my WEB-INF/lib -- I haven't tried removing them
> to see what happens ...
> 
> 
> 
> Eliot Stock wrote:
> 
> > Hello.
> >
> > I'm trying to do what the Struts docs mention here (scroll down to
> > section 5.4.3.1):
> >
> > http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
> >
> > which is, do away with declaring the struts taglibs in my web.xml
> > altogether and just use an absolute URI for the taglib declaration in
> > ths JSP like so:
> >
> > <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>
> >
> > I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.
> >
> > I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
> > get a 500:
> >
> > org.apache.jasper.JasperException: The absolute uri:
> > http://struts.apache.org/tags-html cannot be resolved in either
> > web.xml or the jar files deployed with this application
> >
> > This same mechanism is working perfectly well for JSTL, that is:
> >
> > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> >
> > is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.
> >
> > Any clues anyone?
> >
> > Cheers,
> >
> > Eliot Stock.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



RE: calling request.getInputStream() within Action

2004-07-15 Thread Robert Shields
Hi Paul

I'm trying to pass it to HttpClient - I'm writing a screen scraper
(proxy).
At the moment I have to enumerate the request parameters and pass them
one by one to HttpClient - I have a feeling this won't work when I test
it with a multipart encoded form (although I may be able to make use of
the struts multipart stuff). It's a whole lot easier to write:

HttpClient client = new HttpClient();
HttpMethod method = new PostMethod(url.toString());
postMethod.setRequestBody(request.getInputStream());

Rob

-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED] 
Sent: 15 July 2004 17:00
To: 'Struts Users Mailing List'
Subject: RE: calling request.getInputStream() within Action

Can I ask why you are after the binary content of the request?

Paul

> -Original Message-
> From: Robert Shields [mailto:[EMAIL PROTECTED]
> Sent: 15 July 2004 16:02
> To: Struts Users Mailing List
> Subject: RE: calling request.getInputStream() within Action
> 
> 
> Hi Bill
> 
> Thanks for your response.
> I've tried with a servlet too, but even without calling
> request.getParameter the stream is still empty:
> 
> 
> public class TestServlet extends HttpServlet {
>ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>
>public void doGet(HttpServletRequest request,
>  HttpServletResponse response)
>throws IOException, ServletException 
>{
>   int length = request.getContentLength(); // 18
>   String contentType= request.getContentType();
>   // application/x-www-form-urlencoded
>   
>   InputStream inputStream = request.getInputStream();
>   int bytesAvailable = inputStream.available(); // 0
>   
>   byte[] buf = new byte[1024];
>   int bytesread;
>   
>   // bytesread is always -1
>   while((bytesread = inputStream.read(buf)) != -1)
>   {
>   // do stuff
>   }
>}
> 
>public void doPost(HttpServletRequest request,
>  HttpServletResponse response)
>throws IOException, ServletException
>{
>doGet(request, response);
>}
> }
> 
> 
> This should work, right?
> I'm starting to think something is wrong with my Tomcat!
> 
> Regards,
> Rob
> 
> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow
> Sent: 15 July 2004 14:16
> To: [EMAIL PROTECTED]
> Subject: Re: calling request.getInputStream() within Action
> 
> Robert, I found the following link that discusses this:
> 
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=jsp-inter
> est&F=&S=&
> P=49196
> 
> It sounds like you are correct -- if request.getParameter() has been 
> called you cannot get the input stream -- have you considered using a 
> Servlet instead?
> 
> Robert Shields wrote:
> 
> > Hi Struts Users
> > 
> > I'm trying to get the InputStream to read the binary contents of the
> > request within an Action's execute method. E.g.
> > 
> > 
> > 
> > public ActionForward execute(
> > ActionMapping mapping,
> > ActionForm form,
> > HttpServletRequest request,
> > HttpServletResponse response)
> > throws IOException, ServletException {
> > 
> > InputStream inputStream = request.getInputStream();
> > 
> > // bytesAvailable is always 0
> > int bytesAvailable = inputStream.available();
> > 
> > int bytesRead;
> > byte[] buf = new byte[1024];
> > while((bytesRead = inputStream.read(buf)) != -1)
> > {
> > // do stuff
> > }
> > }
> > 
> > So bytesAvailable is always 0, and inputStream.read(buf) immediately
> > returns -1.
> > 
> > I have heard that calling request.getParamter() before trying to
> access
> > the input stream can affect accessing the input stream. I believe
> struts
> > calls request.getParamter (it must do to populate the form bean).
> > 
> > My question is, how can I get access to the entire binary 
> contents of
> > the HTTP body?
> > 
> > I'm using Tomcat 5.0.25 BTW
> > 
> > TIA
> > Rob
> > 
> > 
> > This e-mail has been scanned for all viruses by Star Internet. The
> > service is powered by MessageLabs. For more information on 
> a proactive
> > anti-virus service working around the clock, around the 
> globe, visit:
> > http://www.star.net.uk
> > 
> _
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> _
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For mo

Re: The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Bill Siggelkow
Well, I have the TLDs in my WEB-INF/lib -- I haven't tried removing them 
to see what happens ...

Eliot Stock wrote:
Hello.
I'm trying to do what the Struts docs mention here (scroll down to
section 5.4.3.1):
http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
which is, do away with declaring the struts taglibs in my web.xml
altogether and just use an absolute URI for the taglib declaration in
ths JSP like so:
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>
I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.
I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
get a 500:
org.apache.jasper.JasperException: The absolute uri:
http://struts.apache.org/tags-html cannot be resolved in either
web.xml or the jar files deployed with this application
This same mechanism is working perfectly well for JSTL, that is:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.
Any clues anyone?
Cheers,
Eliot Stock.

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


Re: The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Bill Siggelkow
Are you using the nightly build (or 1.2.1?) The taglib directive
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>
works fine for me. Maybe you have an old jar or TLD lying around in your 
classpath or WEB-INF?

Eliot Stock wrote:
Hello.
I'm trying to do what the Struts docs mention here (scroll down to
section 5.4.3.1):
http://struts.apache.org/userGuide/configuration.html#dd_config_taglib
which is, do away with declaring the struts taglibs in my web.xml
altogether and just use an absolute URI for the taglib declaration in
ths JSP like so:
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>
I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.
I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
get a 500:
org.apache.jasper.JasperException: The absolute uri:
http://struts.apache.org/tags-html cannot be resolved in either
web.xml or the jar files deployed with this application
This same mechanism is working perfectly well for JSTL, that is:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.
Any clues anyone?
Cheers,
Eliot Stock.

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


RE: calling request.getInputStream() within Action

2004-07-15 Thread Paul McCulloch
Can I ask why you are after the binary content of the request?

Paul

> -Original Message-
> From: Robert Shields [mailto:[EMAIL PROTECTED]
> Sent: 15 July 2004 16:02
> To: Struts Users Mailing List
> Subject: RE: calling request.getInputStream() within Action
> 
> 
> Hi Bill
> 
> Thanks for your response.
> I've tried with a servlet too, but even without calling
> request.getParameter the stream is still empty:
> 
> 
> public class TestServlet extends HttpServlet {
>ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>
>public void doGet(HttpServletRequest request,
>  HttpServletResponse response)
>throws IOException, ServletException 
>{
>   int length = request.getContentLength(); // 18
>   String contentType= request.getContentType();
>   // application/x-www-form-urlencoded
>   
>   InputStream inputStream = request.getInputStream();
>   int bytesAvailable = inputStream.available(); // 0
>   
>   byte[] buf = new byte[1024];
>   int bytesread;
>   
>   // bytesread is always -1
>   while((bytesread = inputStream.read(buf)) != -1)
>   {
>   // do stuff
>   }
>}
> 
>public void doPost(HttpServletRequest request,
>  HttpServletResponse response)
>throws IOException, ServletException
>{
>doGet(request, response);
>}
> }
> 
> 
> This should work, right?
> I'm starting to think something is wrong with my Tomcat!
> 
> Regards,
> Rob
> 
> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow
> Sent: 15 July 2004 14:16
> To: [EMAIL PROTECTED]
> Subject: Re: calling request.getInputStream() within Action
> 
> Robert, I found the following link that discusses this:
> 
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=jsp-inter
> est&F=&S=&
> P=49196
> 
> It sounds like you are correct -- if request.getParameter() has been 
> called you cannot get the input stream -- have you considered using a 
> Servlet instead?
> 
> Robert Shields wrote:
> 
> > Hi Struts Users
> > 
> > I'm trying to get the InputStream to read the binary contents of the
> > request within an Action's execute method. E.g.
> > 
> > 
> > 
> > public ActionForward execute(
> > ActionMapping mapping,
> > ActionForm form,
> > HttpServletRequest request,
> > HttpServletResponse response)
> > throws IOException, ServletException {
> > 
> > InputStream inputStream = request.getInputStream();
> > 
> > // bytesAvailable is always 0
> > int bytesAvailable = inputStream.available();
> > 
> > int bytesRead;
> > byte[] buf = new byte[1024];
> > while((bytesRead = inputStream.read(buf)) != -1)
> > {
> > // do stuff
> > }
> > }
> > 
> > So bytesAvailable is always 0, and inputStream.read(buf) immediately
> > returns -1.
> > 
> > I have heard that calling request.getParamter() before trying to
> access
> > the input stream can affect accessing the input stream. I believe
> struts
> > calls request.getParamter (it must do to populate the form bean).
> > 
> > My question is, how can I get access to the entire binary 
> contents of
> > the HTTP body?
> > 
> > I'm using Tomcat 5.0.25 BTW
> > 
> > TIA
> > Rob
> > 
> > 
> > This e-mail has been scanned for all viruses by Star Internet. The
> > service is powered by MessageLabs. For more information on 
> a proactive
> > anti-virus service working around the clock, around the 
> globe, visit:
> > http://www.star.net.uk
> > 
> _
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> _
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> _
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this mes

The absolute uri: http://struts.apache.org/tags-html cannot be resolved

2004-07-15 Thread Eliot Stock
Hello.

I'm trying to do what the Struts docs mention here (scroll down to
section 5.4.3.1):

http://struts.apache.org/userGuide/configuration.html#dd_config_taglib

which is, do away with declaring the struts taglibs in my web.xml
altogether and just use an absolute URI for the taglib declaration in
ths JSP like so:

<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %>

I also shouldn't need any tld files in WEB-INF/lib - all I need is struts.jar.

I'm deploying on Tomcat 5.0.25 which should handle this. But instead I
get a 500:

org.apache.jasper.JasperException: The absolute uri:
http://struts.apache.org/tags-html cannot be resolved in either
web.xml or the jar files deployed with this application

This same mechanism is working perfectly well for JSTL, that is:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

is finding the TLD for JSTL core in the JSTL far file in WEB-INF/lib just fine.

Any clues anyone?

Cheers,

Eliot Stock.

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



RE: [OT] Best practice for background service

2004-07-15 Thread Daniel Perry
Nope, you dont need to start another process - i use a struts plugin to load
and initialise Quartz.  It will run in other threads, but this will all be
done for you behind the scenes.

The code for my struts plugin is below (if it's of any help).  Add the
following entry to the struts-config-default.xml in the plug-in section to
load it:



It runs a "Job" every 30 mins.

This job takes the form:

public class RemoveOldProvisionalTrainingJob implements StatefulJob {
public void execute(JobExecutionContext arg0) throws JobExecutionException {
// code to do actual work here
}
}


Note that i'm implementing StatfulJob - this stops it running two of the
same job at the same time.

Daniel.


-SchedulerService.java-
package com.netcase.pdp.service;

import java.util.Date;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;

import
com.netcase.pdp.service.scheduledjobs.RemoveOldProvisionalTrainingJob;

/**
 * @author Daniel Perry
 *
 */
public class SchedulerService implements PlugIn {

Scheduler sched;

public void init(ActionServlet servlet, ModuleConfig moduleConf)
throws ServletException {
System.out.println("Starting scheduler service...");

SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
try {
sched = schedFact.getScheduler();
sched.start();

JobDetail jobDetail = new JobDetail(
"removeOldProvisionalTrainingJob",
Scheduler.DEFAULT_GROUP,
RemoveOldProvisionalTrainingJob.class);

// new trigger - repeat every 30 mins starting in 5 
mins time
// (delay for startup)
SimpleTrigger trigger = new 
SimpleTrigger("30MinTrigger",
Scheduler.DEFAULT_GROUP, new Date(new 
Date().getTime()
+ (5L* 60L * 1000L)), 
null,
SimpleTrigger.REPEAT_INDEFINITELY, 30 
* 60L * 1000L);

sched.scheduleJob(jobDetail, trigger);


} catch (SchedulerException ex) {
ex.printStackTrace();
}

}

public void destroy() {
try {
sched.shutdown();
} catch (SchedulerException ex) {
ex.printStackTrace();
}
sched = null;
}

}
---



> -Original Message-
> From: Marco Mistroni [mailto:[EMAIL PROTECTED]
> Sent: 15 July 2004 14:57
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] Best practice for background service
>
>
> Hello,
>   Sorry for 'OT' for asking questions about Quartz..
> Is it so that I have to start a separate 'process' for Quartz to run?
> So, at the end I will have my application server running as well as a
> Quartz process running 'outside' the application server?
>
> Regards
>   marco
>
> -Original Message-
> From: Daniel Perry [mailto:[EMAIL PROTECTED]
> Sent: 15 July 2004 14:48
> To: Struts Users Mailing List
> Subject: RE: [OT] Best practice for background service
>
> Quartz is very easy to use.  No need for thread programming.
>
> But "Job" classes are created as and when they are needed (so no
> initialisation and shared object).
>
> Create a struts plug-in which initialises quartz, and sets up the jobs
> (very
> little code needed).
>
> Daniel.
>
> > -Original Message-
> > From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
> > Sent: 15 July 2004 14:29
> > To: [EMAIL PROTECTED]
> > Subject: Re: [OT] Best practice for background service
> >
> >
> > Jan,
> > Bryan's recommendation of Spring and Quartz sounds good though I have
> > not had a chance to work with these yet. If you want to "roll your
> own"
> > I suggest you look at the java.util.Timer and java.util.TimerTask
> > objects -- they work well for these type of services. See
> > http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html.
> >
> > Jan Behrens wrote:
> >
> > > Hi list,
> > >
> > > I am coding an app where I rely on a background service to
> > check regularly
> > > for new mail. I want to instantiate my service component (the
> > one checking
> > > for mail) when the context is loaded and have it running in a
> background

RE: calling request.getInputStream() within Action

2004-07-15 Thread Robert Shields
Hi Bill

Thanks for your response.
I've tried with a servlet too, but even without calling
request.getParameter the stream is still empty:


public class TestServlet extends HttpServlet {
   ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
   
   public void doGet(HttpServletRequest request,
 HttpServletResponse response)
   throws IOException, ServletException 
   {
int length = request.getContentLength(); // 18
String contentType= request.getContentType();
  // application/x-www-form-urlencoded

InputStream inputStream = request.getInputStream();
int bytesAvailable = inputStream.available(); // 0

byte[] buf = new byte[1024];
int bytesread;

// bytesread is always -1
while((bytesread = inputStream.read(buf)) != -1)
{
// do stuff
}
   }

   public void doPost(HttpServletRequest request,
 HttpServletResponse response)
   throws IOException, ServletException
   {
   doGet(request, response);
   }
}


This should work, right?
I'm starting to think something is wrong with my Tomcat!

Regards,
Rob

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow
Sent: 15 July 2004 14:16
To: [EMAIL PROTECTED]
Subject: Re: calling request.getInputStream() within Action

Robert, I found the following link that discusses this:

http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=jsp-interest&F=&S=&;
P=49196

It sounds like you are correct -- if request.getParameter() has been 
called you cannot get the input stream -- have you considered using a 
Servlet instead?

Robert Shields wrote:

> Hi Struts Users
> 
> I'm trying to get the InputStream to read the binary contents of the
> request within an Action's execute method. E.g.
> 
> 
> 
> public ActionForward execute(
>   ActionMapping mapping,
>   ActionForm form,
>   HttpServletRequest request,
>   HttpServletResponse response)
>   throws IOException, ServletException {
> 
>   InputStream inputStream = request.getInputStream();
> 
>   // bytesAvailable is always 0
>   int bytesAvailable = inputStream.available();
> 
>   int bytesRead;
>   byte[] buf = new byte[1024];
>   while((bytesRead = inputStream.read(buf)) != -1)
>   {
>   // do stuff
>   }
> }
> 
> So bytesAvailable is always 0, and inputStream.read(buf) immediately
> returns -1.
> 
> I have heard that calling request.getParamter() before trying to
access
> the input stream can affect accessing the input stream. I believe
struts
> calls request.getParamter (it must do to populate the form bean).
> 
> My question is, how can I get access to the entire binary contents of
> the HTTP body?
> 
> I'm using Tomcat 5.0.25 BTW
> 
> TIA
> Rob
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> _


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


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


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

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



Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Niall Pemberton
Its in the commons-validator.jar that I downloaded with Struts 1.2.1

Fair enough if it works - still the wrong one though.

Niall

- Original Message - 
From: "Bryan Hunt" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 15, 2004 3:14 PM
Subject: Re: validation wierdness possibly related to multiple struts config
files


> h ... if i put that in mine I get a file not found exception the
> commons-validator jar doesn't include that one.
> with this definition it seems to be working ok for the time being
>
>  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
>
> curse these dtd's :-)
>
> --b
>
>
>
>
>
> Niall Pemberton wrote:
>
> >I got confused recently about validator versions  - validator 1.1.3 has
just
> >been released and thats what Struts 1.2.1 uses - validator 1.2 is still
in
> >development so you need to be using
> >
> >  >   "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> >   "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>
> >
> >
> >Niall
> >
> >- Original Message - 
> >From: "Bryan Hunt" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Sent: Thursday, July 15, 2004 2:20 PM
> >Subject: Re: validation wierdness possibly related to multiple struts
config
> >files
> >
> >
> >
> >
> >>finally solved it.
> >>
> >>When you have the following DTD definition in your validation.xml file
> >>snip=
> >> >>  "-//Apache Software Foundation//DTD Commons Validator Rules
> >>Configuration 1.0//EN"
> >>  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> >>=snip
> >>It breaks.
> >>
> >>When you have the following DTD definition in your validation.xml file *
> >>*snip=
> >> >>"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
> >>=snip*
> >>*It works
> >>
> >>When you have the following DTD definition in your validation.xml file
> >>snip=
> >> >>"http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> >>=snip
> >>It works.
> >>
> >>
> >>--b
> >>
> >>Bryan Hunt wrote:
> >>
> >>
> >>
> >>>Ok , dunno who to report this to but this validator stuff needs to be
> >>>looked at before this
> >>>is released to the public cause it's a bit of a mess.
> >>>
> >>>Just noticed that the version of validator-rules that is distributed
> >>>is for the validator_1_1.dtd version.
> >>>
> >>>I think somebody needs to take a little look at this. It doesn't seem
> >>>to know whether to do
> >>>1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
> >>>other.
> >>>
> >>>--b
> >>>
> >>>Bryan Hunt wrote:
> >>>
> >>>
> >>>
> Thank you Bill, your answer was correct. I've found that
> commons-validator as distibuted with the latest
> 1.2.1 version of struts doesn't include the
> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
> file. So despite my specifying the DTD like so
> snip=
> 
>   "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.0//EN"
>  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> =snip
> 
> I've copied the following files over to my libs dir.
> 
> snip=
> 08/07/2004  09:26  358,273 antlr.jar
> 08/07/2004  09:26  118,726 commons-beanutils.jar
> 08/07/2004  09:26  165,119 commons-collections.jar
> 08/07/2004  09:26  109,096 commons-digester.jar
> 08/07/2004  09:26   22,379 commons-fileupload.jar
> 08/07/2004  09:26   38,015 commons-logging.jar
> 08/07/2004  09:26   84,260 commons-validator.jar
> 08/07/2004  09:26   65,425 jakarta-oro.jar
> 08/07/2004  09:26  520,842 struts.jar
> =snip
> 
> 
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Bryan Hunt
h ... if i put that in mine I get a file not found exception the 
commons-validator jar doesn't include that one.
with this definition it seems to be working ok for the time being

http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
curse these dtd's :-) 

--b


Niall Pemberton wrote:
I got confused recently about validator versions  - validator 1.1.3 has just
been released and thats what Struts 1.2.1 uses - validator 1.2 is still in
development so you need to be using
http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>
Niall
- Original Message - 
From: "Bryan Hunt" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 15, 2004 2:20 PM
Subject: Re: validation wierdness possibly related to multiple struts config
files

 

finally solved it.
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It breaks.
When you have the following DTD definition in your validation.xml file *
*snip=
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
=snip*
*It works
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It works.
--b
Bryan Hunt wrote:
   

Ok , dunno who to report this to but this validator stuff needs to be
looked at before this
is released to the public cause it's a bit of a mess.
Just noticed that the version of validator-rules that is distributed
is for the validator_1_1.dtd version.
I think somebody needs to take a little look at this. It doesn't seem
to know whether to do
1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
other.
--b
Bryan Hunt wrote:
 

Thank you Bill, your answer was correct. I've found that
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
I've copied the following files over to my libs dir.
snip=
08/07/2004  09:26  358,273 antlr.jar
08/07/2004  09:26  118,726 commons-beanutils.jar
08/07/2004  09:26  165,119 commons-collections.jar
08/07/2004  09:26  109,096 commons-digester.jar
08/07/2004  09:26   22,379 commons-fileupload.jar
08/07/2004  09:26   38,015 commons-logging.jar
08/07/2004  09:26   84,260 commons-validator.jar
08/07/2004  09:26   65,425 jakarta-oro.jar
08/07/2004  09:26  520,842 struts.jar
=snip
   

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

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

   


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

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


Re: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Bryan Hunt
I dunno, it's a good product and I really like it but I've never seen 
any awareness of jsp editing.

I've been using it for a while now as well.
And cause it hasn't ever indicated that it understands scriptlets I've 
never used it for debugging.

Then again, I'm aiming for zero java code in my jsp's.
--b
[EMAIL PROTECTED] wrote:
NitroX DOES support code completion: http://www.m7.com/appxray.jsp
If you get a moment, you should view the video of the demo.  However, 
I've heard that the new offering from Sun is good as well:
http://www.demosondemand.com/clients/m7/001/page/demo.asp

To be fair, I'm _still_ using Idea (and _still_ lovin' it).
Dennis

*Bryan Hunt <[EMAIL PROTECTED]>*
07/15/2004 06:53 AM
Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>

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

Subject
Re: [OT] Editor for Struts/J2ee apps




Nitrox from M4 ... best that I've seen (for struts) . Better than
MyEclipse but does not support code completion within JSP's
or debugging ( from what I can see ) .
--b
Navjot Singh wrote:
> hi,
>
> I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with
> struts as web framework and i need to decide on the IDE that i should
> use.
>
> May i have your inputs on pros/cons on IDEs that you are using. Any
> specific inputs on IDEA/MyEclipse are most welcome.
>
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Struts Validator & Date Patterns

2004-07-15 Thread Enrique Medina
Hi,
I would like to know if it's possible to indicate a validation of
type "date" indicating as a dattePatern/datePatternStrict a key from
an application resource message file. I mean, instead of:



datePatternStrictMMdd

to be able to indicate the "MMdd" dynamically (to be found
through a key in a resource bundle).
Thanks in advance,
Enrique Medina.
_
Dale rienda suelta a tu tiempo libre. Encuentra mil ideas para exprimir tu 
ocio con MSN Entretenimiento. http://entretenimiento.msn.es/

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


Re: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread DGraham

NitroX DOES support code completion:
http://www.m7.com/appxray.jsp

If you get a moment, you should view
the video of the demo.  However, I've heard that the new offering
from Sun is good as well:
http://www.demosondemand.com/clients/m7/001/page/demo.asp

To be fair, I'm _still_ using Idea (and
_still_ lovin' it).

Dennis






Bryan Hunt <[EMAIL PROTECTED]>

07/15/2004 06:53 AM



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





To
Struts Users Mailing List
<[EMAIL PROTECTED]>


cc



Subject
Re: [OT] Editor for Struts/J2ee
apps








Nitrox from M4 ... best that I've seen (for struts)
. Better than 
MyEclipse but does not support code completion within JSP's
or debugging ( from what I can see ) .

--b

Navjot Singh wrote:

> hi,
>
> I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with 
> struts as web framework and i need to decide on the IDE that i should

> use.
>
> May i have your inputs on pros/cons on IDEs that you are using. Any

> specific inputs on IDEA/MyEclipse are most welcome.
>

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


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

RE: [OT] Best practice for background service

2004-07-15 Thread Marco Mistroni
Hello,
Sorry for 'OT' for asking questions about Quartz..
Is it so that I have to start a separate 'process' for Quartz to run?
So, at the end I will have my application server running as well as a 
Quartz process running 'outside' the application server?

Regards
marco

-Original Message-
From: Daniel Perry [mailto:[EMAIL PROTECTED] 
Sent: 15 July 2004 14:48
To: Struts Users Mailing List
Subject: RE: [OT] Best practice for background service

Quartz is very easy to use.  No need for thread programming.

But "Job" classes are created as and when they are needed (so no
initialisation and shared object).

Create a struts plug-in which initialises quartz, and sets up the jobs
(very
little code needed).

Daniel.

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
> Sent: 15 July 2004 14:29
> To: [EMAIL PROTECTED]
> Subject: Re: [OT] Best practice for background service
>
>
> Jan,
> Bryan's recommendation of Spring and Quartz sounds good though I have
> not had a chance to work with these yet. If you want to "roll your
own"
> I suggest you look at the java.util.Timer and java.util.TimerTask
> objects -- they work well for these type of services. See
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html.
>
> Jan Behrens wrote:
>
> > Hi list,
> >
> > I am coding an app where I rely on a background service to
> check regularly
> > for new mail. I want to instantiate my service component (the
> one checking
> > for mail) when the context is loaded and have it running in a
background
> > thread. I have done only very limited coding with threads so far :(
> >
> > What I plan to do is to create a controller servlet that is loaded
on
> > startup and that creates instances of all my services. All
> services extend
> > Thread and are started by invoking the run() method when the
controller
> > servlet starts. Would that work? How would I then set the
> intervall on which
> > my mail service checks for new mail? Could this be done using
> > sleep(interval)?
> >
> > I wonder whether anyone has tips on this for a newbie or if
> there is such a
> > thing as a best practice on this.
> >
> > TIA, Jan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


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



Re: Struts Sample / Best Practices for Database access

2004-07-15 Thread Hubert Rabago
The mailreader app is included with the 1.2.1 distribution.
http://cvs.apache.org/dist/struts/v1.2.1/

--- Richard Reyes <[EMAIL PROTECTED]> wrote:
> Thanks Ted. Where can i get the mailreader webapp again?
> 
> Ted Husted wrote:
> 
> >This is kind of a trick question, or at least a trick subject. 
> >
> >In a Struts application, the best practice for database access is for
> Struts to be unaware that there is even such a thing as a database. If you
> are using the Struts best practice, then it shouldn't matter whether the
> database example is in a Struts application or not. 
> >
> >The Struts Mailreader demonstrates an excellent practice for database
> access. It defines an POJO interface with the methods that accept and/or
> return the data that the application needs. The Actions expect that
> singleton instances of these plain-old Java objects will be in application
> scope under a known name. The Actions speak only to the interface. A Struts
> PlugIn loads an implementation of the interfaces into application scope
> under the expected names, and we are ready to rock.
> >
> >The POJO JavaBeans can be implemented using whatever technology you like.
> They should not know there are living in a Struts application, or even a
> Web application, and should be fully testable. You should be able to write
> them using stock examples for your chosen technology, blissfully unaware of
> whether they will be used by Struts or not.
> >
> >-Ted.
> >
> >On Thu, 15 Jul 2004 14:16:29 +0800, Richard Reyes wrote:
> >  
> >
> >> Hi Guys,
> >>
> >> Newbie question, where can i get struts sample application using
> >> database components like DAO, JDO or Hibernate samples.
> >>
> >> Thanks
> >> Richard
> >>
> >>
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >  
> >
> 




__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



RE: [OT] Best practice for background service

2004-07-15 Thread Daniel Perry
Quartz is very easy to use.  No need for thread programming.

But "Job" classes are created as and when they are needed (so no
initialisation and shared object).

Create a struts plug-in which initialises quartz, and sets up the jobs (very
little code needed).

Daniel.

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
> Sent: 15 July 2004 14:29
> To: [EMAIL PROTECTED]
> Subject: Re: [OT] Best practice for background service
>
>
> Jan,
> Bryan's recommendation of Spring and Quartz sounds good though I have
> not had a chance to work with these yet. If you want to "roll your own"
> I suggest you look at the java.util.Timer and java.util.TimerTask
> objects -- they work well for these type of services. See
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html.
>
> Jan Behrens wrote:
>
> > Hi list,
> >
> > I am coding an app where I rely on a background service to
> check regularly
> > for new mail. I want to instantiate my service component (the
> one checking
> > for mail) when the context is loaded and have it running in a background
> > thread. I have done only very limited coding with threads so far :(
> >
> > What I plan to do is to create a controller servlet that is loaded on
> > startup and that creates instances of all my services. All
> services extend
> > Thread and are started by invoking the run() method when the controller
> > servlet starts. Would that work? How would I then set the
> intervall on which
> > my mail service checks for new mail? Could this be done using
> > sleep(interval)?
> >
> > I wonder whether anyone has tips on this for a newbie or if
> there is such a
> > thing as a best practice on this.
> >
> > TIA, Jan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



RE: [OT] Best practice for background service

2004-07-15 Thread Marco Mistroni
Hello,
If u r familiar with JMX, there is a Timer service
That does exactly what you want (emit notifications at certain
Interval)

Regards
marco

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow
Sent: 15 July 2004 14:29
To: [EMAIL PROTECTED]
Subject: Re: [OT] Best practice for background service

Jan,
Bryan's recommendation of Spring and Quartz sounds good though I have 
not had a chance to work with these yet. If you want to "roll your own" 
I suggest you look at the java.util.Timer and java.util.TimerTask 
objects -- they work well for these type of services. See 
http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html.

Jan Behrens wrote:

> Hi list,
> 
> I am coding an app where I rely on a background service to check
regularly
> for new mail. I want to instantiate my service component (the one
checking
> for mail) when the context is loaded and have it running in a
background
> thread. I have done only very limited coding with threads so far :(
> 
> What I plan to do is to create a controller servlet that is loaded on
> startup and that creates instances of all my services. All services
extend
> Thread and are started by invoking the run() method when the
controller
> servlet starts. Would that work? How would I then set the intervall on
which
> my mail service checks for new mail? Could this be done using
> sleep(interval)?
> 
> I wonder whether anyone has tips on this for a newbie or if there is
such a
> thing as a best practice on this.
> 
> TIA, Jan


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


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



Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Niall Pemberton
I got confused recently about validator versions  - validator 1.1.3 has just
been released and thats what Struts 1.2.1 uses - validator 1.2 is still in
development so you need to be using

 http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>


Niall

- Original Message - 
From: "Bryan Hunt" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 15, 2004 2:20 PM
Subject: Re: validation wierdness possibly related to multiple struts config
files


> finally solved it.
>
> When you have the following DTD definition in your validation.xml file
> snip=
>"-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.0//EN"
>   "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> =snip
> It breaks.
>
> When you have the following DTD definition in your validation.xml file *
> *snip=
>  "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
> =snip*
> *It works
>
> When you have the following DTD definition in your validation.xml file
> snip=
>  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> =snip
> It works.
>
>
> --b
>
> Bryan Hunt wrote:
>
> > Ok , dunno who to report this to but this validator stuff needs to be
> > looked at before this
> > is released to the public cause it's a bit of a mess.
> >
> > Just noticed that the version of validator-rules that is distributed
> > is for the validator_1_1.dtd version.
> >
> > I think somebody needs to take a little look at this. It doesn't seem
> > to know whether to do
> > 1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
> > other.
> >
> > --b
> >
> > Bryan Hunt wrote:
> >
> >> Thank you Bill, your answer was correct. I've found that
> >> commons-validator as distibuted with the latest
> >> 1.2.1 version of struts doesn't include the
> >> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
> >> file. So despite my specifying the DTD like so
> >> snip=
> >>
> >>  >>  "-//Apache Software Foundation//DTD Commons Validator Rules
> >> Configuration 1.0//EN"
> >>  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
> >> =snip
> >>
> >> I've copied the following files over to my libs dir.
> >>
> >> snip=
> >> 08/07/2004  09:26  358,273 antlr.jar
> >> 08/07/2004  09:26  118,726 commons-beanutils.jar
> >> 08/07/2004  09:26  165,119 commons-collections.jar
> >> 08/07/2004  09:26  109,096 commons-digester.jar
> >> 08/07/2004  09:26   22,379 commons-fileupload.jar
> >> 08/07/2004  09:26   38,015 commons-logging.jar
> >> 08/07/2004  09:26   84,260 commons-validator.jar
> >> 08/07/2004  09:26   65,425 jakarta-oro.jar
> >> 08/07/2004  09:26  520,842 struts.jar
> >> =snip
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Bill Siggelkow
I am using this DTD declaration in my validation.xml and 
validator-rules.xml files:


  "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.1//EN"
  "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>

It lets me access the new  element.
Bill
Bryan Hunt wrote:
finally solved it.
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It breaks.
When you have the following DTD definition in your validation.xml file *
*snip=
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
=snip*
*It works
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It works.
--b
Bryan Hunt wrote:
Ok , dunno who to report this to but this validator stuff needs to be 
looked at before this
is released to the public cause it's a bit of a mess.

Just noticed that the version of validator-rules that is distributed 
is for the validator_1_1.dtd version.

I think somebody needs to take a little look at this. It doesn't seem 
to know whether to do
1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
other.

--b
Bryan Hunt wrote:
Thank you Bill, your answer was correct. I've found that 
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the 
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=


 "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.0//EN"
 "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip

I've copied the following files over to my libs dir.
snip=
08/07/2004  09:26  358,273 antlr.jar
08/07/2004  09:26  118,726 commons-beanutils.jar
08/07/2004  09:26  165,119 commons-collections.jar
08/07/2004  09:26  109,096 commons-digester.jar
08/07/2004  09:26   22,379 commons-fileupload.jar
08/07/2004  09:26   38,015 commons-logging.jar
08/07/2004  09:26   84,260 commons-validator.jar
08/07/2004  09:26   65,425 jakarta-oro.jar
08/07/2004  09:26  520,842 struts.jar
=snip


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

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


Re: [OT] Best practice for background service

2004-07-15 Thread Bill Siggelkow
Jan,
Bryan's recommendation of Spring and Quartz sounds good though I have 
not had a chance to work with these yet. If you want to "roll your own" 
I suggest you look at the java.util.Timer and java.util.TimerTask 
objects -- they work well for these type of services. See 
http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html.

Jan Behrens wrote:
Hi list,
I am coding an app where I rely on a background service to check regularly
for new mail. I want to instantiate my service component (the one checking
for mail) when the context is loaded and have it running in a background
thread. I have done only very limited coding with threads so far :(
What I plan to do is to create a controller servlet that is loaded on
startup and that creates instances of all my services. All services extend
Thread and are started by invoking the run() method when the controller
servlet starts. Would that work? How would I then set the intervall on which
my mail service checks for new mail? Could this be done using
sleep(interval)?
I wonder whether anyone has tips on this for a newbie or if there is such a
thing as a best practice on this.
TIA, Jan

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


Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Bryan Hunt
finally solved it.
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It breaks.
When you have the following DTD definition in your validation.xml file *
*snip=
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
=snip*
*It works
When you have the following DTD definition in your validation.xml file
snip=
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip
It works.
--b
Bryan Hunt wrote:
Ok , dunno who to report this to but this validator stuff needs to be 
looked at before this
is released to the public cause it's a bit of a mess.

Just noticed that the version of validator-rules that is distributed 
is for the validator_1_1.dtd version.

I think somebody needs to take a little look at this. It doesn't seem 
to know whether to do
1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
other.

--b
Bryan Hunt wrote:
Thank you Bill, your answer was correct. I've found that 
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the 
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=


 "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.0//EN"
 "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip

I've copied the following files over to my libs dir.
snip=
08/07/2004  09:26  358,273 antlr.jar
08/07/2004  09:26  118,726 commons-beanutils.jar
08/07/2004  09:26  165,119 commons-collections.jar
08/07/2004  09:26  109,096 commons-digester.jar
08/07/2004  09:26   22,379 commons-fileupload.jar
08/07/2004  09:26   38,015 commons-logging.jar
08/07/2004  09:26   84,260 commons-validator.jar
08/07/2004  09:26   65,425 jakarta-oro.jar
08/07/2004  09:26  520,842 struts.jar
=snip

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

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


RE: [faked-from] RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread B.S.Narayana
tell me the url for JDeveloper.

-Original Message-
From: Amjad Shahrour [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 15, 2004 1:14 PM
To: 'Struts Users Mailing List'
Subject: [faked-from] RE: [OT] Editor for Struts/J2ee apps


I agree JDeveloper 10g is GREAT.


Amjad 

-Original Message-
From: Sebastian Ho [mailto:[EMAIL PROTECTED] 
Sent: 28 جمادى الاولى, 1425 10:38 ص
To: Struts Users Mailing List
Subject: Re: [OT] Editor for Struts/J2ee apps

Try Jdeveloper. Great support for Struts.

sebastian


On Thu, 2004-07-15 at 13:10, Navjot Singh wrote:
> hi,
> 
> I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with
struts 
> as web framework and i need to decide on the IDE that i should use.
> 
> May i have your inputs on pros/cons on IDEs that you are using. Any 
> specific inputs on IDEA/MyEclipse are most welcome.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
___
Labbaik - The Integrated Solution
Provider for the Hospitality Industry


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


Re: calling request.getInputStream() within Action

2004-07-15 Thread Bill Siggelkow
Robert, I found the following link that discusses this:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=jsp-interest&F=&S=&P=49196
It sounds like you are correct -- if request.getParameter() has been 
called you cannot get the input stream -- have you considered using a 
Servlet instead?

Robert Shields wrote:
Hi Struts Users
I'm trying to get the InputStream to read the binary contents of the
request within an Action's execute method. E.g.

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
InputStream inputStream = request.getInputStream();
// bytesAvailable is always 0
int bytesAvailable = inputStream.available();
int bytesRead;
byte[] buf = new byte[1024];
while((bytesRead = inputStream.read(buf)) != -1)
{
// do stuff
}
}
So bytesAvailable is always 0, and inputStream.read(buf) immediately
returns -1.
I have heard that calling request.getParamter() before trying to access
the input stream can affect accessing the input stream. I believe struts
calls request.getParamter (it must do to populate the form bean).
My question is, how can I get access to the entire binary contents of
the HTTP body?
I'm using Tomcat 5.0.25 BTW
TIA
Rob
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
_

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


Re: final getter/setter methods in actionform and valueobject classes

2004-07-15 Thread Bill Siggelkow
See section of 8.4.3.3 of the Java Language Specification at 
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html.

There is nothing wrong with declaring them as final; it means that the 
methods cannot be overriden by subclasses.

Viral_Thakkar wrote:
Hi All,
I was wondering if all the getXXX methods in the Value Objects could be
declared as final.
Regards,
Viral

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


Best Free Plugins for Eclipse with Struts

2004-07-15 Thread Henrique VIECILI
Hi all Eclipse and Struts fans,

What free plugins for eclipse 3 do you recommend to build a complete enviroment to 
develop J2EE applications using Struts?

A complete enviroment includes:
UML modeling
DataBase connection
J2EE development
Struts framework

Thanks,
Henrique Viecili

Re: LabelValueBean and BeanMap with and for indexed properties

2004-07-15 Thread Niall Pemberton
No I see no difficulty in relying on it. I was just saying the same as Joe
had already said but I just thought it would give you more comfort to know
the principle that the beanutils committers are working on.

Just for information, the inconsistency issue currently in beanutils is
where you have a bean that extends a Map but also implements some simple
properties.

For example

public class MyBean extends Map {

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

Currently if you call PropertyUtils.setProperty("foo", "bar") then beanutils
would set the value in the "foo" property rather than the Map. But using
PropertyUtils.getProperty("foo") ignores the "foo" property and only looks
for an entry in the Map with a key of "foo".

Its likely that beanutils will change in the future so that the "setter"
works in the same way as the "getter".

Niall

- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 15, 2004 1:04 PM
Subject: Re: LabelValueBean and BeanMap with  and
 for indexed properties


> At 03:52 AM 7/15/2004, you wrote:
> >There are currently some discrepencies in beanutils where the above
> >statement isn't followed - but, from the discussion over on commons, its
> >likely that in a  future version of beanutils it will be changed so that
it
> >is always consistent with the above statement.
> >
> >Niall
>
>
> Niall, what is the upshot of your observation?  Does this mean that, in
> your view, I am likely nor not likely to see a difficulty if I rely upon
> this undocumented use of  and bean utils?
>
> Thanks,
>
> Michael
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: [OT] Best practice for background service

2004-07-15 Thread Bryan Hunt
better idea , integrate the spring framwork and use the built in support 
for quartz scheduling.

http://www.springframework.org/docs/reference/index.html
http://www.springframework.org/docs/reference/scheduling.html
--b
*
*
Jan Behrens wrote:
Hi list,
I am coding an app where I rely on a background service to check regularly
for new mail. I want to instantiate my service component (the one checking
for mail) when the context is loaded and have it running in a background
thread. I have done only very limited coding with threads so far :(
What I plan to do is to create a controller servlet that is loaded on
startup and that creates instances of all my services. All services extend
Thread and are started by invoking the run() method when the controller
servlet starts. Would that work? How would I then set the intervall on which
my mail service checks for new mail? Could this be done using
sleep(interval)?
I wonder whether anyone has tips on this for a newbie or if there is such a
thing as a best practice on this.
TIA, Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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


[OT] Best practice for background service

2004-07-15 Thread Jan Behrens
Hi list,

I am coding an app where I rely on a background service to check regularly
for new mail. I want to instantiate my service component (the one checking
for mail) when the context is loaded and have it running in a background
thread. I have done only very limited coding with threads so far :(

What I plan to do is to create a controller servlet that is loaded on
startup and that creates instances of all my services. All services extend
Thread and are started by invoking the run() method when the controller
servlet starts. Would that work? How would I then set the intervall on which
my mail service checks for new mail? Could this be done using
sleep(interval)?

I wonder whether anyone has tips on this for a newbie or if there is such a
thing as a best practice on this.

TIA, Jan


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



Re: LabelValueBean and BeanMap with and for indexed properties

2004-07-15 Thread Michael McGrady
At 03:52 AM 7/15/2004, you wrote:
There are currently some discrepencies in beanutils where the above
statement isn't followed - but, from the discussion over on commons, its
likely that in a  future version of beanutils it will be changed so that it
is always consistent with the above statement.
Niall

Niall, what is the upshot of your observation?  Does this mean that, in 
your view, I am likely nor not likely to see a difficulty if I rely upon 
this undocumented use of  and bean utils?

Thanks,
Michael

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


Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Bryan Hunt
Ok , dunno who to report this to but this validator stuff needs to be 
looked at before this
is released to the public cause it's a bit of a mess.

Just noticed that the version of validator-rules that is distributed is 
for the validator_1_1.dtd version.

I think somebody needs to take a little look at this. It doesn't seem to 
know whether to do
1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
other.

--b
Bryan Hunt wrote:
Thank you Bill, your answer was correct. I've found that 
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the 
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=


 "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.0//EN"
 "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip

I've copied the following files over to my libs dir.
snip=
08/07/2004  09:26  358,273 antlr.jar
08/07/2004  09:26  118,726 commons-beanutils.jar
08/07/2004  09:26  165,119 commons-collections.jar
08/07/2004  09:26  109,096 commons-digester.jar
08/07/2004  09:26   22,379 commons-fileupload.jar
08/07/2004  09:26   38,015 commons-logging.jar
08/07/2004  09:26   84,260 commons-validator.jar
08/07/2004  09:26   65,425 jakarta-oro.jar
08/07/2004  09:26  520,842 struts.jar
=snip

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


Re: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Bryan Hunt
sorry should have said M7
--b
Bryan Hunt wrote:
Nitrox from M4 ... best that I've seen (for struts) . Better than 
MyEclipse but does not support code completion within JSP's
or debugging ( from what I can see ) .

--b
Navjot Singh wrote:
hi,
I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with 
struts as web framework and i need to decide on the IDE that i should 
use.

May i have your inputs on pros/cons on IDEs that you are using. Any 
specific inputs on IDEA/MyEclipse are most welcome.

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


Re: validation wierdness possibly related to multiple struts config files

2004-07-15 Thread Bryan Hunt
Thank you Bill, your answer was correct. I've found that 
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the 
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=


 "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.0//EN"
 "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
=snip

I've copied the following files over to my libs dir.
snip=
08/07/2004  09:26  358,273 antlr.jar
08/07/2004  09:26  118,726 commons-beanutils.jar
08/07/2004  09:26  165,119 commons-collections.jar
08/07/2004  09:26  109,096 commons-digester.jar
08/07/2004  09:26   22,379 commons-fileupload.jar
08/07/2004  09:26   38,015 commons-logging.jar
08/07/2004  09:26   84,260 commons-validator.jar
08/07/2004  09:26   65,425 jakarta-oro.jar
08/07/2004  09:26  520,842 struts.jar
=snip
It still appears to be still validating using an old dtd and throws the 
following exception.

wierd ... wierd ... wierd
15-Jul-2004 13:22:07 org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 30 column 21: The content of element type 
"field" mu
st match "(msg|arg0|arg1|arg2|arg3|var)*".
org.xml.sax.SAXParseException: The content of element type "field" must 
match "(
msg|arg0|arg1|arg2|arg3|var)*".
   at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
   at 
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
ource)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown 
Source)

   at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
n Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
   at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.commons.digester.Digester.parse(Digester.java:1581)
   at 
org.apache.commons.validator.ValidatorResources.(ValidatorResou
rces.java:153)
   at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:233)
   at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:164)
   at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:839)
   at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
   at javax.servlet.GenericServlet.init(GenericServlet.java:256)
   at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
   at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
   at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3853)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
168)
   at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:
2897)
   at 
org.apache.catalina.core.StandardContext.backgroundProcess(StandardCo
ntext.java:4472)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1658)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1667)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p

I've tried getting the latest version from 
http://cvs.apache.org/builds/jakarta-commons/nightly/commons-validator/
and despite it including the 1.2 dtd the problem persists, perhaps I am 
brain dead but I can't figure this out.

--b
Bill Siggelkow wrote:
Are you using Struts 1.2 or the nightly build? I had this issue the 
other day and I think I got around it by using the new  element 
instead of  -- simply change arg0 to arg in your validation.xml.


Or you can try using the new position attribute:

Bill Siggelkow
Bryan Hunt wrote:
I have the following jsp page
snip=

 
   
 
   
 
   
 :
 
   
 
etc etc etc
=snip

I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
They are declared as so in my web.xml file.
snip=

config
/WEB-INF/struts/default.xml,
/WEB-INF/struts/client.xml,
/WEB-INF/struts/sales.xml,
/WEB-INF/struts/admin.xml


=snip
The default.xml contains the following lines which work ju

RE: Easy Struts Eclipse V3

2004-07-15 Thread James Holmes
Struts Console is very similar to Easy Struts and works in ALL versions of
Eclipse (but best in 3.0).  In fact, Easy Struts is based on Struts Console,
so they are very similar.

http://www.jamesholmes.com/struts/

-James  

-Original Message-
From: Denis Peyrusaubes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 15, 2004 4:30 AM
To: Struts Users Mailing List
Subject: Easy Struts Eclipse V3

Hi,

I am wondering  if somebody tries the easystruts plugin for eclipse V3.
http://easystruts.sourceforge.net only talk about eclipse V2

Do u know other plugin for developing struts based application using Eclipse
V3

Thank u

Denis 




-Message d'origine-
De : Robert Shields [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 15 juillet 2004 11:23
À : [EMAIL PROTECTED]
Objet : calling request.getInputStream() within Action

Hi Struts Users

I'm trying to get the InputStream to read the binary contents of the
request within an Action's execute method. E.g.



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

InputStream inputStream = request.getInputStream();

// bytesAvailable is always 0
int bytesAvailable = inputStream.available();

int bytesRead;
byte[] buf = new byte[1024];
while((bytesRead = inputStream.read(buf)) != -1)
{
// do stuff
}
}

So bytesAvailable is always 0, and inputStream.read(buf) immediately
returns -1.

I have heard that calling request.getParamter() before trying to access
the input stream can affect accessing the input stream. I believe struts
calls request.getParamter (it must do to populate the form bean).

My question is, how can I get access to the entire binary contents of
the HTTP body?

I'm using Tomcat 5.0.25 BTW

TIA
Rob


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

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



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


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



Re: examples of struts??

2004-07-15 Thread Bryan Hunt
http://aerlingus.com 
The finest of Irish airlines, to be sure , to be sure !
--b
Lykins Don H Contr AFSAC/ITS wrote:
What real-world web sites are using struts?
Can someone point me to some sites and do you know which packages/classes are used?
also, which is the most popular/beneficial class in use today?
Don Lykins
AFSAC
937-257-4295 x4539
[EMAIL PROTECTED]

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

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


Re: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Bryan Hunt
Nitrox from M4 ... best that I've seen (for struts) . Better than 
MyEclipse but does not support code completion within JSP's
or debugging ( from what I can see ) .

--b
Navjot Singh wrote:
hi,
I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with 
struts as web framework and i need to decide on the IDE that i should 
use.

May i have your inputs on pros/cons on IDEs that you are using. Any 
specific inputs on IDEA/MyEclipse are most welcome.

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


Re: LabelValueBean and BeanMap with and for indexed properties

2004-07-15 Thread Niall Pemberton
I've been doing a bit of work on PropertyUtils bugs recently and discussing
some discrepencies with how simple/mapped properties are handled between the
different methods with a couple of the other beanutils committers.

Quoting from Craig McClanahan

"The standard implementations of expression evaluation (JSTL 1.0/1.1, JSP
2.0, JSF 1.0/1.1) all conform to the way that BeanUtils currently works -- 
if the object you pass implements Map, it is *always* treated as a  Map."

There are currently some discrepencies in beanutils where the above
statement isn't followed - but, from the discussion over on commons, its
likely that in a  future version of beanutils it will be changed so that it
is always consistent with the above statement.

Niall

- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 15, 2004 2:49 AM
Subject: Re: LabelValueBean and BeanMap with  and
 for indexed properties


> Thanks, Joe.  I expect you are right, but it is comforting to hear it.
>
> Michael
>
> At 04:06 PM 7/14/2004, you wrote:
> >Michael:
> >
> >This is ultimately a function performed by commons-beanutils, not Struts
> >itself.  Specifically, o.a.c.beanutils.PropertyUtils has a method,
> >"getProperty(Object, String) which returns the object value of the bean
> >property.  (Internally, that's actually forwarded to
> >getNestedProperty(Object, String) but the end result is the same...)
> >
> >Anyway, while it's not explicit in the docs, it is explicit in the
code -- 
> >if the Object passed to PropertyUtils implements java.util.Map, then the
> >String passed in is used as a key to the map to get the value to
> >return.  As much as you trust the developers of beanutils to maintain
> >backwards compatibility, you can count on this. I'd say you're pretty
safe.
> >
> >Joe
> >
> >
> >At 3:28 PM -0700 7/14/04, Michael McGrady wrote:
> >>I am using my version of a BeanMap built for instrumentation, cf.
> >>http://wiki.apache.org/struts/StrutsCatalogMappedBeans, and am putting a
> >>series of java.util.LinkedLists holding
> >>org.apache.struts.util.LabelValueBeans into the BeanMap via
> >>setProperty(Object key,Object value).  I am then accessing the lists via
> >> in Struts radio tags (where "eclipse" is a key in the
> >>BeanMap holding a list of LabelValueBeans) as follows:
> >>
> >>
> >>>> property="eclipse">
> >> 
> >> 
> >>   
> >>
> >>This works great!  However, I am not sure that this behavior will be
> >>guaranteed in the future, since it is not documented in the docs.
> >>
> >>In the docs, the property for iterator is "defined" as the
> >>
> >> "Name of the property, of the JSP bean specified by name, whose
> >> getter returns the collection to be iterated".
> >>
> >>Obviously, my code sneaks in the value of the property attribute as the
> >>
> >> "Name of the key in the BeanMap which returns the Collection
> >> saved is scope as "layouts_schemes"
> >>
> >>Trust me, if I change the property value to a different key in the
> >>BeanMap, I do get a different collection (List) from the BeanMap on the
> >>page.  My question is whether this will be guaranteed in the future. Or,
> >>is this an anomaly that I cannot count on in the future? Anyone have an
> >>inkling on that?
> >>
> >>Thanks!
> >>
> >>Michael
> >>
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >--
> >Joe Germuska
> >[EMAIL PROTECTED]
> >http://blog.germuska.com
> >"In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back;
> >I'll know I'm in the wrong place."
> >- Carlos Santana
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: Struts Sample / Best Practices for Database access

2004-07-15 Thread Richard Reyes
Thanks Ted. Where can i get the mailreader webapp again?
Ted Husted wrote:
This is kind of a trick question, or at least a trick subject. 

In a Struts application, the best practice for database access is for Struts to be unaware that there is even such a thing as a database. If you are using the Struts best practice, then it shouldn't matter whether the database example is in a Struts application or not. 

The Struts Mailreader demonstrates an excellent practice for database access. It 
defines an POJO interface with the methods that accept and/or return the data that the 
application needs. The Actions expect that singleton instances of these plain-old Java 
objects will be in application scope under a known name. The Actions speak only to the 
interface. A Struts PlugIn loads an implementation of the interfaces into application 
scope under the expected names, and we are ready to rock.
The POJO JavaBeans can be implemented using whatever technology you like. They should 
not know there are living in a Struts application, or even a Web application, and 
should be fully testable. You should be able to write them using stock examples for 
your chosen technology, blissfully unaware of whether they will be used by Struts or 
not.
-Ted.
On Thu, 15 Jul 2004 14:16:29 +0800, Richard Reyes wrote:
 

Hi Guys,
Newbie question, where can i get struts sample application using
database components like DAO, JDO or Hibernate samples.
Thanks
Richard
   


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

 



Re: Struts Sample / Best Practices for Database access

2004-07-15 Thread Ted Husted
This is kind of a trick question, or at least a trick subject.

In a Struts application, the best practice for database access is for Struts to be 
unaware that there is even such a thing as a database. If you are using the Struts 
best practice, then it shouldn't matter whether the database example is in a Struts 
application or not.

The Struts Mailreader demonstrates an excellent practice for database access. It 
defines an POJO interface with the methods that accept and/or return the data that the 
application needs. The Actions expect that singleton instances of these plain-old Java 
objects will be in application scope under a known name. The Actions speak only to the 
interface. A Struts PlugIn loads an implementation of the interfaces into application 
scope under the expected names, and we are ready to rock.

The POJO JavaBeans can be implemented using whatever technology you like. They should 
not know there are living in a Struts application, or even a Web application, and 
should be fully testable. You should be able to write them using stock examples for 
your chosen technology, blissfully unaware of whether they will be used by Struts or 
not.

-Ted.

On Thu, 15 Jul 2004 14:16:29 +0800, Richard Reyes wrote:
> Hi Guys,
>
> Newbie question, where can i get struts sample application using
> database components like DAO, JDO or Hibernate samples.
>
> Thanks
> Richard



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



Re: Struts Example for standards

2004-07-15 Thread Ted Husted
http://struts.apache.org/learning.html#Examples

But, it's not required.

This check was made in earlier versions of the Struts Mailreader and justified as 
"defensive programming". If the ActionForm was missing, the Action created one. Later, 
the check was removed, since the Action should not be compensating for a broken API 
contract. If an Action expects an ActionForm, than any ActionMapping that wants to use 
it must provide one. The Action should fail if its contract is broken.

The best strategy might be to check for null, log if its missing, and then throw a 
very large exception to "nip it the bud".

-Ted.

On Thu, 15 Jul 2004 11:11:08 +0530, Viral_Thakkar wrote:
> Hi All,
>
> Is there place where I can find struts example projects? I need to
> see the coding style and whether null checking in Action class is
> required or not.
>
> I am not using ActionForm in my project.
>
> Regards,
> Viral
>
>
> 
> - To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]



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



Easy Struts Eclipse V3

2004-07-15 Thread Denis Peyrusaubes
Hi,

I am wondering  if somebody tries the easystruts plugin for eclipse V3.
http://easystruts.sourceforge.net only talk about eclipse V2

Do u know other plugin for developing struts based application using Eclipse V3

Thank u

Denis 




-Message d'origine-
De : Robert Shields [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 15 juillet 2004 11:23
À : [EMAIL PROTECTED]
Objet : calling request.getInputStream() within Action

Hi Struts Users

I'm trying to get the InputStream to read the binary contents of the
request within an Action's execute method. E.g.



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

InputStream inputStream = request.getInputStream();

// bytesAvailable is always 0
int bytesAvailable = inputStream.available();

int bytesRead;
byte[] buf = new byte[1024];
while((bytesRead = inputStream.read(buf)) != -1)
{
// do stuff
}
}

So bytesAvailable is always 0, and inputStream.read(buf) immediately
returns -1.

I have heard that calling request.getParamter() before trying to access
the input stream can affect accessing the input stream. I believe struts
calls request.getParamter (it must do to populate the form bean).

My question is, how can I get access to the entire binary contents of
the HTTP body?

I'm using Tomcat 5.0.25 BTW

TIA
Rob


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

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



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



calling request.getInputStream() within Action

2004-07-15 Thread Robert Shields
Hi Struts Users

I'm trying to get the InputStream to read the binary contents of the
request within an Action's execute method. E.g.



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

InputStream inputStream = request.getInputStream();

// bytesAvailable is always 0
int bytesAvailable = inputStream.available();

int bytesRead;
byte[] buf = new byte[1024];
while((bytesRead = inputStream.read(buf)) != -1)
{
// do stuff
}
}

So bytesAvailable is always 0, and inputStream.read(buf) immediately
returns -1.

I have heard that calling request.getParamter() before trying to access
the input stream can affect accessing the input stream. I believe struts
calls request.getParamter (it must do to populate the form bean).

My question is, how can I get access to the entire binary contents of
the HTTP body?

I'm using Tomcat 5.0.25 BTW

TIA
Rob


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

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



RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Amjad Shahrour
FYI, 
NO JDeveloper10g Does NOT require oracle 10 database.
Actually it can work with all JDBC compliant databases (including MS Access).
Even more, it doesnât require oracle application server , so you can use with 
tomcat, weblogic, Jboss.. and others.

I suggest before you make the decision to download and evaluate more than one IDE and 
see which suites your needs.


Regards,

Amjad shahrour

-Original Message-
From: Oswald Campesato [mailto:[EMAIL PROTECTED] 
Sent: 28 ØÙØØÙ ØÙØÙÙÙ, 1425 11:38 Ø
To: Struts Users Mailing List
Subject: RE: [OT] Editor for Struts/J2ee apps

What the heck, I'll add a few comments as well:

1) Oracle's JDeveloper10G (AFAIK it requires a 10G 
database) has support for Struts as well as JSF.
Since the latter is kinda-sorta the recommended
future direction by Craig McLanahan, JDeveloper
is probably a very good choice

2) Eclipse supports Struts as a plug-in, but the
last I saw the plug-in used an Ant build file to
compile the code, which is what I always do at
the command line, so it gave me no added-value:)

3) Java Studio Creator (based on NetBeans, I think)
supports JSF, and IIRC it also supports Struts.
In fact, creating JSF-based pages in JSC is as 
smooth as creating ASP.NET pages in VWD2005:)

4) Struts Console is a very popular download, 
but from what I've seen, it essentially gives
you a hierarchical display (ala XMLSpy) of the
struts-config.xml file (so it ain't an IDE).

I haven't used Struts heavily in IDEs because I
create files manually and it's actually fairly
easy to compile from the command line (make sure
you have struts.jar and the other commons-type
JAR files in CLASSPATH).

I would say that you need to consider the rest
of the features of the IDE, along with any of
the Struts-related stuff, when deciding which
IDE to use.

You can also search the struts group archives
(a _very_ active list) for the answer to this
question...

Regards,

Oswald

--- Erez Efrati <[EMAIL PROTECTED]> wrote:
> I was using JBuilder, paid too much money and moved
> to MyEclipse (based
> on Eclipse) for 30$/year. It's working good, does
> the job and extremely
> light on the pocket.
> 
> Erez
> 
> -Original Message-
> From: Amjad Shahrour [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 15, 2004 9:44 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] Editor for Struts/J2ee apps
> 
> I agree JDeveloper 10g is GREAT.
> 
> 
> Amjad 
> 
> -Original Message-
> From: Sebastian Ho
> [mailto:[EMAIL PROTECTED] 
> Sent: 28 Ã ÃÃ, 1425 10:38 Ã
> To: Struts Users Mailing List
> Subject: Re: [OT] Editor for Struts/J2ee apps
> 
> Try Jdeveloper. Great support for Struts.
> 
> sebastian
> 
> 
> On Thu, 2004-07-15 at 13:10, Navjot Singh wrote:
> > hi,
> > 
> > I am starting a j2ee
> app(servlets,jsp.taglibs,ejb,jms,jaxp) with
> struts 
> > as web framework and i need to decide on the IDE
> that i should use.
> > 
> > May i have your inputs on pros/cons on IDEs that
> you are using. Any 
> > specific inputs on IDEA/MyEclipse are most
> welcome.
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
style"font-size:13.5px">
> ___Labbaik -
> The Integrated
> Solution Provider for the Hospitality
> Industry
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
___Labbaik - The Integrated Solution Provider for the Hospitality 
Industry


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



RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Oswald Campesato
What the heck, I'll add a few comments as well:

1) Oracle's JDeveloper10G (AFAIK it requires a 10G 
database) has support for Struts as well as JSF.
Since the latter is kinda-sorta the recommended
future direction by Craig McLanahan, JDeveloper
is probably a very good choice

2) Eclipse supports Struts as a plug-in, but the
last I saw the plug-in used an Ant build file to
compile the code, which is what I always do at
the command line, so it gave me no added-value:)

3) Java Studio Creator (based on NetBeans, I think)
supports JSF, and IIRC it also supports Struts.
In fact, creating JSF-based pages in JSC is as 
smooth as creating ASP.NET pages in VWD2005:)

4) Struts Console is a very popular download, 
but from what I've seen, it essentially gives
you a hierarchical display (ala XMLSpy) of the
struts-config.xml file (so it ain't an IDE).

I haven't used Struts heavily in IDEs because I
create files manually and it's actually fairly
easy to compile from the command line (make sure
you have struts.jar and the other commons-type
JAR files in CLASSPATH).

I would say that you need to consider the rest
of the features of the IDE, along with any of
the Struts-related stuff, when deciding which
IDE to use.

You can also search the struts group archives
(a _very_ active list) for the answer to this
question...

Regards,

Oswald

--- Erez Efrati <[EMAIL PROTECTED]> wrote:
> I was using JBuilder, paid too much money and moved
> to MyEclipse (based
> on Eclipse) for 30$/year. It's working good, does
> the job and extremely
> light on the pocket.
> 
> Erez
> 
> -Original Message-
> From: Amjad Shahrour [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 15, 2004 9:44 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] Editor for Struts/J2ee apps
> 
> I agree JDeveloper 10g is GREAT.
> 
> 
> Amjad 
> 
> -Original Message-
> From: Sebastian Ho
> [mailto:[EMAIL PROTECTED] 
> Sent: 28 ÌãÇÏì ÇáÇæáì, 1425 10:38 Õ
> To: Struts Users Mailing List
> Subject: Re: [OT] Editor for Struts/J2ee apps
> 
> Try Jdeveloper. Great support for Struts.
> 
> sebastian
> 
> 
> On Thu, 2004-07-15 at 13:10, Navjot Singh wrote:
> > hi,
> > 
> > I am starting a j2ee
> app(servlets,jsp.taglibs,ejb,jms,jaxp) with
> struts 
> > as web framework and i need to decide on the IDE
> that i should use.
> > 
> > May i have your inputs on pros/cons on IDEs that
> you are using. Any 
> > specific inputs on IDEA/MyEclipse are most
> welcome.
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
style"font-size:13.5px">
> ___Labbaik -
> The Integrated
> Solution Provider for the Hospitality
> Industry
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



RE: Access to message properties from within application

2004-07-15 Thread Jan Behrens


-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 14, 2004 6:46 PM
To: Struts Users Mailing List
Subject: RE: Access to message properties from within application




> -Original Message-
> From: Jan Behrens [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 14, 2004 9:44 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Access to message properties from within application
> 
> 
> Thanks Jim,
> 
> RTFM I did (yoda would say ;) What I want to do though, is access the 
> localized messages from within my application code - not from within 
> my JSP's or Servlets but out of my logic. I could not find
> anything on this in
> the manual yet. Am I beeing completely ignorant not seeing 
> the obvious, or
> is this not that easy?

Jim Barrows wrote:
Ah in that case. you are reading the wrong FM, you probably want the
J2SE documentation, and are looking for MessageFormat.  I assume that you
have found and don't want to use org.apache.struts.util.MessageResources for
this.

I found org.apache.struts.util.MessageResources now ;) and am trying to get
it to do what I want. Thanks for the hint.

Cheers, Jan


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



RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Erez Efrati
I was using JBuilder, paid too much money and moved to MyEclipse (based
on Eclipse) for 30$/year. It's working good, does the job and extremely
light on the pocket.

Erez

-Original Message-
From: Amjad Shahrour [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 15, 2004 9:44 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] Editor for Struts/J2ee apps

I agree JDeveloper 10g is GREAT.


Amjad 

-Original Message-
From: Sebastian Ho [mailto:[EMAIL PROTECTED] 
Sent: 28 جمادى الاولى, 1425 10:38 ص
To: Struts Users Mailing List
Subject: Re: [OT] Editor for Struts/J2ee apps

Try Jdeveloper. Great support for Struts.

sebastian


On Thu, 2004-07-15 at 13:10, Navjot Singh wrote:
> hi,
> 
> I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with
struts 
> as web framework and i need to decide on the IDE that i should use.
> 
> May i have your inputs on pros/cons on IDEs that you are using. Any 
> specific inputs on IDEA/MyEclipse are most welcome.


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

___Labbaik - The Integrated
Solution Provider for the Hospitality Industry


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



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



RE: [OT] Editor for Struts/J2ee apps

2004-07-15 Thread Amjad Shahrour
I agree JDeveloper 10g is GREAT.


Amjad 

-Original Message-
From: Sebastian Ho [mailto:[EMAIL PROTECTED] 
Sent: 28 جمادى الاولى, 1425 10:38 ص
To: Struts Users Mailing List
Subject: Re: [OT] Editor for Struts/J2ee apps

Try Jdeveloper. Great support for Struts.

sebastian


On Thu, 2004-07-15 at 13:10, Navjot Singh wrote:
> hi,
> 
> I am starting a j2ee app(servlets,jsp.taglibs,ejb,jms,jaxp) with
struts 
> as web framework and i need to decide on the IDE that i should use.
> 
> May i have your inputs on pros/cons on IDEs that you are using. Any 
> specific inputs on IDEA/MyEclipse are most welcome.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
___Labbaik - The Integrated Solution Provider for the Hospitality 
Industry


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



  1   2   >