Re: requiredif - simple example

2003-06-26 Thread Kevin Robair
The following worked for me. Note that in RC1, the  tag values
are expected to be field-test[n], not fieldTest[n] and so on

The requiredif check was removed because in 1.1RC1, requiredif would break
a javascript validator such as mask. I used custom validation instead.





   mask
   ${4dig}
   



You can also check out the Validator doc on the struts documentation. Just
expand the struts-documentation webapp that comes with your version of
struts, it is under User and Developer Guides.

-Kevin


--- Brian McSweeney <[EMAIL PROTECTED]> wrote:
> Hi all,
>  
> The validator package works well for me. 
> But I'm trying to use the requiredif and failing.
>  
> I know there has been previous discussion of this, 
> but I'm trying to a simple validation based on a checkbox 
> so perhaps someone could tell me where I'm going wrong.
>  
> For example,
>  
> I want to validate a creditcard, if a checkbox is checked.
>  
> I currently am trying to do this as follows:
>  
>  
>   
> depends="requiredif,creditCard">
>  
>   
>  name="creditCard"
> key="CreditCard"
>   resource="false"
>   />
>  name="requiredif"
> key="A Credit-Card is"
>   resource="false"
>   />
>   
> myForm.checked
> on
>   
>   
>   
>  
>  
> The form name is: myForm
>  
> The creditcard field is named "creditCard"
> The checkbox field is named "checked"
>  
> Note that all other types of validation are working correctly for me.
>  
> Any help would be SO much appreciated.
> Brian
> 


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



Re: requiredif question

2003-06-25 Thread Kevin Robair
Just a hunch:

For Struts 1.1RC1 , the varnames should be:

field-test[x]
field-join
etc...

In 1.1RC2, they are

fieldTest[n]
fieldJoin  
etc

BTW, I am unsure what you mean by:

  "does not seem to operate at all"

Are there any errors or exceptions in the log? If the form validates no
matter what you enter, and there are no errors in the log, then it is
possibly a configuration problem. You could try a simpler validation, in
place of this one just to make sure it is doing something. Then, remove
the NOTNULL check, and see if the NOTEQUAL alone works.

-Kevin

--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> I have the following code that does not seem to operate at all.
> 
> I want phone1type to be a required field _if_ the phone1 attribute is
> _not_ 
> ""
> 
>  depends="requiredif">
> 
> 
> field[0]
> phone1
> 
> 
> fieldTest[0]
> NOTNULL
> 
> 
> field[1]
> phone1
>   
>   
> fieldTest[1]
> NOTEQUAL
>   
>   
> fieldValue[1]
>  
>   
>   
> fieldJoin
> OR
> 
> 
> 
> 
> 
> 
> ---
> Thanks...
> Mick Knutson
> ---
> 
> _
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 
> -
> 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 taglibs on iPlanet 4.1SP12

2003-06-25 Thread Kevin Robair
Hi all,

I am faced with the enjoyable task of deploying a struts1.1RC2 app 
to iPlanet 4.1SP12.

My current problem is that the jasper compiler cannot file the TLD's for
the  struts tags libraries. I have placed WEB-INF in docroot, in the file
system root, and in my application's subdir, all to no avail. The iPlanet
4.1 guide on the struts website does not say anything about taglibs.

This the error:

[25/Jun/2003:10:04:09] info (  153): JSP: JSP1x compiler threw exception 
org.apache.jasper.JasperException: Unable to open taglibrary
struts-bean.tld : null 
at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:708)

at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:119)

at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:190) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1048) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1022) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1018) 
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:173) 
at
com.netscape.server.http.servlet.NSServletEntity.load(NSServletEntity.java:231)

at
com.netscape.server.http.servlet.NSServletEntity.update(NSServletEntity.java:149)

at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:453)

 
Hopefully someone can point me in the right direction.

-Kevin




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



Re: Possible problem with forms & struts

2003-06-16 Thread Kevin Robair
Hi Andrew,

Welcome to the list. Without more details, I can only speculate. Since my
code regularly parses (successfully) input from one form with multiple
buttons, I doubt this is a struts bug, but more than likely a config
issue.

A couple questions:

1. Are you looking at both the HTML page source, and the Request
parameters as seen by your action, and seeing the discrepancy? One thing
you could try is to extend ActionServlet and print out the request
parameters in and overridden version of  doGet() before moving on (don't
forget to call super.doGet()). If the discrepancy still exists, the
problem is in your container, or browser, or possibly in your
interpretation of what you are seeing.

2. Are you handling session timeouts? if not, you may be getting saddled
with a new session w/o expecting it. This seems an unlikely candidate
unless you are using the submitted button's value in some indirect way,
but I thought I would suggest it anyway.

I would assume you are doing something like this:

   
  

    
    
   
  
   
    
   
   
   

