forgive mebut could'nt your form have an id property?
then your action's execute method could get the id from the form.
Rick Hightower
Developer
Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring
H this is a good point.
In the past I have created a map wrapper that wraps the request object and
session object and passed those as well.
the advantage is that the execute method is a little easier to test since it
does not rely on the servlet API.
The execute method would look
sometimes code reviews and/or pair programming work as well
although, electric shock is more fun.
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
Quoting Matt Raible [EMAIL PROTECTED]:
Remember Me functionality with j_security_check has worked fine for me.
I just go to a LoginServlet from my loginForm, which sets cookies and
redirects to j_security_check. Then I map a Filter to check for those
cookies and logs the user in
Title: Cannot find message resources under key org.apache.struts.action.MESSAGE
Hi ,
I got this error after i restarted the system. I tried delpoying it again. I checked the struts config file also
Pls help me finding the error.
thanks,
sudhakar
org.apache.jasper.JasperException:
Hi ,
Can you elaborate a bit? The situation in my mind is, a jsp page with a
list of records, but no form at all.
Like
a href=details.jsp?id=1Apple/a
a href=details.jsp?id=2Orange/a
Of course the a links are generate by struts. Then how could the form be
used in this case?
I can think of
Aaah...but these are not related to form actions and are more like query
strings. I guess in this case, request.getParameter would still be the
best bet, rather than trying to go for an overkill with the hidden id
field etc etc ...just my thought.
If you still don't want to request object,
In the logic-el:iterate you defined the bean to scope with the id
attribute, but then don't reference it in the form element
html-el:checkbox name=acct property=accounts indexed=true /
I'd consider not storing the formbeans in a map as you don't need to
get the values out with a key. I
Why not use JSTL and let the server determine the location?
link rel=stylesheet href=c:url value=/css/start.css /
type=text/css
If the jsessionid string that may be automatically appended
by c:url bothers you, it's easy to write a small custom tag
exclusively for such purposes.
-- Chris.
-
Hi All,
I was wondering if anyone knew what the lifecycle of an ActionForm is?
The reason I ask is in regards to the display of variables with a html:form.
I have noticed that the values displayed within a html:form are values after a
reset() method has been called,
and not after a validate
I'm getting an exception thrown by bean utils when i submit a form, i
think this is related to setting a form property of type hashmap.
The values are set correctly in the jsp, and i'm not validating yet.
Are there any issues related to using maps as form properties? I've
scoped the form to
I already used the struts template tags successfully, but I'm having
trouble now inside a moduled application. The problem is that the
template tags seems to insert the module prefix before the path of the
jsp template file, which I would not, also because I thought the jsp
pages could/should not
I've had a similar problem before when the offending class did not implement
java.io.Serializable...
regards
Leticia
-Original Message-
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED]
Sent: 12 January 2004 18:54
To: Struts Users Mailing List
Subject: REQUEST_PROCESSOR - couldn't
Don't worry I was being a dick..
On 13 Jan 2004, at 10:05, Mark Lowe wrote:
I'm getting an exception thrown by bean utils when i submit a form, i
think this is related to setting a form property of type hashmap.
The values are set correctly in the jsp, and i'm not validating yet.
Are there
Hi!
I was myself trying to work on a similar issue.
My problem is as follows:
i query db.
Then store data in Araylist.
How to pass this to jsp page?
Any sample code great appreciation.
Please urgent.
Sha
At 02:27 PM 1/12/2004 -0700, you wrote:
From: Wendy Smoak
Apparently you don't have to use
On Jan 13, 2004, at 12:42 AM, Craig R. McClanahan wrote:
Filters are *not* required to be invoked on j_security_check
invocations. In
fact, Tomcat won't even enable the j_security_check url unless an
unauthenticated user accesses a protected resource. Basically, I
believe there
is no
Hi,
A few other folks and I had a discussion on this topic in this list
archive, search for it.
I just hope that I have not misunderstand you.
Topic of the message thread is Modules with Tiles Problem. See if it
helps.
(if you really can't find these messages, I can PM you)
Rgds,
Patrick.
If this was Websphere I would say that it is
install root/config/cells/cell name/virtualhosts.xml
Take a look at Jason McGee's article on IBM on how to configure virtual
hosts
http://www-106.ibm.com/developerworks/websphere/library/techarticles/0301_mc
gee/mcgee.html
Regards,
Martin Gainty
-
what does you form bean look like (dyna or otherwise)?
On 13 Jan 2004, at 12:07, shankarr wrote:
Hi!
I was myself trying to work on a similar issue.
My problem is as follows:
i query db.
Then store data in Araylist.
How to pass this to jsp page?
Any sample code great appreciation.
Please
Add 1 Nota Bene:
objects in request scope are lost on a redirect, but remain in scope after
a forward...
-Martin
- Original Message -
From: Matt Raible [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 7:05 AM
Subject: Re: handling form
I have encountered a problem where the equals method was implemented on an
ActionForm to return true under very loose conditions (ie two similar
objects would be regarded as equal). This however broke our JSPs which were
then unable to fetch properties from the form bean. Removal of the equals
Wendy,
If you simply want to present a list of options to the user represented as
check boxes
and collect the selected options, and the selected options are just single
string values,
then you can do the following:
Define accounts property as an java.lang.String[] and initialize it to {}.
beanUtils keeps getting its knickers in a twist when i submit a form
with 2 select menus with multiple values. I've had this working before
with the same version of struts and commons. Its not the action as the
exception is thrown before i get that far, when i remove the menus the
form
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Unless I've missed something, I don't see the need to using indexed
properties here if the selected value is single String and
order doesn't matter.
After much consideration, neither do I! I thought ArrayList would be
easier to deal with, but
You might want to check out iBATiS, specifically the
executeQueryForPaginatedList methods ... quite useful!!
http://www.ibatis.com/
Enjoy!
Viral_Thakkar wrote:
Hi all,
Do struts have any support for *_pagination_* purpose?
By pagination, I mean, displaying the data retrieved from
The Pager Tag Library is the easy and flexible way to implement paging of
large data sets in JavaServer Pages (JSP). It can emulate all currently
known paging styles with minimal effort. It also includes re-usable index
styles that emulate the search result navigators of popular web sites such
as
Using arrayList as a form property works fine with action forms dyna or
otherwise. In fact IMO it makes like simpler. As i recall you were
trying to iterate through a map of forms not an arraylist.
On 13 Jan 2004, at 14:28, Wendy Smoak wrote:
From: Robert Taylor [mailto:[EMAIL PROTECTED]
I started using modules in my struts application, but have difficulties with
links defined in a default tile.
In my default app tiles-defs.xml I have defined a base layout which is being
extended in my module tiles-defs.xml.
The base layout puts a header, menu , body footer
definition
Hi Patrick,
I'm interested in this thread because it seems we have (had?) similar
problems regarding html:link in modules with global tiles;
But your last question remained unanswered??
Thanks David, The multiconfig eliminates the error message.
Another question is, the html:link is screwed
I am running into a problem with Struts Tiles. My action class is being executed
twice when I submit a page.
I have a simple page like this.
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:form action=ViewOtherCustomerInformation
input type=submit name=submit
/html:form
It
hi
i'm starting to program with java struts
i'm following a struts tutorial than i downloaded
from the web
i'm doing a example hello world and it don't work
the error than i get is the follow:
type Exception report
message
description The server encountered an internal error () that prevented it
Gabriel, look at these examples:
http://reumann.net
[EMAIL PROTECTED] 01/13/04 8:23 AM
hi
i'm starting to program with java struts
snip
somebody have a struts tutorial than help me to learn
about java struts?
-
To
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Using arrayList as a form property works fine with action
forms dyna or
otherwise. In fact IMO it makes like simpler. As i recall you were
trying to iterate through a map of forms not an arraylist.
The iterator goes through a Map, yes, but that
fair enough ..
i'm having a bad day with multiple, select menus and bean utils not
dealing with life every well.
java.lang.IllegalArgumentException: argument type mismatch
bean utils seems to be complaining that the types in my form and those
in the form bean are somehow different, i cant see
Hi Max,
I haven't tested it either. I read it about this in IBM WebSphere V5.0
Security handbook (page 64).
Regards,
Dipak Parmar
-Original Message-
From: Max Cooper [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 10:42 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Hello everyone,
I'm having trouble understanding the mapping tags of
struts-config.xml.
I have one simple jsp form and one form and one action to take care of
it. In my /pages/form.jsp I have a html:form pointing to my do/action.
My action-mapping is path=/action and I'm putting no input value.
You can do either but i always use an action and forward to the jsp.
The only really objection not to routing your request through a mapping
is that you expose your jsp's to the user. But this often isn;t a
problem for some folks.
If you want to pre-populate your form then you can map the form
Hi Folks,
I have a simple login.jsp that I want to validate. So I have a Class
LoginForm with a validate method, that fills up the ActionErrors with
the errors that might occur (missing username/password, wrong
username/password). Later the execute method of the corresponding Action
class
You could forward (not redirect) to a generic failure page if there are
errors present. I confess i haven;t done this but it could be what you
want, even forward to a global forward defined in struts config, so you
can reuse you error page for other stuff.
On 13 Jan 2004, at 16:27, Christian
I have a problem understanding how to use those
I have jsp pages using html:forms
Ted's book says that a hidden field is automatically added when the
form sees that a tokens are being used
but I fail to see how the forms sees that. In other wods, what do I
have to put as attribute to get
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
If I understand what you're asking, try setting validate=false in your action
mapping so that validation is deferred to your action. Otherwise, Struts will
perform validation automatically and, as you've noticed, never invoke your
action if there are errors.
Another option would be to keep
Hi,
can anyone explain why :
bean:write name=org.apache.struts.action.EXCEPTION /
prints mypackage.Exception: cause; and
% anyscope.getAttribute(org.apache.struts.action.EXCEPTION).toString(); %
prints null ??
Henrique Viecili
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
From: Mark Lowe [mailto:[EMAIL PROTECTED]
It was working, until i rearranged a few things. A few
questions/suggestions in help me problem solve would be greatly
appreciated if you have the time.
I also don't see why BeanUtils can't handle turning multiple request
parameters with the same
For a resizable list from an array, try:
List stringList = new ArrayList(Arrays.asList(stringArray));
Quoting Wendy Smoak [EMAIL PROTECTED]:
From: Mark Lowe [mailto:[EMAIL PROTECTED]
It was working, until i rearranged a few things. A few
questions/suggestions in help me problem solve
Hi Richard
Here are the summarized bits
public ArrayList getColours() {
return colourList;
}
public void setColours(ArrayList colourList) {
this.colourList = colourList;
}
//
ProductForm theForm = (ProductForm) form;
theForm.setColours(colourList);
...
html:select
The only issue with using arraylist as a form property is to scope to
session so you can change the size when required. I tend to use them
for nesting beans rather then just storing strings.
My form parameters are in an arraylist. I just think beanUtils hates me
or something rational like
Hi, i figured out the answer!
i changed the scope in the global exceptions declaration to session instead of
request.
sometimes some atributes in request scope simply disapear, *weird*
Henrique
- Original Message -
From: Henrique VIECILI [EMAIL PROTECTED]
To: Struts Users Mailing List
I generally like to stay away from using login.jsp AND a failure.jsp. Mainly
because its two different pages to maintain, when they look very similar.
So use just login.jsp for both just simple login, and failure.
I would suggest that in your DisplayLoginAction or similar, set a request
Additionally i don't get the exception when i remove sizes and colours
from the form, as i was getting mystical bean utils errors I started
doing split half debugging like one does with javascript.
Everything's fine except for these properties. As I said before I've
had this working in this
Hello all and happy new year,
suppose I have 2 beans one beanA extends Action Form, the other beanB
extends ValidatorForm. I have one Action class which needs data from both
beans. How can I do that ?
Regards,
ERic
-
To
Hi, Wendy,
Just do this or whatever is similar that you like. This is what I do.
public class ArrayListWrapper
extends ArrayList {
private ArrayListWrapper(Object [] param) {
for(int i = 0; i param.length; i++) {
this.add(param[i]);
}
}
public static ArrayList
From: Eric C [mailto:[EMAIL PROTECTED]
suppose I have 2 beans one beanA extends Action Form, the other beanB
extends ValidatorForm. I have one Action class which needs
data from both
beans. How can I do that ?
AFAIK Struts is only going to populate one Form bean from one request.
But if
you can store one in the session,
FirstForm beanA = (FIrstForm) form;
SecondForm beanB = (SecondForm) session.getAttribute(beanB);
Or nest beanB in beanA or vice versa.
On 13 Jan 2004, at 18:56, Eric C wrote:
Hello all and happy new year,
suppose I have 2 beans one beanA extends Action Form,
I'm a little confused on how tab library versioning works. When I run my
Struts web app, the resin console fills up with SAXCompileExceptions,
complaining about jsp-version is an unexpected element and short-name
is expected, etc., etc. My app seems to run fine, but I'd like to resolve
this issue.
Are Servlet filters supposed to be called for both GET and POST
methods? They seem to be getting called for GETs only on Tomcat 5.
-Chris
-Original Message-
From: Parmar, Dipakkumar [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 03:57 PM
To: 'Struts Users Mailing List'
Vanessa,
As discussed a time ago on this list, it is considered a best pratice
to go through an action all the time. So you can decouple your view layer
in a way that makes your life easier. There are plenty of learning resources
around the Internet about Struts, but i'd like to recommend
Don't know how i had it working before but does now. Thanks man..
Still don't agree about the messages vs errors ;o) Although I agree
that tags belong in jsp's.
Thanks again Mark
On 13 Jan 2004, at 18:49, Richard Hightower wrote:
Change colors property to use a regular array.
-Original
Thank you for your advices! That helped improving my understanding of
struts alot! At first glance I like the aproach with validate=false and
calling the validate method myself in the LoginAction class, so I have the
control when to validate.
Regards,
Chris
I generally like to stay away from
All,
The application I am working on is secured with a login that required a
username and password. Once a user is logged in, all pages can be accessed
as long as there is a Subject object in the Session. My problem is that
part of the webapp provided links to pages that open in another window,
Yes, the offending class seems to be the Struts RequestProcessor.
-Original Message-
From: Leticia Golubov [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 2:26 AM
To: Struts Users Mailing List
Subject: RE: REQUEST_PROCESSOR - couldn't deserialize
I've had a similar problem
Guys.
I'm using JBOSS 3.2.3, struts 1.1.
When I try to execute my action I get the following on my server stdout.
I thought this was depricated and to use execute()
java.lang.UnsupportedOperationException: Method perform() not yet
implemented.
at
Nevermind.
LOL I forgot to remove the throw exception..
DUHH
-Original Message-
From: Bret Kumler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 2:10 PM
To: Struts Users Mailing List
Subject: New to struts, having an issue
Guys.
I'm using JBOSS 3.2.3, struts 1.1.
When I
Bret,
I'm using execute in all of my actions. You are implementing the execute
action properly in your viewDataAction action class correct? Also you are
properly extending Action? Posting some source code might help.
-David
- Original Message -
From: Bret Kumler [EMAIL PROTECTED]
To:
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]
What you're likely running into is the fact that the cookie that the
application server uses to track a user's session object, is very
specific to what host can read the cookie.
I use Apache and one of the things I've done is set a configuration
parameter UseCanonicalName to be on - it
Quoting [EMAIL PROTECTED]:
Are Servlet filters supposed to be called for both GET and POST
methods? They seem to be getting called for GETs only on Tomcat 5.
-Chris
For filters mapped to ordinary application URLs, the filter should indeed get
mapped on both GET and POST methods. For
Quoting Fullam, Jonathan [EMAIL PROTECTED]:
All,
The application I am working on is secured with a login that required a
username and password. Once a user is logged in, all pages can be accessed
as long as there is a Subject object in the Session. My problem is that
part of the webapp
It is a huge disappointment that the servlet 2.4 specification didn't
address programmatic authentication. Dispatching requests to
j_security_check is a pain in many use cases.
I really hope that a future version of tomcat would address this even if
this didn't make it into the spec this time.
I'm a little closer.
I am running Struts 1.1 on iPlanet iws 6.05 (it works fine on tomcat 3.3.1). I am
using JDK 1.4.1_05 (JDK 1.4.1_01 is the highest supported on 6.05). The app is
running on Windows 2000 - destined for HPUX. I am also using tiles and validation.
At first, nothing worked.
Craig,
Ok fair enough. If the spec says it is undefined, that what is one to do?
Keep in mind I'm trying to do the right thing here and build an application
where people can logon AND I can send them a cookie to remember their user
ID.
What is the propery way to do this under J2EE/Struts?
I am converting a pure JSP page into Struts, and am having problem
converting links which calls a javascript and has dynamically specified
target. The particular line is below:
a href=javascript:if (confirm('Do you want to delete this event?'))
location = 'delete.jsp?e=%= EventId %'
I like to avoid putting javascript logic in the JSP tag itself (although
you can usually do it if you get the syntax right).
I usually pull the script out of the tag like this:
script
function deleteEvent()
{
if (confirm('Do you want to delete this event?'))
Dear All,
I am developing an application on resin-2.1.9 web server.
Connection to MYSQL Database is using JNDI. JNDI connection code is written in a class
called DBService.
I am instantiating DBService class where ever i need database connection and getting
connection using getConnection()
I have a jsp page with a form on it using indexed properties. I have a bean
with an array of beans that I use to connect with the jsp page. The page
displays fine, but when I try to save it, I get the following error:
javax.servlet.ServletException: BeanUtils.populate
at
They should be getting called for both - since they both are a
request. You might try adding the dispatcher element to trap
forwards as well. This is a Servlet 2.4 feature.
filter-mapping
filter-nameloginFilter/filter-name
url-pattern/security/*/url-pattern
!--
My guess is that you have a connection leak somewhere. Does this problem
start occurring immediately, or does it only show up after visiting a number
of pages in the site?
Various db pools have different ways of dealing with no connections being
available. Often, you can configure which strategy
Dear Max,
Yah, this problem occures after visiting some pages,
to use #1 strategy, whether I need to do any changes in configuration or is
there any other way?
Thanks for your suggestions immediate response,
Regards,
viru
- Original Message -
From: Max Cooper [EMAIL PROTECTED]
To:
Hi!
What is worrying me is that the number of activeCount and useCount are
increasing though there have been no db interactions.
Any help, appreciated.
This is my data source entry from struts-config.xml file. Is there
something wrong in it ?
data-sources
data-source
Hi,
html:select property=ap onfocus=f(this) onblur=b(this)
html:option value=---/html:option
html:option value=one/html:option
html:option value=two/html:option
/html:select/td
if i select two then it will include table in same page.plz
Hi,
html:select property=ap onfocus=f(this) onblur=b(this)
html:option value=---/html:option
html:option value=one/html:option
html:option value=two/html:option
/html:select/td
if i select two then it will include table in same page.plz send
Hi All,
We have been facing a very strange problem with form validation
We have a JSP which is an input to an action and there is an associated form bean to
validate the form.
Here is the configuaration file
struts-config.xml:
form-beans
form-bean name=summaryForm
86 matches
Mail list logo