I use the following code:
myActionForm.setMessage(getResources(request).getMessage(getLocale(request),
"messages.deleteFailed"));
I have two property files, ofmResources_en.properties and
ofmResources_de.properties. The above code fetches the
messages.deleteFailed message from the appropriate
Is your preparation being done in an Action? If so, why not just
instantiate it yourself and call execute() manually?
I do something I think is similar to your question in an application I just
converted to Struts...
I have a management-type screen that has a list of users that can be
mainta
Just wanted to chime in with a tad bit more detail...
If you have a form defined as so...
...And in your action you do...
System.out.println(request.getParameter("submit_value"));
...You will indeed see the value of the button that was clicked.
I only wanted to mention this because I personall
I've only really been concerned with such a thing in one instance, and that
was because we were caching some returned ResultSets, and they could be very
large... What I wound up doing is wrapping each ResultSet in a HashMap, and
I had two other elements, one storing the datetime stamp the object
Have you verified what is being passed to the server? I use a tool called
HTTPWatch, but I'm betting it's not available for Mac, but I'm sure there
are comperable tools available. I can't imagine the browser isn't passing
the data, unless you have some script running before the for is submitte
d I worry about
performance?
Date: Wed, 26 May 2004 15:01:21 -0700
None,
That was EXACTLY the kind of information I was looking for! Thanks for the
deatiled answer.
My god that homegrown framework must have been a beast to convert, but I
bet
the app is sure happier now that its using Struts.
My config file for a project I'm currently working on is 7k, and that's NOT
counting comments (something like 16k counting them - I'm a comment freak).
Since it's only parsed once at startup, I wouldn't be too overly concerned
about performance. Yes, your talking about a lookup for each reques
I presume the element that's throwing the NPE is one of the elements that
the user cannot change. I presume this because let's say for the sake of
argument that all the fields of the ActionForm were on the screen, then what
you describe should never happen.
Your dealing with the classic statel
h the better.
From: Hubert Rabago <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Catch-all ActionMapping?
Date: Tue, 25 May 2004 13:02:20 -0700 (PDT)
--- None None <[EMAIL
Hello all... I guess this is really actually two questions...
First, can anyone explain the settings of the debug and detail init params
of ActionServlet? I haven't been able to dig up any good detail. The best
I've found is that higher numbers are more detailed, but what's the highest
possibl
Seems valid. In general, each individual action is mapped to it's own
action. You can (and sometimes should) break that rule when appropriate,
but more times it tends to be true than not.
For question #2, one thing you can do is submit some sort of flag value from
/app/Contact that /app/Conta
Another option is what I've implemented in a project recently...
First, every single Web Service request is directed to a single Action
mapping, quit originally called /WebServices.app :)
Then, in the action I first check for the SOAPAction header, making the
assumption that only a valid Web Ser
UE);
}
}
The other thing to do is to configure the strut-config.xml, i.e.
BR
/Amleto
-Messaggio originale-
Da: None None [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 19 maggio 2004 20.08
A: [EMAIL PROTECTED]
Oggetto: RE: R: Turning OFF auto form population?
That's interesting, I knew S
lways extend the
RequestProcessor class and override the processPopulate(...) method.
Furthermore, you have to configure struts to use the extended
RequestProcessor version.
BR
/Amleto
-Messaggio originale-
Da: None None [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 19 maggio 2004 19.33
A: [EMA
Hello all... Is it possible to turn OFF Struts auto-populating an ActionForm
with the paramters from the client?
The reason I ask is that I'm converting a non-Struts app over, and in this
app, because it was using a homegrown framework, we have value object
classes which are basically exactly w
ez <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Validation problem
Date: Tue, 18 May 2004 17:43:16 +0200
Try:
- Original Message -
From: "
...
From: Iván Rodríguez <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Validation problem
Date: Tue, 18 May 2004 17:43:16 +0200
Try:
-
Hello again... I'm playing with validation for the first time, and I got it
almost working completely, one remaining problem...
In my ActionForm validate() method, I am checking two elements for errors,
In my test case, both should be getting flagged as incorrect (and they are,
I can see that
lized(ServletContextEvent event) {
this.context = event.getServletContext();
// run your initialization routine here
}
public void contextDestroyed(ServletContextEvent event) {
this.context = null;
}
}
and put this in your web.xml:
path.to.MyContextListener
Jacob
- Original Message -
ther thing that PlugIn gets you
which an SCL doesn't is that its init() method receives a reference
to the Struts ModuleConfig for which the plugin is being initialized
-- so if you need a handle on that object, using a PlugIn is probably
the most straightforward way to get one.
Joe
>Paul
&
Hello again everyone... I am starting conversion of a none-Struts app to
Struts, and mostly it's straight-forward, but two things I have questions
about...
The home-grown framework this app was written with has the notion of an App
Loader. Basically, this is a class that runs at startup and re
:-)
You only need an ActionForm in your action if you need to get told
something
about what to do by the user. If the fact the action is being called is
sufficient knowledge, then dispense with the form declaration.
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
s
and never mess with the httpSession directly.
Locale russian = new Locale("ru");
Locale english = Locale.ENGLISH;
if (condition == true)
{
this.setLocale(request, english);
}
else
{
this.setLocale(request, russian);
}
> -Original Me
Is it the case that every Action MUST be associated with an ActionForm?
Next week I have to start converting an app to Struts, and one of the
assumptions I've been making is that I can just NOT associate any ActionForm
with the Actions. As you say it's not a big deal, I can just do the empty
Unless I'm missing something in your question, the answer is that you can
access the elements in the request object, they should still be there when
the submission gets to your Action.
From: "Matt Bathje" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts
le locale =
(Locale)session.getAttribute("org.apache.struts.action.LOCALE");
if(locale == null)
locale = defaultLocale;
return locale;
}
So to switch the Locale dynamically, update the Locale object saved in
the session.
Thanks,
Yuanbo
-Original Message--
ale dynamically, update the Locale object saved in
the session.
Thanks,
Yuanbo
-Original Message-
From: None None [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Sharing what I've learned: locale switching
Because this might be helpful to othe
Because this might be helpful to others, and because I probably would have
spent another couple of hours figuring it out on my own without the help of
some people on this lsit, I wanted to give back as much as I could. So,
here's a consolidated bit of info I've learned about switching language
r work.
Another way is that you save your Locale object to session in jsp something
like
session.setAttribute(Globals.LOCALE_KEY, yourLocaleObject);
then Struts can just find out the correct resource for different locale
when you use the following in the jsp
Hope this helps.
Larry Zhang
-
monstrate the i18n faculties. Have you looked at that?
Paul
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 4:40 PM
> To: [EMAIL PROTECTED]
> Subject: How to access a variable message resource bundle from JSP
>
>
> Hi again
Hi again everyone... yesterday, with assistance from some of you folks, I
was able to get multiple message resource bundles working to return a
Locale-specific error message from one of my Action classes. Very cool.
Now I'm trying to do the same thing in a JSP.
Here's my question... in my JSP'
ct: RE: Language resource bundles problem
Date: Fri, 14 May 2004 09:49:44 +0100
I think the Locale should be magically in session for you.
Paul
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 6:48 PM
> To: [EMAIL PROTECTED]
>
Another related problem...
I've gotten this working as you state fine now. I have a session attribute,
countryCode, that is literally just EN, DE, etc. I have some images of
flags, when you click one it calls an action that sets the appropriate code
in session (I also do this in the first Act
Sorry Paul, I actually missed your reply (the inevitable result of having
five different high-volume mailing lists filing into one eMail account).
Indeed, what you state did the trick, thank you very much!
Oh, actually, one other question... I've never had to think about
internationalization b
t;de", "messages.deleteFailed"));
Correct me if I am wrong
Harjot
- Original Message -
From: "None None" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 13, 2004 8:54 PM
Subject: Language resource bundles problem
> Hello all. I poste
Hello all. I posted this question a little while ago as a reply to another
thread, but I figured the question might be lost there...
I'm trying to get multiple language support to work. I have created two
files, ofmResources.properties and ofmResources_de.properties and stored
them in WEB-INF
ls.LOCALE_KEY);
[...]
this.seleccio =
messages.getMessage(locale,"etiqueta.enregistramentPersonal.intern");
is it correct?
- Original Message -
From: "None None" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 12, 2004 10:11 PM
Subject: Re: Accessi
d servlet since it's already in
production. Also the ActionForm associated with my Action does not have the
member variable needed by the second servlet. I really didn't want to add
fields to the ActionForm that weren't needed for this Action
-Original Message-
From: None N
cool in my book.
From: Riyad Kalla <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Accessing ResourceBundle items from Action class
Date: Wed, 12 May 2004 13:05:50 -07
. The forward I'm
mapping to is not a Struts action but a servlet mapping specified in the
web.xml.. It's an older servlet created before we started using struts so
it
does have to get the required parameters from the request object
-Original Message-
From: None None [mailto:[EMAIL
s the properties file...
I think this should do the trick, please fix the path when necessary:
Properties properties = new
Properties().load(MyActionServlet.getClass().getResourceAsStream("ApplicationResources.properties");
----
On Wednesday 12 May 2004 12:51 pm, None N
Hello all. I have in my app a resouce bundle, and I can use it in my JSP's
no problem... my question though is how can I access those items from an
Action?
Specifically, I have some error messages that I want to return to the view.
At present they are hardcoded in my Action classes and they a
I'm pretty new to Struts, and it's entirely possible I'm not following what
your saying, but...
If the first Action is getting an ActionForm with the four parameters
populated, you can simply instantiate the second Action, passing it the
ActionForm, and then return from the first Action the Act
Well, for anyone following my posts over the past few days, I now have a
rather useful little file manager application working. Just the bare
minimums at the moment (file system hierarchy traversal, all drives on the
system accessible, downloading files, deleting and renaming files and
directo
May 2004 10:14:44 -0700
Woops I just reread your message and noticed that I missed that part. But
you
found it, so nice job.
Have fun strusting
On Tuesday 11 May 2004 10:13 am, None None wrote:
> Wow, it really is that easy, isn't it?!? :) The only problem is that,
as I
> unde
ollections
Date: Tue, 11 May 2004 10:06:49 -0700
...
...
...
On Tuesday 11 May 2004 10:03 am, None None wrote:
> Hi folks... this should be a simple one, but I've been reading for about
30
> minutes now w
Hi folks... this should be a simple one, but I've been reading for about 30
minutes now without finding the answer...
I have a collection that I iterate over with logic:iterate, building a
table... normal stuff... problem is, the collection might be null, which the
tag handles just fine, except
forward to (I assume it's valid to do that within
Struts? Can't think of too many instances where returnign null from an
action would be what you wanted to do, but I didn't seem to see any
complaints, so I guess it's OK to do).
Maybe that'll help someone else out some
Ok, so in my continuing effort to learn Struts by writing a file manager
app, things are going very well. But, now I find myself at another
stumbling block...
Is there any easy way to implement a file download in Struts WHEN THE TARGET
FILE COULD BE ANYWHERE IN THE FILE SYSTEM? It doesn't see
y 2004 21:08:54 +0100
Its all looks good to me except that File.getName() is returning an empty
String - instead of using "name" in your try "path" and I
think
you'll see what you're expecting:
Niall
- Original Message -
From: "None None&qu
rs Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Some further newbie woes
Date: Thu, 6 May 2004 15:37:53 -0400
Any joy looking at the page source maybe..?
> -Original Message-
> From: None None [mailto:
I'll stick with None None until I get this figured out :)
That didn't seem to help either... I actually thought of that previously, I
figured at some point there has to be some code casting an Object to a File
object, otherwise certainly the getName() method call is going to fail.
PROTECTED]>
Subject: RE: Some further newbie woes
Date: Thu, 6 May 2004 14:31:18 -0500
Hi None None...
So in your JSP you are iterating over an ArrayList of File objects, trying
to get at a property inside the File objects. To get at nested objects,
you use the Struts nested tag library.
Tr
Ok, I've banged my head enough in the past two hours...
I'm working on a file manager Struts app to get myself acquainted with
Struts. The first logical step is a list of drives. Here's what I've
done...
I have created an index.jsp that does a quick forward to main.jsp (just like
the blank s
-0400
Excessive?
Maybe the struts console could be of assistance?
http://www.jamesholmes.com/struts/
Dennis
"None None" <[EMAIL PROTECTED]>
05/05/2004 04:34 PM
Please respond to "Struts Users Mailing List"
To: [EMAIL PROTECTED]
cc:
Hello all. I am a new struts user (but an accomplished web developer...
don't ask how those statements can possibly be logical consistent! :) ) ...
for my first learning project I decided to do a file manager app. I was
going OK with the basics, but then I ran into an issue I can't seem to
re
56 matches
Mail list logo