Then in a formbean (in this case an dyna form:
 

 

The in the Action something like this, depending on your ActionForm:

  DynaValidatorForm dvf = (DynaValidatorForm)actionForm;
  submitVal = (String)dvf.get("submit");


This always works for me. 


--- Andrew Yates <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> This is the first time I've mailed this list so hi to everyone. I think
> my problem lies in struts so hopefully this is the correct place to mail
> to. I have a JSP page with two submit buttons which are linked to the
> same ActionForm and Action with each button corresponding to a different
> action. One is a search button and the other is a commit changes button.
> The form was capturing these two button's outputs and the action then
> deciding on what processes/classes/methods to run.
> 
> The problem is that every so often the page will create a get using the
> search button even though I pressed the commit button. I've tried giving
> both buttons the same name but different values, spliting the two
> submits into two forms. I don't want to do split them up into two pages
> and two sets of Actions & forms since the two pages are very similar in
> content.
> 
> Has anyone else encountered this kind of problem before & how did you
> solve it?
> 
> Many thanks,
> 
> Andy Yates
> 
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


=
Kevin Robair
[EMAIL PROTECTED]
(h) 703 876-0894
(c) 703 850-9544

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



Re: Checkbox problem?

2003-06-10 Thread Kevin Robair
You can pre-populate the form in a previous action. Here is an example.

http://jakarta.apache.org/struts/faqs/newbie.html#prepopulate

-Kevin

--- Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
> oki, maybe my explanation isn't the best :) (I know that I can't do it
> in the reset method, as it is clearly not working)  but I am still not
> sure where to put the code to set the checkbox to true then.
> As far as I know, the action class isn't called before after the form
> bean has called the reset method and the page has been rendered (and the
> submit button has been pressed), or is it something I am missing?
> 
> BTJ
> 
> On Tue, 2003-06-10 at 20:28, James Mitchell wrote:
> > On Tuesday 10 June 2003 14:11, Bjørn T Johansen wrote:
> > > You are missing my point! If I just could set the checkbox value to
> > > false in the reset method, everything is fine. But there are times
> when
> > > that value has to be reset to true and not false and if I do that in
> my
> > > reset method, I am not able to see of the user unchek the checkbox,
> > > because the boolean variable is still true after the form has been
> > > posted!
> > 
> > No, actually *YOU* are missing the point!  Several people have tried
> to 
> > explain how this works to you.
> > 
> > So, for one last effort
> > 
> > 
> > DO *NOT* SET THE FIELDS YOU INTENT TO USE AS CHECKBOXES (booleans) TO
> TRUE IN 
> > THE RESET METHOD!  
> > 
> > 
> > If you want the field to be true when the page is rendered, set it to
> true 
> > from your action class, NOT in the reset of your formbean.
> > 
> > I hope that clears it up for you.
> > 
> > 
> > >
> > >
> > > BTJ
> > >
> > > On Tue, 2003-06-10 at 19:22, Tor Henrik Hanken wrote:
> > > > [EMAIL PROTECTED]
> > > >
> > > > | Yes, but to clarify...
> > > > | I am showing a jsp page with values read from a database. If the
> > > > | checkbox value is true, how do I then make the checkbox on my
> jsp-page
> > > > | checked and how do I then find out if the checkbox has been
> unchecked?
> > > > | Do I have to manually read the posted data and see if the
> checkbox
> > > > | attribute is missing or is there a better way?
> > > >
> > > > I assume that you are using an Action with an ActionForm.
> > > >
> > > > To make the value of the checkbox come up correctly, import
> > > > struts tags into your jsp-page:
> > > >
> > > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="strb" %>
> > > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="strh" %>
> > > > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="strl" %>
> > > >
> > > > Then use the Struts checkbox tag:
> > > >
> > > > 
> > > >
> > > > Assuming that your form has the methods getDone and setDone,
> > > > these methods will be used to render the value of the checkbox
> > > > correctly.
> > > >
> > > > As to the question of boolean values that are set to false by the
> > > > user: You don't have to parse the posted data manually.  The
> > > > method reset() in ActionForm is run before the posted data is
> > > > used to populate the form.  Write your own reset() method where
> > > > you set the boolean fields to false.
> 
> 
> 
> -
> 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: More validation woes... Ack!

2003-06-10 Thread Kevin Robair
All I can say is that I think you must have some other config error.
Have you looked at the examples that come w/ Struts to see if you can
track down the problem. That helps me most of the time with these kinds of
issues.

You seem to be a bit hung up on the URL having SaveTWSItem.do in it.
I don't see a problem with that. Unless your are doing a re-direct, the
URL will not change no matter what .jsp you forward to (validation error
or not). The URL will be that of the action referenced in whatever form
the user submits. I am no expert here, but I think when struts does a
"forward", it writes out the .jsp to the output stream from the
originating request, so from the browsers POV, it only knows it submitted
a URL and got some data back. The URL will never change w/o a redirect.

Good luck,

-Kevin

