Can't make html:checkbox CHECKED by default

2004-02-05 Thread otisg
Hello,

I am using  Struts tag, but I am unable to set
it
to a CHECKED state by default (I read the docs).

This is what I am using now: 

 

Is 'value' not the attribute I should use for that?
Which attribute should I use then?

Any help would be appreciated.
Thanks,

Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Re: RE: Looking for junior Java/Struts developers

2004-02-04 Thread otisg
Hello,

Just noticed this thread.
If the original sender is still looking for a Java/Struts
developer, I know several good ones in Zagreb, Croatia.
The cost of living in Croatia is much lower than in the U.S. and
wester Europe, so they are much more affordable.

If you need more information, leads, etc., feel free to contact
me.

Otis




 On Thu, 5 Feb 2004, Andrew Hill
([EMAIL PROTECTED]) wrote:

> Least you can afford a car in Herdon VA. Over here even a
simple Toyota
> Camry will set you back $110k (about $64k US).
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 5 February 2004 00:38
> To: Jiin-Her Lu
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Looking for junior Java/Struts developers
> 
> 
> Jiin-Her hits the nail on the head
>  I certainly wouldn't want to make 50K while living in Boston
or New York
> City...
> Here's the cost of living for Herndon VA
>
http://realestate.yahoo.com/re/neighborhood/search.html?sa=&c=Herndon&s=VA&z
> =
> 
> Cost of living (taxes, expenses, insurance, etc...) can change
from town
> to town even. As the add says you need to move to Herndon VA
to live on
> that 50K. ;)
> 
> -R^3
> 
> On Wed, 4 Feb 2004, Jiin-Her Lu wrote:
> 
> > Depends on when, where, and what is your citizenship. It can
be up to $
> 85000+  in US.
> >
> > Jiin-Her Lu
> > (816) 926-2145
> >
> 
>
-
> 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]
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



html:checkbox - default check state - how?

2004-02-04 Thread otisg
Hello,

I am using html:checkbox Struts tag, but I am unable to set it
to a CHECKED state by default.
I checked the docs for the Struts HTML taglib, but found nothing
that worked.

This is what I am using now (removed gt and lt to avoid HTML
rendition problems): 

 html:checkbox property="foo" value="true"

Any help would be appreciated.
Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Re: ActionMessage(s) + html:messages

2003-12-02 Thread otisg
Hello,

I still haven't resolved the problem described in the original
email, so here is some sample code that should illustrate the
problem with ActionMessage(s) and html:message tags futher.

The code that uses ActionError(s) works when used with
html:messages tag.
The code that uses ActionMessage(s) does _not_ work with
html:messages tag, even though it looks like it should be
equivalent to the lines that use ActionError(s).

  // ActionErrors errors = new ActionErrors();
  ActionMessages errors = new ActionMessages();
  // errors.add(ActionErrors.GLOBAL_ERROR,
 new ActionError("error.auth.failure"));
  errors.add(ActionMessages.GLOBAL_MESSAGE,
   new ActionMessage("error.auth.failure"));
  // saveErrors(request, errors);
  saveMessages(request, errors);
  return mapping.findForward("failure");


I am using html:messages like this:

  

  


The above JSP snippet works fine with ActionError(s) code above,
but _not_ with ActionMessage(s) code, which is also above.

Am I doing something wrong here?

Thanks,
Otis




Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


 On Fri, 28 Nov 2003, otisg ([EMAIL PROTECTED]) wrote:

> Hello,
> 
> I am trying to use ActioMessage(s) + html:messages to display
> error and non-error messages in the UI.
> 
> However, my html:message tag is showing only messages set by
the
> validator, and not the messages that I am trying to set
inside
> an Action, like so:
> 
>   ActionMessages errors = new ActionMessages();
>   errors.add(ActionMessages.GLOBAL_MESSAGE, new
> ActionMessage("error.auth.failure"));
>   saveMessages(request, errors);
>   return mapping.findForward("failure");
> 
> In the JSP layer I use html:messages like this:
> 
>   
> 
>   
> 
>   
> 
> Am I using these two things incorrectly?
> 
> Any help will be appreciated.  I found example usage of
> html:messages in a few Struts-related web pages, but none
> described how it works when you set ActionMessage(s) in an
> Action class.
> 
> Thank you,
> Otis
> 
> 
> 
> 
> Get your own "800" number
> Voicemail, fax, email, and a lot more
> http://www.ureach.com/reg/tag
> 
>
-
> 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]



ActionMessage(s) + html:messages

2003-11-28 Thread otisg
Hello,

I am trying to use ActioMessage(s) + html:messages to display
error and non-error messages in the UI.

However, my html:message tag is showing only messages set by the
validator, and not the messages that I am trying to set inside
an Action, like so:

  ActionMessages errors = new ActionMessages();
  errors.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage("error.auth.failure"));
  saveMessages(request, errors);
  return mapping.findForward("failure");

In the JSP layer I use html:messages like this:

  

  

  

Am I using these two things incorrectly?

Any help will be appreciated.  I found example usage of
html:messages in a few Struts-related web pages, but none
described how it works when you set ActionMessage(s) in an
Action class.

Thank you,
Otis




Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



validwhen released?

2003-07-17 Thread otisg
Hello,

I would like to use validwhen validation rule, but I am unsure
whether the recently released Struts 1.1 includes this.  I heard
that it does, but according to
http://jakarta.apache.org/struts/userGuide/dev_validator.html,
validwhen will be released in a release after the 1.1 release.

I was wondering if anyone can clear this up for me.
Also, if validwhen is not in 1.1, I would be curious to know
when a release with validwhen will be made.  We need this for a
web app that is supposed to go in production by the end of July
2003.

Thank you,
Otis




Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Re: FW: Running unit tests for Validator used with Struts

2003-02-26 Thread otisg
Hello Edgar,

I already am using StrutsTestCase to tests
Actions I write.  I see how that could be
used to test whether validation works, but
unless I'm missing something testing of
custom validators this way would really be
just a side-effect of testing Actions.

So imagine you have an Action A that uses
Validator V.  I write a STC-bases unit test
and run it.  It passes, no problems.  One
day somebody modifies A to stop using V and
modifies V and breaks it.

My STC-bases tests keep running and passing,
because A still works, but I will never find
out that V is broken, because V is never
really tested directly.

A new developer is hired and writes a new
Action, AA, and decides to use V.  V is
broken and his AA class is now broken
because V is kaput.

One could argue that AA should have its unit
tests, too, and that those should show me
that V is (has been) broken

So I will use STC for testing the Validator,
too, but I'm wondering if there is better,
more direct way of testing them?
I can test them directly when they are
Struts-independent, but when they depend on
Struts (e.g. by taking some Struts classes
as params), then I cannot.

Thanks,
Otis




 On Wed, 26 Feb 2003, Edgar P. Dollin
([EMAIL PROTECTED]) wrote:

>  
> > Use StrutsTestCase,
http://strutstestcase.sourceforge.net.  
> > It does the whole struts cycle and
allows test of all struts 
> > components.
> > 
> > Edgar
> > 
> > > -Original Message-
> > > From: otisg [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, February 26, 2003 4:51 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: Q: Running unit tests for
Validator used with Struts
> > > 
> > > 
> > > Hello,
> > > 
> > > It is almost impossible to get anyone
> > > attention on struts-user.
> > > I'm using Struts and Validator with it.
> > > I wrote a custom Validator and want to
write
> > > a unit test for it.
> > > My Validator has a method like this:
> > > 
> > > public static boolean validateStartLetter(
> > > Object bean,
> > > ValidatorAction validatorAction,
> > > Field field,
> > > ActionErrors errors,
> > > HttpServletRequest request
> > > )
> > > {
> > > String value =
> > > ValidatorUtil.getValueAsString(bean,
> > > field.getProperty());
> > > if
> > >
((GenericValidator.isBlankOrNull(value)) ||
> > > !Character.isLetter(value.charAt(0)))
> > > {
> > > errors.add(field.getKey(),
> > > Resources.getActionError(request,
validatorAction, field));
> > > }
> > > 
> > > return errors.isEmpty();
> > > }
> > > 
> > > I am running JUnit from Ant to run my unit
> > > test class.
> > > Apparently this doesn't work because the
> > > instance of ActionErrors passed to this
> > > method is null, causing a NPE.
> > > 
> > > I wanted to check the unit tests for
> > > Validator in Struts (FieldChecks) to
see how
> > > you wrote your unit tests, so that
this NPE
> > > is avoided, but I could not find any unit
> > > tests for it.
> > > Are there really no unit tests there?
> > > 
> > > Regardless, how would you go about running
> > > unit tests for a custom validator from
> > > something like Ant?
> > > 
> > > It seems to me that doing that may be
> > > impossible, because there is no Struts
> > > running to instantiate ActionErrors, there
> > > is no HttpServletRequest, and so on.
> > > 
> > > Is there a way to do this?
> > > 
> > > Thanks,
> > > Otis
> > > 
> > > 
> > >

> > > Get your own "800" number
> > > Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
> > > 
> > > 
> >
-
> > > 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]
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Re: JUnit Error

