probably not exactly want you want, but
Check out
http://jakarta.apache.org/commons/dbutils/
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original
I've been responding to your questions here and at JavaRanch on this
subject.
It seems like you are missing the point of DynaActionForms.
Please read 4.3 and 4.4 of the user guide.
http://jakarta.apache.org/struts/userGuide/building_controller.html
Lots of additional comments below.
Master the Struts Tiles Framework Tutorial (Dec. 2003)
http://www.arc-mind.com/downloads.htm
The Tiles framework makes creating reusable pages and visual components
easier. Developers can build Web applications by assembling reusable tiles.
You can use tiles as templates or as visual components.
step 1) in your action's execute method
ActionErrors errors = new ActionErrors();
errors.add(userHasFooProblem,new ActionError(message.key));
//message.key must be in resource bundle, e.g., application.properties
this.saveErrors(errors);
return mapping.findForward(failure);
step 2) then
Step 1) in struts config file
global-forwards
forward name=foo path=/foo.do/
/global-forwards
foo.do is the path of the action
(this assumes you have an action mapping with a path of /foo)
(you can also use a forward that is a member of your action)
Step 2) in your action's execute
ActionMessages, saveMessages and getResources oh my!
Back in the primordial ooze of Struts pre-1.1, people liked ActionErrors.
They started using them for tasks for which they were never intended. People
started using ActionErrors as a general-purpose way to display i18n-enabled
dynamic messages.
Reflection has gotten much, much faster than it use to be (JDK1.3 and JDK1.4
made a lot of improvements in speed).
Also consider that a lot of custom tags use reflection already (JSTL, Struts
tags). If you are using JSP, and custom tags than you are already using
reflection all over the place.
Check out
http://doc.advisor.com/Articles.nsf/nl/13372
(I wrote it)
snippet below
the above tutorial covers dispatch action and lookup disptacth action
i am not a fan of lookup dispatch action.
i like dispatch action.
(i created my own dispatch action called
there are at least two ways
static parameter?
forward path=foo.jsp?foo=bar/
dynamic? (in execute method)
ActionForward forward = mapping.findForward(success);
return new ActionForward(forward.getPath() + ?foo= + bar);
[check the java docs on the second one... i am doing it from memory,
I am sure there are more than two ways... but those are the two I could
think of.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
From: Richard
I've done this before with tiles.
You have a nested tile that displays the field. One for editing, one for
viewing.
You have a base definition that uses the field display tile as an argument.
You create definitions that extend the base definition passing the correct
display display definition.
Is this object an ActionForm?
Check you action mapping setting.
make sure you are consistent with a scope of type session, which is the
default.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
Create a superclass that overides the execute method and calls an abstract
execute method that does not pass the request object.
The subclasses overide the execute method without the request object being
passed.
Also look into the ProcessAction, which is part of the scaffold.
You can get the
I believe this is the easiest way
Have the form login go to your own custom action.
Have your action forward to the j_security_check, passing the correct
request parameters.
Set the foward you setup that points to j_security_check to do a
redirect=true.
Rick Hightower
Developer
I believe this is the easiest way
Have the form login go to your own custom action.
Have your action forward to the j_security_check, passing the correct
request parameters.
Set the foward you setup that points to j_security_check to do a
redirect=true.
Rick Hightower
Developer
you're left with only storing things in the session scope, which I
wouldn't consider ideal.
Right?
Richard Hightower wrote:
Create a superclass that overides the execute method and calls an
abstract execute method that does not pass the request object. The
subclasses overide the execute method
.
Right?
Richard Hightower wrote:
Create a superclass that overides the execute method and calls an abstract
execute method that does not pass the request object.
The subclasses overide the execute method without the request object being
passed.
Also look into the ProcessAction, which is part
I
wouldn't consider ideal.
Right?
Richard Hightower wrote:
Create a superclass that overides the execute method and calls an
abstract execute method that does not pass the request object. The
subclasses overide the execute method without the request object being
passed.
Also look
OK this is a bit of an Obligatory plug but
The Professional Struts book written by myself and James Goodwill covers
this step by step.
First it lists the steps. Then it breaks the code down by each step.
You will want to have you saveToken called just before the form loads for
the first
First, the behavior experiencing is as designed. I suggest getting a good
book on Struts geared for Struts novices like Professional Struts published
by Wrox (written by James Goodwill and me).
You can turn validation off in the action mapping (action element in the
struts config file) by setting
I have an idea, but would like to see your html:form and ActionForm before I
ruin my reputation with a bad mojo answer.
Send them directly to me and copy this list.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
Understanding the lifecycle of an ActionForm...
The ActionServlet handles requests for Struts, i.e., requests ending in *.do
is common. The ActionServlet looks up the RequestProcessor associated with
the module prefix. The RequestProcessor implements the handling of the
lifecycle and uses
Conclusion:
Your execute method is getting called... it is the one throwing the
exception. (Or the exception gets thrown when it executes a helper object).
See... com.faid.qa.actions.viewDataAction.execute(viewDataAction.java:19)
Send the above line of code with surrounding code.
Thought
I just saw your LOL. too funny I can't say I have never done anything
like that. Let's both get some sleep, we need it.
-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 3:34 PM
To: Struts Users Mailing List; [EMAIL PROTECTED
I assert the following:
You could override the ActionForm associated with this html:form/ by
using the scope and type attribute. The scope specifies where to look for
the ActionForm, and the type specifies what type of ActionForm it is, i.e.,
the fully qualified Java classname. This technique is
Oppsss
the code listig should read:
html:form action=/myaction scope=request type=arcmind.MyForm
name=myform/
-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 14, 2004 10:08 AM
To: Struts Users Mailing List
Subject: low priority question
To populate an ActionForm with a domain object so that it can be displayed
on an input JSP with html:form, you first have to create an action that is
called before the form:
action path=/readUser
type=rickhightower.ReadUserAction
name=UserForm scope=request
Check your action forward and make sure you don't have redirect=true.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
From:
You can pass the config init-parameter a comma delimited list of config
files. The config files will be treated as one logical file.
Or, you can pass multiple config/name-of-modules to have struts modules.
Modules are like little mini-struts apps (they used to be called
subapplications). Modules
like this could potentially
change the ActionForm stored in the session as well? Did I miss
something?
Regards,
Glenn
-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 14, 2004 9:11 AM
To: Struts Users Mailing List
Subject: RE: low
the scope dynamically like this could potentially
change the ActionForm stored in the session as well? Did I miss
something?
Regards,
Glenn
-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 14, 2004 9:11 AM
To: Struts Users Mailing List
I'd start by getting log4j and turning on full debug logging.
Study the logs of a working form.
Study the logs of the form that does not work.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
pragma no cache, transaction tokens.
-Original Message-
From: Gede Indrawan [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 3:01 AM
To: Struts Users Mailing List
Subject: Back and Refresh Button Effect
Hi all,
In building struts web appl, what are the deep concern we must
html:select /, html:option /, html:options /, html:optionsCollection
/
The html:select / tag renders a drop down selection or list box to the end
user. You can specify the options for the html:select/ tag with
html:select /, html:option /, html:options /, html:optionsCollection
/ tags.
The
Did you put the messages in the resource bundle?
-Original Message-
From: Vinicius Carvalho [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 4:24 AM
To: [EMAIL PROTECTED]
Subject: Struts and Action errors
Hi there! I'm a newbie to Struts, and this question may be a
Java Applet or ActiveX control.
-Original Message-
From: N.N.S.S Ravi Krishna [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 4:28 AM
To: 'struts users'
Subject: How to enable Text formatting in Text area using struts html
tagshtml:TextArea...
Hi,
I am using html:textarea
seems like an odd request... but here goes...
html:img href=file://c:/photo directory/foo.gif/
html:img supports three attributes for specifyin the location of an image
forward (referes to a global forward), page (relative to the current web
context), and href (any valid URL).
Rick Hightower
I am not familiar with that attribute. I think I can guess what it is
for
But if it is something you need, submit a request to bugzilla (after you
search the mailling list).
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
I think you want a mapped backed property.
Here is an example:
form-bean name=userRegistrationDynaForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=userName type=java.lang.String /
form-property name=email type=java.lang.String /
There are a 1/2 dozen ways to do this at least.
Here are four of them.
1) Create an additional action-mapping with validate=false, submit to that
mapping. (someone else stated this one)
2) Override the validate method of the form look for an attribute and
selective call super class validate
about your earlier message ok i did misunderstand
okay
did you know bean:message not only takes a key but the trinity of
attributes...
i define the trininty of attributes as name, property, scope
thus,
bean:message name=simpleForm property=widgetDescription
scope=session/
i don't think you need bean:write.
did you know bean:message not only takes a key but the trinity of
attributes...
i define the trininty of attributes as name, property, scope
thus,
bean:message name=simpleForm property=widgetDescription
scope=session/
the above would call
I have done the same type of thing before You want HttpClient.
http://jakarta.apache.org/commons/httpclient/
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
weird
i wonder if page index is putting white space in?
9
instead of 0
do this
##pg:endidx/##
and see if you get ##9## or ##9 ##
-Original Message-
From: Konrad [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 3:39 PM
To: Struts Users Mailing List
Subject: Re:
Doh! I should have caught that.
-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Martin Cooper
Sent: Friday, January 16, 2004 5:16 PM
To: [EMAIL PROTECTED]
Subject: Re: [General TagLib question] Custom TagLib storing value in
PageContext/session and reference by Standard
I want to use the latest JSF with Struts. Can I use the latest JSF with
Struts 1.1? Or should I get the latest from CVS?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Sure that is one way to do it.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
From: David Liles [mailto:[EMAIL PROTECTED]
Sent: Saturday,
StrutsTestCase builds on top of Cactus (or MockObjects).
In the past, I was a big Cactus fan, and I still like it.
But, nowadays... I prefer to use StrutsTestCase or just the MockObjects that
ship with StrutsTestCase.
I've used StrutsTestCase to test Actions, TileControllers, and more.
I like
I agree.
I tend to use businsess facades that the actions get from an
AbstractFactory.
For testing, it instantiate a test Factory that delivers fake (mock)
business facades.
In the container, it instantiates a real Factory that delivers up business
facades that talks to Stateless session beans.
I've tried My Eclipse. In fact, I am using it on my current assignment
(which begins tomorrow).
So far, I really like it.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
Which do you suggest?
-Original Message-
From: Mike Deegan [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 18, 2004 5:48 PM
To: Struts Users Mailing List
Subject: Re: JSF and StrutsFaces
Sure that is one way to do it.
- Original Message -
From: Richard Hightower [EMAIL
/ tutorials ..
http://arc-mind.com/downloads.htm
Keep up the good work !
- Original Message -
From: Richard Hightower [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, January 18, 2004 5:57 PM
Subject: RE: JSF and StrutsFaces
Which do you suggest
Sure that is one way to do it.
Look for my comments below (Mike Deegan [EMAIL PROTECTED] the
Struts list avenger missed them :)
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
Does the problem go away after you access and Action?
Please, Send the URL that you send to the server.
Try this.
action path=/index forward=/index.jsp/
The above ensures that the resource bundle is intialized before hitting the
page for the first time.
Rick Hightower
Developer
Struts/J2EE
try setting your servlet mapping for the aciton servlet to
(i don't know if it will work)
more comments below...
see **
-Original Message-
From: Eric Dahnke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 10:11 AM
To: [EMAIL PROTECTED]
Cc: Taro Tokuhiro
Subject: URL
Increase the size of the output buffer for the JSP (the non error one).
-Original Message-
From: BubenÃk Miroslav [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 1:59 AM
To: [EMAIL PROTECTED]
Subject: problem with error page
Hi all,
I have problem with error page in JSP. In
.
Where is the right limit of buffer size?
*** The size that works. :)
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
From: Richard Hightower
html:link has a name attribute.
Set the name to a Map (e.g. HashMap)
demo as follows: (syntax may be off)
jsp:useBean id=params class=java.util.HashMap /
%
params.put(action,edit);
params.put(id,12345);
%
html:link action=edit name=params/
Rick Hightower
Developer
Struts/J2EE training
Try this to see if it works:
logic:messagesPresent
html:messages id=error
%=error%
/html:messages
/logic:messagesPresent
If the above works, make sure you imported the right tld for core.
Core has a JSTL EL tld (c.tld), and a runtime expression tld (crt.tld??)
Howsa 'bout showing
you should try jWebUnit.
i like it a lot.
-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 12:52 PM
To: Struts Users Mailing List
Subject: RE: Unit Test in struts
Well, we use Junit for testing our business logic (you do have your
Put the first ActionForm in session scope. (scope=session in the action
mapping)
You can get from the attribute attribute in the action mapping. (just see
what you have this set to)
if the attribute attribute is blank then the value of the attribute
attribute becomes the name attribute.
just
Use the initial attribute on the form-property/ (???) element.
-Original Message-
From: Daynell Trent [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 4:44 PM
To: Struts Users Mailing List
Subject: reset property using DynaActionForm
Hi,
I'm using a DynaActionForm (lazy,
comments below
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
From: Chris Wall [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22,
use JSTL
c:url/
it allows you to pass parameter tags
-Original Message-
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 9:47 AM
To: Struts Users Mailing List
Subject: html:link multiple parameters
Is there any reason why this has not been implemented in
MyEclipse is at http://www.myeclipseide.com
I have used a fair amount of them. If you got the cash IBM's WSAD is the
best (state of the art if you will).
If you don't have a lot of cash, you can't go wrong with MyEclipse. It's is
the best $31.75, I've not spent yet.
It integrates nicely with
check out logic:messagesPresent, it will do what you want for line item 2.
There is a good example of using this in the book Professional Struts.
I know... I wrote that example ;)
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting
Look at the bottom of the page...
http://sourceforge.net/project/showfiles.php?group_id=49385
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
-Original Message-
Classic Struts
logic:iterate id=foo name=bar property=foos
html:link action=someAction paramID=id paramName=foo
paramProperty=idbean:write name=foo property=name//html:link
/logic:iterate
JSTL
c:forEach var=foo collection=${bar.foos}
value=${vo.ID}/
html:link action=/someAction name=params
c:out value=${vo.ID}/
/html:link
/c:forEach
Quoting Richard Hightower [EMAIL PROTECTED]:
Classic Struts
logic:iterate id=foo name=bar property=foos
html:link action=someAction paramID=id paramName=foo
Make sure you are not missing a taglib declaration.
It seems like you have a hmtl:text (or html:radio or something) that is
missing the html:form.
html:form access the ActionForm and puts it in a place where the html:text,
etc. can find it.
-Original Message-
From: Edgar Silva
c:out value=${symbol} escapeXml=false /
-Original Message-
From: Ricky Lee [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 07, 2004 7:42 AM
To: [EMAIL PROTECTED]
Subject: how to output html symbol to jsp page from user-defined taglib?
hi, thanks for reading..
i have a problem about
71 matches
Mail list logo