--- "Gregory F. March" <[EMAIL PROTECTED]> wrote:
> 
> On Jun 10, 2003, Kevin Robair <[EMAIL PROTECTED]>  wrote:
> 
>  |I may have already replied to this yesterday, I cannot
>  |recall if it was this thread or another. Sorry if this
>  |is redundant
> 
> Kevin,
> 
> Yes, you did reply (thanks!).  And, I tried what you said (and are
> saying again today), and after beating my head against the wall, I
> found a typo.  However, that didn't solve everything.
> 
> I have the input of my action specifying a global forward (that I use
> elsewhere), but the url still has the SaveTWSItem.do and I get a page
> that is "out of context" with what I had before, i.e. all my relative
> paths are messed up.
> 
> Any other ideas?
> 
> Thanks a bunch...
> 
> /greg
> 
> --
> Gregory F. March-=-http://www.gfm.net:81/~march-=-   
> AIM:GfmNet
> 
> -
> 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: More validation woes... Ack!

2003-06-10 Thread Kevin Robair
OK, so I WAS being redundant 

Greg, everything looks good to me from here (of course, that does not mean
it IS good). It may be a tiles issue, I am not familiar with tiles, so I
cannot comment further on that. Maybe "input" needs to be set to
"LOCCreateParticipanty.jsp" ???

-Kevin

