hello,
i have a question about the logic:iterate tag. My tag iterates over an ArrayList
which contains an amount of beans. However, in the last iteration i want to perform
some special action. My current code looks something like this:
logic:iterate id=foo name=bar scope=session indexId=index
in other words, your setup action will be called only when you enter
the page for the first time
Suppose I have:
1) A listbox with values retrieved from db
2) a form with values retrieved from db that the user can change.
Now, if I don't call the setup action when there's a validation error,
I'm sorry, I'll try to explain better.
If I used your solution in case of a validation error my list box
would not be filled.
When you have a validation error it returns to the page where you
filled the
list box and these values are the same that the user introduced.
The listbox and
Hello Ben,
you can do this in this way:
logic:iterate id=foo name=bar scope=session indexId=index
...
logic:equal value=%=bar.length-1% name=index
...
/logic:equal
/logic:iterate
Regards,
Frank
-Ursprüngliche Nachricht-
Von: Turner Benjamin [mailto:[EMAIL
Sorry, I mean:
foo.length-1 instead bar.length-1
-Ursprüngliche Nachricht-
Von: Otto, Frank [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Februar 2004 10:41
An: 'Struts Users Mailing List'
Betreff: AW: logic:iterate question
Hello Ben,
you can do this in this way:
logic:iterate
IE on mac used the same dom as standard frames. Although I imagine that
you can use getElementById for IE 6 as well as other browsers.
document.all is a legacy dom from ie4 , if you're support NS4 then you
can use a div and load content into that and drill using
document.layers[mydiv]. The
Hello everybody,
I am porting my application from Tomcat 4.1.29 to Tomcat 5.0.18.
I have a Struts ForwardAction mapped to /Login.do that produces the page
with login form.
Form based authentication is set with the following fragment of the
deployment descriptor:
login-config
auth-method
Well, when I said: these values are the same that the user introduced I
would want to say: the values selected by the user in the listbox .And the
values introduced in fields, checkbox, ... stay too
When an error occur, it doesnt return to preprare action. It just back to
the page selected in the
Since it's Friday, I thought I'd ask you Aussie java guys what the deal
is on this strange points system Australia has for its working visas.
I thought for a few years I'd never meet the target, whenever I thought
about moving to down under. I'm too old, too British, not enough
relatives
Can I set the request to null once I have got the value i required.
I have a parameter which has to be set to null in the request object once it
is been used as i dont want that request to go to the next page
Can anyone help
Regards
Kamal
When an error occur, it doesnt return to preprare action. It just back to
the page selected in the tag input (input=/prepare.jsp )
You dont need to write code like this...
if (!comingFromAValidationError())
form.fillfromDB();
else
// leave form as is, with data entered by the user
}
Ok,
I understand you...
Let me I think it...
- Original Message -
From: Leonardo Francalanci [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 06, 2004 10:21 AM
Subject: R: repost: validator retrieving data
When an error occur, it doesnt return
Ok,
I understand you...
Let me I think it...
I found 2 solutions so far:
1) hidden field in the form
(extending a Form that has an hidden field and extending an action that has
a method
like isComingFromAValidatorError() that looks for the value of the hidden
par)
2) If the request is a GET
You could use the mapping class and then compare what is the action tag
execute.
Some like this:
if (mapping.getPath().compareTo(/prepare)==0)
form.fillfromDB();
else
do nothing; // leave form as is, with data entered by the user
Dou you like this...?
- Original Message -
From:
My Action put´s a JavaBean into my request. Depending on the instance Type
of my Bean I choose different Parameter names for my Bean.
Code snippet Action:
if (object instanceof A) {
request.setAttribute(y, object);
} else if(object instanceof B) {
request.setAttribute(x,
hi otto,
that solution didnt work - it wouldn't recognise bar as a variable in the %= %.
this solution does work for me:
bean:size id=size name=articles scope=session /
...
logic:iterate id=article name=articles scope=session indexId=index
...
logic:equal value=%=
You don't need 2 actions only 3 mappings yes
But action would only be 1 Single Class
-Original Message-
From: Leonardo Francalanci [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 3:15 PM
To: Struts Users Mailing List
Subject: R: repost: validator retrieving data
Ok,
I
Did you put down that you like to play rugby :o)
On 6 Feb 2004, at 11:06, Adam Hardy wrote:
Since it's Friday, I thought I'd ask you Aussie java guys what the
deal is on this strange points system Australia has for its working
visas.
I thought for a few years I'd never meet the target,
I have a nested list...
something like:
logic:iterate property=orders name=allocationOrder
id=element
..
..
..
logic:iterate property=orderDetails name=orders
id=subElement
..
html:text name=subElement property=qty/
..
if you use the nested tags rather than the logic and html tags then this
should solve your problem.
- Original Message -
From: Michael Wiles [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, February 06, 2004 12:32 PM
Subject: nested iterators and writing
On 02/06/2004 11:11 AM Kamal Gupta wrote:
Can I set the request to null once I have got the value i required.
I have a parameter which has to be set to null in the request object once it
is been used as i dont want that request to go to the next page
No, you're not allowed to edit the request
i have a question about the logic:iterate tag. My tag
iterates over an ArrayList which contains an amount of beans.
However, in the last iteration i want to perform some special
action. My current code looks something like this:
logic:iterate id=foo name=bar scope=session indexId=index
The second list just needs the have the name of the object that
contains the list.
At the moment you've got
orders.getOrders()
which i assume is wrong. If each order contains an iterate-able object
then that's what you want to reference in the nested one.
i think you want
logic:iterate
Oops, did you mean to do this?
c:forEach items=foo.bar var=bar varStat=stat
c:if test=stat.last
^^^
do what needs to be done
/c:if
/c:forEach
shouldn't that be?
c:if test=${stat.last}
^^ ^
--
James Mitchell
Software
shouldn't that be?
c:if test=${stat.last}
Yes, it sure should. And the first line should be:
c:forEach items=${foo.bar} var=bar varStat=stat
So the whole thing should look like this:
c:forEach items=${foo.bar} var=bar varStat=stat
c:if test=${stat.last}
do what needs to be
Hi,
Is there a configuration variable (web.xml / struts-config.xml / other file) for
enabling the log for the RequestProcessor class (and the like)?
Regards,
Freddy.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 /
Hi
I need a hint on how to return always to the originating action preserving
all input-parameters to that originating action...
problem: From any screen in my application the user is allowed to
change the language of the UI. He should be immediately presented
the same screen
Hi,
IMHO, this is a difficult problem to solve (100%, that is). Including the redo-URL on
the language link is the most practical of those options, if you are able to generate
redo-URLs that do not redo the last action itself but only recompose the current
view (not that simple, I know).
Even with the id's set correctly it doesn't write the value you enter
into the html text box back onto the form.
On Fri, 2004-02-06 at 16:31, Mark Lowe wrote:
The second list just needs the have the name of the object that
contains the list.
At the moment you've got
orders.getOrders()
difficult indeed, that's why I wanted to hear what other's think.
Fortunately, at the moment, this application is read-only...
But I want something that works also in a read/write app. Thanks for
reminding
Alexander
-Original Message-
From: Villalba Arias, Fredy [BILBOMATICA]
Hi,
We have implemented similar concept.And you are right.You have to be careful not to
redo the last posts.
Luckily for us, the desin we had solved the problem.We have a concept of
OpenAction(Actions that prepare data for view) and Save action(Post actions,actions
that update DB).So in
Sounds good.
I normally try to follow a similar design... (open- and save-actions...)
thanks for the hint
Alexander
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Freitag, 6. Februar 2004 16:40
To: [EMAIL PROTECTED]
Subject: RE: Back to the originating
Michael McGrady [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
At 10:13 AM 2/3/2004, Greg Blomquist wrote:
I apologize in advance if this question has already been answered
somewhere.
Looks like basebeans is down so I can't search the struts-user archives.
I'm trying to do the
I would suggest intercepting the request processing cycle early on
and looking for the evidence that the language has changed and adjust
the user's session to the requested language before your other
actions even execute.
You can extend org.apache.struts.action.RequestProcessor and override
Is there a configuration variable (web.xml / struts-config.xml /
other file) for enabling the log for the RequestProcessor class (and
the like)?
Struts uses the commons-logging API.
If Log4J is on the classpath, then you don't need any additional
configuration besides the Log4J config files.
the method names and the scoped id name need to be the same i think,
Its a quirk.
On 6 Feb 2004, at 16:38, Michael Wiles wrote:
Even with the id's set correctly it doesn't write the value you enter
into the html text box back onto the form.
On Fri, 2004-02-06 at 16:31, Mark Lowe wrote:
The
The action that changes the Language should target in a hidden frame and
the forwarding JSP to be rendered in this hidden frame could reload the
frames that need to be changed by language change:
html:form action=/changeLanguiage target=hiddenFrame
.
/html:form
When you submit this form, the
Struts v1.1
We are currently using Struts and Tiles and have a dynamic navigation menu
with 2-3 nested levels for each top-level menu item (over 100 total menu
items). Currently, we are generating links with the action mapping and
then appending parameters to determine what level in the menu
Hello All,
I have a question for people using the displaytag tablib for table
rendering. I was wondering is there an easy way I can display each of the
object in my list that gets rendered as a row to show in a table of its own(
showing the header again ).
Thx
Avinash
Hi,
How can I iterate over a collection which depends of a request
parameter?
Thank You a lot,
Dragos
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED]
How can I iterate over a collection which depends of a request
parameter?
JSTL and/or Struts-EL can probably help, but I'm not quite sure what
your question is. Can you give an example?
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU
Hi,
Thank you for your answer.I would like to change the code shown below,
to pass a request parameter to the modelList function;something like
this:
public Collection getModelList(String requestString){}, where
requestString is a parameter of the http request..
Warmest Regards,
Dragos
Title: Data truncation in request scope
hi all,
I am passing a lot of data from the action class through the request =
scope
but the data is getting truncated... ie there are 50 elements in the arraylist only 25 are displayed
Is there any limit on the amount of data that can be
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED]
Thank you for your answer.I would like to change the code shown below,
to pass a request parameter to the modelList function;something like
this:
public Collection getModelList(String requestString){}, where
requestString is a parameter of
You should be able to use BeanUtils' mapped property access for this, right?
c:set var=modelListProp value=modelList(${param.paramName})/
jsp:useBean id=modelListProp type=java.lang.String/
bean:define id=modelList name=bean property=%= modelListProp %/
Which should give you a bean called
Forgot the obligatory, but you should really do this in an action. There's no
reason to clog your JSP with this kind of stuff. Grab the collection in an
action, set it as a request attribute, forward to the JSP, and...
Quoting Kris Schneider [EMAIL PROTECTED]:
You should be able to use
I followed the instructions on page
http://jakarta.apache.org/commons/sandbox/scaffold/cvs-usage.html,
namely:
cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic login
cvs -z3 -d :pserver:[EMAIL PROTECTED]:/home/cvspublic co
jakarta-commons/scaffold
and got the following error:
cvs
Is it possible to attach a query string to a tiles forward.
my struts-config.xml has an entry like
action path=/login name=login
type=com.rdlogic.struts.control.LoginAction
forward name=startapp path=tiles.self.effort/forward
forward name=userForInput path=tiles.self.effort/forward
forward
Hello Folks
I am having problems with my DispatchAction.
The name of the my method parameter is method, and I have been receiveing
this message error:
Request [/testAction] does not contain handler parameter named method
But this error has been happening only sometimes.
Have somebody ever
From: Ricardo de Souza Moura [mailto:[EMAIL PROTECTED]
Request [/testAction] does not contain handler parameter named method
But this error has been happening only sometimes.
Have somebody ever seen this error ?
Yes, when the request doesn't contain the handler parameter. Take a
look at the
I assume you want to pass the query string remember=test001 to
/pages/time_inputeffort_body_nested.jspf. One way I can think of is
put the remember=test001 as a request attribute in the logic of
com.rdlogic.struts.control.LoginAction.
try reading the attribute directly from the request, since
I know it, but It happen only sometimes. The same form sometimes works, and
sometimes doesn't work.
I don't get to make a simulation because this mistake only happens when I
open my app to internet. My app work very well in my intranet.
Does anybody have a sugestion ?
From: Wendy Smoak [EMAIL
If I were using a straight action, I would simply get the path from my
ActionForward subclass and append the query string to it. This seems
ponderous for placing a parameter in the url.
Is there any other way?
Wayne
Anand Patil wrote:
I assume you want to pass the query string
It may sound strange, and may not be what is happening to you, but I have
seen similar things occur if your jsp page has a tag referencing a bean or
list that isn't there somewhere further down on the page.
-Rob
_
From: Namasivayam, Sudhakar (Cognizant) [mailto:[EMAIL PROTECTED]
Sorry for the OT post, but Googling and searching the mailing list archives are not
producing much.
I may not be asking the right question though.
Anyhow, I need a tool (free) to examine the request and response headers.
Any suggestions?
robert
Filters + Eclipse + Debug?
-David
- Original Message -
From: Robert Taylor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 06, 2004 11:44 AM
Subject: [OT] Examining Response Headers
Sorry for the OT post, but Googling and searching the mailing list
archives are not
Try JMeter on soureceforge.net
-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 1:45 PM
To: [EMAIL PROTECTED]
Subject: [OT] Examining Response Headers
Sorry for the OT post, but Googling and searching the mailing list archives
are not
Robert,
You can use the org.apache.soap.util.net.TcpTunnelGui
tool to monitor your request and response messages. It
comes in the Jakarta SOAP distribution. It acts like a
proxy. You will need to run it using something like
java org.apache.soap.util.net.TcpTunnelGui
server_host_name 80
where
I want to iterate over a list where each object in the
list is a map, and print values from the map. The problem,
of course, is Map is not a bean - no getters and setters.
Do I have to wrap each map in a bean, or is there a
more clever approach.
(I am pretty much stuck with list:iterate, not
Thanks to all who responded.
Richard, the TcpTunnelGui looks like what I want.
I'll check it out.
Thanks again.
robert
-Original Message-
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 5:01 PM
To: Struts Users Mailing List
Subject: Re: [OT]
I am confused. What I meant was that you are using a jsp or some form of
jsp (judging by the extension as jspf) to render the body of the tile.
The logic (if I may) must be that the jsp attached on the tile , will
include the body attribute as a dynamic include. All I could think of is
that you
You can use LabelValueBean that's available in
org.apache.struts.util.LabelValueBean package
-Original Message-
From: Daniel Lipofsky [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 5:12 PM
To: [EMAIL PROTECTED]
Subject: iterate over list of maps
I want to iterate over a list
Well, Mr. Greg Bloomquist, Ben Anderson is not correct on that point, if
you cite him correctly. You can use the src attribute fine. I do it all
the time. I explore this more below. You said:
With the help of Ben Anderson, I was able to figure out that I should be
using the path attribute
I don't think you can pass parameters in JSTL, at least not yet. But
you could, in your action, call getModelList passing the String you got
from the request, and then when you forward to the JSP, iterate over
that Collection.
I am not sure what you meant, Wendy, but, in case you meant that you
There is no include anywhere in my app. I am just combining tiles (jspf
is the name of fragments of jsp pages)to build up the page. Top level
of the page is a .jsp with a bunch of tiles:insert tags filling out the
cells of a table. I just want to dynamically build a query string for
the
Robert,
DevProxy is a great program for monitoring the request and response headers:
http://www.widgetbuilders.com/
I recently did some socket programming. DevProxy was an invaluable tool. You can see
exactly
what flows through the socket between browser and host. Very good GUI interface.
Oh ok ...
I am sorry, I misunderstood ur requirement.
Anand
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Wayne Kidd
Sent: Friday, February 06, 2004 3:42 PM
To: [EMAIL PROTECTED]
Subject: Re: Query String for tiles
There is no include anywhere in my app. I am
So, do you have any ideas?
Wayne
Anand Patil wrote:
Oh ok ...
I am sorry, I misunderstood ur requirement.
Anand
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Wayne Kidd
Sent: Friday, February 06, 2004 3:42 PM
To: [EMAIL PROTECTED]
Subject: Re: Query String for
You could create an forward-action for the JSP.
action path=/go/whatever
type=org.apache.struts.actions.ForwardAction
parameter=tiles.self.effort/
And modify the foward in your action to,
forward name=startapp path=/do/go/faq?remember=test001/forward
This may not fit within the best
typo in my previous email.
should have been..
forward name=startapp path=/do/go/whatever?remember=test001/forward
-Original Message-
From: Gopalakrishnan, Jayesh
Sent: Friday, February 06, 2004 3:47 PM
To: Struts Users Mailing List
Subject: RE: Query String for tiles
You could create
Just to save you time looking, Greg Bloomquist, here is the tag that works:
IMG
height=18
alt=Powered by Struts
src=RESOURCE.MICHAELMcGRADY?file_type=giffile_name=struts-power.gif
Okay dokay? Not trying to beat a dead horse or get one to float when led
to water but just letting you know
Hi Ricardo...
The only thing I can see in this situation is the some change in the value
of parameter method, due to DispatchAction uses this value to call
selected method in the class, I mean: the value of method must be the nome
of method in the class.
I am using a lot of DispatchActions,
Greg, maybe the best way to help you with this is to give you the simple
view solution and just forget the fancy stuff. If so, here is the URL:
http://jakarta.apache.org/struts/userGuide/struts-html.html#img.
-
To
Hello,
My application has two page form (wizard type). To make the programming and
maintenance simpler, I have selected Validator along with DynaValidatorForm.
The problem which i am facing is that, my first page validation works correctly. But,
second page doesnt seems to work. It doesnt go
Greetings,
I get the following error when I run a web app with:
java version 1.4.2_01
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
It works without any problems with:
java version 1.3.1_02
Java(TM) 2 Runtime
75 matches
Mail list logo