I need to create another validation method; I need dates to be able to
pass if they are set to N/A (or n/a or N/a or nA, etc) -- I imagine
I could just subclass one of the validator methods.
Any advice to get me started?
-
To
I have a tag that optionally contains body text that represents an SQL
where clause.
Here's the doAfterBody code:
public int doAfterBody() throws JspException {
BodyContent bc = getBodyContent();
this.SQLfrombody = bc.getString();
return EVAL_PAGE;
}
Apparently
I have two routines in my data layer that close connections; one takes an
exception as a parameter and the other doesn't. My data layer objects open
their own connections and close them when they're done. (Actually, routines
that populate/read DTOs from/to the data layer make the calls)
OK, so Java isn't my first language, busted...
- Original Message -
From: David Graham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 10:25 AM
Subject: Re: [OT] data layer, try-catch-finally, connections
Setting the conn, rs, and s pointers to null in this method
At that exact moment, the Atlanta Struts user group was meeting, so we were
all having out listening to Chuck and expanding our minds. Don't take that
expanding our minds too liberally, either.
- Original Message -
From: Mark Galbreath [EMAIL PROTECTED]
To: 'Struts Users Mailing List'
Does anyone have example code for that handy?
- Original Message -
From: Phillip Qin [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 11:36 AM
Subject: RE: Login
I prefer servlet filter. If not logged in, redirect user to the login
page.
What kind of comment are you using, !-- HTML -- or %-- JSP --%
As far as why logic:equal isn't being found, post your JSP...
- Original Message -
From: Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 10:13 AM
Subject: Weirdness...
What I've done in the past is something like this -- first, I try to always
use DynaActionForms. In my struts-config file I'd declare something like
form-bean name=familyForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=address1 type=java.lang.String/
check logic:empty
- Original Message -
From: Susan Bradeen [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 3:32 PM
Subject: Re: DynaActionForm with logic:present
It appears (I am sure I missed some docs about this somewhere ... ) that
Don't do that. Make all your form fields strings, use the validator plug
in, and convert from String to other type in your Action class. One good
reason to do this is that if the user were to type ouch in an Integer
field, it would be impossible to even tell them that ouch wasn't a valid
value
form Q
I don't understand.
I thought the Validation framework would check for Integer in an Integer
field, then return the appropriate message.
-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:41 PM
To: Struts Users Mailing List
Subject: Re
Don't you mean
this(taxi_limo + day) = ...
see the dot after this in your example? Start drinking scotch, it helps a
lot... lol
- Original Message -
From: Mark Galbreath [EMAIL PROTECTED]
To: struts [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 6:48 PM
Subject: Too much wine tonight?
I believe the longest matching URL wins, so the action action of the
test module should get called.
Anyone disagree?
- Original Message -
From: Thomas CORNET [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 9:35 AM
Subject: ROOT context
You should be able to set up multiple database connections in server.xml; I
don't see why there's a problem. As long as you're using unique names for
the resources, you should be OK. BTW, a standard for naming such things
would be com.mycompany.myapp.Constants.DATABASE_KEY -- not likely to ever
automate the creation of the new acme database
from a postgres template database. I can automate the addition of a
datasource in server.xml, but then the server needs to restart and I
cannot automate the addition of another constant in my Constants class.
-Original Message-
From: Ian Hunter
are created
there until the load is equal to the others. When the load on one server
gets too high, a database can be moved to another server, and the
companies web app gets is informed of the move, that's where the
.properties file should do its work.
-Original Message-
From: Ian Hunter
I have a need to make quick-and-dirty utility programs that access the
underlying model of my struts application. I would like to implement a
JNDI datasource in a small utility program, so I can reuse all the classes I
have that rely on that datasource.
How do I do that?
that
reset is not being called.
Ian Hunter, you were asking about this in mid-March, did you ever find a
solution?
I searched Bugzilla but did not find anything, but I may have done it
wrong. That search page is daunting to say the least.
Isn't reset supposed to be called before the form is populated
I had a similar problem recently. I have a series of actions that populate
a formbean from a database, forward to a JSP for editing, and those submit
to a different action for handling updates and cascaded things that must
happen based on business rules.
I also want to be able to link directly
I saw a Bugzilla post from someone who needed to use ForwardAction but get a
redirect rather than a forward, and suggested implementing a
RedirectAction -- did that ever get done? How are folks handling this
scenario?
-
To
,
HttpServletResponse response)
throws Exception {
ActionForward retVal = super.execute (mapping, form, request,
response);
retVal.setRedirect (true); // there's the key part
return retVal;
}
}
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users
Before anyone flames me, I have read through the archive, and as someone
already said, there is info in there, but no concrete basic examples.
Here's the formBean I'm trying to handle:
form-bean name=familyForm
type=org.apache.struts.validator.DynaValidatorForm
form-property
I would up having to call initialize (mapping) from within my overridden
reset (mapping, request) method.
SURELY there is a cleaner way to set/reset values in a DynaActionForm.reset
method...
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL
Since this isn't as clear as it could be, here's an example for anyone who
cares:
(this class adds or updates a bulletin on a message board; all data access
goes through a central service called the DataStore)
public final class UpdateBulletinAction extends Action {
public
PROTECTED]
Sent: Thursday, March 13, 2003 9:17 AM
Subject: Re: Example of accessing DynaActionFrom properties from within an
Action
By using BeanUtils.getProperty or PropertyUtils.getProperty you can
essentially
ignore whether the form is a DynaActionForm or not.
Quoting Ian Hunter [EMAIL
(somekey).toString();
So what you are doing works for me...
hope this helps mark
Giovedì, 13 mar 2003, alle 15:03 Europe/Rome, Ian Hunter ha scritto:
Since this isn't as clear as it could be, here's an example for anyone
who
cares:
(this class adds or updates a bulletin on a message board; all
Just to see if this gets you anywhere, do
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
(message.login.confirmation));
saveMessages(request, response);
then use
html:messages id=message message=true
bean:write name=message/br
/html:messages
- Original Message -
On Thu, 2003-03-13 at 10:18, Ian Hunter wrote:
Just to see if this gets you anywhere, do
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
(message.login.confirmation));
saveMessages(request, response);
then use
html:messages id=message message=true
bean:write name
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.action.ActionMapping;
public class MemberForm extends org.apache.struts.action.DynaActionForm {
public void reset (ActionMapping mapping, HttpServletRequest request) {
... :(
- Original Message -
From: louis majanja [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 2:35 PM
Subject: Re: html:messages/ not displaying messages
i am forwarding
On Thu, 2003-03-13 at 11:14, Ian Hunter wrote:
Are you redirecting or forwarding
I'm just trying to clear the checkbox. With the standard DynaActionForm, it
doesn't get reset, so I have the standard HTML problem with not being able
to go from checked to unchecked and save that change.
- Original Message -
From: Chen, Gin [EMAIL PROTECTED]
To: 'Struts Users Mailing
Oh, and I'm using a session scoped bean for this. Comes in handy having
this data still populated for other pages.
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 3:40 PM
Subject: Re: overriding
I have a form where the submit button is supposed to say add login or
update login depending on if the user in question (based on field
fkMember) already exists in the login database. I have tags called HasLogin
and HasNoLogin that take an integer parameter, and return whether or not the
-el:form
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 5:51 PM
Subject: Accessing DynaActionForm fields within custom tag
I have a form where the submit button is supposed to say add login
Can you put them in an array?
- Original Message -
From: Jason Long [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 9:38 PM
Subject: Dynamic form value replacements???
I have a form that is dynamically created as a jsp in xml syntax.
I looked through the archive before posting this, but there was just so much
stuff in there about forms and select that my eyes glazed over and I gave
up.
What I want to do is have a series of items from a database appear on a
page, in a table, each one to a row. At the end of the row, in one
=editbulletin
type=BulletinForm
html:hidden property=id name=bulletin property=id/
html:submit value=Edit/
/html:form
Am I missing something?
Geeta
Ian Hunter wrote:
I looked through the archive before posting this, but there was just so
much
stuff in there about forms and select that my
.
Ian Hunter wrote:
Lowly me? Contribute to the FAQ? hee hee. Glad to help.
(Hey, who's in charge of the FAQ around here?)
- Original Message -
From: Peng Tuck Kwok [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 11:39 PM
If you can, make it based on some user token that only you would have.
- Original Message -
From: John Espey [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 10:35 AM
Subject: RE: Reporting an Exception message in a JSP.
What do you
I just went through this.
- Original Message -
From: LUCERO,DENNIS (HP-Boise,ex1) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 1:56 PM
Subject: select multiple
When using html:select the fields that do not use the multiple = true
attribute are correctly
I use this search engine:
http://www.mail-archive.com/cgi-bin/htsearch?config=struts-user_jakarta_apac
he_orgrestrict=exclude=words=Ian+Hunter
- Original Message -
From: LUCERO,DENNIS (HP-Boise,ex1) [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday
My guess is the BeanUtils.populate error is because you wrote an indexed
setter method and overloaded the String[] or Collection setter method.
Don't do that.
- Original Message -
From: Peng Tuck Kwok [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday,
The ActionForm descendant.
- Original Message -
From: Peng Tuck Kwok [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 10:39 PM
Subject: Re: Help with optionsCollection error
You say :
My guess is the BeanUtils.populate error is
10:56 PM
Subject: Re: Help with optionsCollection error
I'm currently implementing the recipients as a vector of beans and I do
provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring to ?
Thanks.
Ian Hunter
results. Thanks.
Ian Hunter wrote:
I think so -- whichever setter method within your ActionForm applies
to the
field named in your html:select tag has to be the ONLY setter method
named
whatever it's named.
That's contradictory to normal bean conventions where you would
normally
have
; if not simply create a
JavaBean with name and value properties and make a collection of them.
Look at the docs for html:options on how to use it.
Also, ensure that your html:select is inside a html:form
Sri
-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 23
id)
If I comment out setIds(String[] ids) completely, it runs right through but
never populates the ids field. I guess it assumes that's a read only
field. What signature is it looking for in the setIds method if not
String[]?
- Original Message -
From: Ian Hunter [EMAIL PROTECTED
It's working perfectly now. I don't know for sure what fixed it; I compared
the example code to mine, started pulling stuff OUT of my class, Tomcat /
Sun ONE Studio started acting funny, so I closed everything, blew away the
Tomcat /work directory, tried again, and *poof* no more errors. I think
in.
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 11:57 AM
Subject: Re: html:select multiple problems
It's working perfectly now. I don't know for sure what fixed it; I
compared
the example code to mine, started
That's what I had in the first place, and it did NOT work. Refer to the
code in TestBean.java for the html-select examples, and you'll see that the
individual element getter/setter methods have TOTALLY different names.
As far as struts is concerned, you MUST drop the s - Struts does not use
the
So as it works now, do you have
public int setValue(int index, String value)
and
public int setValues(ArrayList values)
or do you have
public int setValues(int index, String value)
and
public int setValues(ArrayList values)
? My theory is that the introspection will croak utterly if you
IIRC, you also had a bunch of other getIds/setIds methods. This can
confuse the
heck out of bean introspection. Make sure you only have those 4 methods
defined.
I finally realized that was part of the problem. When I cleaned it up and
pulled the other junk out, it worked. When I added back in
Thanks!
- Original Message -
From: Nelson, Laird [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 12:21 PM
Subject: RE: [OT] (Slightly OT) Accessing individual array elements (was Re:
html:select multiple problems)
Call it public void
Thanks!
- Original Message -
From: Jörg Maurer [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 12:22 PM
Subject: RE: [OT] (Slightly OT) Accessing individual array elements (was Re:
html:select multiple problems)
DO NOT NEVER EVER OVERLOAD
RGH
I would give one of my legs right now for a working example of an
html:select multiple=true usage that populates an array in an
ActionForm.
Help?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
am a kind man and hint you to the
your_jakarta-struts-1.1-b3-src_dir\web\exercise-taglib\html-select.jsp.
-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: Montag, 24. Februar 2003 03:20
To: Struts Users Mailing List
Subject: html:select multiple problems
RGH
Yes. In fact, since I just tested it again, it won't even work with
non-multiple... I have hosed something. Wah.
Here: (I used to have just String[] get/setters but Tomcat whined about
reflection, so I did this:)
(JSP)
html:select property=ids multiple=true
html:options property=ids/
(String[] ids)
or
public void setIds(ArrayList ids)
or what?
Seems like no matter what setter method I provide, it doesn't get called.
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, February 23, 2003 9:20 PM
Subject
If one component was upgraded, you'd have to replace the whole shootin'
match.
- Original Message -
From: Jason Vinson [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 21, 2003 8:28 AM
Subject: combining commons-*.jar
This may be a dumb question,
I need to populate the options in a multiple select box dynamically from
javascript. The property that is being populated is an array of strings. I
have that set up and working with no errors, but I don't ever get anything
back in my array.
For example, say I declare
html:form name=theForm
When you add your error message to the errors object, you are specifying
Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to do
something like
html:errors property=something/ to get that SPECIFIC error. If you
switch to ActionErrors.GLOBAL_ERROR it will display all of them
: Thursday, February 20, 2003 4:25 PM
Subject: RE: Validation problem
Thanks for your help.
My jsp is displaying : ???nl_BE.error.invalid.email???
Still something wrong. It seems my key is not found.
Can you help me again please?
Kind regards,
-Oorspronkelijk bericht-
Van: Ian
I boogered up my email server for the last two days -- anyone have any
insight on this that I missed?
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 5:09 PM
Subject: Log detail question
I have low verbosity and debug=0 set
implemented your second option.
-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:35
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem
Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?
1) If you
]
Sent: Thursday, February 20, 2003 4:55 PM
Subject: RE: Validation problem
no app did not complain
-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:55
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem
Did
Override the ActionForm.validate() method
- Original Message -
From: Kola Oyedeji [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 4:56 PM
Subject: where to place form validation logic
Hi
Just a quick question, where is the best
I do something like this:
app:MemberSelect id=memberVectorORDER BY LASTNAME,
FIRSTNAME/app:MemberSelect
logic:present name=memberVector
logic:iterate id=member type=classname here name=memberVector
do stuff here
/logic:iterate
/logic:present
logic:notpresent
Whine here
It seems to work right for me.
- Original Message -
From: Justin F. Knotzke [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 10:27 PM
Subject: Form Validation
Hi,
I'd like to know if future versions of struts will have
properties from this request
2003-02-17 17:05:46 action: Validating input form properties
2003-02-17 17:05:46 action: No errors detected, accepting input
2003-02-17 17:05:46 action: Looking for Action instance for class
LogonAction
2003-02-17 17:05:46 action: Logon by user Ian Hunter for session
Einstein (1879-1955)
-Original Message-
From: Ian Hunter [mailto:ihunter;hunterweb.net]
Sent: Tuesday, October 29, 2002 11:29 PM
To: [EMAIL PROTECTED]
Subject: Can I avoid bouncing app when database goes down?
I have struts app that works great until MSDE (MS SQL Server) drops
bouncing app when database goes down? (struts 1.0
.2)
I had the same problem. Try using poolman (I had to patch it since it was
running in endless loop whenever sybase server was rebooted)
-Original Message-
From: Ian Hunter [mailto:ihunter;hunterweb.net]
Sent: Wednesday, October 30
(Constants.DATABASE_KEY);
conn = ds.getConnection();
Or do I have to jump through all kinds of hoops?
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, October 30, 2002 11:04 AM
Subject: Re: Can I avoid bouncing app
:
Do you keep your connection all the time? If you
do, it is not adviced to do so. Close it when ever
you can.
Do you use connection pooling?
-D
- Original Message -
From: Ian Hunter [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday
database goes down? (struts 1.0
.2) (try poolman) (use validationQuery)
I am using poolman 2.1 with Sybase jconnect driver and don't have this
problem.
Mark.
-Original Message-
From: Ian Hunter [mailto:ihunter;hunterweb.net]
Sent: Wednesday, October 30, 2002 2:42 PM
To: Struts Users
I have struts app that works great until MSDE (MS SQL Server) drops a
connection, then I have to reset the whole app. I'm connecting to a
datasource defined in struts-config.xml and using the ms sql native jdbc
drivers.
Any ideas?
--
To unsubscribe, e-mail:
indeterminate. Can anybody enlighten me as to how to do this correctly;
would tiles give me some control over this?
Many Thanks
Ian Hunter
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Sorry Folks,
Just found the bit about useing flush - did the job!
Perhaps this is an FAQ? It certainly stumped for a while.
Ian
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
77 matches
Mail list logo