Re: Design problem

2005-05-21 Thread Erik Weber
The parameter attribute can have whatever value you want and be used however you want. I use it as a poor man's dispatch action. For example, you have an actor called a customer. The customer can log on and perform some actions with regard to his details. Let's say one action is to view,

Re: is there a better way of creating SQL queries from form objects ?

2005-05-09 Thread Erik Weber
As far as the implementation goes, there is no reason to be scared of switches and loops. (But favor polymorphism/virtual functions over a giant loop.) However, you should get rid of all those concat operators and use StringBuffer.append instead. The performance will improve significantly.

Re: is there a better way of creating SQL queries from form objects ?

2005-05-09 Thread Erik Weber
Erik Weber wrote: As far as the implementation goes, there is no reason to be scared of switches and loops. (But favor polymorphism/virtual functions over a giant loop.) Sorry, I meant over a giant switch, not loop! However, you should get rid of all those concat operators and use

Re: AW: [OT] Recommendation of Instant Messagging System

2005-05-05 Thread Erik Weber
in a Intranet. Yours, Miquel Angel Seguí -Mensaje original- De: Erik Weber [mailto:[EMAIL PROTECTED] Enviado el: miércoles, 04 de mayo de 2005 18:39 Para: Struts Users Mailing List Asunto: Re: [OT] Recommendation of Instant Messagging System I just finished putting together a system

Re: AW: [OT] Recommendation of Instant Messagging System

2005-05-05 Thread Erik Weber
. For your situation, I cannot say which is the right approach. You'll have to judge for yourself. I would do my homework. Erik Erik Weber wrote: XMPP and HTTP are nothing alike. XMPP is a stateful protocol and HTTP is a stateless protocol. XMPP pushes out alerts actively while with HTTP you have

Re: [OT] Recommendation of Instant Messagging System

2005-05-05 Thread Erik Weber
to me; Smack sounds good, but with the problems you pointed out, I doubt if I am able to handle them correctly. Would you contribute your modifcation back to Smack someday ? appreciate your info very much ! lixin On 5/5/05, Erik Weber [EMAIL PROTECTED] wrote: I just finished putting together

Re: struts date validator

2005-05-05 Thread Erik Weber
=/mySubmitAction field property=myDate depends=date msg name=date key=myDate.format.mm.dd./ /field /form Erik Weber [EMAIL PROTECTED] wrote:I think you want datePatternStrict instead of datePattern. Erik Carl Smith wrote: We are using struts date validator, for some reason we found that the struts

Re: Seeking advice image resizing

2005-05-05 Thread Erik Weber
Look at ImageIO for read/write and RescaleOp for your scaling. Erik Scott Purcell wrote: Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma. I have created a ECommerce type site, in which there are three

Re: Hosting cost: Java/Struts apps -versus- PHP apps...help!

2005-05-04 Thread Erik Weber
Sorry no URLs, but I have been seeing prices dipping into the $10 range, which is even with PHP (the cheapest PHP I ever saw was $4 but typical is $8.99 I think). And I have found that Tomcat/MySQL or Tomcat/PostgreSQL is everywhere, plus you'll usually get an Apache Web Server too. But be

Re: [OT] Recommendation of Instant Messagging System

2005-05-04 Thread Erik Weber
I just finished putting together a system with a Swing client and combined services over XMPP and HTTP. I think Leon's suggestion of doing your own is not bad, if you are good with Sockets, ServerSockets, XML APIs and Threads (find a good tutorial on building a chat system such as in the

Re: struts date validator

2005-05-04 Thread Erik Weber
I think you want datePatternStrict instead of datePattern. Erik Carl Smith wrote: We are using struts date validator, for some reason we found that the struts date validator let 04/02/05 pass, but we are hoping that the validation fails since 04/02/05 is not of format MM/dd/. Did you have

Re: Double submit and Implied Save

2005-04-27 Thread Erik Weber
Nancy, could you try to be a little more specific and clearer in your explanations? Nancy Lin wrote: Our application required that if user enter some data and click on other menu link or tab without clicking the submit button, the page will automatically be save. Do you mean that you are

Re: Caching Java Objects

2005-04-26 Thread Erik Weber
Also, check these out: https://whirlycache.dev.java.net/ http://www.opensymphony.com/oscache/ Erik temp temp wrote: Is it similar to sessions ie each user will have his own cached Object or all the users share the same Cached object . I have a jsp with multiple submit buttons .Each submit

Re: Action call another action?

2005-04-25 Thread Erik Weber
Ted Husted wrote: On 4/21/05, Erik Weber [EMAIL PROTECTED] wrote: That's the way I do it. If your Actions are light, as they should be, it doesn't add a lot of code. Some redundant code is not a bad thing, it can make things clearer. If you were to chain actions, then you'd be going through

Re: PropertyUtils

2005-04-25 Thread Erik Weber
I could be mistaken, but I think what you want to look at is BeanUtils.copyProperties. Erik tarek.nabil wrote: Hi everyone, I have some insert and update actions where I copy the data the user entered from the ActionForm to a DTO object which I send as a parameter to my business method. Since I

Re: How to Known if there error for a property

2005-04-25 Thread Erik Weber
for inclusion in Struts. Seems like it might be better left for local development. Joe . . . At 5:10 PM -0500 11/8/04, Erik Weber wrote: Here is a way to do it that works with 1.1: logic:messagesPresent name=org.apache.struts.action.ERROR property=username bean:message key=error.username.required

Re: Caching Java Objects

2005-04-25 Thread Erik Weber
temp temp, If you are going to cache: Use request scope for objects that should be cached for the duration of a single request servicing. Use session scope for objects that should be cached for the duration of a user's session (more than one request) and that represent data unique to the user,

Re: seeking advice on authorization and authentication

2005-04-25 Thread Erik Weber
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/ Chapter 32: Security Should help. Erik Scott Purcell wrote: I am creating a shopping-cart type application using struts and have a question. The site itself does not have any authentication on it, as people just browse and add stuff to the cart.

Re: JSF Articel

2005-04-22 Thread Erik Weber
Some interesting stuff here: http://www.coreservlets.com/JSF-Tutorial/ Erik Pramod wrote: Hi All, Could any one can refer the best articles for JSF ? Regards Pramod - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: html:option tag

2005-04-21 Thread Erik Weber
Yes, form field values (generated by the Struts tags) are synced with corresponding ActionForm field values when the page is rendered. So you can override the ActionForm's reset method to specify initial values. But typically you only want to do this when you are showing a fresh add form, not

Re: Struts Radio button

2005-04-21 Thread Erik Weber
I think that my answer to another post earlier this morning applies here, so I have pasted it: . . . Form field values (generated by the Struts tags) are synced with corresponding ActionForm field values when the page is rendered. So you can override the ActionForm's reset method to specify

Re: logic:iterate problem...

2005-04-21 Thread Erik Weber
I think your List reference is probably null. Also, have you looked at html:options and html:optionsCollection? Erik Lucas Bern wrote: Hi all... I get this exception trying to render options with logic iterate tag... javax.servlet.jsp.JspException: Cannot create iterator for this collection My

Re: logic:iterate problem...

2005-04-21 Thread Erik Weber
Hmm I didn't even notice that. However, this is the section of code that throws that Exception (from 1.2.4 src): /** * Construct an iterator for the specified collection, and begin * looping through the body once per element. * * @exception JspException if a JSP exception has

Re: [OT] [Friday] Re: AJAX: Whoa, Nellie!

2005-04-21 Thread Erik Weber
Heh. Normally I hate stuff like this, but for some reason, that one was so silly it just cracked me up. Must be because I just woke up. :) Erik Vic Cekvenich (netsql) wrote: [EMAIL PROTECTED] wrote: I think all salient points have been made. Agree. It's almost friday:

