RE: Date validator does not ignore nulls

2005-05-06 Thread tarek.nabil
That's strange, because the way I understand it is just the opposite.
What I understand is if a validation depends on another validation, then
this validation should not be triggered unless the first one succeeds.
Actually, this makes sense, because it's useless to try to validate an
empty field to make sure it's a date.

But anyway, if this is the case, what do you suggest?

In my validations.xml, I did not specify that this field depends on the
required validation. I don't think changing the validator declaration
would help, since the problem is with the code itself.

Thanks

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 05, 2005 6:12 PM
To: Struts Users Mailing List
Subject: Re: Date validator does not ignore nulls

tarek.nabil wrote:

>  classname="org.apache.struts.util.StrutsValidator"
>   method="validateDate"
> methodParams="java.lang.Object,
>   org.apache.commons.validator.ValidatorAction,
>   org.apache.commons.validator.Field,
>   org.apache.struts.action.ActionErrors,
>   javax.servlet.http.HttpServletRequest"
>  depends="required"
>  msg="errors.date"
>   jsFunctionName="DateValidations">
>
>Although the validator declares that it depends on required, so (as far

>as I understand) that means it should not be triggered if the value is 
>null or blank. Nevertheless, it is, and it shows the error that the 
>date is invalid. I checked the source for the class that performs the 
>validation, and obviously it adds the error to the errors collection if

>the value is null or blank. But I think it's not supposed to even get 
>called, because in the declaration of the validator, it says it depends

>on required.
>  
>
"Required" means the value must not be blank or null, right? So if a
validation depends on "required" that means that the value can't be
blank or null. So it _should_ be triggered on a blank or null.

Dave



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



Re: Losing request attributes after validate()

2005-05-06 Thread Michael Jouravlev
Umm... This one  pulls data from
userName property of a form bean. So if the form bean has session
scope, the value will be retained..

This one  pulls value from portfolioName, you need to
check where this object is stored, in what scope. You are right, if
this object has request or page scope, then it will be wiped out after
redirect.

Michael.