--- "Gregory F. March" <[EMAIL PROTECTED]> wrote:
> 
> Quick version:
> 
> How does one handle a tile-based form that fails validation?  Or, is
> there a special forward tag in the form's action that I need?
> 
> Long version:
> 
> Ok, I've managed to get simple validation working (why is there not
> reference to the html:errors tag in the validation chapter in the
> O'Reilly book?!  Ack!).
> 
> Now, I am trying to validate a multipage form that resides in a tile.
> What I am getting is basically what I was getting yesterday with my
> last validation email.
> 
> The players:
> 
> Form name:   LOCCreateForm (a DynaValidatorForm)
> Tile page:   LOCCreateParticipanty.jsp
> Parent:  LOCCreate.jsp
> Action name: SaveTWSItem
> 
> The scenario:
> 
> LOCCreate.jsp has some logic tags to determine which tile to load in
> the body, as in:
> 
> 
>   
>  value="/loc/tiles/LOCCreateParticipants.jsp" />
>   
> 
> 
> But, I'm not sure if this is relevant.
> 
> When validation fails, the url generated is of the form:
> 
> http://myserver:port/app/SaveTWSItem.do?
> 
> (as opposed to any in my action's forward decls).
> 
> It seems that when the validation fails, I don't have the return
> forward set up properly.  Do I need a special forward tag in my
> SaveTWSItem action?
> 
> Here is my validation.xml:
> 
> 
>   
> 
>property="CRN"
> depends="required,mask">
> 
> 
>   mask
>   ^[0-9]*$
> 
>   
> 
>   
> 
> 
> Here is my struts-config.xml:
> 
>name="LOCCreateForm"
>   type="org.apache.struts.validator.DynaValidatorForm">
> 
>   
> 
>type="java.lang.String"/>
>type="java.lang.String"/>
>   
>   ...
> 
>path="/SaveTWSItem"
>   type="com.mycompany.action.SaveTWSItemAction"
>   scope="session"
>   name="LOCCreateForm"
>   validate="true"
>   input="/LOCCreate.jsp"
>   parameter="action">
> 
>  name="Success"
>   path="/mainpage/mainpage.jsp"
>   redirect="true" />
> 
>  name="Failure"
>   path="/errors/general.jsp"
>   redirect="true" />
> 
>   
>   ...
> 
> Thanks for any help...
> 
> /greg
> 
> --
> Gregory F. March-=-http://www.gfm.net:81/~march-=-   
> AIM:GfmNet
> 
> -
> 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: More validation woes... Ack!

2003-06-10 Thread Kevin Robair
I may have already replied to this yesterday, I cannot
recall if it was this thread or another. Sorry if this
is redundant

When validation fails, it should return you to the
page or forward specified in the "input" property of
the Action, in this case:

>   input="/LOCCreate.jsp"

Since this is not a re-direct, you should see the URL
below in either case. Are you getting a blank html
page?

There is a setting in struts-config.xml that causes
the value of the "input" property to be treated as the
name of a local or global forward. In this case, you
would need:

input = "someForwardNameThatPointsTo-LOCCreate.jsp"

-Kevin


> When validation fails, the url generated is of the
> form:
> 
>
> http://myserver:port/app/SaveTWSItem.do? here>
> 
> (as opposed to any in my action's forward decls).
> 


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



RE: Checkbox problem?

2003-06-10 Thread Kevin Robair
In your ActionForm reset() method, set the checkbox
value to false.

Struts will set the value to true if the box is
checked.

If you are using DynaForms, you will need to extend it
and override the reset() method.

To populate the checkbox initially, you need to
instantiate and populate the form bean and place it in
the appropraite context. For more details, see:

http://jakarta.apache.org/struts/faqs/newbie.html#prepopulate
http://jakarta.apache.org/struts/faqs/newbie.html#checkbox

-Kevin

--- Bjørn T Johansen <[EMAIL PROTECTED]> wrote:
> Yes, but to clarify...
> I am showing a jsp page with values read from a
> database. If the
> checkbox value is true, how do I then make the
> checkbox on my jsp-page
> checked and how do I then find out if the checkbox
> has been unchecked?
> Do I have to manually read the posted data and see
> if the checkbox
> attribute is missing or is there a better way?
> 
> 
> BTJ
> 
> On Tue, 2003-06-10 at 15:45, Kandi Potter wrote:
> > I would suggest not doing the propagate in the
> reset.   Just use it for the original values.   The
> values entered on the form are automatically
> propagated by struts after the reset by the setters
> and getters.   Just put in some logging or print
> statements in those methods and you will see when
> they are invoked.
> > 
> > -Original Message-
> > From: Bjorn T Johansen [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, June 10, 2003 4:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: Checkbox problem?
> > 
> > 
> > I use checkboxes to input some variables in a form
> and as long as I
> > insert new records, i.e. the checkbox variable
> gets set to false in the
> > form's reset method, it works fine.
> > But when I, say, edit the same record (and
> propagate the values of the
> > form in the reset method), I never can uncheck the
> checkbox if it was
> > set to true in the reset method.
> > 
> > Are there any solutions/work around for this?
> > 
> > 
> > Regards,
> > 
> > BTJ
> > 
> > 
> > 
> >
>
---
> > Bjørn T Johansen (BSc,MNIF)
> > Executive Manager
> > [EMAIL PROTECTED]  Havleik Consulting
> > Phone : +47 67 54 15 17 Conradisvei 4
> > Fax : +47 67 54 13 91   N-1338 Sandvika
> > Cellular : +47 926 93 298  
> http://www.havleik.no
> >
>
---
> > "The stickers on the side of the box said
> "Supported Platforms: Windows
> > 98, Windows NT 4.0,
> > Windows 2000 or better", so clearly Linux was a
> supported platform."
> >
>
---
> > 
> > 
> >
>
-
> > 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]
> -- 
>
---
> Bjørn T Johansen (BSc,MNIF)
> Executive Manager
> [EMAIL PROTECTED]  Havleik Consulting
> Phone : +47 67 54 15 17 Conradisvei 4
> Fax : +47 67 54 13 91   N-1338 Sandvika
> Cellular : +47 926 93 298  
> http://www.havleik.no
>
---
> "The stickers on the side of the box said "Supported
> Platforms: Windows
> 98, Windows NT 4.0,
> Windows 2000 or better", so clearly Linux was a
> supported platform."
>
---
> 
> 
>
-
> 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]



RC2 requiredif validation rule syntax change

2003-06-10 Thread Kevin Robair
FYI:

While testing my app with RC2, I noticed this:

In RC1, the requiredif validator rule used these tags:

field-test[n]
field-value[n]
field-join[n]

In RC2, it uses:

fieldValue[n]
fieldTest[n]
fieldJoin[n]

If you are getting a reflection error / null pointer
exception, this is why. 

-Kevin



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



Virus warning

2003-06-10 Thread Kevin Robair
Hi all,

FYI

Looks like someone who was or is on this list has a
virus/worm, as I just got the following email in my
inbox (Sent to me, not struts-user) with an attached
.xls file with the Bugbear virus (as scanned by
Yahoo's Norton Anti-virus)

BTW, I was not on this list April 01, and did not
participate in the thread referenced below, so anyone
could get this.

I tried to email the originator privately, but it
bounced.

-Kevin

Message content follows:
--

From: <[EMAIL PROTECTED]>
Subject: RE: [log4j]

yup. no problems...

-Original Message-
From: 
Sent: April 01, 2003 11:37 AM
To: [EMAIL PROTECTED]
Subject: [log4j]
4




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



Re: Argh! [was Re: DynaValidatorForm setup]

2003-06-09 Thread Kevin Robair
Make sure "/LOCCreateParticipants.jsp" is in the root
of your web app. (Sorry, I know that is obvious, but I
included it just in case)

In your struts-config.xml, check to see if you have
this:






If so, create a global forward:



and change Action so that input="CreateParticipants"


-Kevin

--- "Gregory F. March" <[EMAIL PROTECTED]> wrote:
> 
> On Jun 6, 2003, "Barry Volpe"
> <[EMAIL PROTECTED]>  wrote:
> 
>  |I was able to piece it all together using the
>  |struts-validator.war file that comes in the
> 
> Barry,
> 
> Thanks for that write up.  Looking at that war, I
> set my app up
> similarly, but I am having a very frustrating
> problem.
> 
> When my form tag in the validation.xml file points
> to (name=) my
> DynaValidatorForm in my struts-config.xml,
> submitting that form yields
> an error 404 - not available.  Changing the form
> method to GET, the
> url is do... after the submit. 
> Turning off the
> validation (by changing the name in the
> validation.xml to something
> else) and submitting the form yields a url that came
> from the action's
> forward tag.
> 
> I just don't have enough experience with struts to
> be able to
> understand what is happening (read: HELP!).  I
> suspect that the
> validation is returning something that I am not
> handling, but I can't
> figure out what it is so that I can handle it. 
> Below are the code
> snippets.
> 
> Thanks...
> 
> /greg (clumps of hair in my white-knuckled fists!)
> 
> --
> Gregory F. March-=-   
> http://www.gfm.net:81/~march-=-AIM:GfmNet
> 
> struts-config.xml:
>name="LOCCreateForm"
>  
>
type="org.apache.struts.validator.DynaValidatorForm">
> 
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
> ...
>  path="/SaveTWSItem"
>  
> type="com.mycompany.web.action.SaveTWSItemAction"
>   scope="session"
>   name="LOCCreateForm"
>   validate="true"
>   input="/LOCCreateParticipants.jsp"
>   parameter="action">
> 
>  name="Success"
>   path="/mainpage/mainpage.jsp"
>   redirect="true" />
> 
>  name="Failure"
>   path="/errors/general.jsp"
>   redirect="true" />
> ...
> 
> validation.xml:
> 
> 
>   
> 
>property="CRN"
> depends="required,mask">
> 
> 
>   mask
>   ^[0-9]*$
> 
>   
> 
>   
> 
> 
>
-
> 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: strange problem setting up struts

2003-06-09 Thread Kevin Robair
In some versions of struts, you must have an internet
connection in order to the validation XML files to
validate. I have the problem in 1.1RC1, but I read
that it is fixed in the nightly build. In your
validator XML files, you can change the URL of the DTD
to point to a local disk file, and that should solve
the problem (I think!).

-Kevin

--- Aaron Robinson <[EMAIL PROTECTED]>
wrote:
> I'm working through the readme with struts rc1.1 and
> get the following error 
> from both Tomcat and WLS 8.1 when trying to start
> the servlet container 
> after deploying the struts-examples war. The
> documentation war has deployed 
> successfuly
> 
> 
> 
> 
> INFO: Initializing, 
>
config='org.apache.struts.webapp.example.ApplicationResource
> s', returnNull=true
> 09-Jun-2003 12:17:40 
>
org.apache.struts.webapp.example.memory.MemoryDatabasePlugI
> n init
> INFO: Initializing memory database plug in from
> '/WEB-INF/database.xml'
> 09-Jun-2003 12:17:40
> org.apache.struts.validator.ValidatorPlugIn 
> initResources
> INFO: Loading validation rules file from
> '/WEB-INF/validator-rules.xml'
> 09-Jun-2003 12:17:40
> org.apache.struts.validator.ValidatorPlugIn 
> initResources
> SEVERE: jakarta.apache.org
> java.net.UnknownHostException: jakarta.apache.org
> at 
>
java.net.InetAddress.getAllByName0(Ljava.lang.String;Z)[Ljava.net.Ine
> tAddress;(Unknown Source)
> at 
>
java.net.InetAddress.getAllByName0(Ljava.lang.String;)[Ljava.net.Inet
> Address;(Unknown Source)
> at 
>
java.net.InetAddress.getAllByName(Ljava.lang.String;)[Ljava.net.InetA
> ddress;(Unknown Source)
> at 
>
weblogic.net.http.HttpClient.openServer(Ljava.lang.String;I)V(HttpCli
> ent.java:228)
> at
>
weblogic.net.http.HttpClient.openServer()V(HttpClient.java:292)
> 
>
_
> Get Hotmail on your mobile phone
> http://www.msn.co.uk/msnmobile
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


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



Re: Accessing ApplicationResources.properties

2003-06-09 Thread Kevin Robair
You can treat it as a ResourceBundle:

String bundleName =
"com.mycompany.myapp.ApplicationResources";

ResourceBundle  bundle
   ResourceBundle.getBundle(bundleName,
currentLocale);

Leave out currentLocale if you want the default.

A more consistent way is, if you have access to the
Session"

MessageResources bundle = (MessageResources)
request.getSession().getServletContext().getAttribute("org.apache.struts.action.MESSAGE");


-Kevin

--- Zoran Avtarovski <[EMAIL PROTECTED]> wrote:
> I have what is hopefully a simple question.
> 
> I have a set a number of file system specific
> variables in my
> ApplicationResources.properties file to make it
> easier to deploy the
> application on different platforms.
> 
> I can access Message Resources properties from
> Action classes using:
> 
> MessageResources messages =
> getResources(request);
> String message =
> messages.getMessage("the.chosen.message");
> 
> Outside an action class I'm having trouble
> instantiating the
> MessageResources.
> 
> I can see that I need to use:
> 
> MessageResources messages = MessageResources (x,
> y);
> 
> But I don't know what arguments  to pass as x and y
> 
> Could somebody please email me a way to get this
> done in my helper classes.
> 
> Thanks
> 
> Zoran
> 
> 
>
-
> 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 repopulate Form which has html elements with samename

2003-06-06 Thread Kevin Robair
I have one more:

Validation errors kept returning me to a blank page. 
Turns out, in my struts-config (borrowed from a Struts
book, so I deserved it!) I had, way down at the
bottom:


 
 


but my input tag was input="/errorpage.jsp"

Had to look through the struts examples until I found
one that used inputForward names instead of paths.
Then I saw my problem.

-Kevin


--- "Bailey, Shane C." <[EMAIL PROTECTED]>
wrote:
> 
> The 5 things I can think a newbie would do so
> validation doesn't work:
> 
> 1. no tld for struts html at the top of the JSP or
> not using html:text
> 2. no input=thejsp in the action mapping
> 3. validation isn't implemented right (or set to
> false or something)
> 4. Incorrect form bean type (especially if using
> struts validator) or no
> bean
> 5. Likes to annoy others just for fun
> 
> I can't think of any other pitfalls.
> 
> -Original Message-
> From: Kevin Robair [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 05, 2003 5:06 PM
> To: Struts Users Mailing List
> Subject: Re: How to repopulate Form which has html
> elements with samename
> 
> Repopulation IS a freebie. The examples that come
> with
> struts are right (generally). The first thing to do
> is
> understand every tag in the examples'
> struts-config.xml. Easier said than done, but maybe
> this will help:
>
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01060.html
> 
> In any case, you do not need to 'rebuild' a form,
> simply forward back to the .jsp page where the error
> happened. If the 'input' parameter of the 
> is
> set, this should happen automatically if validation
> is
> on. 
> 
> 
> -Kevin
> 
> 
> --- sjones <[EMAIL PROTECTED]> wrote:
> > Repopulating Fields.
> > 
> > I keep hearing that this is a freebie in struts
> but
> > i have note seen it work
> > on
> > my app yet.  i just stuff what i want to
> repopulate
> > with in the session (for
> > now).
> > 
> > It would be nice if someone could post what "setup
> > write"  IS.  so we can
> > check
> > if we have something set up "WRONG".
> > 
> > After all,  WSAD 5 came with struts preloaded so
> how
> > can it be setup wrong?
> > 
> > 
> > 
> > "Sashi Ravipati" <[EMAIL PROTECTED]> wrote in
> > message
> > news:[EMAIL PROTECTED]
> > > Let me rephrase my question.
> > >
> > > I have a table which looks like this.. example
> > >  > cellpadding="1">
> > > 
> > >   Name
> > >   Sex
> > > 
> > > 
> > > 
> > >   
> > >    
> > > >Male
> > > > >Female
> > > 
> > >   
> > >   
> > > 
> > >   
> > >   
> > >    
> > >    
> > > >Male
> > > > >Female
> > > 
> > >   
> > > 
> > > 
> > >
> > > So when I add data like
> > > Sashi Male
> > > Sushma FEMALE
> > >
> > > now I submit the form, and say there are some
> > validation errors
> > >
> > > how can I build the table with the above values
> > retrieving from the Form
> > > Bean .My  form bean has the following methods
> > >
> > > public String[] getName(){
> > > return name;
> > >   }
> > >
> > >   public void setName(String[] newName){
> > > name = newName;
> > >   }
> > >
> > >   public String[] getSex(){
> > > return sex;
> > >   }
> > >
> > >   public void setSex(String[] newSex){
> > > sex = newSex;
> > >   }
> > >
> > > The values are getting stored in the array, but
> to
> > get them back and
> > > build my table is what is not clear to me..
> > >
> > >  may do the job but how to use
> > it??
> > >
> > > Hope I am clear now
> > >
> > >
> > > >>> [EMAIL PROTECTED] 06/05/03 11:30AM >>>
> > >
> > > Sounds like you might be missing
> > input="theform.jsp" in your action
> > > where
> > > theform.jsp is the name of your JSP you want to
> > have come back with the
> > > errors.  Also, have  in the JSP to
> > report the errors (just
> > > as
> > > important (more) than repopulating).
> > >
> > > I

Re: Error — [Ljava.lang.String;@d23.

2003-06-06 Thread Kevin Robair
What you are seeing is the String[].toString() output.
I am not sure how this is an error, what is the jsp
code that is causing it to be displayed?

I am also not sure it makes sense to set a String[]
from a  field, this field results in a
String, not a String[]. I know if you try to map an
 field to a String[] type in the
DynaActionForm, you will get something like
[Ljava.lang.String;@118cb3a in the text field, so
struts does not automatically type convert String to
String[] .

-Kevin
--- Sashi Ravipati <[EMAIL PROTECTED]> wrote:
> Hi
> 
> I get the following error when the jsp page is
> displayed after the validation fails (Validation
> errros are all working fine)
> 
> [Ljava.lang.String;@d23.
> 
> This happens when I am passing values to a String
> Array. eg: .jsp I have 
> 
> 
> 
> These are my set and get methods in my ActionForm
> 
> private String [] FirstName=null;
> 
> public String[] getfirstName(){
> return FirstName;
>   }
> 
>   public void setfirstName(String[] newName){
> FirstName = newName;
>   }
> 
> It works fine when I use String but returns jusn
> when using String array. The values are being set
> correctly when I ran in debug mode.
> 
> Is this a bug??
> 
> Thanks
> 


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



Re: collaborate struts and existing servlet?

2003-06-06 Thread Kevin Robair
Hi Harris,

This has me curious, just in case I run into it in the
future:

Are you saying that weblogic 5.1 treated 

 http://www.somewhere.com/app/servlet1
 http://www.somewhere.com/app/struts

as being in different contexts? 

I don't know the servlet spec by heart, but it seems
to me that it violatates the spec, regardless of where
the configuration parameters for the app are stored.

Thanks,

Kevin

--- harris <[EMAIL PROTECTED]> wrote:
> thanks for you reply.
> 
> my problem was solved and it was particularly the
> configuration in
> weblogic.properties
> In weblogic 5.1, the servlets is specified in
> weblogic.properties file.
> 
> But to use Struts, I need to specify the servlet in
> web.xml
> So, it was the reason why weblogic5.1 treats the
> servlet as different
> application.
> After I moved the servlet mapping to web.xml
> everything works well.
> 
> thanks,
> Harris.
> 
> 
> 
> 
> 
> - Original Message -
> From: "Navjot Singh" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Friday, June 06, 2003 5:49 PM
> Subject: RE: collaborate struts and existing
> servlet?
> 
> 
> > session belongs to web server. every request
> coming your way will be
> having
> > same session. no matter which program set that.
> > you can easily access them *ANYWHERE* you want in
> entire application. You
> > just need to have REQUEST object.
> >
> > does this clear the air or may be i misunderstood
> you.
> >
> > -navjot singh
> >
> > |-Original Message-
> > |From: harris [mailto:[EMAIL PROTECTED]
> > |Sent: Friday, June 06, 2003 1:04 PM
> > |To: Struts Users Mailing List
> > |Subject: collaborate struts and existing servlet?
> > |
> > |
> > |Hi,
> > |
> > |I have an web application partly using struts and
> partly using
> > |typical jsp/servlet pattern.
> > |I have an issue to share the session between
> struts and existing servlet.
> > |A session is created in struts seems to differ
> from the session in
> servlet.
> > |
> > |Is there any way to collaborate between struts
> and existing
> > |servlet by using the same sessionId?
> > |
> > |thanks,
> > |Harris
> >
> >
> >
>
-
> > 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 repopulate Form which has html elements with samename

2003-06-06 Thread Kevin Robair
Repopulation IS a freebie. The examples that come with
struts are right (generally). The first thing to do is
understand every tag in the examples'
struts-config.xml. Easier said than done, but maybe
this will help:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01060.html

In any case, you do not need to 'rebuild' a form,
simply forward back to the .jsp page where the error
happened. If the 'input' parameter of the  is
set, this should happen automatically if validation is
on. 


-Kevin


--- sjones <[EMAIL PROTECTED]> wrote:
> Repopulating Fields.
> 
> I keep hearing that this is a freebie in struts but
> i have note seen it work
> on
> my app yet.  i just stuff what i want to repopulate
> with in the session (for
> now).
> 
> It would be nice if someone could post what "setup
> write"  IS.  so we can
> check
> if we have something set up "WRONG".
> 
> After all,  WSAD 5 came with struts preloaded so how
> can it be setup wrong?
> 
> 
> 
> "Sashi Ravipati" <[EMAIL PROTECTED]> wrote in
> message
> news:[EMAIL PROTECTED]
> > Let me rephrase my question.
> >
> > I have a table which looks like this.. example
> >  cellpadding="1">
> > 
> >   Name
> >   Sex
> > 
> > 
> > 
> >   
> >    
> >Male
> > >Female
> > 
> >   
> >   
> > 
> >   
> >   
> >    
> >    
> >Male
> > >Female
> > 
> >   
> > 
> > 
> >
> > So when I add data like
> > Sashi Male
> > Sushma FEMALE
> >
> > now I submit the form, and say there are some
> validation errors
> >
> > how can I build the table with the above values
> retrieving from the Form
> > Bean .My  form bean has the following methods
> >
> > public String[] getName(){
> > return name;
> >   }
> >
> >   public void setName(String[] newName){
> > name = newName;
> >   }
> >
> >   public String[] getSex(){
> > return sex;
> >   }
> >
> >   public void setSex(String[] newSex){
> > sex = newSex;
> >   }
> >
> > The values are getting stored in the array, but to
> get them back and
> > build my table is what is not clear to me..
> >
> >  may do the job but how to use
> it??
> >
> > Hope I am clear now
> >
> >
> > >>> [EMAIL PROTECTED] 06/05/03 11:30AM >>>
> >
> > Sounds like you might be missing
> input="theform.jsp" in your action
> > where
> > theform.jsp is the name of your JSP you want to
> have come back with the
> > errors.  Also, have  in the JSP to
> report the errors (just
> > as
> > important (more) than repopulating).
> >
> > If this doesn't help find a better (for you)
> online struts tutorial.
> > What
> > you are trying to do  is a freebie in struts (if
> everything is setup
> > right).
> >
> >
> > -Original Message-
> > From: Sashi Ravipati
> [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 10:59 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to repopulate Form which has html
> elements with same name
> >
> > Hi
> >
> > I am a newbie to struts...
> >
> > I have a dynamic table which has a  
> and a  .
> > The
> > user cliks on a add button and enter values in
> each row of the table and
> > submits the form.
> >
> > How can I repopulate the valuse if validation
> fails.
> >
> > Can some body give a working exapmle of the Action
> Form that is required
> > for
> > this kind of requirement.
> >
> > I found this in Ted Husted site but had no clue as
> what he is trying to
> > do,
> > What is RESULT etc
> >
>
--
> --
> > ---
> > 
> >  id="row">
> > 
> > name
> > category
> > 
> > 
> > 
> > <%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE
> NAME --%>
> > 
> > Art
> > Automotive
> > <%-- ... --%>
> > 
> > <%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE
> NAME --%>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
>
--
> --
> > -
> >
> >
>
-
> > 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: html link href, forward an action attribute

2003-06-06 Thread Kevin Robair
Someone already has:

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

-Kevin

--- [EMAIL PROTECTED] wrote:
> 
> Can someone explain me
> the great difference beetween action, href and
> forward attribute
> with the html link tag.
> supposing that there is an action that corresponds
> to the forward 
> attribute
> 
> Meissa
> 
> L'integrite de ce message n'etant pas assuree sur
> internet, Natexis
> Banques Populaires ne peut etre tenu responsable de
> son contenu. Toute utilisation ou diffusion non
> autorisee est
> interdite. Si vous n'etes pas destinataire de ce
> message, merci de le
> detruire et d'avertir l'expediteur.
> 
> The integrity of this message cannot be guaranteed
> on the Internet. Natexis Banques Populaires can not
> therefore be
> considered responsible for the contents.Any
> unauthorized use or dissemination is prohibited.
> If you are not the intended recipient of this
> message, then please delete it and 
> notify the sender.


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



Re: How to repopulate Form which has html elements withsamename

2003-06-06 Thread Kevin Robair
Second hint: RTFF (Read The Fine FAQ) 

http://jakarta.apache.org/struts/faqs/newbie.html#multiple

-Kevin

--- Gemes Tibor <[EMAIL PROTECTED]> wrote:
> Sashi Ravipati írta:
> 
> >Thanks for the sample and I have that working. But
> my issues is slightly
> >different where there are Multiple HTML elements
> with the same name
> >
> >Eg:  property="name" />
> > property="name" />
> > property="name" />
> > property="name" />
> >
> >Then in this case how do u repopulate the page.
> >  
> >
> Hint: array
> 
> Tib
> 
> 
> 
> 
>
-
> 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: collaborate struts and existing servlet?

2003-06-06 Thread Kevin Robair
Is your struts application and your exisitng servlet
in the same context? They have to be, or else the
sessionIDs will be different. This is a Java
Servlet/JSP issue, not struts.

i.e. This will work.

http://www.someurl.com/application/strutsapp
http://www.someurl.com/application/oldapp

This will not: 

http://www.someurl.com/application/strutsapp
http://www.someurl.com/other/oldapp

I think there may be a way to tell your app server to
group the two together, but I have never done it, I
only vaguely remember reading about it.

-Kevin

--- harris <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have an web application partly using struts and
> partly using typical jsp/servlet pattern.
> I have an issue to share the session between struts
> and existing servlet.
> A session is created in struts seems to differ from
> the session in servlet.
> 
> Is there any way to collaborate between struts and
> existing servlet by using the same sessionId?
> 
> thanks,
> Harris


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



Re: Client-side validation is not working - rich

2003-06-06 Thread Kevin Robair
As one person already noted, we need more information.


A couple of suggestions:

1. Open your browser's javascript console and look for
errors.

2. Don't use requiredif with other validations, such
as mask, if you want client side validation in rc1. It
breaks the client side javascript (you'll know this
right away if you turn on your console.)

-Kevin

--- Rich <[EMAIL PROTECTED]> wrote:
> I am having problems enabling client side
> (JavaScript) validation in struts
> 1.1rc
> 
> I have added these lines in my jsp:
>   ...
>   <%@ taglib uri="/WEB-INF/struts-html.tld"
> prefix="html" %>
>   ...
>   
>   ...
>onsubmit="return
> validateDiaryForm(this);" >
>   ...
> 
> Is there anything else I need to do to get the
> client-side JavaScript
> validation to work.  Right now only the server-side
> is working.
> 
> Thanks,
> 
> Richard Conover
> Developer
> MountainView Software Products and Services
> Gallagher Bassett Services, Inc.
> Phone: 801-544-2446 Ext. 320
> Fax: 866-741-0545
> [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: Subclassing ActionServlet

2003-06-06 Thread Kevin Robair
I just did the same thing, but had no problems. Here
is what I did:

public class ExtendedActionServlet extends
org.apache.struts.action.ActionServlet
{

/** Initializes the servlet.
 */
public void init(ServletConfig config) throws
ServletException
{
super.init(config);
   
App224DataManager.setContextBeans(config.getServletContext());
}


}


Make sure you call super.init(config) , I bet that is
your problem.

-Kevin

--- Jim Collins <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> I have just modified an  application where I now
> subclass ActionServlet. The
> problem is my JSP's that use resources now throws an
> exception about not
> being able to find the key. Are there any issues
> with subclassing
> ActionServlet that I should be aware of.
> 
> Thanks
> 
> Jim.
> 
> 
>
-
> 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]