Re: Action call another action?

2005-04-21 Thread Erik Weber
That's the way I do it. If your Actions are light, as they should be, it doesn't add a lot of code. Some redundant code is not a bad thing, it can make things clearer. If you were to chain actions, then you'd be going through the entire request processor chain again. I think that Struts 1.3,

Re: Action call another action?

2005-04-21 Thread Erik Weber
; . . . } Even though you have a different design, I think we're talking about the same thing. Please disregard if we're not. Erik Erik Weber wrote: That's the way I do it. If your Actions are light, as they should be, it doesn't add a lot of code. Some redundant code is not a bad thing, it can

Re: requiredif

2005-04-20 Thread Erik Weber
want that to cause an error screen to appear. As for validwhen, I think it's worth giving it a shot to see if it can be plugged in as a custom validator. -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 8:50 AM To: Struts Users Mailing List

Re: help on accessing txt file

2005-04-20 Thread Erik Weber
Not sure if this already has been said but when you are working with text files, it can be easier to use Readers and Writers rather than streams -- check out the API to see if the methods suit you better. Java IO gives you ways to convert between Readers and Writers and streams, for example:

[OT] Re: AJAX: Whoa, Nellie!

2005-04-20 Thread Erik Weber
Frank W. Zammetti wrote: On Tue, April 19, 2005 10:47 am, Erik Weber said: I, with respect for the author, disagree with this entirely. I am people, and this is not what I expect or desire at all. As a user, I expect and desire 1) A fast download 2) my bookmarks to work/easy to remember URLs 3