2003-02-26 Thread otisg
I don't have a solution, but I saw this,
too, but only when running JUnit tests from
Eclipse.  When I run them from Ant I did not
see this problem.

Otis


 On Wed, 26 Feb 2003, Curtney Jacobs
([EMAIL PROTECTED]) wrote:

> Greetings everyone!!
> 
> I don't understand why I am receiving the
following failure from JUnit. I am 
> pretty sure that my log4j.xml file is
properly constructed. 
> 
> I have checked the archive and someone did
post a similiar question, however, 
> there was no reply.
> 
> If you know the cause and solution to this
error please don't be shy and 
> reply.
> 
> _CJ
> 
> unit.framework.AssertionFailedError:
Exception in constructor: testValidLogin 
>
(org.apache.commons.logging.LogConfigurationException:

>
org.apache.commons.logging.LogConfigurationException:

>
org.apache.commons.logging.LogConfigurationException:
Class 
>
org.apache.commons.logging.impl.Log4JLogger
does not implement Log
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:568)
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:265)
>   at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
> -- 
> U-Interface.com
> 
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Decoupling custom Validators from Struts

2003-02-26 Thread otisg
Hello,

All the Validator examples that I have seen
seem to be tightly couples with Struts.
For instance, most validateXXX(...) methods
takes the following types as parameters:
  Object
  ValidatorAction
  Field
  ActionErrors
  HttpServletRequest

Because of presence of ActionErrors, this is
tightly coupled to Struts.
What happens when one day we decide to
replace Struts with XYZ? We have to rewrite
a piece of this Validator.

Because of presence of HttpServletRequest,
thi is usable only in the Web App context.
What happens if we want to use this
Validator in a desktop application?

I am wondering how one would create a custom
Validator that did not have these 2
dependencies (or at least not the Struts
dependency).

If I write a custom Validator with a method
such as:
  validateXXX(Object, Field)

How do I use this method in a Struts
application without passing it instances
Struts-specific classes, such as
ActionErrors, and still somehow end up with
error messages suitable for showing to the
user, etc.?

I have seen code such as the following, but
this would require that a developers
manually inserts error messages into an
instance of ActionErrors, etc.  Is there no
better way?

ValidatorResources resources = new
ValidatorResources();

InputStream rules = 
ValidateExample.class.getResourceAsStream("validator-rules.xml");
ValidatorResourcesInitializer.initialize(resources,
in);

InputStream forms = 
  
ValidateExample.class.getResourceAsStream("validation.xml");
ValidatorResourcesInitializer.initialize(resources,
forms);


// Suppose we already had a CheckoutForm
object created and populated
CheckoutForm form = new CheckoutForm();

// Create a validator with the checkoutForm
Validator validator = new
Validator(resources, "checkoutForm");

// Tell the validator which bean to validate
against.  
validator.addResource(Validator.BEAN_KEY, form);

// Validate the checkoutForm object and
store the validation results
ValidatorResults results = validator.validate();


Thanks.
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



RE: RE: handling form errors in Actions, returning to form, prepopulating them without re-POSTING

2003-02-19 Thread otisg
Hello,

>>>  >>   type= 
>>>
"com.example.action.ProcessCountryFormAction"
>>>   scope= "request"
>>>   name=  "countryForm"
>>>   input= "/SetUpCountryForm">
>>>   >> path="success-page" redirect="false"/>
>>>   >> path="error-page" redirect="false"/>
>>>   

>> Note that the input attribute value must
be the URI and
>> not just the action mapping name. So in your 
>> /ProcessCountryForm configuration, input
should be 
>> /do/SetUpCountryForm or /SetUpCountryForm.do
>> which ever you use.

Alright, thank you!

One more thing, though.
So I have input="/myWebApp/SetUpCountryForm.do"

But this is a real URI.  Who will forward to
this URI?  Does Struts do that somehow
behind the scenes, or do I have to somehow
get the value of 'input' attribute, convert
that into ActionForward somehow, and return
an instance of that ActionForward from my
ProcessCountryForm's execute(...) method?
(e.g. return mapping.getInputForward(); )

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




RE: RE: handling form errors in Actions, returning to form, prepopulating them without re-POSTING

2003-02-19 Thread otisg
Aha!  Thank you for clarifying this.
So, in Struts config-speak, is this all that
is needed to do what you described:



  
  
  
  

  
  
  
  




In addition to this, the actual JSP has to
be non-static, that is, it is JSPs
responsibility to take any data it needs
from the HTTP Request and populate the HTML
form with it, is that correct? (i.e. this is
not done auto-magically by Struts - it is up
to the JSP developer to add code to do that
to the JSP)?

Thank you,
Otis



 On Wed, 19 Feb 2003, Robert Taylor
([EMAIL PROTECTED]) wrote:

> Wrong. If you look more closely I offered
a solution that allows
> you to avoid putting data in session scope.
> 
> 
> "Rick, I usually define the setUpForm
action URI as the input attribute
> of the processForm action element. That
way if a validation error occurs
> the request is forwarded to the setUpForm
action which repopulates the list
> and forwards to the page where my list is
displayed along with the error
> message and the users input.
> 
> Works for me and I don't have to place
anything in the session."
> 
> 
> - SetUpAction prepares the page to be
displayed. For example,
>   populate the form associated with this
action with a list of
>   countries. Let's put the form in request
scope.
> 
> - ProcessAction processes the user input. The
>   input attribute value of the action
element for the 
>   ProcessAction action mapping is defined
to be
>   the uri which invokes the SetUpAction.
> 
> - When a validation error, the appropriate
error messages are
>   created and the request is forwarded to
the SetUpAction where
>   the page is prepared. The request
contains all the user input
>   and the SetUpAction (once again)
populates the countries in 
>   the form.
> 
> - The request is then forwarded to the
.jsp page where the 
>   data which the user entered is rendered
along with their
>   invalid input which caused the
validation errors.
> 
> - Nothing in session scope.
> 
> To answer your specific questions:
> 
> > But how does one do these things:
> > 
> > A. Get the user back the input form
> Upon validation error, struts will forward the
> request to the URI defined in the input
attribute value
> of the action element of the action mapping
> defined for the action which processes the
user input.
> In the above example would be for
ProcessAction. 
> 
> > 
> > B. Display the error message
> Struts validation will create ActionErrors and
> place them in the request. Assuming you
are using
> StrutsValidator.
> 
> 
> > C. Make sure that all possible fields are
> Since the request is forwarded, all user input
> still exists in the request and thus the form.
> 
> 
> > D. The pull-down in the form has that same
> >list of countries
> Since you are being forwarded to the
SetUpAction (see above example)
> your countries will be re-populated.
> 
> robert
> 
> > -Original Message-
> > From: otisg [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 19, 2003 1:37 PM
> > To: Struts Users Mailing List
> > Subject: Re: RE: handling form errors in
Actions, returning to form,
> > prepopulating them without re-POSTING
> > 
> > 
> > Thanks.
> > However, that thread really says one thing -
> > put everything in session scope and don't
> > worry about it :)
> > 
> > But how does one do these things:
> > 
> > A. Get the user back the input form
> > 
> > -- Is it by just finding a 'failure' forward
> > that points to the original JSP with the
form?
> > 
> > B. Display the error message
> > 
> > -- I guess the errors are saved either in
> > Session or Request, ok.
> > 
> > C. Make sure that all possible fields are
> >pre-populated with data that the user
> > already entered
> > 
> > -- Is this up to the JSP develop to do,
> > perhaps with the help of
> >some Struts JSP tags or does this happen
> > automagically?
> > 
> > D. The pull-down in the form has that same
> >list of countries
> > 
> > -- Yes, a developer could just save this in
> > Session scope, but if that is not desired,
> > then how is this re-retrieved if the user it
> > forwarded to a JSP?  The user would need to
> > be re-sent to the original action that
> > retrieved the list, no?
> > 
> > E. The user is not prompted with 'Do you
> >want to re-POST' dialog
> > 
> > -- Does this happen automagically?
> > 
> > Thanks,
> > Otis
> > 
> > 
> > 
> > 
> >  On Wed, 19 

