Good, that's what I had assumed was the case. The app I'm converting next
week was based on a home-grown framework, and at least in the first
iteration it's easiest to not even think about ActionForms. We have Value
Object classes that are akin to ActionForms, except that they are just
transf
Exactly, that's true. If you just want a struts action performing your
request processing you do not need any form.
Your mapping will look something like.
And in your action class you can then do the same thing as earlier :
public ActionForward execute(ActionMapping mapping, ActionForm form,
Hello Geeta,
I've solved the problem, still don't really understand the reason.
I've defined a global forward for the input of my reluctant form, and
now, in case of validation error, I am forwarded to the desired page,
not to the blank one.
Thanks for you help.
Samuel
--
Actually, it's not at all the case.
To merge a couple of simultaneous threads here, my app has a link that
lets the user toggle between languages. It calls an action that cares
nothing about any form. It just looks at the current Locale and goes on
:-)
You only need an ActionForm in your action
You can use request.getParameter()/getParameterValues() inside an Action to
retrieve form values without using an ActionForm. However, without an
ActionForm, you won't be able to use the Struts and related tags
and form validation.
--- None None <[EMAIL PROTECTED]> wrote:
> Is it the case that e
Excellent, even better! Thank you!
It's becoming obvious to me that I need to spend a few hours just looking at
what's available in the Action (and other) base classes. I've been just
learning what I need to each step of the way, but maybe a little time
reading through the javadocs would be us
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
Suggestion:
Rather than using the GLOBALS.Locale_Key in the session, use the
action.setLocale() method. This way you won't have to be changing your
code if the internals change.
For example, to decide between, say English and Russian, you can do this
and never mess with the httpSession directly.
At 4:44 PM -0500 5/14/04, Matt Bathje wrote:
Hi all.
I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)
Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as well
as multi-p
Matt,
In your action class, you have the request and the response object which
will get you all your form elements
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws java.lang.Exception {
String xxx
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
pls,
You won't get an null ActionForm in your Action, you
will just get an empty one. I think because you are
testing for null, you are always populating it from
the DB.
Regards,
Richard
--- pls <[EMAIL PROTECTED]> wrote:
> Hi Richard,
>
>I thought this one would work for sure.. but no
> d
If you want to submit it to a struts action, then presumably you can
control the action element of the form tag.
If so, why can't you associate the action with a struts form too?
It would help to have more information.
-Joe
> -Original Message-
> From: Matt Bathje [mailto:[EMAIL PROTECT
Hi all.
I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)
Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as well
as multi-part (formfile) elements from the form.
Any
Hi Richard,
I thought this one would work for sure.. but no dice.. the values still
reappear (except for the multiboxes whcih are cleared in the reset() method)
after request.getSession().removeAttribute("MBForm"); and a forward to the
next action.
"Richard Yee" <[EMAIL PROTECTED]> wrote i
"Ashish Goswami, Noida" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi ,
> i am facing a problem where i am getting xml input from another server
over
> http to my servlet.i use request.getInputStream() to get the xml file
parse
> it and use JAXB to marashall into java objects.My
pls,
If the form exists in session scope, then you need to
remove it from session using the
request.getSession.removeAttribute() method
call. Otherwise, when the JSP page is executed, struts
will use the form from the session.
Regards,
Richard
--- pls <[EMAIL PROTECTED]> wrote:
> that won't chan
I have double checked that the signin/Welcome.jsp is
at the application root. Therefore, the forward
statement should not cause the NullPointerException
problem.
What confuses me is that I have done something similar
before; i.e. I have other java class extends Action.
And upon completio
In my experience this works fine.
Colin
Nathan Maves wrote:
That was it!
What is the best way to set a date field as a hidden property?
Will is just work if I use
Nathan
On May 14, 2004, at 2:10 PM, Colin Kilburn wrote:
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date
That was it!
What is the best way to set a date field as a hidden property?
Will is just work if I use
Nathan
On May 14, 2004, at 2:10 PM, Colin Kilburn wrote:
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date
field. It seems that a null or empty String is not a vali
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date
field. It seems that a null or empty String is not a valid value for
conversion to a Date. I remember the issue having something to do with
BeanUtils' converter not having a default value for Date. Any
chance
Correct me if I am wrong, I don't know if this is ever possible. If the
validation method in ActionForm class returns a not null ActionErrors
obj, the flow will direct to "input" page, so if you really want to
invoke something in this case, my bet is that you have to put that logic
inside your Acti
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessor
that won't change the form as it exists in session scope, only temporarily
in the action.. thanks anyways
"Kiran Kumar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> just a guess in ur execute method try this
>
> form = null;
>
>
>
> --- pls <[EMAIL PROTECTED]> wrote:
> > thanks fo
Hi,
In my JSP I get an Vector with VehicleTO-objects (which was set into the
request
from an action). Now I want to Submit the generated form to another action
with
an associated ActionForm (VehicleForm). The VehicleForm has an indexed
property
(locationScheduleEntry) of type ArrayList.
locationSc
Well, I run in similar issues deploying in iplanetAS 6.0 SP5. I was able to
make it start the application by patching the class loading in struts and
digester jars, but I rejected in patching the custom tags, so I decided to
use plain HTML instead.
WHY this happends? Maybe because iPlanet 6.0 i
That's good to know too, thanks very much Larry!
From: "Zhang, Larry (L.)" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Sharing what I've learned: locale switching
Date: Fri, 14 May 2004 14:53:06 -0400
Additionally, if you want other key(other than org.apache.struts.action.LOCALE
=Globals.LOCALE_KEY) to store your locale,
you can do this:
session.setAttribute("myNewMeaningfulKey",myLocaleObject), then in your JSP you would
use this:
. This is the way the
locale attribute in message tag is us
Ah, thank you Yuanbo, I didn't see the getLocale() method of the Action
class. Excellent, so the code in the Action I posted can be reduced
somewhat... when you want to get a Locale-sensitive string to return to the
view, you can do:
lpcaf.setMessage(getResources(request).getMessage(getLocale(
Thanks for sharing the information. Basically struts using the following
method to decide which Locale is in the session, then load the
corresponding resource bundle:
protected Locale getLocale(HttpServletRequest request)
{
HttpSession session = request.getSession();
Locale loc
All-
In an attempt to find the limits of iWS6.0SP5, I created a simple "Hello
World" Struts app using 1.0 and have it successfully deployed and running.
To take it to the next level, I made the same app Struts 1.1 compliant by
changing the struts-config.xml to 1.1 format, upgrading stuts.jar and
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
Where is signin/Welcome.jsp?
if located under WEB-INF/signin then modify forward statement to
Martin
- Original Message -
From: "Caroline Jen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 14, 2004 10:54 AM
Subject: NullPointerException - findSuccess(Unknown Source)
> Nee
Thanks Larry, I wasn't sure the order that the JSP processor would interpret
things, whether it would do the scriplets before the tags. Either way, I
think the second point you make is really the "right" answer, especially
since Paul indicates the same thing, so I'm going to go do that. Should
I have to admint I haven't looked at and of the samples, but I'm going to
right after I hit send here :)
From: Paul McCulloch <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: How to access a variable me
I have a DispatchAction with two methods. I pass a hidden field "method" in
my form, to determine which method should be called. But I want to override
this and call a specific method if the form's validation fails.
Is it legitimate to put this in the action mapping?
input="/myAction.do?method
You can try using doSomething.do?p1=BU&p2=BR&M&p3=bu2
That is, replace '&' in your paramter value with '&' .
robert
> -Original Message-
> From: bojke [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 11:51 AM
> To: Struts Users Mailing List
> Subject: The request parameter value c
You'll have to intercept the spaces and covert them to 's, atleast
this is what I have had to do.
Brad Balmer wrote:
This isn't a struts issue as it seems to be an issue with how browsers
(IE) don't display two spaces in a row.
I'm using bean:write to display a variable to the page. The prob
This isn't a struts issue as it seems to be an issue with how browsers
(IE) don't display two spaces in a row.
I'm using bean:write to display a variable to the page. The problem is
that the value sometimes contains double-spaces which are being
displayed as a single-space.
Does anybody know
Thanks dude,
Bojan.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Try:
String url = "oSomething.do?p1=BU&p2=" +
java.net.URLEncoder.encode("BR&M) + "&p3=bu2"
Thanks,
Yuanbo
-Original Message-
From: bojke [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 11:51 AM
To: Struts Users Mailing List
Subject: The request parameter value contains &
Hi,
Suppose you have
<% String countryCode = "en"; %>
I think will do your
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
w
An Idea of the cause or an idea of a workaround ?
As of the cause, i wish you know it.
As of a solution, here is from another list :
Any value that is passed that is not A-Za-z0-9_- should to
be url encoded. That is all spaces are turned into + signs
and other characters are changed into this for
works without any further help, assuming the struts session
scope locale attribute is set.
I'm pretty sure that one of the struts example apps is specifically there to
demonstrate the i18n faculties. Have you looked at that?
Paul
> -Original Message-
> From: None None [mailto:[EMAIL PR
Hi,
I have the request parameter and that one has value par example BR&M.
par example:
doSomething.do?p1=BU&p2=BR&M&p3=bu2
I must use GET method for the as methodt. (I am launching the popup
using window.open(url)).
So, in the action, on the server side I am getting BR as the parameter
value i
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'
The stack trace indicates that you are extending
org.apache.struts.scaffold.BaseAction rather than just Action.
I'm not familiar with the scaffold package - perhaps the forward "success"
has a special meaning within scaffold?
Paul
> -Original Message-
> From: Caroline Jen [mailto:[EMAIL
Need your expertise to diagnose the problem.
I have a java class ListThread.java that extends
Action. This java class simply calls a couple of
helper classes to access my database. In the end of
the ListThread.java, it is a standard statement:
return ( mapping.findForward( "success" ) );
I have
Good Morning Geeta,
Geeta Ramani wrote:
Hmm.. Ok, look at the source code of the page you get.. anything there?
No so much, right?
I used to work, then I probably change _something_
Sincerly
Samuel
--- andinasoft SA - Software y Consulting ---
Mariano Aguilera 276 y Almagro - Quito, Ecu
I ran into a problem like this before, and I suspected it was the PDF reader
which sent the second request. It wasn't happening with earlier Acrobat
versions, though. When our company rolled out a (then) newer Acrobat
version, we started seeing these double requests.
The solution I used then was
Ok, when I get back to work on this Monday I'll do a dump of session
attributes and see if it's there. If it is by default, then great, I'll
just use that instead my own countryCode attribute like I've done. In
regard to your other post about using what the browser sends, that's a good
idea,
Hi Vetri:
I don't know the solution to your problem, but I remember not too long ago somebody
else had a similar problem with his/her page being submitting twice. I believe that
problem was in fact solved. So maybe you could search the archives..?
Regards,
Geeta
> -Original Message-
>
Thanks for the reply.
I also confirmed a few things myself. I was able to rebuild the Struts
1.1 source against Commons-Lang 2.0 and did not encounter any errors.
Furthermore, it looks like the only "Commons-Lang" dependencies are in
the "test" classes which are part of the struts.jar release (
Jonathan Wright wrote:
Can anyone see anything wrong with the following select and option tags? I
cannot fathom out why I keep getting an exception thrown in the
BodyContent.clearBody method.
This does not work:
Select One Auckland Christchurch Dunedin Gisborne Ham
Hmm.. Ok, look at the source code of the page you get.. anything there?
Geeta
> -Original Message-
> From: Samuel Rochas [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 6:42 PM
> To: Struts Users Mailing List
> Subject: Re: Server side validation
>
>
> Hello Geeta,
>
> > "login
Andrew Hill wrote:
That will destroy *everything* in the users session.
Yes, it is a bit brutal, but it is precisely what I wanted. The user has
completed a purchase, having entered credit card details and all. This
logs them out completely, which is what I needed. Adam's requirement may
we
Haven't done it myself but I thought you had to edit the registry to modify VM
settings for a TC service. See if there's a TC entry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Quoting Daniel Perry <[EMAIL PROTECTED]>:
> eh?
> i thought ANT_OPTS was for ant, not tomcat.
>
> I dont h
That seems like the best bet. Many thanks
-Original Message-
From: Yves Sy [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 11:42
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Newbie question: Deleting an ActionForm that is in session
scope.
That doesn't seem lika a r
Hi Tarun
Have a look at this
(Search for 'token' on this page)
http://www.scioworks.net/camino_doc/manual/strutsIntro/struts1_0.html
Hope you find a solution.
Harjot
- Original Message -
From: "Tarun Dewan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sen
Use redirect = "true" in the forward property of your action mapping. As
a rule of thumb, you should redirect if you do any action that involves
writing in the persistence layer such as deleting, saving, updating,
etc...
HTH,
-Yves-
> -Original Message-
> From: Tarun Dewan [mailto:[EMAIL
eh?
i thought ANT_OPTS was for ant, not tomcat.
I dont have any trouble with ant using default memory allowance.
Its tomcat that is running out of memory, and is ignoring the CATALINA_OPTS.
Daniel.
-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 12:14
T
> -Original Message-
> From: Tarun Dewan [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 11:47
> To: 'Struts Users Mailing List'
> Subject: Refresh - Duplicate Records Issue.
>
>
> Dear All,
>
> I'm facing one problem in my application. If user clicks 'REFRESH'
> (through right click men
I believe we are using it no problem.
Let me check...
yep.
sandeep
-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 12:12 AM
To: 'Struts Users Mailing List'
Subject: RE: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?
You might want to as
Daniel,
For your problem 3 you must have to set ANT_OPTS=-Xmx512m in your dos
prompt as mentioned by Chris.
-Jignesh
On Friday 14 May 2004 15:49, Daniel Perry wrote:
> I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment
> variables.
>
> If i start tomcat using startup.ba
Use JavaScript to avoid re-submitting the form, which in turn will prevent invoking
the duplicate call to the database.
-Original Message-
From: Tarun Dewan [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 4:17 PM
To: 'Struts Users Mailing List'
Subject: Refresh - Duplicate Records
Struts provides 'tokens' (Action.saveToken(), Action.isTokenValid()) to
catch users doing this.
One way of making it more difficult for users to do this is to use a
redirecting forward to your save confirmation page. This way a rfresh will
just refress the confirmation, not the record creation.
P
Dear All,
I'm facing one problem in my application. If user clicks 'REFRESH'
(through right click menu) duplicate records gets inserted in my
application.
Pls. Suggest best way to handle the same.
Thanks & regards,
Tarun.
-
That doesn't seem lika a really a good idea especially if you're keeping
track of the user logged in! invalidate() is used only when a user
clicks log out or if you want something to that effect.
Just remove the actionform from the session"
Session.removeAttribute("yourActionFormNameDeclaredInTh
That will destroy *everything* in the users session.
-Original Message-
From: John Moore [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 May 2004 18:25
To: Struts Users Mailing List
Subject: Re: Newbie question: Deleting an ActionForm that is in session
scope.
Adam Lipscombe wrote:
>Folks,
>
Yes, you can remove the related ActionForm inside the session using the
following code inside the "last" Action of the wizard
HttpSession session = httpServletRequest.getSession( false );
if ( session != null ) {
session.removeAttribute( actionMapping.getName() );
}
But this solution is un
Adam Lipscombe wrote:
Folks,
I have a wizard framework that uses the same ActionForm to collect data as
the wizard progresses.
The scope of the ActionForm is session so that values are preserved when the
user navigates back and forwards through the wizard.
When I get to the end of the wizard, I d
I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment variables.
If i start tomcat using startup.bat it uses these.
If i start tomcat using as a windows service, it doesnt use these.
Daniel.
-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: 14
Yes, that's very interesting indeed. It rechecked and it wasn't in my
last nightly download (4/23).
I suppose it could be an error in the notes, or a recent change. I
happen to be using common-lang for other reasons entirely.
> -Original Message-
> From: Hohlen, John C [mailto:[EMAIL PRO
Yes, you can just remove the form from the session.
Struts will create a new one when its needed. :-)
-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 May 2004 18:15
To: [EMAIL PROTECTED]
Subject: Newbie question: Deleting an ActionForm that is in session
Folks,
I have a wizard framework that uses the same ActionForm to collect data as
the wizard progresses.
The scope of the ActionForm is session so that values are preserved when the
user navigates back and forwards through the wizard.
When I get to the end of the wizard, I don't want the same
Type java -X in a windows shell and look at setting some of the below options in your
environment using JAVA_OPTS
-Xmsset initial Java heap size
-Xmxset maximum Java heap size
-Xssset java thread stack size
I alse use this to allocate more memory to ant at build time f
I'm using jdk1.4.2_04, and it still happens!
Here are some of my observations on the issue:
1. I did once develop some software using servlets/jsps. I never came accross this
problem. However, as jsps are automatically releaded, and this app was mainly jsp
based, i dont remeber doing any resta
W liście z pią, 14-05-2004, godz. 10:52, Paul McCulloch pisze:
> I'd try overwriting the struts Locale in Globals.LOCALE_KEY when the user
> clicks on a flag. I don't know if that will work, but I'd try it.
>
> I'd also give careful consideration to just using the browsers requested
> language, r
I'd try overwriting the struts Locale in Globals.LOCALE_KEY when the user
clicks on a flag. I don't know if that will work, but I'd try it.
I'd also give careful consideration to just using the browsers requested
language, rather than making the user choose one explicitly.
Paul
> -Original Me
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]
> Subject: RE: Language resource bundles problem
>
>
> Sorry Paul, I actually missed your reply
Hi there,
i run in an problem when using where some attributes should
be filled with dynamic content from a Bean.
my example:
">
"/>
When i try to compile this, i run in a
Seems to me that the best way to go around it would be just to warn the
users before they unload the page (whether closing it or moving to
another page) that they haven't submitted the form yet and that all the
data they inputted will get lost if they continue their action...
Regards,
-Yves-
> -
Do you confirm that the submit erase all parameters ?
I will replace the html:link by a button,
but I have the problem for the html:select onchange.
I should use a submit to display my form again.
Is there another way ?
I tried to use a JavaScript but the submit erase parameters.
At the end of t
83 matches
Mail list logo