This is interesting to say the least.
I have a similar form where I MANUALLY PERFORM the validation and I stick in
the message keys myself for a bunch of detail records. I add them via a helper
function:
/**
* Return the field name that represents the detail row that is in error
You should just Google things like this. I did a quick search on: img tag to
display image from database jsp
Here was the first link which explains it pretty well.
http://www.coderanch.com/t/292437/JSP/java/display-image-after-retrieving-it
Sorry for the late response.
Eric
-Original Mess
I always thought the best examples for learning how to do this were here:
http://www.learntechnology.net/content/struts/struts_crud.jsp
Google returns about 300,000 hits when you type in: STRUTS CRUD tutorial. I'm
sure there is something else that's useful. I also liked the www.RoseIndia.com
s
You could create these objects at startup via a Listener (defined in web.xml)
and available as part of the ServletContext as attributes.
You could also wire them together via Spring and gain access via Spring's
WebApplicationContext (I think that's what it's called).
Eric
-Original Message
Is anyone using Struts 1.3.x with the COR pattern (chain-config.xml and
ComposableRequestProcessor) with Spring?
If so, how are you using Spring-defined Service Beans? I haven't looked into
this combination at all since I've been using Struts 1.3.x. I'm just writing
my own DAOs called by Acti
>> I just downloaded the 2.0.14 from the apache site and the
>> struts-tags.tld file is definitely 1.2 as opposed to the one included
>> with the 2.1.6 release which is newer (uses the JSP 2.x xml schema
>> definition).
>>
>> -Original Message-
>> From
: Tuesday, June 02, 2009 11:21 AM
To: Struts Users Mailing List
Subject: Re: S2: on Servlet 2.3
Givler, Eric wrote:
> Can you respond with a specific version that you used? 2.0.?
Probably around 2.0.4-ish, although I really have no clue at this point.
I might be able to find out specifically in a
Can you respond with a specific version that you used? 2.0.?
Thanks!
-Original Message-
From: Dave Newton [mailto:newton.d...@yahoo.com]
Sent: Friday, May 29, 2009 4:03 PM
To: Struts Users Mailing List
Subject: Re: S2: on Servlet 2.3
Givler, Eric wrote:
> I read a few threads on t
.d...@yahoo.com]
Sent: Friday, May 29, 2009 4:02 PM
To: Struts Users Mailing List
Subject: Re: S2: on Servlet 2.3
Givler, Eric wrote:
> I read a few threads on this and have not seen anything that reflects that
> this can be done.
I've run older S2 under servlet 2.3, but that was pre
ppreciated. I'll post back more details if I have some time
this weekend.
Eric
From: Dave Newton [newton.d...@yahoo.com]
Sent: Friday, May 29, 2009 4:02 PM
To: Struts Users Mailing List
Subject: Re: S2: on Servlet 2.3
Givler, Eric wrote:
> I read a few threads o
I read a few threads on this and have not seen anything that reflects that this
can be done.
Is anyone running Struts2 on an older Servlet Container, and if so, what did
you do to get it running? We're stuck with an Oracle Application Server 10gR2
server that can be tweaked to support a newer
This could be caused by the differences in Digester/BeanUtils versions between
the two. You could step it in the old version and in the new one and see how
it parses those properties.
-Original Message-
From: MassimoH [mailto:massimohei...@gmail.com]
Sent: Monday, March 23, 2009 10:54 A
Can't you do something like this:
StringBuffer sb = new StringBuffer(255);
Map fields = BeanUtils.describe( xmlbean );
Iterator iter = fields.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
String value = String.value
m: paulus.benedic...@gmail.com [mailto:paulus.benedic...@gmail.com] On
Behalf Of Paul Benedict
Sent: Thursday, December 18, 2008 11:14 PM
To: Struts Users Mailing List
Subject: Re: S1: Nocache and SSL
Sounds like an interesting idea. Are you using within the action
config to turn caching off only w
to make a framework change when you can just write
the file.
--- On Wed, 12/17/08, Givler, Eric wrote:
> From: Givler, Eric
> Subject: RE: get file path from FormFile
> To: "'Struts Users Mailing List'"
> Date: Wednesday, December 17, 2008, 10:34 AM
> Would th
Would there be an issue with modifying the controller settings and setting the
memFileSize artifically low so the file is always written to disk, then gaining
access to the filename via reflection?
// create in package org.apache.struts.upload
public static String getFilePath( FormFile file ) {
Sorry about that...
I really think the tutorials on the Learntechnology site are better for
learning struts. They all come with downloadable war files. Head on over to:
http://www.learntechnology.net/content/main.jsp and check them out.
-Original Message-
From: Givler, Eric [mailto
This sounds like one of the tutorials on Java Boutique. Not to plug another
site, but I really thought the tutorials on
From: gbattine [EMAIL PROTECTED]
Sent: Sunday, December 07, 2008 11:39 AM
To: user@struts.apache.org
Subject: Cannot find bean in any sc
I'm using Struts 1.3.5 and when I last checked there was a method
getValidationKey:
getValidationKey(ActionMapping mapping, HttpServletRequest request)
Returns the Validation key.
This is fired inside of the validate() method to determine which validation
ruleset to use inside the val
Doesn't the ValidatorActionForm provide a means of getting/setting the
validation key to be used (normally set to the mapping.getPath())? If that's
the case, can't you inject your own key programmatically?
From: dancerjohn [EMAIL PROTECTED]
Sent: Monday,
I'm using Struts 1.3.5.
I've run into a snag lately that my struts-config.xml controller nocache
setting is causing IE to not download/display a PDF from one of my actions (see
http://support.microsoft.com/?kbid=323308). I thought I could selectively turn
off the nocache attribute for the sing
In order to get a grasp of this, it would be helpful if you read the following:
Succeeding With Struts: Dynaforms
By James M. Turner
http://www.developer.com/java/web/article.php/2214681
Succeeding With Struts: Indexed Properties and Beans as Properties
By James M. Turner
http://www.developer.com
You define the field label using an argument, i.e.
So the validator is using the field's label to fill in the message. The
default message for errors.required is:
errors.required={0} is required.
So, it will replace {0} with the prompt.username entry that also appears as a
resou
xception from Module can't find resource
2008/2/21, Givler, Eric <[EMAIL PROTECTED]>:
> B) change the link tag so it always reads from the Context Root.
Just a quick help: use tag, that will transform your relative
path to a server-relative URL:
http://java.sun.com/products/
Greetings
I have an application split into three modules. When an application
error occurs, I have a global exception defined in the root
configuration, as well as in each module.
When the module hits the error, the global exception's entry in the
module is:
The root module's ex
do I prevent two calls concurrently?
Givler, Eric wrote:
> The problem is the
> user double clicks [login] and can get two calls to the service method
> to execute simultaneously. They both don't see a row, so they both do
> an INSERT. One of the inserts fails due to a PK o
I have a Struts application where a user enters an account id#
and a pin to enter the application. The user will already be
authenticated via an LDAP server prior to accessing my application, so
the remote user name is there, as well as role information. After the
user clicks [login], I f
Responses inline...
-Original Message-
From: Minghui Yu [mailto:[EMAIL PROTECTED]
Sent: Thu 11/15/2007 7:16 PM
To: Struts Users Mailing List
Cc:
Subject: Basic Struts work flow question
Hi there,
up
your struts config without using modules.
On 9/28/07, Givler, Eric <[EMAIL PROTECTED]> wrote:
>
> Can anyone assist with this?
>
> -Original Message-
> From: Givler, Eric [mailto:[EMAIL PROTECTED]
> Sent: Saturday, September 22, 2007 1:25 AM
> To: user@strut
Can anyone assist with this?
-Original Message-
From: Givler, Eric [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 22, 2007 1:25 AM
To: user@struts.apache.org
Subject: [s1.35] Need help with Struts and Modules
Hello,
Let me just say that I'm struggling at times writing my
Hello,
Let me just say that I'm struggling at times writing my first production Struts
application. The issue that I'm trying to wrestle with now is that part of the
application requires security, and part of it should allow general access to
the public. This sounds like a case for modules (
I'd recommend going to the Learntechnology site, and reading this:
http://www.learntechnology.net/content/struts/struts_crud.jsp
-Original Message-
From: Henry F. Camacho Jr. [mailto:[EMAIL PROTECTED]
Sent: Thu 5/24/2007 9:10 PM
To: user@struts.apache.org
orm or parse the incoming form.
Hubert
On 4/26/07, Givler, Eric <[EMAIL PROTECTED]> wrote:
> Thanks for the quick response.
>
> The field in the db is to be stored stripped of formatting. However, the
> display and entry of the field should include the formatting.
>
> --
Users Mailing List
Subject: Re: Struts/FormDef formatting question
Your form field will come in as String. If you'll be storing the data
as string as well, maybe you don't need any more conversion between
the two.
Hubert
On 4/26/07, Givler, Eric <[EMAIL PROTECTED]> wrote:
> I
I was reading on the Formdef site about using a formatter (converter) for
handling a phone number for dynamic form beans in Struts. I have a situation
that is very similar to this but I'm not sure how to go about writing it. The
existing table has numeric phone fields which will not be changed
MJ>If you don't use Javascript, how do you supply id of an item to edit?
Right now, it's a hyperlink.
The previous Model 1 based version of the application used a button, and then
it cycled through all the rows (it had a rowcount as a hidden var). So, if the
request.getParameter("event_edit#
I have a multi-record display grid and I want the user to be able to click a
button to Edit a record. Since the page also handles Loading the records, and
navigation to two other places, I was using the EventDispatchAction.
I tried mapping: event_edit{?}=Edit, but the Edit method is never invok
notified that you have received
this communication in error and that any review, disclosure, dissemination,
distribution or copying of it or its
contents
- Original Message -
From: "Givler, Eric" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Monday, Oc
Did you ever get a solution to this?
The filename from FormFile.getFileName() is the client file name, right?
My requirement is that the uploads can be up to 100MB, and I can see the file
created in a temp folder (rather quickly). Before I can load it into the
database, I have to run a virus
Did you ever get a solution to this?
The filename from FormFile.getFileName() is the client file name, right?
My requirement is that the uploads can be up to 100MB, and I can see the file
created in a temp folder (rather quickly). Before I can load it into the
database, I have to run a virus
First, I really appreciate the quick response!
I'm a little confused on the suggestion, since save() is called automatically
since it uses a dispatch action. The struts-config.xml has a mapping for
event_save=save, so if it's in save(), I wouldn't really need to test a form
field called Action
I've been trying to get the hang of struts now for the past few months, and am
wondering how people write "re-usable" base classes for Struts. If you have
the time, I'd really appreciate your thoughts on this - bear with me, as it's a
lot of reading:
My actions tend to be "similar" but making
oops! return mapping.findForward("success");
-Original Message-----
From: Givler, Eric [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 28, 2006 10:23 AM
To: Struts Users Mailing List
Subject: RE: Forward to action without jsp
I'm not sure I understand what's wron
I'm not sure I understand what's wrong with this:
1. The load object from database is in the action's execute.
2. The menu choice is: Edit My Profile (for example), which invokes the action
from #1
public ActionForward execute( ) throws ...
{
String userId = request.getParame
)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:434)
[rest of stack trace remove]
-Original Message-
From: Andy.de [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 28, 2006 3:05 AM
To: user@struts.apache.org
Subject: RE: global exceptions, key?
G
I'm pretty sure the error.message1 key which is looked up in the resource file
can be displayed in the resulting jsp with:
In regards to the exception, that's stored as a request attribute, which can be
obtained via:
<%
Exception e2 = (Exception) request.getAttribute( Globals.EXCEPTION_KEY );
%
Can't you do something like this:
fwd = mapping.findForward( "gf_action2" );
fwd.setPath( fwd.getPath() + "?id=100");
return fwd;
gf_action2 would be a global-forward to action2.
-Original Message-
From: Tony Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, September 22, 2006 10:46 AM
What's the leading "/" for?
-Original Message-
From: Martin Burkhart [mailto:[EMAIL PROTECTED]
Sent: Friday, September 22, 2006 9:40 AM
To: user@struts.apache.org
Subject: Migrating Struts application from weblogic 8.1 to 9.2
Hi
Im trying to get my struts 1.2.7 application running prope
You can find this issue documented inside of the Strut's Survival Guide at:
http://www.objectsource.com/
-Original Message-
From: yamilka vallejo ramos [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 4:10 PM
To: user@struts.apache.org
Subject: about pagination
hi, does any
Do you have to issue code after the call here:
frm.set("typeName", "x");
like:
placeFormBackInScope( mapping, frm, request );
which would place the updated form back in scope:
public void placeFormInScope(ActionMapping mapping,
ActionForm form,
On this page: http://wiki.apache.org/struts/ActionErrorsAndActionMessages
Any of the URLs at the bottom do not appear to work.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
It appears that the value for your paymentPropertyName is not pointing to the
INDIVIDUAL property, but to the ArrayList as a whole. Try setting it to a
property of the object that is in the array list. ie. payments[#].amount
Be sure your form has a getPayments method as well.
-Original M
You may want to use an struts mailing list archive search, and look at this
thread:
how to handle requests submitted using java script with a LookupDispatchAction
subcalss
http://article.gmane.org/gmane.comp.jakarta.struts.user/124351/match=lookupdispatchaction+subcalss+javascript
Or a similar
There's an example of doing this inside the Struts Live Sample Chapters (p 144).
You can register on TheServerSide, and download it here:
http://www.theserverside.com/tt/books/sourcebeat/JakartaStrutsLive/index.tss
The section is titled: Extending Validate and Custom Validation in the
Validate()
You'd need to rebuild the second list on the posting of the form, i.e.
1. get value selected from first list
2. invoke method to refresh dependent list based on user prm from fist list
3. place that list into a request attribute to read on the page.
Here's a code snippet. The prepareLOVs is call
Can you provide the connection pool from your Container's defined data-source
and then use iBATIS for persistence?
http://ibatis.apache.org.
There's a 9 page Java tutorial at:
http://people.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial_en.pdf,
and the total docs are less
I've had this happen when I had a Struts Action which was written to return a
PDF document. I found a note somewhere online that says that IE (in some
versions) sends a second request for these.
-Original Message-
From: Daniel Chacón Sánchez [mailto:[EMAIL PROTECTED]
Sent: Monday, Septe
Assuming you've turned off the automatic validation (validate="false" in
struts-config.xml), then you can programmatically determine which button was
pressed in your execute() method, via request.getParameter("btn_cancel") for
example, then decide not to call something.
public ActionForward exe
Can someone elaborate on this? I'll offer a virtual beer after normal work
hours.
-Original Message-
From: Givler, Eric [mailto:[EMAIL PROTECTED]
Sent: Friday, August 18, 2006 11:59 AM
To: user@struts.apache.org
Subject: Formatting data for display and parsing to save
I don'
Your best bet would be to read some of the tutorials here:
http://www.learntechnology.net/
The Struts CRUD lesson or the Struts iBATIS Lesson 1 would be helpful.
-Original Message-
From: Maya menon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 11:45 AM
To: user@struts.apache.
Is the return forward from your action a forward to an action or to a JSP?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 7:21 AM
To: user@struts.apache.org
Subject: Action will be processed two times
Hi all,
I use struts for a lon
I don't know why, but I've been wondering how to handle the issue of presenting
formatted data to a user in a struts-based application.
That is, is it:
1. Backend bean is strongly typed and data is read into this via Service method
of some sort
2. Action takes backend data and through a helper
If I can't write it in validator easily, then I write it in the validate()
method. I use validator for required, date mask, integer, and a few others.
If I knew anything about regular expressions or struts validator's validwhen()
I'd probably do more - excuses, excuses.
So, you could say some
I had a similar problem here. I used formdef to define the page attribute and
didn't specify the type. When the cast was made inside of validator, it was
unable to cast the value to an Integer. The field was a string containing the
page number. Couldn't it use Integer.valueOf?
-Original
Can you override the validate() method inside your form and just call
super.validate(), then see what the error collection has?
At least then you know it was called, but may not have done what you thought it
should:
package view.struts.forms;
import javax.servlet.http.HttpServletRequest;
impor
You could create another validator, and inside that perform a stripping of
non-numeric characters (stripCommas), then
execute code similar to the existing "long range" validator like this:
/**
* Determines if a formatted numeric value is between a range as defined by
* the user-suppl
Can you override the validate() method in your form that extends ValidatorForm,
and then inside that do something like this?
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
{
ActionErrors errors = null;
if ( request.getParameter("closeButton") == null ) {
Do you generally put any session related expiry code in a base action class so
you can forward prior to calling your execute() method in the action if the
session is no longer "active"?
That is, I really wouldn't want any of the action class code running, and
currently the application I'm wor
But can't you just define a message specific to the field and validator for
each definition in the validations.xml file?
min0
max50
-Original Message-
From: Scott Van Wart [mailto:[EMAIL PROTECTED]
Sent: Tue
properties and validation
Importance: High
You can do this:
http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html
Niall
On 6/15/06, Givler, Eric <[EMAIL PROTECTED]> wrote:
> I was following this article (MS Powerpoint presentation by James Turner)
>
Couldn't you do something like this:
Then you can interrogate that variable later as it contains the contents of the
error for the field in question. If no errors, it is empty.
// do something here
// else do something else
or use a
-Original Me
If you are using Struts 1.2.9, then lookup EventActionDispatcher.
-Original Message-
From: Scott Van Wart [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 21, 2006 1:39 PM
To: Struts Users Mailing List
Subject: Re: Struts Design question
Monkeyden wrote:
> If your implementation is simila
I based a multi record form on an array of beans:
I can populate the array (set it up) for both ADD and EDIT mode, however, when
I click save, none of the request parameters are written into the bean. The
properties (as they exist in RequestUtils.ppulate) are correct.
You can ignore this thread. The issue with validator was found on bugzilla at:
http://issues.apache.org/bugzilla/show_bug.cgi?id=23372
via another Struts thread. "The Mail Archive" site is nice for
finding/searching mailing lists.
-Original Message-----
From: Givler, Eric [mai
rror as opposed to a number of
them?
Also, JDeveloper (10.1.2.1) refuses to recognize the errorStyle tag, though if
I open the struts-html.tld file that is in WEB-INF, it appears directly under
the tag class that JDeveloper says does not support it.
-Original Message-----
From: Givler, Eric
I was following this article (MS Powerpoint presentation by James Turner) here:
http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt
When, I tried to cobble this all into a working example, if I left out multiple
values (in a four record grid), I'd get one struts validation error bac
Are you sure that the version of the code that you are using is consistent with
the version of the Struts version that you are using?
If the signature for the validator-rules methods has changed since the example
that was provided, then it's not going to call those methods. You should be
see
We have an application where we'd like to prevent the user from navigating
within the application using bookmarks or their history. If they do this, in
most cases, the proper queries will not have run and the application will be in
an indeterminate state.
We thought the solution was to simply
78 matches
Mail list logo