Re: RE: handling form errors in Actions, returning to form, prepopulating them without re-POSTING

2003-02-19 Thread otisg
Thanks.
However, that thread really says one thing -
put everything in session scope and don't
worry about it :)

But how does one do these things:

A. Get the user back the input form

-- Is it by just finding a 'failure' forward
that points to the original JSP with the form?

B. Display the error message

-- I guess the errors are saved either in
Session or Request, ok.

C. Make sure that all possible fields are
   pre-populated with data that the user
already entered

-- Is this up to the JSP develop to do,
perhaps with the help of
   some Struts JSP tags or does this happen
automagically?

D. The pull-down in the form has that same
   list of countries

-- Yes, a developer could just save this in
Session scope, but if that is not desired,
then how is this re-retrieved if the user it
forwarded to a JSP?  The user would need to
be re-sent to the original action that
retrieved the list, no?

E. The user is not prompted with 'Do you
   want to re-POST' dialog

-- Does this happen automagically?

Thanks,
Otis




 On Wed, 19 Feb 2003, Robert Taylor
([EMAIL PROTECTED]) wrote:

>
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg58515.html
> 
> > -Original Message-
> > From: otisg [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 19, 2003 12:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: handling form errors in
Actions, returning to form,
> > prepopulating them without re-POSTING
> > 
> > 
> > Hello,
> > 
> > We are starting to use Struts and are
> > wondering how Struts users handle scenarios
> > such as this one:
> > 
> > 1. /ShowForm action gets called, mapped to
> > ShowFormAction.
> >ShowFormAction pulls a list of countries
> > from the DB (for ex.),
> >stick that list in the HTTP request, and
> > 'forwards' to 'ok', 
> >which is a JSP with a form that consists
> > of blank form fields
> >and a pull-down with countries that it
> > gets from the HTTP req.
> > 
> > 2. A user fills the form, but forgets a
> > required field before he
> >submits the form by POSTing to
> > /SubmitForm action.
> > 
> > 3. /SubmitForm is mapped to SubmitFormAction
> > which detects a
> >missing required field.  Is puts error
> > messages in an instance 
> >of ActionErrors.  It now needs to forward
> > to something other
> >than 'ok'.
> > 
> > What we want to happen at this point is:
> > 
> > A. Get the user back the input form
> > B. Display the error message
> > C. Make sure that all possible fields are
> > pre-populated with
> >data that the user already entered
> > D. The pull-down in the form has that same
> > list of countries
> > E. The user is not prompted with 'Do you
> > want to re-POST' dialog
> > 
> > How can this be done?
> > 
> > In our Struts config we have:
> > 
> > 
> >  > type= 
> > "net.wgen.ampng.action.ShowFormAction"
> > scope= "request">
> >  > path="/WEB-INF/v/form-ok.jsp"/>
> >  > path="/WEB-INF/v/form-not.jsp"/>
> > 
> > 
> > 
> >  > type= 
> > "net.wgen.ampng.action.SubmitFormAction"
> > scope= "request"
> > validate=  "true"
> > name=  "myForm"
> > input=
"/WEB-INF/v/form.jsp">
> >  > path="/WEB-INF/v/ok.jsp"/>
> >  > path="/WEB-INF/v/form.jsp"/>
> > 
> > 
> > 
> > What is the best way to handle this and
> > achieve A, B, C, D, and E that I mentioned
> > above?
> > 
> > If SubmitFormAction encounters an error
> > (e.g. a missing required field), what should
> > it forward to?  The original JSP in 'input'
> > attribute?  The JSP mapped to 'failure' (the
> > same JSP with the original form)?
> > Should it forward/chain to another Action
> > that redirects back to the original form?
> > (but that would lose the form data + error
> > messages in the Request, wouldn't it?) 
> > Something else?
> > Does the JSP with the form need to contain
> > the logic for pulling errors + form data
> > from the request, if it exists?
> > 
> > This seems like a situation that would be
> > very common and I feel that Struts has some
> > elegant way for handling this.
> > 
> > Thank you,
> > Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




handling form errors in Actions, returning to form, prepopulating them without re-POSTING

2003-02-19 Thread otisg
Hello,

We are starting to use Struts and are
wondering how Struts users handle scenarios
such as this one:

1. /ShowForm action gets called, mapped to
ShowFormAction.
   ShowFormAction pulls a list of countries
from the DB (for ex.),
   stick that list in the HTTP request, and
'forwards' to 'ok', 
   which is a JSP with a form that consists
of blank form fields
   and a pull-down with countries that it
gets from the HTTP req.

2. A user fills the form, but forgets a
required field before he
   submits the form by POSTing to
/SubmitForm action.

3. /SubmitForm is mapped to SubmitFormAction
which detects a
   missing required field.  Is puts error
messages in an instance 
   of ActionErrors.  It now needs to forward
to something other
   than 'ok'.

What we want to happen at this point is:

A. Get the user back the input form
B. Display the error message
C. Make sure that all possible fields are
pre-populated with
   data that the user already entered
D. The pull-down in the form has that same
list of countries
E. The user is not prompted with 'Do you
want to re-POST' dialog

How can this be done?

In our Struts config we have:














What is the best way to handle this and
achieve A, B, C, D, and E that I mentioned
above?

If SubmitFormAction encounters an error
(e.g. a missing required field), what should
it forward to?  The original JSP in 'input'
attribute?  The JSP mapped to 'failure' (the
same JSP with the original form)?
Should it forward/chain to another Action
that redirects back to the original form?
(but that would lose the form data + error
messages in the Request, wouldn't it?) 
Something else?
Does the JSP with the form need to contain
the logic for pulling errors + form data
from the request, if it exists?

This seems like a situation that would be
very common and I feel that Struts has some
elegant way for handling this.

Thank you,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Writing unit tests for custom Validators

2003-02-06 Thread otisg
Hello,

I am wondering how people write unit tests
for Validators for Struts.
Examples of Validators that I have seen all
take arguments such as:
org.apache.commons.validator.Field
org.apache.commons.validator.ValidatorAction

It seems that these 2 classes take
information from validator-rules.xml and
validation.xml files and I assume Struts
takes care of instantiating Field and
ValidatorAction properly based on these files.

But if I want to write a unit test, how do I
instantiate Field and ValidatorAction with
the information from those 2 Validator files?

Do people use
org.apache.struts.util.StrutsValidatorUtil
to get this information from Struts and then
use that to instantiate Field and
ValidatorAction properly?

Are there any examples of that anywhere, so
I can get the starting skeleton?

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




RE: RE: Validator won't kick-in

2003-02-05 Thread otisg
Yes, I have that, too:






And these files really are included in the WAR:

  3380 Tue Feb 04 19:33:00 EST 2003
WEB-INF/struts-config-amp.xml
 39699 Tue Feb 04 16:19:22 EST 2003
WEB-INF/validator-rules.xml
  3048 Tue Feb 04 18:58:30 EST 2003
WEB-INF/validation-amp.xml
  1261 Tue Feb 04 16:19:22 EST 2003
WEB-INF/validator-rules-amp.xml


Could it be the indentation? (I know, would
be crazy, but...)

Thanks,
Otis


 On Wed, 5 Feb 2003, Pani, Gourav
([EMAIL PROTECTED]) wrote:

> I had this strange issue where the plugin
had to be initialized at the
> bottom of the struts-config.xml to get it
to work.
> 
>   
> 
> 
> 
> 
> -Original Message-
> From: otisg [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 05, 2003 10:04 AM
> To: Stuart Jameson; Struts Users Mailing List
> Subject: RE: RE: Validator won't kick-in
> 
> 
> Hello,
> 
> No, I don't have that.
> I jut added it and tried it, but it didn't
> change anything - Validator still didn't
> kick in.
> I have not seen this mentioned in any docs.
> 
> Any help would be appreciated.
> 
> Thank you,
> Otis
> 
> 
> 
> 
>  On Wed, 5 Feb 2003, Stuart Jameson
> ([EMAIL PROTECTED]) wrote:
> 
> > In web xml there is the following is it
> set for you?
> > 
> > 
> >validate
> >true
> > 
> > 
> > 
> > > -Original Message-
> > > From: otisg [mailto:[EMAIL PROTECTED]] 
> > > Sent: 04 February 2003 23:00
> > > To: Tennent, Erik
> > > Subject: Re: RE: Validator won't kick-in
> > > 
> > > 
> > > Yes I did :)
> > > My original email actually shows that my
> > > 'loginForm' is of type
> org.apache.struts.validator.DynaValidatorForm
> > > 
> > > I am also using input="..." in the action
> > > mapping.
> > > 
> > > Here is the action mapping in question:
> > > 
> > >  > > type= 
> > > "com.example.action.LoginAction"
> > > scope= "request"
> > > validate=  "true"
> > > name=  "loginForm"
> > > input=
> > > "/WEB-INF/shell/login.jsp">
> > >  > > path="/WEB-INF/shell/home.jsp"/>
> > >  > > path="/WEB-INF/shell/login.jsp"/>
> > > 
> > > 
> > > 
> > > Thanks,
> > > Otis
> > > 
> > > 
> > >  On Tue, 4 Feb 2003, Tennent, Erik
> > > ([EMAIL PROTECTED]) wrote:
> > > 
> > > > Did you remember to extend ValidatorForm
> > > or ValidatorActionForm? 
> > > > 
> > > > On a side note, with the ValidatorForm,
> > > you also have to define an
> > > > input="/SomeAction.do" inside of your
> > >  tag so struts knows where
> > > > to forward to if there is an error. The
> > > input can also refer to a jsp page
> > > > or a tiles def.
> > > > 
> > > >  > > type="hotel.HotelSaveAction"
> name="HotelForm"
> > > > validate="true" scope="request"
> > > input="hotelEdit">
> > > >   > > path="hotelDisplay" redirect="false" />
> > > > 
> > > > 
> > > > -ET
> > > > 
> > > > > -Original Message-
> > > > > From: otisg [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Tuesday, February 04, 2003
3:16 PM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: Validator won't kick-in
> > > > > 
> > > > > 
> > > > > Hello,
> > > > > 
> > > > > I am trying to use Commons Validator
> with
> > > > > Struts, but I can't get it to 'kick
> in'.  I
> > > > > am using the CVS HEAD version of
> Struts and
> > > > > Taglibs, and Validator I just built
> from CVS
> > > > > the other day.
> > > > > 
> > > > > My Struts config has a 'loginForm'
> > > defined as:
> > > > > 
> > > > >  > > > >   
> > > > >
> > >
>
type="org.apache.struts.validator.DynaValidatorForm">
> > > > >  

RE: RE: Validator won't kick-in

2003-02-05 Thread otisg
Hello,

No, I don't have that.
I jut added it and tried it, but it didn't
change anything - Validator still didn't
kick in.
I have not seen this mentioned in any docs.

Any help would be appreciated.

Thank you,
Otis




 On Wed, 5 Feb 2003, Stuart Jameson
([EMAIL PROTECTED]) wrote:

> In web xml there is the following is it
set for you?
> 
> 
>validate
>true
> 
> 
> 
> > -Original Message-
> > From: otisg [mailto:[EMAIL PROTECTED]] 
> > Sent: 04 February 2003 23:00
> > To: Tennent, Erik
> > Subject: Re: RE: Validator won't kick-in
> > 
> > 
> > Yes I did :)
> > My original email actually shows that my
> > 'loginForm' is of type
org.apache.struts.validator.DynaValidatorForm
> > 
> > I am also using input="..." in the action
> > mapping.
> > 
> > Here is the action mapping in question:
> > 
> >  > type= 
> > "com.example.action.LoginAction"
> > scope= "request"
> > validate=  "true"
> > name=  "loginForm"
> > input=
> > "/WEB-INF/shell/login.jsp">
> >  > path="/WEB-INF/shell/home.jsp"/>
> >  > path="/WEB-INF/shell/login.jsp"/>
> > 
> > 
> > 
> > Thanks,
> > Otis
> > 
> > 
> >  On Tue, 4 Feb 2003, Tennent, Erik
> > ([EMAIL PROTECTED]) wrote:
> > 
> > > Did you remember to extend ValidatorForm
> > or ValidatorActionForm? 
> > > 
> > > On a side note, with the ValidatorForm,
> > you also have to define an
> > > input="/SomeAction.do" inside of your
> >  tag so struts knows where
> > > to forward to if there is an error. The
> > input can also refer to a jsp page
> > > or a tiles def.
> > > 
> > >  > type="hotel.HotelSaveAction"
name="HotelForm"
> > > validate="true" scope="request"
> > input="hotelEdit">
> > >   > path="hotelDisplay" redirect="false" />
> > > 
> > > 
> > > -ET
> > > 
> > > > -Original Message-
> > > > From: otisg [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, February 04, 2003 3:16 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Validator won't kick-in
> > > > 
> > > > 
> > > > Hello,
> > > > 
> > > > I am trying to use Commons Validator
with
> > > > Struts, but I can't get it to 'kick
in'.  I
> > > > am using the CVS HEAD version of
Struts and
> > > > Taglibs, and Validator I just built
from CVS
> > > > the other day.
> > > > 
> > > > My Struts config has a 'loginForm'
> > defined as:
> > > > 
> > > >  > > >   
> > > >
> >
type="org.apache.struts.validator.DynaValidatorForm">
> > > >  > > > type="java.lang.String"/>
> > > >  > > > type="java.lang.String"/>
> > > > 
> > > > 
> > > > 
> > > > The 2 Validator's files are defined
properly
> > > > in Struts config via .
> > > > 
> > > > IN Struts config I have /Login
action tied
> > > > to the loginForm form.  I also have
> > > > validate="true" set in the action
mapping
> > > > (is this needed?).
> > > > 
> > > > 
> > > > In my JSP that contains this loginForm I
> > > > have action=/Login in the HTML form.
 Fields
> > > > are 'username' and 'password'.
> > > > 
> > > > 
> > > > My validation.xml contains:
> > > > 
> > > > 
> > > >  > > > depends="required">
> > > >  > > > key="Required Called" resource="false"/>
> > > > 
> > > >  > > > depends="required">
> > > > 
> > > > 
> > > > 
> > > > 
> > > > My Action class does not contain any
code
> > > > that calls form.validate(mapping,
request).
&

Re: RE: Validator won't kick-in

2003-02-04 Thread otisg
Yes I did :)
My original email actually shows that my
'loginForm' is of type
org.apache.struts.validator.DynaValidatorForm

I am also using input="..." in the action
mapping.

Here is the action mapping in question:







Thanks,
Otis


 On Tue, 4 Feb 2003, Tennent, Erik
([EMAIL PROTECTED]) wrote:

> Did you remember to extend ValidatorForm
or ValidatorActionForm? 
> 
> On a side note, with the ValidatorForm,
you also have to define an
> input="/SomeAction.do" inside of your
 tag so struts knows where
> to forward to if there is an error. The
input can also refer to a jsp page
> or a tiles def.
> 
>  validate="true" scope="request"
input="hotelEdit">
>  
> 
> 
> -ET
> 
> > -Original Message-
> > From: otisg [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 04, 2003 3:16 PM
> > To: [EMAIL PROTECTED]
> > Subject: Validator won't kick-in
> > 
> > 
> > Hello,
> > 
> > I am trying to use Commons Validator with
> > Struts, but I can't get it to 'kick in'.  I
> > am using the CVS HEAD version of Struts and
> > Taglibs, and Validator I just built from CVS
> > the other day.
> > 
> > My Struts config has a 'loginForm'
defined as:
> > 
> >  >   
> >
type="org.apache.struts.validator.DynaValidatorForm">
> >  > type="java.lang.String"/>
> >  > type="java.lang.String"/>
> > 
> > 
> > 
> > The 2 Validator's files are defined properly
> > in Struts config via .
> > 
> > IN Struts config I have /Login action tied
> > to the loginForm form.  I also have
> > validate="true" set in the action mapping
> > (is this needed?).
> > 
> > 
> > In my JSP that contains this loginForm I
> > have action=/Login in the HTML form.  Fields
> > are 'username' and 'password'.
> > 
> > 
> > My validation.xml contains:
> > 
> > 
> >  > depends="required">
> >  > key="Required Called" resource="false"/>
> > 
> >  > depends="required">
> > 
> > 
> > 
> > 
> > My Action class does not contain any code
> > that calls form.validate(mapping, request).
> >  I don't think this is needed - I think
> > everything should work as defined
> > declaratively in these
filesautomagically :)
> > ...
> > ...but it does not do that (for me) :(
> > 
> > 
> > I've read Chapter 11 of Cavaness' book a few
> > times and according to him what I described
> > above should suffice.
> > 
> > When I go to my login page with the login
> > form and leave the username completely blank
> > I expect to get an error...but I don't
get it.
> > 
> > One more thing that may be worth mentioning,
> > my Action class has:
> > 
> > return
mapping.findForward("success");
> > 
> > And the JSP defined for this "success"
contains:
> > 
> > 
> > 
> > I expect this to show me Validator's errors.
> > I get no application errors, all looks good,
> > too good - I want to see that error about a
> > missing required username field :)
> > 
> > Thanks,
> > Otis
> > 
> > 
> >

> > Get your own "800" number
> > Voicemail, fax, email, and a lot more
> > http://www.ureach.com/reg/tag
> > 
> >
-
> > 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]
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Validator won't kick-in

2003-02-04 Thread otisg
Hello,

I am trying to use Commons Validator with
Struts, but I can't get it to 'kick in'.  I
am using the CVS HEAD version of Struts and
Taglibs, and Validator I just built from CVS
the other day.

My Struts config has a 'loginForm' defined as:







The 2 Validator's files are defined properly
in Struts config via .

IN Struts config I have /Login action tied
to the loginForm form.  I also have
validate="true" set in the action mapping
(is this needed?).


In my JSP that contains this loginForm I
have action=/Login in the HTML form.  Fields
are 'username' and 'password'.


My validation.xml contains:










My Action class does not contain any code
that calls form.validate(mapping, request).
 I don't think this is needed - I think
everything should work as defined
declaratively in these filesautomagically :)
...
...but it does not do that (for me) :(


I've read Chapter 11 of Cavaness' book a few
times and according to him what I described
above should suffice.

When I go to my login page with the login
form and leave the username completely blank
I expect to get an error...but I don't get it.

One more thing that may be worth mentioning,
my Action class has:

return mapping.findForward("success");

And the JSP defined for this "success" contains:



I expect this to show me Validator's errors.
I get no application errors, all looks good,
too good - I want to see that error about a
missing required username field :)

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Re: RE: en_US prefix for resource key? Why?

2003-02-04 Thread otisg
Bingo!
Thanks.

Otis

 On Tue, 4 Feb 2003, Karr, David
([EMAIL PROTECTED]) wrote:

> > -Original Message-
> > From: otisg [mailto:[EMAIL PROTECTED]]
> > 
> > I am trying to make use of ActionError(s)
> > and messages defined in resource files, but
> > instead of an appropriate error message I
> > get something like
> > "???en_US.amp.error.invalidLogin???"
> > I know why I get the resource key instead of
> > "", but I shouldn't be getting the resource
> > key - I want to get the resource value text.
> > 
> > My resources file is called
> > AMPResources.properties and is defined in
> > Struts config as:
> > 
> >  >   
parameter="AMPResources"/>
> > 
> > The AMPResources.properties file is in
> > /WEB-INF in the WAR.
> > 
> > Is the file named wrong?  Why the en_US
prefix?
> 
> No, it's not named wrong, it's just in the
wrong place.  It needs to be
> in "WEB-INF/classes".
> 
> 
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Re: Do I have to set a classpath? If so, how?

2003-02-04 Thread otisg
That fooManager is not in a package?  If so,
I'd imagine you need to specify it, no?
Just a guess...

Otis

 On Tue, 4 Feb 2003, David Haynes
([EMAIL PROTECTED]) wrote:

> Newbie developer here:
>  
> I have a bean (fooManager) that is sitting
in the /WEB-INF/classes
> space.
> I am referencing it in a jsp as
 scope="session"/>
>  
> When I access the jsp, I get a "Cannot
resolve symbol" for fooManager.
>  
> I thought that the classpath was
automatically populated with classes
> from the /WEB-INF/classes directory.
> Do I need to generate a jar? Set up
something in the web.xml?
>  
> Details:
> Tomcat 4.1, Java 1.4
>  
> Thanks!
> -david-
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




en_US prefix for resource key? Why?

2003-02-04 Thread otisg
Hello,

This must be a simple one to answer to
experienced Struts / JSP / taglib users.  I
am using the latest Struts (CVS HEAD) with
Taglibs.

I am trying to make use of ActionError(s)
and messages defined in resource files, but
instead of an appropriate error message I
get something like
"???en_US.amp.error.invalidLogin???"
I know why I get the resource key instead of
"", but I shouldn't be getting the resource
key - I want to get the resource value text.

My resources file is called
AMPResources.properties and is defined in
Struts config as:




My JSP file contains:




My Action class contains this:

ActionErrors errors = new ActionErrors();
errors.add("username", new
ActionError("amp.error.invalidLogin"));

if (!errors.isEmpty())
{
saveErrors(request, errors);
return mapping.getInputForward(); //
login.jsp
}


The AMPResources.properties file is in
/WEB-INF in the WAR.

Is the file named wrong?  Why the en_US prefix?

Thanks,
Otis
P.S.
My problem is similar to this one:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg52074.html



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Re: Re: How to forward from a struts form to a login dialog ?

2002-12-31 Thread otisg
Oh, one more thing.
Note how in this servlet filter some
application-specific URIs are hard-coded. 
It would be more elegant, IMHO, to declare
those elsewhere.
Also, instead of sending a redirect to a
hard-coded URI, one could use sendError with
401 code (unauthorized) and then handle 401
declaratively in web.xml, like this for
instance:


401
/loginView.do


What do people think?  Is this better or not?

Thanks,
Otis

 On Tue, 31 Dec 2002, Ronald Mathies
([EMAIL PROTECTED]) wrote:

> I've added some files as an example. How i
manage the user sessions.
> 
> 
> - Original Message -
> From: "Arik Levin ( Tikal )"
<[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'"
<[EMAIL PROTECTED]>
> Sent: Tuesday, December 31, 2002 11:59 AM
> Subject: RE: How to forward from a struts
form to a login dialog ?
> 
> 
> > There are two main solutions:
> >
> > The first one is more effective,
including JAAS.
> > You have to make a form that call
j_security_check action with j_password
> > and j_username inputs, the web server
has its own security engine that
> > throws you to your first login page if
you are not authorized.
> >
> > The second solution is simpler. You make
a base action which store your
> user
> > information at the HttpSession after it
has been authorized. Every action
> > you have at your application should
extend this base action. In case of
> > session timeout or user not authorized
just forward to your login page.
> >
> > I hope this helps you.
> >
> > Arik.
> >
> > -Original Message-
> > From: Zsolt Koppany [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, November 07, 2002 11:18 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to forward from a struts
form to a login dialog ?
> >
> > Hi,
> >
> > in a struts form I want to check whether
to user has already logged in. If
> > not, instead of showing the form I want
to forward the user to a login
> > dialog
> > and he must log in. After the user
logged in, I want him to come back to
> the
> >
> > form and I have to restore the original
parameters of the form.
> >
> > What is the best solution?
> >
> >
> > Zsolt
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> >

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

> > For additional commands, e-mail:
> 
> >
> >
> 
> 
> 
> /*
>  * $Archive:  $
>  *
>  * $Workfile:  $
>  * $Revision:  $
>  * $Date:  $
>  * $Author:  $
>  *
>  * Copyright 2002 J-Instance. All Rights
Reserved.
>  *
>  * This software is the proprietary
information of J-Instance.
>  * Use is subject to license terms.
>  *
>  */
> 
> package com.jinstance.ibep.login;
> 
> import org.apache.struts.action.*;
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> import javax.naming.*;
> 
> import org.apache.commons.beanutils.*;
> 
> import com.jinstance.ibep.action.*;
> 
> // RMA:
> import org.apache.log4j.PropertyConfigurator;
> import org.apache.log4j.Logger;
> import org.apache.log4j.Priority;  
> 
> public class LoginAction extends
DefaultAction  {
> 
>   static Logger logger =
Logger.getLogger(LoginAction.class.getName());
> 
>   private String sessionUsernamePath;
> 
>   private String loginname,
>  password;
>   
> 
>   /**
>* This is the main action called from
the Struts framework.
>* @param mapping The ActionMapping used
to select this instance.
>* @param form The optional ActionForm
bean for this request.
>* @param request The HTTP Request we
are processing.
>* @param response The HTTP Response we
are processing.
>*/
>   public ActionForward
execute(ActionMapping mapping, ActionForm
form, HttpServletRequest request,
> HttpServletResponse response) throws
IOException, ServletException {
> 
>
PropertyConfigurator.configure("log4j.properties");
> 
> logger.
> 
> ActionErrors ae = new ActionErrors();
> 
> /** Get the path to the username for
this application. */
> sessionUsernamePath =
getSessionUsernamePath();
> 
> try {
> 
>   /** Retrieve the login data from the
form. */
>   loginname =
(String)PropertyUtils.getSimpleProperty(form,
"loginname");
>   password =
(String)PropertyUtils.getSimpleProperty(form,
"password");
> 
> } catch (Exception e) {
>logger.error("Missing loginname or
password method within the LoginActionForm", e);
>System.out.println (e);
> }
> 
> /** Create a user session. */
> HttpSession session =
request.getSession(true);
> 
> /** Set the username at the path
specified in the web.xml file */
>
session.setAttribute(sessionUsernamePath,
loginname);
> 
> logger.info("User " + loginname + "
succesfully logged into the application");
> 
> return
mapping.findForward(ACTION_SUCCESS);
>   }
> 
>   private String getSessionUsernamePath()
throws ServletException {
> try {
>   Context context 

Re: Re: How to forward from a struts form to a login dialog ?

2002-12-31 Thread otisg
Hello,

Thanks for the classes, I am doing the same
thing.
Question:
- What's the advantage of using the entry in
web.xml (maybe you can also send web.xml?),
and doing the naming lookups, etc. versus
just storing an object in a HttpSession and
checking if it is null or not (as you are
doing as well).
What does the naming stuff give you?

Just curious...
Thanks,
Otis
 



 On Tue, 31 Dec 2002, Ronald Mathies
([EMAIL PROTECTED]) wrote:

> I've added some files as an example. How i
manage the user sessions.
> 
> 
> - Original Message -
> From: "Arik Levin ( Tikal )"
<[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'"
<[EMAIL PROTECTED]>
> Sent: Tuesday, December 31, 2002 11:59 AM
> Subject: RE: How to forward from a struts
form to a login dialog ?
> 
> 
> > There are two main solutions:
> >
> > The first one is more effective,
including JAAS.
> > You have to make a form that call
j_security_check action with j_password
> > and j_username inputs, the web server
has its own security engine that
> > throws you to your first login page if
you are not authorized.
> >
> > The second solution is simpler. You make
a base action which store your
> user
> > information at the HttpSession after it
has been authorized. Every action
> > you have at your application should
extend this base action. In case of
> > session timeout or user not authorized
just forward to your login page.
> >
> > I hope this helps you.
> >
> > Arik.
> >
> > -Original Message-
> > From: Zsolt Koppany [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, November 07, 2002 11:18 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to forward from a struts
form to a login dialog ?
> >
> > Hi,
> >
> > in a struts form I want to check whether
to user has already logged in. If
> > not, instead of showing the form I want
to forward the user to a login
> > dialog
> > and he must log in. After the user
logged in, I want him to come back to
> the
> >
> > form and I have to restore the original
parameters of the form.
> >
> > What is the best solution?
> >
> >
> > Zsolt
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> >

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

> > For additional commands, e-mail:
> 
> >
> >
> 
> 
> 
> /*
>  * $Archive:  $
>  *
>  * $Workfile:  $
>  * $Revision:  $
>  * $Date:  $
>  * $Author:  $
>  *
>  * Copyright 2002 J-Instance. All Rights
Reserved.
>  *
>  * This software is the proprietary
information of J-Instance.
>  * Use is subject to license terms.
>  *
>  */
> 
> package com.jinstance.ibep.login;
> 
> import org.apache.struts.action.*;
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> import javax.naming.*;
> 
> import org.apache.commons.beanutils.*;
> 
> import com.jinstance.ibep.action.*;
> 
> // RMA:
> import org.apache.log4j.PropertyConfigurator;
> import org.apache.log4j.Logger;
> import org.apache.log4j.Priority;  
> 
> public class LoginAction extends
DefaultAction  {
> 
>   static Logger logger =
Logger.getLogger(LoginAction.class.getName());
> 
>   private String sessionUsernamePath;
> 
>   private String loginname,
>  password;
>   
> 
>   /**
>* This is the main action called from
the Struts framework.
>* @param mapping The ActionMapping used
to select this instance.
>* @param form The optional ActionForm
bean for this request.
>* @param request The HTTP Request we
are processing.
>* @param response The HTTP Response we
are processing.
>*/
>   public ActionForward
execute(ActionMapping mapping, ActionForm
form, HttpServletRequest request,
> HttpServletResponse response) throws
IOException, ServletException {
> 
>
PropertyConfigurator.configure("log4j.properties");
> 
> logger.
> 
> ActionErrors ae = new ActionErrors();
> 
> /** Get the path to the username for
this application. */
> sessionUsernamePath =
getSessionUsernamePath();
> 
> try {
> 
>   /** Retrieve the login data from the
form. */
>   loginname =
(String)PropertyUtils.getSimpleProperty(form,
"loginname");
>   password =
(String)PropertyUtils.getSimpleProperty(form,
"password");
> 
> } catch (Exception e) {
>logger.error("Missing loginname or
password method within the LoginActionForm", e);
>System.out.println (e);
> }
> 
> /** Create a user session. */
> HttpSession session =
request.getSession(true);
> 
> /** Set the username at the path
specified in the web.xml file */
>
session.setAttribute(sessionUsernamePath,
loginname);
> 
> logger.info("User " + loginname + "
succesfully logged into the application");
> 
> return
mapping.findForward(ACTION_SUCCESS);
>   }
> 
>   private String getSessionUsernamePath()
throws ServletException {
> try {
>   Context context = new InitialContext();
>   return
(String)context.lookup("java:comp/

Re: Re: DispatchAction and 'input' param in struts-config

2002-12-27 Thread otisg
If I understand you correctly, those 2 pages
would then be _nearly_ identical - the main
difference would be that one may have a form
with:



while the other one may have:




Is that what you are saying?

I think I was just forcing the use of
DispatchAction in my particular case.  Yes,
when 2 operations are _really_ similar, then
this will work, but when they are not very
similar, then one may be better of just
having 2 distinct Action classes.

Thanks,
Otis


 On Fri, 27 Dec 2002, Max Kremer
([EMAIL PROTECTED]) wrote:

> Hey Otis,
> 
> > Multiple but identical pages, is what you
> > are saying?
> > If that is so, then I am doing something
> > wrong, and that is probably that I am
> > forcing the use of DispatchAction when I
> > should really be using 2 distinct Action
> > classes instead.
> 
> No, you don't multiple identical pages.
There should be no need for that.
> The page should dynamically decide which
method in the dispatch to call by
> setting a value for the parameter name
defined by the "parameter" attribute
> in the action config in the struts-config.xml.
> For example, I have the following action:
> 
>  scope="request" input="/MainMenu.jsp"
parameter="op_type">
> 
> So I set the parameter called "op_type" to
be the name of the action method
> that should process the form.
> So if op_type = save then the save method
is called.
> 
> 
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Re: Re: DispatchAction and 'input' param in struts-config

2002-12-27 Thread otisg
Hello,

>What you should use the DispatchAction
for is grouping related
> operations. For instance creating a new
item and updating an existing item.
> These both use the same input forms. If
you have two operation that are
> unrelated and depend on two different
ActionForms then you should make them
> independent actions.

Okay.

> In your case you can merge all the
properties from both operation into one
> single ActionForm and then use the ones
you need in each method of the
> DispatchAction.

Okay.

> As for the input attribute in the config,
you can make that
> anything you want. Just create multiple
JSPs to submit to your
> DispatchAction.

Multiple but identical pages, is what you
are saying?
If that is so, then I am doing something
wrong, and that is probably that I am
forcing the use of DispatchAction when I
should really be using 2 distinct Action
classes instead.

Thanks,
Otis


> ----- Original Message -
> From: "otisg" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 27, 2002 2:39 PM
> Subject: DispatchAction and 'input' param
in struts-config
> 
> 
> > Hello,
> >
> > When using DispatchAction to group multiple
> > activities in a single action class, how
> > does one deal with struts-config.xml?  I
> > didn't see this addressed in any Struts
> > articles nor in the Javadoc.
> >
> > In particular, how does one use action's
> > "name", "input" and "validate" attributes of
> > the "action" element?
> >
> > One can specify only 1 "name", and only 1
> > "input", but if one if grouping multiple
> > activities in a single action class, there
> > are usually multiple names (forms) and
> > inputs (pages with forms).
> >
> > Example:
> > Consider AccountManager class (a subclass of
> > DispatchAction) with 2 methods: create
and edit.
> > The 'Create Screen' might contain a form
> > with only 2 fields:
> > first name, and last name.
> > The 'Edit Screen' may contain a form with
> > more fields:
> > email, address, etc.
> >
> > So how does one specify "name" and "input"
> > here, when there are really 2 different
> > names and inputs here?
> >
> > Does one have to code the templates/pages
> > with the logic that renders the appropriate
> > form based on the activity (create or edit)?
> >
> >
> > Similarly, what happens with 'validate'
> > attribute of an action?
> > How does one determine which activity is
> > occurring when validate method is called, so
> > that the correct fields can be validated?
> > In the above example, how does one know
> > whether Create or Edit activity is
happening?
> >
> > Thanks,
> > Otis
> >
> >
> >

> > Get your own "800" number
> > Voicemail, fax, email, and a lot more
> > http://www.ureach.com/reg/tag
> >
> > --
> > To unsubscribe, e-mail:
>
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> > -
> >
> >
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




DispatchAction and 'input' param in struts-config

2002-12-27 Thread otisg
Hello,

When using DispatchAction to group multiple
activities in a single action class, how
does one deal with struts-config.xml?  I
didn't see this addressed in any Struts
articles nor in the Javadoc.

In particular, how does one use action's
"name", "input" and "validate" attributes of
the "action" element?

One can specify only 1 "name", and only 1
"input", but if one if grouping multiple
activities in a single action class, there
are usually multiple names (forms) and
inputs (pages with forms).

Example:
Consider AccountManager class (a subclass of
DispatchAction) with 2 methods: create and edit.
The 'Create Screen' might contain a form
with only 2 fields:
first name, and last name.
The 'Edit Screen' may contain a form with
more fields:
email, address, etc.

So how does one specify "name" and "input"
here, when there are really 2 different
names and inputs here?

Does one have to code the templates/pages
with the logic that renders the appropriate
form based on the activity (create or edit)?


Similarly, what happens with 'validate'
attribute of an action?
How does one determine which activity is
occurring when validate method is called, so
that the correct fields can be validated?
In the above example, how does one know
whether Create or Edit activity is happening?

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




DispatchAction - misleading Javadocs

2002-12-27 Thread otisg
Hello,

I would like to use DispatchAction, which
allows multiple 'execute'-like methods in a
single class.
One problem: DispatchAction's Javadocs do
not say how to configure struts-config.xml
to point to one's DispatchAction Action (the
Action that subclasses DispatchAction).

The Javadocs contain this example:




Oh, I see.  The problem in the above
example is the poor choice of 'type'
attribute's value.

The examples at
http://www.jguru.com/faq/view.jsp?EID=897290
are much better.
The example in the Javadoc is misleading.

It would be much better to use something like:
  type="com.example.actions.MyDispatchAction"

Hopefully Struts' developers are watching...

Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




DynaValidatorForm vs. DynaValidatorActionForm ?

2002-12-26 Thread otisg
Hello,

I am looking at the Javadoc for
DynaValidatorForm and DynaValidatorActionForm:
http://jakarta.apache.org/struts/api/org/apache/struts/validator/DynaValidatorForm.html
http://jakarta.apache.org/struts/api/org/apache/struts/validator/DynaValidatorActionForm.html

I am wondering what exactly the difference
between them is.

Judging from the Javadoc it looks like
DynaValidatorActionForm overrides validate
method of DynaValidatorForm, but the Javadoc
does not indicate what is different in the
implementation of DynaValidatorActionForm's
validate implementation.

Does anyone know?

I looked at the source, and the method
implementations look identical.
Are there future plans that will make them
different?

I am just trying to decide which one to use.
 All Struts articles that mention these 2
classes are super vague about which one to
use.  They just say use one or the other. 
But when should I prefer to use one or the
other?

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




(solved) Re: Re: Can't map HTML form action to Struts action

2002-12-24 Thread otisg
For those who see this error in the future:

This turned out to be a problem with
slightly invalid XML in struts-config.xml,
not web.xml, as the error may lead you to
believe.
The tool that helped me figure this out was
James Holmes' Struts Console application. 
Nice work, thanks.

Otis


 On Tue, 24 Dec 2002, otisg
([EMAIL PROTECTED]) wrote:

> Hello,
> 
> I see.  I thought
>
org.apache.velocity.tools.view.servlet.VelocityViewServlet
> replaces Struts' ActionServlet.  However, it
> seems that it is not an alternative Action
> Servlet for use with Velocity, as I thought,
> but rather an additional servlet capable of
> dealing with Velocity templates, and not
> with action mappings and such.
> 
> I still have a slight problem:
> 
> [2002/12/24 09:26:18] init exception for
> `action'
> javax.servlet.UnavailableException: Parsing
> error processing resource path
> at
>
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:931)
> at
>
org.apache.struts.action.ActionServlet.init(ActionServlet.java:454)
> 
> That 'action' must be referring to this part
> from web.xml:
> 
> 
> action
>
>
org.apache.struts.action.ActionServlet
> 
> config
>
>
/WEB-INF/struts-config.xml
> 
> 
> debug
> 2
> 
> 
> detail
> 2
> 
> 
> validate
> true
> 
> 2
> 
> 
> 
> action
> *.do
> 
> 
> 
> Am I doing something wrong?  This is a
> copied from one of the Struts examples.
> It looks fine to me...
> 
> Thanks,
> Otis
> 
> 
> 
>  On Tue, 24 Dec 2002, Jitendra Singh
> ([EMAIL PROTECTED]) wrote:
> 
> > hi!
> > I am not sure if this is the correct way
> to call an action from HTML ..
> > if we want to call it as form action ..
> then we should give full path like
> > "/foo/login.do" .
> > try and enlighten me too :-)
> > cheers!
> > Jitendra
> > - Original Message -
> > From: "otisg" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 24, 2002 10:51 AM
> > Subject: Can't map HTML form action to
> Struts action
> > 
> > 
> > > Hello,
> > >
> > > I am having difficulties hooking up an
HTML
> > > form action to an action mapping
defined in
> > > struts-config.xml.  This is the Struts
HEAD
> > > from CVS.  I am using Struts with
Velocity.
> > >  I can get .vm templates to load, but
can't
> > > get things like HTML form submission
action
> > > to map to a Struts action.
> > >
> > > My web.xml contains:
> > >
> > > 
> > >
> > >
>
MyVelocityViewServlet
> > >
> > >
> >
>
org.apache.velocity.tools.view.servlet.VelocityViewServlet > ervlet-class>
> > > ...
> > >
> > > 
> > > 
> > >
> > >
>
MyVelocityViewServlet
> > > *.vm
> > > 
> > >
> > >
> > > My struts-config.xml contains:
> > >
> > > 
> > >  > > ="foo.bar.webapp.actions.LoginAction"
> > > name ="loginF"
> > > validate ="true"
> > > path ="/login"
> > > scope="request"
> > > input="/login.vm">
> > >  path="/home.vm"/>
> > >  > > path="/login.vm"/>
> > > 
> > > 
> > >
> > >
> > > My HTML form contains this:
> > >
> > > 
> > >
> > > When I submit this form I get a 404
from the
> > > servlet container:
> > >
> > > 404 Not Found
> > > /foo/login was not found on this server.
> > >
> > > I've looked at several configuration
> > > examples, and what I have looks fine, but
> > > unfortunately it is not.  I am using this
> > > with Resin 2.1.6.  One suspicious
thing that
> > > I notice in Resin's log after I submit the
> > > HTML form is this:
> > >
> > > [2002/12/24 00:05:24] file: init
> > > [2002/12/24 00:05:24]
> > > com.caucho.server.http.DirectoryServlet:
> init
> > >
> > > This looks as if Resin is not mapping my
> > > /foo/action

Re: Can't map HTML form action to Struts action

2002-12-24 Thread otisg
Hello,

I see.  I thought
org.apache.velocity.tools.view.servlet.VelocityViewServlet
replaces Struts' ActionServlet.  However, it
seems that it is not an alternative Action
Servlet for use with Velocity, as I thought,
but rather an additional servlet capable of
dealing with Velocity templates, and not
with action mappings and such.

I still have a slight problem:

[2002/12/24 09:26:18] init exception for
`action'
javax.servlet.UnavailableException: Parsing
error processing resource path
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:931)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:454)

That 'action' must be referring to this part
from web.xml:


action
   
org.apache.struts.action.ActionServlet

config
   
/WEB-INF/struts-config.xml


debug
2


detail
2


validate
true

2



action
*.do



Am I doing something wrong?  This is a
copied from one of the Struts examples.
It looks fine to me...

Thanks,
Otis



 On Tue, 24 Dec 2002, Jitendra Singh
([EMAIL PROTECTED]) wrote:

> hi!
> I am not sure if this is the correct way
to call an action from HTML ..
> if we want to call it as form action ..
then we should give full path like
> "/foo/login.do" .
> try and enlighten me too :-)
> cheers!
> Jitendra
> - Original Message -
> From: "otisg" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 24, 2002 10:51 AM
> Subject: Can't map HTML form action to
Struts action
> 
> 
> > Hello,
> >
> > I am having difficulties hooking up an HTML
> > form action to an action mapping defined in
> > struts-config.xml.  This is the Struts HEAD
> > from CVS.  I am using Struts with Velocity.
> >  I can get .vm templates to load, but can't
> > get things like HTML form submission action
> > to map to a Struts action.
> >
> > My web.xml contains:
> >
> > 
> >
> >
MyVelocityViewServlet
> >
> >
>
org.apache.velocity.tools.view.servlet.VelocityViewServlet ervlet-class>
> > ...
> >
> > 
> > 
> >
> >
MyVelocityViewServlet
> > *.vm
> > 
> >
> >
> > My struts-config.xml contains:
> >
> > 
> >  > ="foo.bar.webapp.actions.LoginAction"
> > name ="loginF"
> > validate ="true"
> > path ="/login"
> > scope="request"
> > input="/login.vm">
> > 
> >  > path="/login.vm"/>
> > 
> > 
> >
> >
> > My HTML form contains this:
> >
> > 
> >
> > When I submit this form I get a 404 from the
> > servlet container:
> >
> > 404 Not Found
> > /foo/login was not found on this server.
> >
> > I've looked at several configuration
> > examples, and what I have looks fine, but
> > unfortunately it is not.  I am using this
> > with Resin 2.1.6.  One suspicious thing that
> > I notice in Resin's log after I submit the
> > HTML form is this:
> >
> > [2002/12/24 00:05:24] file: init
> > [2002/12/24 00:05:24]
> > com.caucho.server.http.DirectoryServlet:
init
> >
> > This looks as if Resin is not mapping my
> > /foo/action to the action servlet defined in
> > my web app's web.xml...maybe, not sure.
> >
> > I have tried mapping /foo/* to
> > MyVelocityViewServlet in web.xml, but that
> > resulted in .vm pages being rendered as
> > text/plain.  That may be fixed by
> > associating .vm extension with text/html,
> > but I'm not sure how to do this under Resin
> > yet.  But I think I have something else
> > wrong, anyway.
> >
> > Thank you,
> > Otis
> >
> >
> >

> > Get your own "800" number
> > Voicemail, fax, email, and a lot more
> > http://www.ureach.com/reg/tag
> >
> > --
> > To unsubscribe, e-mail:
>
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Can't map HTML form action to Struts action

2002-12-23 Thread otisg
Hello,

I am having difficulties hooking up an HTML
form action to an action mapping defined in
struts-config.xml.  This is the Struts HEAD
from CVS.  I am using Struts with Velocity.
 I can get .vm templates to load, but can't
get things like HTML form submission action
to map to a Struts action.

My web.xml contains:


   
MyVelocityViewServlet
   
org.apache.velocity.tools.view.servlet.VelocityViewServlet
...



   
MyVelocityViewServlet
*.vm



My struts-config.xml contains:









My HTML form contains this:



When I submit this form I get a 404 from the
servlet container:

404 Not Found
/foo/login was not found on this server.

I've looked at several configuration
examples, and what I have looks fine, but
unfortunately it is not.  I am using this
with Resin 2.1.6.  One suspicious thing that
I notice in Resin's log after I submit the
HTML form is this:

[2002/12/24 00:05:24] file: init
[2002/12/24 00:05:24]
com.caucho.server.http.DirectoryServlet: init

This looks as if Resin is not mapping my
/foo/action to the action servlet defined in
my web app's web.xml...maybe, not sure.

I have tried mapping /foo/* to
MyVelocityViewServlet in web.xml, but that
resulted in .vm pages being rendered as
text/plain.  That may be fixed by
associating .vm extension with text/html,
but I'm not sure how to do this under Resin
yet.  But I think I have something else
wrong, anyway.

Thank you,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




Re: RE: struts-config: action's "input" attribute purpose

2002-12-23 Thread otisg
Thanks.  Of course, I was looking at the DTD
yesterday, but today I forgot about it :(

Otis


 On Mon, 23 Dec 2002, Siggelkow, Bill
([EMAIL PROTECTED]) wrote:

> Following is taken verbatim from the
struts-config.dtd
> 
> input   Module-relative path of
the action or other resource to
>  which control should
be returned if a validation error is
>  encountered. Valid
only when "name" is specified. Required
>  if "name" is
specified and the input bean returns
>  validation errors.
Optional if "name" is specified and the
>  input bean does not
return validation errors.
> 
> -Original Message-
> From: otisg [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 23, 2002 3:33 PM
> To: [EMAIL PROTECTED]
> Subject: struts-config: action's "input"
attribute purpose
> 
> 
> Hello,
> 
> Warning: new Struts user.  Trying to use it
> with Velocity, actually.
> 
> I'm writing struts-config.xml for my web app
> and I'm wondering about 'input' attribute of
> the 'action' element.
> What is it for, and how is it used?
> I am asking because I see mixed examples -
> some using that attribute, some not.  And
> that 'input' attribute is not listed at
>
http://jakarta.apache.org/struts/userGuide/building_controller.html
> 
> What happens if I use 'input', and what if I
> do not?
> 
> Thanks,
> Otis
> 
> 
>

> Get your own "800" number
> Voicemail, fax, email, and a lot more
> http://www.ureach.com/reg/tag
> 
> --
> To unsubscribe, e-mail:  
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:  
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 
> 
> 



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




struts-config: action's "input" attribute purpose

2002-12-23 Thread otisg
Hello,

Warning: new Struts user.  Trying to use it
with Velocity, actually.

I'm writing struts-config.xml for my web app
and I'm wondering about 'input' attribute of
the 'action' element.
What is it for, and how is it used?
I am asking because I see mixed examples -
some using that attribute, some not.  And
that 'input' attribute is not listed at
http://jakarta.apache.org/struts/userGuide/building_controller.html

What happens if I use 'input', and what if I
do not?

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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




StrutsValidator - error while compiling 1.1 beta 1

2002-06-18 Thread otisg

Hello,

I am trying to compile Struts 1.1 beta 1
from source using ant and I'm getting the
following error:

[javac]
/usr/local/src/java/jakarta-struts-1.1-b1-src/src/share/org/apache/struts/util/StrutsValidator.java:145:
exception
org.apache.regexp.RESyntaxException is never
thrown in body of corresponding try statement
[javac] } catch (RESyntaxException e) {


I found some old posts mentioning that this
is due to jakarta-regexp -> jakarta-oro
switch, so I made appropriate changes in
build.xml and build.properties, so now this
is what I have there:

# grep regexp build*
build.properties:regexp.jar=/usr/local/jakarta-oro/oro.jar
build.xml:  
build.xml:


This looks right to me, and it matches
changes that I got from CVS change log for
these files.

Yet, I get that error when compiling.
Do I need to make any other changes?
Jakarta-oro jar is before jakarta-regexp jar
in my CLASSPATH, too.

Thanks,
Otis



Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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