Re: [OT] looking for salary surveys

2005-04-20 Thread Erik Weber
Thanks everyone for all these responses. They have helped me tremendously. Erik Fogleson, Allen wrote: Erik, I also live in the Atlanta area. The going rate seems to be around 45-50 per hour for most of the consulting firms (body shops) assuming most of those do W2 instead of 1099 then you can

Re: requiredif

2005-04-19 Thread Erik Weber
!-- requiredif -- validator name=requiredif classname=org.apache.struts.validator.FieldChecks method=validateRequiredIf methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction,

[OT] how to reject non-HTTPS instead of redirect?

2005-04-19 Thread Erik Weber
Sorry for the OT but I thought I'd try here since this should be simple and I don't subscribe to tomcat-user. Anyone know how to configure Tomcat (5.0) to simply reject a non-HTTPS request when the transport guarantee is CONFIDENTIAL, rather than to issue a redirect? I can't find anything on

Re: AJAX: Whoa, Nellie!

2005-04-19 Thread Erik Weber
Frank W. Zammetti wrote: On Tue, April 19, 2005 5:30 am, Jesse Alexander (KBSA 21) said: I also think that a well-designed web-UI does not need JS at all... Then what results is exactly what you say: a WEB UI. This was good enough five years ago, it isn't today. People expect, generally,

Re: requiredif

2005-04-19 Thread Erik Weber
- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 3:24 PM To: Struts Users Mailing List Subject: Re: requiredif !-- requiredif -- validator name=requiredif classname=org.apache.struts.validator.FieldChecks method

Re: requiredif

2005-04-19 Thread Erik Weber
of Struts you are using support custom validators? Hope that helps, Erik Thanks -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:54 PM To: Struts Users Mailing List Subject: Re: requiredif Oh, I'm sorry. I pulled that from the last release

Re: Database Assistance Needed

2005-04-15 Thread Erik Weber
JNDI *is* the way to go. See the Tomcat doc on configuring a DataSource (cited below). I use Tomcat 5.0, but I will not buy it that the examples don't work because I have followed the Tomcat documentation many times with success (including MySQL). Then write a simple Java class that acts as a

Re: [OT] question about open source data base selection

2005-04-14 Thread Erik Weber
secrets. :) I've been wanting to do some C++ instead of Java anyway. :) Anyone want to sponsor me? Erik http://www.dwheeler.com/essays/linux-kernel-cost.html Ted Husted wrote: On 4/13/05, Erik Weber [EMAIL PROTECTED] wrote: I get the feeling that the GPL restrictions (at least in MySQL's case

Re: [OT] question about open source data base selection