On 5/6/05, David Johnson <[EMAIL PROTECTED]> wrote:
> Hmm 
>   
> I'm now officially confused (and on a Friday no less). I've set the
> scope="session" but when I get back from the validate() my values are STILL
> gone 
>   
> Also, a separate question, how is what we're talking about different from my
> login screen where if the user puts a userID in but no password, they get a
> validate() error , but the userID is populated with whatever they'd
> previously typed. 
>   
> the one difference I see is that I'm namually populating fields in the non
> working form. 
>   
> So, this does NOT work unpopulated after validate():
>  
>   
> this DOES work (populated after validate()
>  
> 
> am I stupidly OVERRIDING struts' behavior?  I know there's a simple solution
> to this 
> 
>   
> On 5/6/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: 
> > This is how Spring's RedirectView (or ViewRedirect? whatever) works.
> > They have notion of "model" which is usually a Map. You stuff your 
> > data in it, and it is appended automatically as a payload to
> > redirected request. Struts does not do this.
> > 
> > If you had Struts appending all form data to the redirected request,
> > your would be able to use the page only within a strict sequence of 
> > requests. If you jumped out from the page and browse somewhere else,
> > you lose request data. If then you navigate to your page through
> > browser navigation bar, you would see that you form is empty (at best.
> > At worst, you get validation error). 
> > 
> > Spring transfers viewstate in the request, just like ASP.NET. I do not
> > think this is a good idea.
> > 
> > I think that it is much more flexible to pass ID of an object that you
> > want to display, in the redirected request. Then your output action 
> > would load this object from the database (better from the RAM cache)
> > and display it. Thus, the action would not care how it was called:
> > directly, indirectly or through redirect. It just receives object ID
> > in the request, loads object, fills out the form, and shows JSP. 
> > Pretty straightforward.
> > 
> > Or, instead of fiddling with redirection request, just set
> > scope="session" in your  element in struts-config.xml. Then
> > form bean will retain all values for you. 
> > 
> > On 5/6/05, David Johnson <[EMAIL PROTECTED]> wrote:
> > > here's a question. The way I thought it would work is that under the
> covers
> > > and before redirecting BACK to the page (assuming validate() fails) I 
> > > thought it would take all the form attributes and put them back on the
> > > request to provide all the same data the original page was provided
> with
> > >
> > > but I'm seeing that's not the case. :(
> > 
> 
> 
> 
> -- 
> -Dave
> [EMAIL PROTECTED]

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



RE: Any way to retrieve the index of html:select?

2005-05-06 Thread Slattery, Tim - BLS
> I was wondering if there is any way to retrieve the selection 
> index of the  during the action.  The value that I'm 
> storing is the coded value for the description that it 
> represents (e.g. 1 for male, 2 for female).  Instead of taking the 
> value and hitting the database, I would like to take the selection 
> index and use that to pull the information out of a List that is stored 
> as a session variable.

No, the only thing submitted for a  group is the value attribute of
the selection.

But you can make a compound value, something like "1;male" and "2;female".
Then, when the form is submitted you simply break that string on the
semicolon and use whichever part is convenient.


--
Tim Slattery
[EMAIL PROTECTED]


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



Any way to retrieve the index of html:select?

2005-05-06 Thread Randy Kennedy
I was wondering if there is any way to retrieve the selection index of 
the  during the action.  The value that I'm storing is the 
coded value for the description that it represents (e.g. 1 for male, 2 
for female).  Instead of taking the value and hitting the database, I 
would like to take the selection index and use that to pull the 
information out of a List that is stored as a session variable.

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


RE: Losing request attributes after validate()

2005-05-06 Thread Barnett, Brian W.
To the action mapping

-Original Message-
From: David Johnson [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 06, 2005 1:52 PM
To: Michael Jouravlev; Struts Users Mailing List
Subject: Re: Losing request attributes after validate()


a I see. Soam I adding scrope="session" to the Form Bean or the Action 
Mapping? 

On 5/6/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: 
> 
> > I do have redirect="true" set on the actionMapping that brings me to
> this
> > page, and tthe browser should be caching field values.
> >
> > the weird thing is this works in other places
> 
> If you want to keep redirect="true" (I personally prefer redirects for 
> better user experience), then you may want to set scope="session" for 
> your form.
> 
> This should not work in other places. Maybe your other forms have 
> session scope or somehow browser thinks that it can cache those pages?
> 
> > > You need to include hidden files for any static text properties.
> > >
> > > Typically I have  > > />
> > >
> > > NOTE: this should not be done for input fields
> > >
> > >  
> > >
> > I actually am for one of the properties.
> > In the page I have :
> >  and in 
> > the Action Class (right before the reditrct to this page) 
> > request.setAttribute("queryName",queryName);
> > and it shows fine in view--> source.
> > thn if I submit the form (wiuth an error) the hidden field is 
> > **not** populated
> 
> It will not be populated. You redirect to the page, that is, you 
> reload the page from the server using empty GET request with no query 
> parameters. Struts cannot populate your form bean since there is no 
> input data. So it just shows you JSP using current form field values. 
> If your form has request scope, it is recreated for each request, so 
> there are no values in it.
> 
> Do not use hidden fields. You started well using redirection to the 
> View ;-) Just change scope of your form to "session", and it will 
> retain values for you. But now you would have to clean unneeded values 
> in the reset() method. It is a bit of a hassle, but it works better 
> for an end user, and you do not need to pass viewstate in hidden HTML 
> fields.
> 
> Maybe you will find this useful: 
> http://wiki.apache.org/struts/StrutsCatalogRedirectToInputPage
> http://wiki.apache.org/struts/StrutsMultipleActionForms
> 
> Michael.
> 



-- 
-Dave
[EMAIL PROTECTED]

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



Re: Losing request attributes after validate()

2005-05-06 Thread David Johnson
also.. you're RIGHT!!! It's not working in other places either!!!
 here's a question. The way I thought it would work is that under the covers 
and before redirecting BACK to the page (assuming validate() fails) I 
thought it would take all the form attributes and put them back on the 
request to provide all the same data the original page was provided with
 but I'm seeing that's not the case. :(

 On 5/6/05, David Johnson <[EMAIL PROTECTED]> wrote: 
> 
> a I see. Soam I adding scrope="session" to the Form Bean or the Action 
> Mapping? 
> 
> On 5/6/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:  
> > 
> > > I do have redirect="true" set on the actionMapping that brings me to 
> > this
> > > page, and tthe browser should be caching field values. 
> > >
> > > the weird thing is this works in other places
> > 
> > If you want to keep redirect="true" (I personally prefer redirects for
> > better user experience), then you may want to set scope="session" for 
> > your form.
> > 
> > This should not work in other places. Maybe your other forms have
> > session scope or somehow browser thinks that it can cache those pages?
> > 
> > > > You need to include hidden files for any static text properties. 
> > > >
> > > > Typically I have  > > > />
> > > >
> > > > NOTE: this should not be done for input fields 
> > > >
> > > >  
> > > >
> > > I actually am for one of the properties. 
> > > In the page I have :
> > > 
> > > and in the Action Class (right before the reditrct to this page)
> > > request.setAttribute ("queryName",queryName);
> > > and it shows fine in view--> source.
> > > thn if I submit the form (wiuth an error) the hidden field is **not**
> > > populated
> > 
> > It will not be populated. You redirect to the page, that is, you 
> > reload the page from the server using empty GET request with no query
> > parameters. Struts cannot populate your form bean since there is no
> > input data. So it just shows you JSP using current form field values.
> > If your form has request scope, it is recreated for each request, so
> > there are no values in it.
> > 
> > Do not use hidden fields. You started well using redirection to the
> > View ;-) Just change scope of your form to "session", and it will 
> > retain values for you. But now you would have to clean unneeded values
> > in the reset() method. It is a bit of a hassle, but it works better
> > for an end user, and you do not need to pass viewstate in hidden HTML
> > fields.
> > 
> > Maybe you will find this useful:
> > http://wiki.apache.org/struts/StrutsCatalogRedirectToInputPage
> > http://wiki.apache.org/struts/StrutsMultipleActionForms
> > 
> > Michael.
> > 
> 
> 
> 
> -- 
> -Dave
> [EMAIL PROTECTED] 




-- 
-Dave
[EMAIL PROTECTED]


Slightly OT: web security-constraints

2005-05-06 Thread Vinicius Caldeira Carvalho
I was wondering... I have this configuration on my web.xml:

 
 Actions
 Actions
 *.do
 POST
 GET
 
 
   usuarios permitidos
   Administrador
 
 
 Encryption is not required for the application in 
general. 
 NONE
 


Which prevents the user to access resources without being authenticated. 
Is it possoble to create a pattern to exclude some of them? Like 
login/*.do would not require the user being authenticated to be accessed?

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


Re: Losing request attributes after validate()

2005-05-06 Thread David Johnson
a I see. Soam I adding scrope="session" to the Form Bean or the Action 
Mapping? 

On 5/6/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: 
> 
> > I do have redirect="true" set on the actionMapping that brings me to 
> this
> > page, and tthe browser should be caching field values.
> >
> > the weird thing is this works in other places
> 
> If you want to keep redirect="true" (I personally prefer redirects for
> better user experience), then you may want to set scope="session" for
> your form.
> 
> This should not work in other places. Maybe your other forms have
> session scope or somehow browser thinks that it can cache those pages?
> 
> > > You need to include hidden files for any static text properties.
> > >
> > > Typically I have  > > />
> > >
> > > NOTE: this should not be done for input fields
> > >
> > >  
> > >
> > I actually am for one of the properties.
> > In the page I have :
> > 
> > and in the Action Class (right before the reditrct to this page)
> > request.setAttribute("queryName",queryName);
> > and it shows fine in view--> source.
> > thn if I submit the form (wiuth an error) the hidden field is **not**
> > populated
> 
> It will not be populated. You redirect to the page, that is, you
> reload the page from the server using empty GET request with no query
> parameters. Struts cannot populate your form bean since there is no
> input data. So it just shows you JSP using current form field values.
> If your form has request scope, it is recreated for each request, so
> there are no values in it.
> 
> Do not use hidden fields. You started well using redirection to the
> View ;-) Just change scope of your form to "session", and it will
> retain values for you. But now you would have to clean unneeded values
> in the reset() method. It is a bit of a hassle, but it works better
> for an end user, and you do not need to pass viewstate in hidden HTML
> fields.
> 
> Maybe you will find this useful:
> http://wiki.apache.org/struts/StrutsCatalogRedirectToInputPage
> http://wiki.apache.org/struts/StrutsMultipleActionForms
> 
> Michael.
> 



-- 
-Dave
[EMAIL PROTECTED]


Re: Losing request attributes after validate()

2005-05-06 Thread Michael Jouravlev
> I do have redirect="true" set on the actionMapping that brings me to this
> page, and tthe browser should be caching field values. 
>   
> the weird thing is this works in other places

If you want to keep redirect="true" (I personally prefer redirects for
better user experience), then you may want to set scope="session" for
your form.

This should not work in other places. Maybe your other forms have
session scope or somehow browser thinks that it can cache those pages?

> > You need to include hidden files for any static text properties.
> >
> > Typically I have  > />
> >
> > NOTE: this should not be done for input fields
> >
> >  
> >
> I actually am for one of the properties.
>  In the page I have :
> 
>  and in the Action Class (right before the reditrct to this page)
> request.setAttribute("queryName",queryName);
>  and it shows fine in view--> source.
>  thn if I submit the form (wiuth an error) the hidden field is **not**
> populated

It will not be populated. You redirect to the page, that is, you
reload the page from the server using empty GET request with no query
parameters. Struts cannot populate your form bean since there is no
input data. So it just shows you JSP using current form field values.
If your form has request scope, it is recreated for each request, so
there are no values in it.

Do not use hidden fields. You started well using redirection to the
View ;-) Just change scope of your form to "session", and it will
retain values for you. But now you would have to clean unneeded values
in the reset() method. It is a bit of a hassle, but it works better
for an end user, and you do not need to pass viewstate in hidden HTML
fields.

Maybe you will find this useful:
  http://wiki.apache.org/struts/StrutsCatalogRedirectToInputPage
  http://wiki.apache.org/struts/StrutsMultipleActionForms

Michael.

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



Re: struts file upload

2005-05-06 Thread Woodchuck
hihi,

what application server are you using?  and are you forwarding requests
from a web server to your application server (eg. apache/IIS -->
tomcat)?

woodchuck


--- temp temp <[EMAIL PROTECTED]> wrote:
> I am using struts and trying to upload files of any
> type and size.If the server as well as client is on
> the same PC no issues ,but if I try to accomplish this
> across the network then I am only able to upload a
> file if the size is less then 1 MB .Not sure what the
> problem is.
> 
> thanks & regards
> 
> 
> 
>   
> __ 
> Do you Yahoo!? 
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/ 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



__ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250

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



Re: Validations

2005-05-06 Thread Michael Jouravlev
I guess, there are other ways, but these are off the top of my head.

* Define a hidden field in each form with the same name, but different
value. In the validate() method check value of the Java field, which
corresponds to hidden HTML field. Validate accordingly.

* for multiform page you can use DispatchAction or
LookupDispatchAction, set "validate=false" in your action mapping, and
validate manually from button handler. You can have custom validation
methods for each button.

Michael.

On 5/6/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
>  Hi dear Struts list friends.
> 
>  I have several JSPs and all them map only one actionform. All work
> fine, in my actionform i have all attributes they appear in my JSPs.
> 
>  The problem is when i want to validate some input. For example in a
> JSP i have two forms and when i want to work with only the first one,
> i want to validate its attributes. I use the validate method in my
> actionform, but there is an error because it validates all atributes
> in my jsp and of course because I want to work with only one form, all
> attributes of the another form has to be blank and this is the error.
> 
>  Is it correct to have only one actionform for many JSPs??
> 
>  How can i validate my attributes with this approach?.
> 
>  thanks for your cooperation
> 
> --
> 
>  Rafael Taboada

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



Re: Losing request attributes after validate()

2005-05-06 Thread David Johnson
I actually am for one of the properties.
 In the page I have :

 and in the Action Class (right before the reditrct to this page)
request.setAttribute("queryName",queryName);
 and it shows fine in view--> source.
 thn if I submit the form (wiuth an error) the hidden field is **not** 
populated
  On 5/6/05, Liu, Benson <[EMAIL PROTECTED]> wrote: 
> 
> You need to include hidden files for any static text properties.
> 
> Typically I have  />
> 
> NOTE: this should not be done for input fields
> 
>  
> 
> -Ben
> 
> -Original Message-
> From: David Johnson [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 06, 2005 12:02 PM
> To: Struts Users Mailing List
> Subject: Losing request attributes after validate()
> 
> Hi all
> I apprear to be losing my request parameters after a form submit that 
> fails
> in the Validate() of my Form. Has anyone seen this before? It works fine 
> in
> all the other areas of the application, it's just this one page.
> the result is when I come back t the page all the data is blank as if I
> hasnt set the reequest parameters.
> thoughts?
> 
> --
> -Dave
> [EMAIL PROTECTED]
> 



-- 
-Dave
[EMAIL PROTECTED]


RE: multiple file uploads with one property

2005-05-06 Thread Durham David R Jr Ctr 805 CSPTS/SCE
> http://issues.apache.org/bugzilla/show_bug.cgi?id=25963

I applied the suggested patch, and tested it.  Looks like it works,
though I'm not exactly sure what an automated test script would like for
this use case.  BTW, does anyone else find the ASCII art in this test
hilarious?

 http://tinyurl.com/c4dro  (MultipartBoundaryInputStreamTest)


Thanks,

Dave

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



Re: Losing request attributes after validate()

2005-05-06 Thread Michael Jouravlev
Do you redirect to your form, and your form bean has request scope? Or
do you just click Back browser button, and your pages are marked as
non-cachable or browser is instructed not to cache field values?

On 5/6/05, David Johnson <[EMAIL PROTECTED]> wrote:
> Hi all
>  I apprear to be losing my request parameters after a form submit that fails
> in the Validate() of my Form. Has anyone seen this before? It works fine in
> all the other areas of the application, it's just this one page.
>  the result is when I come back t the page all the data is blank as if I
> hasnt set the reequest parameters.
>  thoughts?
> 
> --
> -Dave
> [EMAIL PROTECTED]

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



Validations

2005-05-06 Thread Rafael Taboada
 Hi dear Struts list friends.

 I have several JSPs and all them map only one actionform. All work
fine, in my actionform i have all attributes they appear in my JSPs.

 The problem is when i want to validate some input. For example in a
JSP i have two forms and when i want to work with only the first one,
i want to validate its attributes. I use the validate method in my
actionform, but there is an error because it validates all atributes
in my jsp and of course because I want to work with only one form, all
attributes of the another form has to be blank and this is the error.

 Is it correct to have only one actionform for many JSPs??

 How can i validate my attributes with this approach?.

 thanks for your cooperation

-- 

 Rafael Taboada

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



Losing request attributes after validate()

2005-05-06 Thread David Johnson
Hi all
 I apprear to be losing my request parameters after a form submit that fails 
in the Validate() of my Form. Has anyone seen this before? It works fine in 
all the other areas of the application, it's just this one page.
 the result is when I come back t the page all the data is blank as if I 
hasnt set the reequest parameters.
 thoughts?

-- 
-Dave
[EMAIL PROTECTED]


Local struts developer in MD/DC/VA area?

2005-05-06 Thread Vincent
Hello,
Don't want to spam the list with job postings but...
if you are in the DC Metropolitan area and are looking for a
job working with struts based webapp, please
email me or IM me at xaymaca2020 (AIM,MSN). Back to
regularly scheduled broadcast.
Thanks,
Vincent
--
Plato is my friend, Aristotle is my friend,
but my greatest friend is truth.
- Isaac Newton
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [ANNOUNCE] Struts 1.2.7 Test Build Available

2005-05-06 Thread Niall Pemberton
In the  Struts 1.2.x series we adopted the Tomcat style of release. We ship
a version (say 1.2.7) and then vote on its quality. If there are any issues
we don't fix that version we just roll the next one (i.e. 1.2.8).

Version 1.2.6 was voted only "beta" quality since there were a issues with
it - mainly that we had added new attributes to some of the "core" tags and
not synchronised the other flavours (can't remember if it was the "nested"
or "el" tags). So 1.2.6 will remain forever beta.

At this point in time 1.2.7 is a "development release" - probably in a
couple of weeks we will have a vote on its "quality" - hopefully it will get
a "ga" tag - but if not then we will just move on to 1.2.8.

The release plans are kept on the wiki here:

http://wiki.apache.org/struts/StrutsReleasePlans

Niall

- Original Message - 
From: "Michael Jouravlev" <[EMAIL PROTECTED]>
Sent: Friday, May 06, 2005 5:54 PM


While 1.2.7 is going to be released, should 1.2.6 status be changed to
"stable", or there will be two beta versions? Or 1.2.7 will become
"stable" and 1.2.6 will be removed from download?



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



Re: [ANNOUNCE] Struts 1.2.7 Test Build Available

2005-05-06 Thread Michael Jouravlev
While 1.2.7 is going to be released, should 1.2.6 status be changed to
"stable", or there will be two beta versions? Or 1.2.7 will become
"stable" and 1.2.6 will be removed from download?

Michael.

> At 1:18 PM +0100 5/6/05, Niall Pemberton wrote:
> >The Struts 1.2.7 Test Build is now available here:
> >
> >http://cvs.apache.org/dist/struts/v1.2.7/

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



Re: struts file upload

2005-05-06 Thread Dakota Jack
If you look into the basics of the URL framework in Java, you can see
it is fairly easy to add support for new protocols and content types. 
The engineers at Sun, planning for a self-extensible browser, divided
the problem into protocol handling and content handling.  Handling the
protocol means managing or handling the interaction between the client
and the server: generating requests in correct format, interpreting
headers, acknowledging data receipt, etc.  Handling content means
doing something that fits the data received, e.g. displaying an image.
 The software that displays the image does not care how the data got
there by gopher, HTTP, FTP, or your own protocol.  So, protocol and
content are decoupled.  I LOVE DECOUPLING!  On the other hand, the
protocol handler could care less about the data, image, HTML, MPEG,
etc., but merely extracts the data from the headers to pass to the
content handler.

Protocol handling is further abstracted in parts in the java.net
package: URL, URLConnection, URLStreamHandlerFactory.  URL is the only
concrete class and in implementing your own protocol you have to write
concrete subclasses for the URLStreamHandler and URLConnection
classes.  The result is, say, something sent as, say,
dakota://www.crackwillow.com instead of http://www.cracckwillow.com. 
To use the former two classes, you also have to write a class that
implements the URLStreamHandlerFactory interface.

URLs are pointers which specify the protocol, e.g. mailto:, http and
ftp.  The URL constructor strips the input and gets the protocol
string (e.g. "http") and uses it to call the right
URLStreamHandlerFactory.  When the URL gets the stream handler, it
uses the stream handler to finish parsing the URL string and to create
a subclass of URLConnection that knows how to deal with servers for
the protocol.  (You can define a URL format that is appropriate to
your task.)

The URLConnection class is responsible for ineracting with the server.
 This class knows how to read headers and generate requests.  The
output is raw data for a content handler.

You can build a browser, too, which will accept new protocols at
runtime.  Cool, eh?

There are numerous books out there outlining how to do this.  With
Java, it is very simple.  Not hard at all and something someone with
specialized interests, like you seem to have, should use.

Cheers. 

On 5/6/05, temp temp <[EMAIL PROTECTED]> wrote:
> I  did not understand writing my own protocol .
> Can you elobrate  or explain me writing my own
> protocol for uploading files .
> 
> 
> --- Dakota Jack <[EMAIL PROTECTED]> wrote:
> 
> > If the stream to the file upload fails, then the
> > file upload must
> > abort.  I would suggest, again, that you seriously
> > consider writing
> > your own protocol instead of using HTTP.  Or, you
> > might, as previously
> > suggested by someone else, use FTP.  You realize you
> > can use FTP with
> > your server, right?
> >
> >
> >
> > On 5/6/05, temp temp <[EMAIL PROTECTED]> wrote:
> > > Now I am using commons file upload .At times I get
> > > this error message.
> > >
> > > Processing of multipart/form-data request failed.
> > > Stream ended unexpectedly]:
> > > org.apache.commons.fileupload.FileUploadException:
> > > Processing of multipart/form-data request failed.
> > > Stream ended unexpectedly
> > >
> > > what causes this  and how to resolve this.
> > >
> > >
> > > --- Dakota Jack <[EMAIL PROTECTED]> wrote:
> > >
> > > > An initial view show that you do not set an
> > upper
> > > > limit on the file
> > > > size.  Why don't you cheeck and see if there is
> > one
> > > > in commons?  I
> > > > suspect there might be.  You can override that,
> > of
> > > > course.  If you
> > > > don't want to check, why don't you just override
> > it?
> > > >
> > > > Also, have you considered writing your own
> > protocol
> > > > for this?  I have
> > > > to agree that HTTP is not the best for this.
> > Maybe
> > > > you could use FTP
> > > > or write one that works best for you.
> > > >
> > > >
> > > >
> > > > On 5/5/05, temp temp <[EMAIL PROTECTED]>
> > wrote:
> > > > > Atached is my upload jsp upload ActionForm and
> > > > > upload Action
> > > > >
> > > > > thanks & regards
> > > > >
> > > > >
> > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote:
> > > > > > Then let see the code you are using and go
> > from
> > > > > > there.
> > > > > >
> > > > > > On 5/4/05, temp temp <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > > >
> > > > > > > I want to continue on this path and donot
> > know
> > > > how
> > > > > > to
> > > > > > > fix it  please help me .
> > > > > > >
> > > > > > > thanks & regards
> > > > > > >
> > > > > > > If you really want to continue on this
> > path
> > > > and
> > > > > > > > don't know how to fix
> > > > > > > > it, let me know and I will be glad to
> > help.
> > > > > > >
> > > > > > > --- Dakota Jack <[EMAIL PROTECTED]>
> > wrote:
> > > > > > > > You might want to build your own file
> > upload
> > > > > > > > application off of
> 

Re: Validator not plugging in keyed values

2005-05-06 Thread Niall Pemberton
The "bundle" attribute in Commons Validator (i.e. in your validation.xml) is
not supported in the current release of Struts (Version 1.2.4) which is why
it isn't finding your  values. This has now been implemented in the
latest Struts version (version 1.2.7) which I announced today:

http://www.mail-archive.com/user%40struts.apache.org/msg26228.html

In that version there are a couple of pages in the struts-examples webapp
showing use of alternative message resource bundles. Also I posted some
stuff recently here about this:

http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section7_2

Having said all that, looks like you're doing everything right - except you
need Version 1.2.7 (and Validator 1.1.4)

Niall

- Original Message - 
From: "Allistair Crossley" <[EMAIL PROTECTED]>
Sent: Friday, May 06, 2005 4:51 PM


Some more information; my message resources were declared as follows



Note the use of a key on the bundle. In my JSP output of the errors I used









Interestingly, then, when I remove the key from message-resources AND remove
the bundle instruction from the html:messages tag, the whole thing works.

I have to say, the whole struts validator stuff is a little unclear from the
documentation. The distinction between ActionMessages and ActionErrors and
when to use html:errors and html:messages is not clear.

Furthermore, the use of bundle on html:messages DOES work when you wish to
use bean:message or indeed, just iterating over ActionMessages that were not
linked to validator.

Some clarification on the matter would be appreciated,

Allistair

> -Original Message-
> From: Allistair Crossley
> Sent: 06 May 2005 16:12
> To: user@struts.apache.org
> Subject: Validator not plugging in keyed values
>
>
> Hello Again,
>
> Having a spot of bother with validating an ActionForm. It's
> all setup and I believe accurately.
>
> I have 2 text fields. Each are specified as needing the
> required rule. I do not ask my action mapping to validate.
>
> 
>  "http://intranet/iq/j2ee/validator_1_1_3.dtd";>
> 
> 
> 
> 
>  key="test.field.key" />
> 
> 
> 
> 
> 
> 
> 
>
> Instead I run the validation in an Action class
>
> ActionMessages errors = form.validate();
>
> I log the output of this, and I accurately get 1 error or 2
> errors according to whether I left one or two fields blank in
> my form. So that's fine. I save the errors container using
> saveErrors(request, errors) and back in the JSP:
>
> 
>   
> 
>   
> 
>   
> 
>
> This, too, works to some extent. In my ApplicationResources, I have:
>
> errors.required={0} is required.
> test.field.key=Some random value
> test.field2.key=Some random value 2
>
> The problem I am seeing is that when my form validates, all I
> get back are bullet points with
>
> - is required
>
> which is the errors.required key's value. That is,
> test.field.key's value is not being inserted into the {0}
> placeholder of the errors.required value.
> Like I say, everything is working in terms of the system
> spotting I have errors according to the rule, and the
> messages are being found by validator because it finds "is
> required". But the error is that is does not pump in the
> value from the custom key.



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



Re: Infinite loop with action mappings

2005-05-06 Thread Michael Jouravlev
Um, you pulled this from default tomcat\conf\web.xml? Because
application's web.xml is processed before default web.xml, you had to
explicitly process your JSPs before actions?

Why don't you just change your Struts action mapping to something like


  controller
  *.do


so Struts would receive calls to actions only, and JSPs would be
processed by default mapping?

Michael.

On 5/6/05, Allistair Crossley <[EMAIL PROTECTED]> wrote:
> I found that by placing a direct jsp mapping to Tomcat's JSP servlet, I could 
> accomplish what I needed, so long as the URL is longer than the catch-all 
> mapping as per the servlet spec.
> 
> 
> jsp
> org.apache.jasper.servlet.JspServlet
> 
> fork
> false
> 
> 
> xpoweredBy
> false
> 
> 3
> 
> 
> 
> jsp
> /views/*
> 
> 
> 
> controller
> /*
> 
> 
> > -Original Message-
> > From: Allistair Crossley
> > Sent: 06 May 2005 15:11
> > To: user@struts.apache.org
> > Subject: Infinite loop with action mappings
> >
> >
> > Hi,
> >
> > I have a catch-all servlet mapping to push all requests to my
> > Struts controller in web.xml;
> >
> > 
> >   controller
> >   /*
> > 
> >
> > I have 2 action mappings;
> >
> > 
> > 
> >
> > When I request http://www.domain.com/view Struts finds the
> > action mapping and delegates a forward to /views/layout.jsp.
> > However, /views/layout.jsp is being picked up by the /*
> > servlet mapping in web.xml and being routed back to Struts.
> > This time because there is no action mapping for
> > /views/layout.jsp it goes to the wildcard action mapping and
> > that action's tile view is returned.
> >
> > This causes an infinite loop in Struts.
> >
> > Is this more to do with the servlet mapping, or is there
> > something I can instruct Struts to do with regard to getting
> > that JSP out to the response without causing another call to
> > the controller?
> >
> > I need every request to go into the struts framework, but I
> > also need my JSPs to work inside struts which is not
> > happening right now due to this infinite loop.
> >
> > Regards, Allistair
> >
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.action.RequestProcessor:174) - Processing
> > a 'GET' for path '/view'
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.action.RequestProcessor:992) -  Delegating
> > via forward to '/views/layout.jsp'
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.catalina.core.ApplicationDispatcher:143) -
> > servletPath=, pathInfo=/views/layout.jsp, queryString=null, name=null
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.catalina.core.ApplicationDispatcher:370) -  Path
> > Based Forward
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.util.ModuleUtils:169) - Get module name for path
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.util.ModuleUtils:193) - Module name found: default
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.action.RequestProcessor:174) - Processing
> > a 'GET' for path '/views/layout.jsp'
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.config.ActionConfigMatcher:102) -
> > Attempting to match '/views/layout.jsp' to a wildcard pattern
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.action.RequestProcessor:257) -  Looking
> > for Action instance for class
> > com.qas.newmedia.internet.core.page.action.PageAction
> > 2005-05-06 14:48:58,424 - DEBUG
> > (org.apache.struts.action.RequestProcessor:271) -   Returning
> > existing Action instance
> > ---
> > QAS Ltd.
> > Developers of QuickAddress Software
> > http://www.qas.com";>www.qas.com
> > Registered in England: No 2582055
> > Registered in Australia: No 082 851 474
> > ---

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



RE: Validator not plugging in keyed values

2005-05-06 Thread Allistair Crossley
Some more information; my message resources were declared as follows



Note the use of a key on the bundle. In my JSP output of the errors I used



 

 
 


Interestingly, then, when I remove the key from message-resources AND remove 
the bundle instruction from the html:messages tag, the whole thing works.

I have to say, the whole struts validator stuff is a little unclear from the 
documentation. The distinction between ActionMessages and ActionErrors and when 
to use html:errors and html:messages is not clear. 

Furthermore, the use of bundle on html:messages DOES work when you wish to use 
bean:message or indeed, just iterating over ActionMessages that were not linked 
to validator.

Some clarification on the matter would be appreciated,

Allistair

> -Original Message-
> From: Allistair Crossley 
> Sent: 06 May 2005 16:12
> To: user@struts.apache.org
> Subject: Validator not plugging in keyed values
> 
> 
> Hello Again,
> 
> Having a spot of bother with validating an ActionForm. It's 
> all setup and I believe accurately. 
> 
> I have 2 text fields. Each are specified as needing the 
> required rule. I do not ask my action mapping to validate. 
> 
> 
>  "http://intranet/iq/j2ee/validator_1_1_3.dtd";>
> 
> 
> 
> 
>key="test.field.key" />
>   
>   
>   
>   
> 
> 
> 
> 
> Instead I run the validation in an Action class
> 
> ActionMessages errors = form.validate();
> 
> I log the output of this, and I accurately get 1 error or 2 
> errors according to whether I left one or two fields blank in 
> my form. So that's fine. I save the errors container using 
> saveErrors(request, errors) and back in the JSP:
> 
> 
>   
>  
>   
>  
>
> 
> 
> This, too, works to some extent. In my ApplicationResources, I have:
> 
> errors.required={0} is required.
> test.field.key=Some random value
> test.field2.key=Some random value 2
> 
> The problem I am seeing is that when my form validates, all I 
> get back are bullet points with 
> 
> - is required
> 
> which is the errors.required key's value. That is, 
> test.field.key's value is not being inserted into the {0} 
> placeholder of the errors.required value. 
> Like I say, everything is working in terms of the system 
> spotting I have errors according to the rule, and the 
> messages are being found by validator because it finds "is 
> required". But the error is that is does not pump in the 
> value from the custom key.
> 
> Any helpers?
> 
> Cheers, Allistair.
> 
> 
> 
>  
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
> 
> 
> -
> 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]



Fwd: struts file upload

2005-05-06 Thread Dakota Jack
-- Forwarded message --
From: Dakota Jack <[EMAIL PROTECTED]>
Date: May 6, 2005 8:50 AM
Subject: Re: struts file upload
To: temp temp <[EMAIL PROTECTED]>


If the stream to the file upload fails, then the file upload must
abort.  I would suggest, again, that you seriously consider writing
your own protocol instead of using HTTP.  Or, you might, as previously
suggested by someone else, use FTP.  You realize you can use FTP with
your server, right?


On 5/6/05, temp temp <[EMAIL PROTECTED]> wrote:
> Now I am using commons file upload .At times I get
> this error message.
>
> Processing of multipart/form-data request failed.
> Stream ended unexpectedly]:
> org.apache.commons.fileupload.FileUploadException:
> Processing of multipart/form-data request failed.
> Stream ended unexpectedly
>
> what causes this  and how to resolve this.
>
>
> --- Dakota Jack <[EMAIL PROTECTED]> wrote:
>
> > An initial view show that you do not set an upper
> > limit on the file
> > size.  Why don't you cheeck and see if there is one
> > in commons?  I
> > suspect there might be.  You can override that, of
> > course.  If you
> > don't want to check, why don't you just override it?
> >
> > Also, have you considered writing your own protocol
> > for this?  I have
> > to agree that HTTP is not the best for this.  Maybe
> > you could use FTP
> > or write one that works best for you.
> >
> >
> >
> > On 5/5/05, temp temp <[EMAIL PROTECTED]> wrote:
> > > Atached is my upload jsp upload ActionForm and
> > > upload Action
> > >
> > > thanks & regards
> > >
> > >
> > > --- Dakota Jack <[EMAIL PROTECTED]> wrote:
> > > > Then let see the code you are using and go from
> > > > there.
> > > >
> > > > On 5/4/05, temp temp <[EMAIL PROTECTED]>
> > wrote:
> > > > >
> > > > > I want to continue on this path and donot know
> > how
> > > > to
> > > > > fix it  please help me .
> > > > >
> > > > > thanks & regards
> > > > >
> > > > > If you really want to continue on this path
> > and
> > > > > > don't know how to fix
> > > > > > it, let me know and I will be glad to help.
> > > > >
> > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote:
> > > > > > You might want to build your own file upload
> > > > > > application off of
> > > > > > commons or cos.
> > > > > >
> > > > > > The Struts application is not particularly
> > > > > > sophisticated.  However, if
> > > > > > you do, then you have to build your own
> > objects
> > > > to
> > > > > > mine the data,
> > > > > > because Struts has tied the internals of the
> > > > > > RequestProcessor to the
> > > > > > upload application and the last I looked
> > they
> > > > are
> > > > > > going to continue to
> > > > > > do so even with 1.3 although everything else
> > is
> > > > > > abstracted out of the
> > > > > > RequestProcessor in 1.3.  I just rebuilt the
> > > > whole
> > > > > > thing so that I
> > > > > > don't have to worry about the multipart
> > handling
> > > > > > stuff in Struts.
> > > > > >
> > > > > > If you really want to continue on this path
> > and
> > > > > > don't know how to fix
> > > > > > it, let me know and I will be glad to help.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 5/4/05, temp temp <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > > > I am using struts and trying to upload
> > files
> > > > of
> > > > > > any
> > > > > > > type and size.If the server as well as
> > client
> > > > is
> > > > > > on
> > > > > > > the same PC no issues ,but if I try to
> > > > accomplish
> > > > > > this
> > > > > > > across the network then I am only able to
> > > > upload a
> > > > > > > file if the size is less then 1 MB .Not
> > sure
> > > > what
> > > > > > the
> > > > > > > problem is.
> > > > > > >
> > > > > > > thanks & regards
> > > > > > >
> > > > > > > __
> > > > > > > Do you Yahoo!?
> > > > > > > Yahoo! Small Business - Try our new
> > resources
> > > > > > site!
> > > > > > > http://smallbusiness.yahoo.com/resources/
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> -
> > > > > > > To unsubscribe, e-mail:
> > > > > > [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail:
> > > > > > [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > "You can lead a horse to water but you
> > cannot
> > > > make
> > > > > > it float on its back."
> > > > > > ~Dakota Jack~
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> -
> > > > > > To unsubscribe, e-mail:
> > > > > > [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail:
> > > > > > [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > > __
> > > > > Do you Yahoo!?
> > > > > Yahoo! Small Business - Try our new resources
> > > > site!
> > > > > http://smallbusiness.yahoo.com/resources/
> > > > >
> > > >
> > > >
> > > > --
> > > > "You can lead

Re: [ANNOUNCE] Struts 1.2.7 Test Build Available

2005-05-06 Thread Joe Germuska
At 1:18 PM +0100 5/6/05, Niall Pemberton wrote:
The Struts 1.2.7 Test Build is now available here:
http://cvs.apache.org/dist/struts/v1.2.7/
Thank you for taking the time, Niall -- this is really valuable.
Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Validator not plugging in keyed values

2005-05-06 Thread Allistair Crossley
Hello Again,

Having a spot of bother with validating an ActionForm. It's all setup and I 
believe accurately. 

I have 2 text fields. Each are specified as needing the required rule. I do not 
ask my action mapping to validate. 


http://intranet/iq/j2ee/validator_1_1_3.dtd";>













Instead I run the validation in an Action class

ActionMessages errors = form.validate();

I log the output of this, and I accurately get 1 error or 2 errors according to 
whether I left one or two fields blank in my form. So that's fine. I save the 
errors container using saveErrors(request, errors) and back in the JSP:


  
 
  
 
   


This, too, works to some extent. In my ApplicationResources, I have:

errors.required={0} is required.
test.field.key=Some random value
test.field2.key=Some random value 2

The problem I am seeing is that when my form validates, all I get back are 
bullet points with 

- is required

which is the errors.required key's value. That is, test.field.key's value is 
not being inserted into the {0} placeholder of the errors.required value. 
Like I say, everything is working in terms of the system spotting I have errors 
according to the rule, and the messages are being found by validator because it 
finds "is required". But the error is that is does not pump in the value from 
the custom key.

Any helpers?

Cheers, Allistair.



 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



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



RE: Infinite loop with action mappings

2005-05-06 Thread Allistair Crossley
I found that by placing a direct jsp mapping to Tomcat's JSP servlet, I could 
accomplish what I needed, so long as the URL is longer than the catch-all 
mapping as per the servlet spec.


jsp
org.apache.jasper.servlet.JspServlet

fork
false


xpoweredBy
false

3



jsp
/views/*
  


controller
/*


> -Original Message-
> From: Allistair Crossley 
> Sent: 06 May 2005 15:11
> To: user@struts.apache.org
> Subject: Infinite loop with action mappings
> 
> 
> Hi,
> 
> I have a catch-all servlet mapping to push all requests to my 
> Struts controller in web.xml;
> 
> 
>   controller
>   /*
> 
> 
> I have 2 action mappings;
> 
> 
> 
> 
> When I request http://www.domain.com/view Struts finds the 
> action mapping and delegates a forward to /views/layout.jsp. 
> However, /views/layout.jsp is being picked up by the /* 
> servlet mapping in web.xml and being routed back to Struts. 
> This time because there is no action mapping for 
> /views/layout.jsp it goes to the wildcard action mapping and 
> that action's tile view is returned.
> 
> This causes an infinite loop in Struts.
> 
> Is this more to do with the servlet mapping, or is there 
> something I can instruct Struts to do with regard to getting 
> that JSP out to the response without causing another call to 
> the controller?
> 
> I need every request to go into the struts framework, but I 
> also need my JSPs to work inside struts which is not 
> happening right now due to this infinite loop.
> 
> Regards, Allistair
> 
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.action.RequestProcessor:174) - Processing 
> a 'GET' for path '/view'
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.action.RequestProcessor:992) -  Delegating 
> via forward to '/views/layout.jsp'
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.catalina.core.ApplicationDispatcher:143) - 
> servletPath=, pathInfo=/views/layout.jsp, queryString=null, name=null
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.catalina.core.ApplicationDispatcher:370) -  Path 
> Based Forward
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.util.ModuleUtils:169) - Get module name for path 
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.util.ModuleUtils:193) - Module name found: default
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.action.RequestProcessor:174) - Processing 
> a 'GET' for path '/views/layout.jsp'
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.config.ActionConfigMatcher:102) - 
> Attempting to match '/views/layout.jsp' to a wildcard pattern
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.action.RequestProcessor:257) -  Looking 
> for Action instance for class 
> com.qas.newmedia.internet.core.page.action.PageAction
> 2005-05-06 14:48:58,424 - DEBUG 
> (org.apache.struts.action.RequestProcessor:271) -   Returning 
> existing Action instance
> 
> 
>  
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
> 
> 
> -
> 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]



Infinite loop with action mappings

2005-05-06 Thread Allistair Crossley
Hi,

I have a catch-all servlet mapping to push all requests to my Struts controller 
in web.xml;


  controller
  /*


I have 2 action mappings;




When I request http://www.domain.com/view Struts finds the action mapping and 
delegates a forward to /views/layout.jsp. However, /views/layout.jsp is being 
picked up by the /* servlet mapping in web.xml and being routed back to Struts. 
This time because there is no action mapping for /views/layout.jsp it goes to 
the wildcard action mapping and that action's tile view is returned.

This causes an infinite loop in Struts.

Is this more to do with the servlet mapping, or is there something I can 
instruct Struts to do with regard to getting that JSP out to the response 
without causing another call to the controller?

I need every request to go into the struts framework, but I also need my JSPs 
to work inside struts which is not happening right now due to this infinite 
loop.

Regards, Allistair

2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.action.RequestProcessor:174) 
- Processing a 'GET' for path '/view'
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.action.RequestProcessor:992) 
-  Delegating via forward to '/views/layout.jsp'
2005-05-06 14:48:58,424 - DEBUG 
(org.apache.catalina.core.ApplicationDispatcher:143) - servletPath=, 
pathInfo=/views/layout.jsp, queryString=null, name=null
2005-05-06 14:48:58,424 - DEBUG 
(org.apache.catalina.core.ApplicationDispatcher:370) -  Path Based Forward
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.util.ModuleUtils:169) - Get 
module name for path 
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.util.ModuleUtils:193) - 
Module name found: default
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.action.RequestProcessor:174) 
- Processing a 'GET' for path '/views/layout.jsp'
2005-05-06 14:48:58,424 - DEBUG 
(org.apache.struts.config.ActionConfigMatcher:102) - Attempting to match 
'/views/layout.jsp' to a wildcard pattern
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.action.RequestProcessor:257) 
-  Looking for Action instance for class 
com.qas.newmedia.internet.core.page.action.PageAction
2005-05-06 14:48:58,424 - DEBUG (org.apache.struts.action.RequestProcessor:271) 
-   Returning existing Action instance


 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



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



Re: Action's set-property Tag

2005-05-06 Thread rmanchu
set-property is available when u extend ActionConfig and include your 
getter/setter methods. [for 1.2.x branch ]

if you're using 1.3.x-dev you can use

to set arbitrary properties without extending the config class.
Only available for ActionConfig as of now.
hopefully all config's would get this feature soon
riyaz
Prashant Reddy wrote:
Struts DTD specifies :

But there seems to be no API on "ActionConfig" to get the Name-Value paris
set using "set-property" Tag




Many Thanks for any help.
-Prashant
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Action's set-property Tag

2005-05-06 Thread Prashant Reddy

Struts DTD specifies :



But there seems to be no API on "ActionConfig" to get the Name-Value paris
set using "set-property" Tag








Many Thanks for any help.

-Prashant


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



Re: ajax proj

2005-05-06 Thread ahmet hassan

  Hi all,
I try to use XmlHttpRequest, but I can't
successfully.I have a form which is composed  of 5
select boxes and on each of them, I have onchange =
"submitData()" ( taken from Zammetti's sample
:)).Every combo data changes each time one
changes.Anyway below the code:


Kurum Kodu : 








script is:

var req;
var which;

function submitData() {
// Construct a CSV string from the entries.  Make
sure all fields are
// filled in first.
m =
document.accountStateReportForm.memberID.value;
s =
document.accountStateReportForm.subAccountNo.value;
a =
document.accountStateReportForm.accountNo.value;
alert(a);
i   =
document.forms.accountStateReportForm.isinType.value;
if (m == "" || s == "" || a == "" || i == "" ) {
 alert("Please fill in all fields first");
return false;
   }
csv = m + "," + s + "," + a + "," + i  ;
// Ok, so now we retrieve the response as in all
the other examples,
// except that now we append the CSV onto the URL
as a query string,
// being sure to escape it first.
   
retrieveURL("fillCombosAccountStateReportReg.do?csv="
+ escape(csv));
  }

function retrieveURL(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
  req = new XMLHttpRequest();
  req.onreadystatechange = processStateChange;
  try {
req.open("GET", url, true);
  } catch (e) {
alert(e);
  }
  req.send(null);
} else if (window.ActiveXObject) { // IE
  req = new ActiveXObject("Microsoft.XMLHTTP");
  if (req) {
req.onreadystatechange = processStateChange;
req.open("GET", url, true);
req.send();
  }
}
  }
function processStateChange() {
if (req.readyState == 4) { // Complete
  if (req.status == 200) { // OK response

  <%-- I do nothing here
document.getElementById("accCombo").innerHTML =
req.responseText; --%>
  
  } else {
alert("Problem: " + req.statusText);
  }
}
  }

I send form data to myAction, I prepare them and I set
the collections data to request.
 request.setAttribute("MEMBERS_OF_INVESTOR", members);
 
request.setAttribute("ACCOUNTS_OF_INVESTOR_MEMBER",accs);
 
request.setAttribute("SUB_ACCOUNTS_OF_INVESTOR_MEMBER",allSubAccountsCol);
request.setAttribute("ISINS_OF_INVESTOR_MEMBER",allIsinsCol);
return mapping.findForward("success");//REturns to the
  same jsp.
 But the combos don't change..?Eg:I see accounts combo
is the same before I set new values to request and
forward to my jsp.




value="">


<%-- --%>

 
  Thanks for help ? 
Regards;
 Özgür OKTAN


--- "Frank W. Zammetti" <[EMAIL PROTECTED]> wrote:

> Sure! :)
> 
> Basically view the entire server portion as one
> piece... at the end of
> whatever it is that it does, it's returning HTML
> (whether it's a complete
> page, as usual, or just a snippet, like with Ajax
> techniques usually). 
> Whether that HTML is written directly to response in
> an Action or a JSP
> processes (which is writing out to response
> essentially remember), it's
> the same thing.
> 
> The fifth example in my webapp from the article
> shows this, albeit very
> simplistically... the Action just constructs a
> string from the parameters
> submitted, then shoves that string into a request
> attribute... the then
> forwards to a JSP, which basically does nothing but
> outputs the string and
> returns the resultant "page" (the page in this case
> being nothing but the
> string).
> 
> Imagine what the table sorting example would look
> like with this
> approach... all the outputting of HTML would be
> removed, we would instead
> do:
> 
> request.setAttribute("sortedPresidentsList",
> sortedPresidentsList);
> 
> ...and we'd just do a normal forward to some JSP...
> in the JSP we might do:
> 
> <% ArrayListhm =
>
(ArrayList)request.getAttribute("sortedPresidentsList");
> %>
>  cellspacing="0">
> 
> 
onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Name
> 
onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Middle Name
> 
onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Name
> 
onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Year In
> Office
> 
onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Year In
> Office
> 
> <%
> for (Iterator

[ANNOUNCE] Struts 1.2.7 Test Build Available

2005-05-06 Thread Niall Pemberton
The Struts 1.2.7 Test Build is now available here:

http://cvs.apache.org/dist/struts/v1.2.7/

The release notes include highlights of changes in this version, as well as
the full details of changes and bug fixes:

http://struts.apache.org/userGuide/release-notes.html

Once feedback has been collected on the stability and quality of this build,
a determination will be made as to whether it should be promoted to General
Availability (GA) or Beta status,  or neither.

You are encouraged to download and test this build at your earliest
convenience, and provide your feedback via the lists or via the bug
database.

--
Niall Pemberton



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



Re: Overwriting HtmlTag

2005-05-06 Thread Cliff Lam
I bind the onchange function dynamically at the client side using
javascript.

But I don't know if it is a good idea.

Cliff

- Original Message - 
From: "Nancy Lin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, May 04, 2005 11:59 PM
Subject: Overwriting HtmlTag


> Hi all,
>
> I have bunch of jsp with html tag and I want to automatically
> generate onchange function whent user changes/modified the data.
> Since the function that will be called on onChange will be the same
> throught out, I do not want every developer to go to each JSP(there
> are hundreds of file) and implement the onchange method on each
> field.  I want to be able to overwrite the html tag to automatically
> generate the onchange function.
>
> Any good idea?
>
> Nancy.
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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