2005-04-13 Thread Erik Weber
After doing a little research on this I still wasn't getting a clear picture, so I wrote to someone at MySQL AB (I found an e-mail address for someone who seemed to welcome questions on the Web). I presented what I thought were some typical scenarios of MySQL use (such as JDBC applications and

Re: [OT] question about open source data base selection

2005-04-13 Thread Erik Weber
to a dispute, *you* would be the one getting sued, not MySQL. Craig (who works for a company that has required review policies before *any* open source software can be used) On 4/13/05, Erik Weber [EMAIL PROTECTED] wrote: After doing a little research on this I still wasn't getting a clear picture, so I

Re: Combined fields validation with Validator

2005-04-12 Thread Erik Weber
http://struts.apache.org/userGuide/dev_validator.html See the sections on the requiredif and validwhen validators. Erik Rodolfo García Esteban/CYII wrote: Hi, I need to do a validation of required fields who depends of the values of previos fields. More clearly, I have a radio button to choose

Re: Beginner Question: Which is the Best place to start

2005-04-12 Thread Erik Weber
http://struts.apache.org/learning.html http://wiki.apache.org/struts/ and http://wiki.apache.org/struts/StrutsResources On that page is a link to a site that helped me a lot when I first started with Struts (plenty of examples): http://www.reumann.net/struts/main.do But, with all that said, I

Re: [OT]question about open source data base selection

2005-04-11 Thread Erik Weber
I read that document and I still don't get it. There is even a forum post about the article asking about the situation that is typical for many of us: having a proprietary JDBC- or PHP-based application that connects to a single MySQL server (not embedded) using Connector-J. The author of the

Re: Use of tokens

2005-04-09 Thread Erik Weber
Yes, tokens are used to prevent duplicate submits of a single form. These are the four methods your Action inherits from org.apache.struts.action.Action: protected String generateToken(HttpServletRequest request) { return token.generateToken(request); } protected boolean

Re: Obtaining size of java.util.Collection through Struts/JSTL

2005-04-05 Thread Erik Weber
I use bean:size. I don't know if there is a JSTL equivalent. Seems odd that there wouldn't be one, but I can't find one in my JSTL reference. Erik Greg Pelly wrote: What is the prefered way to obtain the size of elements that implement the Collection interface, such as a Vector? I would like

Re: Is It Possible to Code Using Struts and JSF at the Same Time?

2005-04-04 Thread Erik Weber
Craig McClanahan wrote: On Apr 2, 2005 8:38 AM, Erik Weber [EMAIL PROTECTED] wrote: I was playing a bit of devil's advocate when I wrote I have no interest in JSF. It probably sounded harsh. The truth is, I want both Struts and JSF in my toolbox. I don't want one to supplant the other. I have

Re: Is It Possible to Code Using Struts and JSF at the Same Time?

2005-04-02 Thread Erik Weber
I was playing a bit of devil's advocate when I wrote I have no interest in JSF. It probably sounded harsh. The truth is, I want both Struts and JSF in my toolbox. I don't want one to supplant the other. I have a couple of JSF questions. 1) I do a lot of Swing work with some HTTP-based services

Re: Is It Possible to Code Using Struts and JSF at the Same Time?

2005-04-01 Thread Erik Weber
I agree. I thought, Craig, that you until recently were interested in Struts and JSF coexisting, meaning that both would grow, even if you were no longer the active leader of Struts. As a developer, I have no interest in JSF, but am interested in Struts 1.3. Erik Benedict, Paul C wrote: Craig,

Re: REPOST: Relative URLs

2005-03-30 Thread Erik Weber
to resources within your context. You may want to simply think of writing plain old a and img tags and do it yourself. -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 9:18 AM To: Struts Users Mailing List Subject: Re: REPOST: Relative URLs Can't you

Re: Actions and form methods ...

2005-03-30 Thread Erik Weber
Try using request.getParameterNames to see what's actually being delivered to the server. Erik Stéphane Zuckerman wrote: Hello, Are the Action classes only processing POST forms ? I am asking this because I'd like to give some parameters to an Action I am creating, and can't get no result with

Re: REPOST: Relative URLs

2005-03-29 Thread Erik Weber
Can't you embed a ServletContext attribute (variable) in your links using the EL? The attribute value could come from an init param and get set at app startup. Erik tarek.nabil wrote: Hi everyone, I still can not find an answer to my question, so I thought I'd repost this and try to make it

Re: Struts , hibernate, and DBCP

2005-03-29 Thread Erik Weber
In my opinion, the question is on topic. I'm not sure whether by instantiated you mean the pool class or the connection class. If it's the former, I'm not sure of the answer, but I would assume that the pool class typically is instantiated at server startup. If not, wouldn't the JNDI lookup

Re: Struts , hibernate, and DBCP

2005-03-29 Thread Erik Weber
to be created. -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 2:58 PM To: Struts Users Mailing List Subject: Re: Struts , hibernate, and DBCP In my opinion, the question is on topic. I'm not sure whether by instantiated you mean the pool class

Re: Struts , hibernate, and DBCP

2005-03-29 Thread Erik Weber
for connection leaks. It's really not that hard to switch the pooler, I'll probably give c3p0 a shot with and without my extended base class and see what happens there. -B -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 3:46 PM To: Struts Users Mailing

Obtaining MessageResources from ExceptionHandler

2005-03-28 Thread Erik Weber
How can I obtain a reference to a non-default MessageResources instance from within the execute method of an ExceptionHandler? The signature is: public ActionForward execute(Exception e, ExceptionConfig config, ActionMapping mapping, ActionForm form, HttpServletRequest request,

Re: Best practice for dynamic reloading of a part of the JSP ?

2005-03-25 Thread Erik Weber
Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work

Re: Best practice for dynamic reloading of a part of the JSP ?

2005-03-25 Thread Erik Weber
as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: Thanks for the example. I copied the source. I suppose you could write some JavaScript

Re: Redirect work only with browser?

2005-03-24 Thread Erik Weber
Jim Theodoridis wrote: Erik Weber wrote: Jim Theodoridis wrote: Sorry it is a new message In an action i am having the following path = .; a.setRedirect(true); a.setPath(path.toString()); .. at the path assing a URL as http://www.yahoo.com or http

Re: HTML Tag Users Guide

2005-03-23 Thread Erik Weber
I don't know if there is anything like it for Struts tags, but Sue Spielman's JSTL Practical Guide for JSP Programmers (Morgan Kaufmann) is exactly what you are looking for if you also use JSTL tags. It's 200 pages, example-based and 20 bucks. Erik Scott Purcell wrote: Hello, following up with

[OT] JDBC -- batch inserts generated keys

2005-03-23 Thread Erik Weber
I have a (MySQL) batch insert scenario where I need to retrieve all the generated keys. What is the best approach for this? Can I take advantage of the new return generated keys feature for this? Here are three approaches I can think of. I haven't tried any of them yet. Figured someone here

Re: Locale question

2005-03-22 Thread Erik Weber
Yes, it's gone in 1.2.4 and replaced by Globals.LOCALE_KEY. Erik Sergey Livanov wrote: Is Action.LOCALE_KEY deprecated ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Locale question

2005-03-22 Thread Erik Weber
Well, one place to look would be the API documentation: http://struts.apache.org/api/index.html Click on Globals in the All Classes frame and check out the Field Summary. Also, click on one of the key fields and you'll see a link to Constant Field Values. Follow that for a summary page

Re: best practice image handling

2005-03-21 Thread Erik Weber
My 2 cents: 1) I always try to serve my images from another server (Apache Web Server) configured to serve all the static content, and only send requests to my app server that actually require the app server. As a side effect, paths are easier to manage as they don't change when your

Re: last element of logic iterate

2005-03-18 Thread Erik Weber
One way is to use a combination of logic:iterate's indexId attribute (serves as a loop counter) and the bean:size tag (can give the total size of a collection before you iterate). Then you could use a logic:equal test inside the iteration. Erik Richard Reyes wrote: Hello All , How do you

Re: Will the execute method of ExceptionHandler be called ?

2005-03-18 Thread Erik Weber
was .. Whether it will be invoked if some exception occurs at the time of population the ActionForm's properties. Population is done by Struts Utils classes. So I am not very much sure whether it will execute it or not . Sachin -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent

Re: canceling a operation after sending to container

2005-03-18 Thread Erik Weber
Are you familiar with synchronizer tokens? Basically, you insert a hidden variable (a unique string) into your form when the user requests the form page. On the server side, you track that same string in the session for that user. When the form is later submitted, you check that the token

Re: Will the execute method of ExceptionHandler be called ?

2005-03-17 Thread Erik Weber
Yes. The execute method of an ExceptionHandler is invoked whenever an Action's execute method throws an Exception that the ExceptionHandler is configured to handle (via exception elements in struts-config.xml). It is then up to the handler to provide the forward rather than the Action.

Re: Validate Two String Fields Equal

2005-03-15 Thread Erik Weber
http://struts.apache.org/userGuide/dev_validator.html See the section on pluggable validators. I don't think the type of Form you use matters, but I don't use Dyna forms. Erik Scott Purcell wrote: Hello, I have a simple validation problem I am seeking help with. I have a form in which the

Re: html:form question

2005-03-11 Thread Erik Weber
Scott Purcell wrote: Hello, I have a login that I call and displays its initial presentation. I am using the html:form action=login.do line for when I submit its values. But I want to put in some default values into the initial presentation. So upon reading about html:form it looks like I could

Re: session and request scope

2005-03-10 Thread Erik Weber
No, it's all memory. But, you have to remember that session attributes stay in memory for the life of the session (which typically spans many requests and perhaps all day long), whereas request attributes stay in memory for the life of the request. In other words, requests don't really require

Re: user management

2005-03-10 Thread Erik Weber
wo_shi_ni_ba_ba wrote: do struts developers usually store user as an object in session? Yes, that is typical. or does struts have additional framework for handling user management. No. But there is container managed security, which has its own concept of a user (typically represented by a

Re: Page flow with some business logic

2005-03-09 Thread Erik Weber
Yes, having methods along the lines of ensure and do that are paired makes sense and I have seen the strategy work well. The challenge is that you often want these two methods to be invoked within a single transaction context. For example, you don't want to return true from ensure,

Re: Hidden parameter passing: RE: parameter passing from one jsp-screen to another

2005-03-08 Thread Erik Weber
Well, this is not great nice solution in my opinion, but it does seem to be popular. This requires you to have a form on screen A and to use POST instead of GET to request screen B. Also, it requires JavaScript. You could make all your links have the same URL, but put an onclick JavaScript

Re: bean write format=mm/dd/yyyy

2005-03-07 Thread Erik Weber
Refer to the API documentation for java.text.SimpleDateFormat. Erik Brian McGovern wrote: Hi. I'm having some problems finding documentation on how to format a java.util.Date object in my presentation layer. I have bean:write name=mybean property=startDate format=mm/dd/ / and it works

Re: bean write format=mm/dd/yyyy

2005-03-07 Thread Erik Weber
Actually, if you are using mm/dd/, I could be wrong. Are you sure you aren't using MM/dd/? SimpleDateFormat uses M for month and m for minute, so now I'm beginning to wonder if bean:write actually does use SimpleDateFormat . . . Erik Erik Weber wrote: Refer to the API documentation

Re: Why Template Method instead of Strategy in Commons Chain?

2005-03-07 Thread Erik Weber
Joe Germuska wrote: I have no idea why Craig would say that the RequestProcessor is somehow related to the Template Method pattern. It just isn't. Are you talking about org.apache.struts.action.RequestProcessor? Even if its not a shining textbook example of Template, it most certainly is

Re: session.invaludate(); not working in LogoffAction

2005-03-07 Thread Erik Weber
I think that you shouldn't just check for the existence of a Session, you should check for a user Session attribute that you have set in your own code. If you are invalidating the Session and this attribute still exists afterward, I'd suggest something has gone awry . . . And yes, I do it in

Re: form-bean and persistent data

2005-03-07 Thread Erik Weber
This is a valid way to do it. To be more specific, your Action would ask some delegate for the domain object, then it would use that object as either a scoped (request, session, etc.) attribute or as a field for your form-bean (if you are indeed using your form-bean for setup actions as well

Re: DownloadAction Application

2005-03-07 Thread Erik Weber
It depends on what you are using to do the uploading. For example, an FTP system cares. But an application that simply copies bytes from an octet stream doesn't have to care. Erik Rajaneesh wrote: Hi, A basic question! Should a file type(BINARY or ASCII) matter during the upload process?

Re: Why Template Method instead of Strategy in Commons Chain?

2005-03-06 Thread Erik Weber
Dakota Jack wrote: You are probably right, Bill. How to approach this has been a mystery to me. Everything good in the world starts with a desire to see others succeed. Erik But, I do think you are right about this and probably this is really ineffective. Jack On Sun, 6 Mar 2005 17:00:41 -0500,

Re: Why Template Method instead of Strategy in Commons Chain?

2005-03-06 Thread Erik Weber
I think it's probably usually good to question Template when the realization of it comes via class inheritance. However, I'm confused. I read Bill's article (first pass anyway -- and I'm new to Commons Chain), and I'm still not seeing where exactly Template is implemented in Commons Chain. He

Re: Why Template Method instead of Strategy in Commons Chain?

2005-03-06 Thread Erik Weber
available with Strategy. I think people generally agree that Strategy is a better pattern that Template Method to do the same thing.) On Sun, 06 Mar 2005 18:22:44 -0500, Erik Weber [EMAIL PROTECTED] wrote: I think it's probably usually good to question Template when the realization of it comes via

Re: Eliminate Setup Actions

2005-03-05 Thread Erik Weber
You could populate static combo boxes with data stored as application scope attributes that are set at app startup by either a ServletContextListener or a Struts PlugIn (those attributes will be available to any JSP in the app). Erik Ben Taylor wrote: Hi, Can anyone tell me if there is an easy

Re: Struts and EJB integration question?

2005-03-03 Thread Erik Weber
- From: Erik Weber [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, March 01, 2005 5:03 PM Subject: Re: Struts and EJB integration question? I think it depends on your service locator design and API. The goals are ease of maintenance, reusability/decoupling

Re: Struts and EJB integration question?

2005-03-03 Thread Erik Weber
Well that's a good point. I was using a looser definition of facade. Erik N G wrote: On Thu, 03 Mar 2005 12:03:27 -0500, Erik Weber [EMAIL PROTECTED] wrote: Well, a facade is supposed to be a black box, so you shouldn't have to, for example, do an EJB lookup, to use the facade. It's supposed

Re: problem in custom validation method

2005-03-03 Thread Erik Weber
Geez, thanks Niall. I've been posting custom validation examples that wouldn't work with 1.2 and didn't realize it. Please let me know if there are any other significant validator plugin changes from 1.1 to 1.2. Erik Niall Pemberton wrote: The validation method signatures in Struts 1.2 changed

Re: [validation] Help with 'contains' validation

2005-03-01 Thread Erik Weber
This is untested (!), but adapted from a working twofields validation method (used to make sure password1 matches password2, etc.), so it shouldn't be far off the mark. validation.xml: !-- nothing real unusual here -- field property=userID depends=required,minlength,maxlength

Re: [validation] Help with 'contains' validation

2005-03-01 Thread Erik Weber
To ignore case, just convert the two Strings to uppercase before you test if one contains the other. Hope I'm understanding the problem correctly . . . Erik Erik Weber wrote: This is untested (!), but adapted from a working twofields validation method (used to make sure password1 matches

Re: ??? action returning multiple attachments?

2005-03-01 Thread Erik Weber
Could it be accomplished by a single ActionForward with a path that specifies the attachments in a query string? Sorry, I don't exactly know what you mean by attachments. Erik Eric Lemle wrote: Is there a way I can have an action return more than one action forward, meaning some are going to be

Re: Struts and EJB integration question?

2005-03-01 Thread Erik Weber
I think it depends on your service locator design and API. The goals are ease of maintenance, reusability/decoupling and performance. Is the extra layer going to facilitate reuse of your service locator/EJBs? If so then it's probably worth it because it probably won't cost much in terms of

Re: RequestURI (Action not JSP)

2005-02-28 Thread Erik Weber
I used something like this once. First I extended RequestProcessor. I picked the processActionPerform method because it's one of the last ones to be invoked by the controller, and various attributes tend to get removed/added as the controller moves through the request processing chain.

Re: [HTML-TAG] select tag and collections : need of a very simple example

2005-02-28 Thread Erik Weber
html:select styleClass=dropdown property=businessState size=1 html:option value=State:/html:option html:options name=USStateValues labelName=USStateLabels/ /html:select

Re: Propagating errors from a PlugIn to a jsp

2005-02-28 Thread Erik Weber
Your plugin could set application scope attributes using any Exceptions it encounters during the init method. Then your requested JSP (or setup Action) could grab those and iterate them. Erik Alistair Young wrote: Is there any way for a PlugIn to get exception messages up to a jsp? I have a

Re: Iterate over validation errors?

2005-02-27 Thread Erik Weber
Last I checked, Struts came configured to do what I think you are asking by default. This is an example of the (Struts 1.1) ApplicationResources.properties file: #header and footer for form validation error messages errors.header=table width=100% border=0 cellspacing=0 cellpadding=0tr

Re: Iterate over validation errors?

2005-02-27 Thread Erik Weber
bundle? On Sun, 2005-02-27 at 19:04 -0500, Erik Weber wrote: Last I checked, Struts came configured to do what I think you are asking by default. This is an example of the (Struts 1.1) ApplicationResources.properties file: #header and footer for form validation error messages errors.header=table

Re: Iterate over validation errors?

2005-02-27 Thread Erik Weber
Here are a couple of old posts I saved that might help too: At 5:10 PM -0500 11/8/04, Erik Weber wrote: Here is a way to do it that works with 1.1: logic:messagesPresent name=org.apache.struts.action.ERROR property=username bean:message key=error.username.required/ /logic:messagesPresent

Re: Iterate over validation errors?

2005-02-27 Thread Erik Weber
Heh, just ignore everything I wrote and listen to Joe. :) Erik Joe Germuska wrote: html:messages is an iterator through messages, so you can leave the HTML out of the resources file: For the example below, here's how to do it with html:messages instead: div class=error ul html:messages id=msg

Re: RequestURI (Action not JSP)

2005-02-27 Thread Erik Weber
I don't have the best answer, but I've got two ideas for you. One is to remember that the ActionMapping (which inherits from ActionConfig) instance is available to the setup action before you transfer control to your JSP. Not sure if that would help or not. Also, I found it very helpful to

Re: Struts Approach

2005-02-26 Thread Erik Weber
Robert Taylor wrote: Tim, I think things look pretty good so far. Right now Customer is a domain object representing a customer. CustomerDAO is a DAO respsonible for mapping the Customer to its relational counterpart(s). CustomerService collaborates with CustomerDAO to manage the persistence

Re: Struts Approach

2005-02-26 Thread Erik Weber
the strategy I just described and have found the applications have been more scalable and most of the changes tend to be isolated in the application service layer. /robert Erik Weber wrote: Robert Taylor wrote: Tim, I think things look pretty good so far. Right now Customer is a domain object

Re: Struts Jar File conflict

2005-02-25 Thread Erik Weber
application. But the application itself uses some Jakarta jar (older version than the ones in Struts distribution). Any suggestion is welcome. Thank you. Sam -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 6:29 PM To: Struts Users Mailing List Subject

  1   2   3   4   5   >