Hi list, I want to iterate over a number of rows from my database.
I have removed most of my Javacode, but two statements remain.
Any way I can get rid of those too?
% BuchKatalog bk = new BuchKatalog(); %
ol
logic:iterate id=myBooks collection=%= bk.getBuecher() %
li
bean:write
hi list,
I don't manage to use methods from my classes with JSTL.
This is normal Java code:
BuchKatalog bk = new BuchKatalog();
java.util.Iterator i = bk.getBuecher();
How can I achieve the same with JSTL? (tons of examples to
continue afterwards, but none to this point .-()
You may want to have a look at this page.
http://developer.novell.com/tech/1126.html.
It shows, using struts, on how to retrieve and display data from a database.
From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject:
If the list is in an available context you can just use the name
attribute..
%
java.util.ArrayList myList = new ArrayList();
myList.add(one);
myList.add(two);
pageContext.setAttribute(mylist,myList.toArray());
%
logic:iterate id=item name=mylist
Hi Mark,
that eleminates one of the two scriplets, but leaves me with:
pageContext.setAttribute(bk2, new BuchKatalog().getBuecher());
Anyway I can remove that one too?
Stephan
Mark Lowe [EMAIL PROTECTED] schrieb am 03.08.2003, 10:39:28:
If the list is in an available context you can just
Hi message,
I get an broken link error :-(
message message [EMAIL PROTECTED] schrieb am 03.08.2003,
09:31:21:
You may want to have a look at this page.
http://developer.novell.com/tech/1126.html.
It shows, using struts, on how to retrieve and display data from a database.
From:
On Friday, July 25, 2003, at 08:08 PM, Curtney Jacobs wrote:
Oopse,
I forge to add that my action is no longer being called. It was
working fine
two days ago. I don't know what broke it. The only thing I notice was
what I
have written below. Also, I have pasted the relevant parts of my
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
that eleminates one of the two scriplets, but leaves me with:
pageContext.setAttribute(bk2, new BuchKatalog().getBuecher());
Anyway I can remove that one too?
You can set the bk2 attribute in your action's execute method.
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
I get an broken link error :-(
Remove the . from the url:
http://developer.novell.com/tech/1126.html
Maybe you should also look closer at the Learing about Struts on the
struts website:
http://jakarta.apache.org/struts/learning.html
Hope this
The scriplet was an example.. The code could just as simply be in an
action. I included as a scriptlet so you didn't have to recompile and
reload you webapp.. Ithough it would make thinks simpler but obviously
I was making too many assumptions.
If your iterator is straight from you model (DB
Okay I've been looking at the struts source to try an solve this, I
tried using the form config objects and setting the size there, but the
form configuration is frozen. So when i try to set the form property
size at run time i get an exception..
Merely attempting to populate the form to set
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
table
tr
tdinput type=text name=aTextField/td
tdinput type=text name=anotherTextField/td
tdinput type=text name=anotherOneTextField/td
Hi Mark,
why would I want to iterate over my data just to put it into an
ArrayList? I thought the use of an Iterator is to prevent me doing that?
I can set move the setRequest to my ActionClass, so now it works for me.
Thanks!
Stephan
Mark Lowe [EMAIL PROTECTED] schrieb am 03.08.2003,
ArrayLists are handy, and you need to read some of the excellent docs
that are provided..
If your iterator is taken from your model (DB i should imagine) you
wont want to be dumping its contents to your presentation layer without
copying the contents to mediating structure. If this isn't
you must have meant...
request.setAttribute(myObj,it);
Despite my misgivings about exclamation marks, I like your Torque
primer.
On Sunday, August 3, 2003, at 12:20 PM, Mark Lowe wrote:
ArrayLists are handy, and you need to read some of the excellent docs
that are provided..
If your
Thanks!
By adjusting the clock setting I was able to get rid of the compile
warning of modified in future
That still does not solve the primary error I am getting as below :
[javac] C:\Program
Files\eclipse\workspace\jakarta-struts\src\share\org\apache\struts\actio
n\ActionServlet.java:117:
Somebody please answer my question as in the email below..
-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie:
you mean to say there is absolutely no way I can achieve it by using
Struts???
If that is the case,struts is not a wise choice to use in our apps..because
we don't know what is present there and what is not
-Original Message-
From: Oguz Kologlu [mailto:[EMAIL PROTECTED]
Sent:
Jitesh,
I didn't say that. I think you have some misconceptions about
what struts is.
You were asking how to do a for loop. The answer is to use the
Java Standard Tag Library - JSTL. There is no need to use
struts tags for this. JSTL and Struts tags play very
nicely together.
If you are
That's fine Oz...
Actually by looking at your reply,I thought you know that it cannot be done
by Struts...
Thanks for letting me onto JSTL
-Original Message-
From: Oguz Kologlu [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 03, 2003 8:29 PM
To: Struts Users Mailing List
Subject: RE:
%@ taglib uri=http://java.sun.com/jstl/core; prefix=c %
c:forEach begin=1 end=5
... what ever you want here
/c:forEach
Hope this helps,
Erez
-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 03, 2003 5:09 PM
To: Struts Users Mailing List
--- [EMAIL PROTECTED] wrote:
Hi list, I want to iterate over a number of rows from my database.
I have removed most of my Javacode, but two statements remain.
Any way I can get rid of those too?
% BuchKatalog bk = new BuchKatalog(); %
ol
logic:iterate id=myBooks collection=%=
I am developing an e-commerce application which will
need among other things store things like a product
description in different languages. These different
product descriptions would be stored in a database
table(product) and there will be a column for each
(product_description_en,
How a method inside the FormBean can get the
current localization without receiveing aditional parameters?
Add a locale property to your ActionForm. Then, in the reset method set
it to the Struts locale stored in the session.
-Ted.
RODRIGO CARVALHO DOS SANTOS wrote:
Yansheng,
Thanks
Currently a definition cannot be used as a target for a html:link. You can put a
definition in a .jsp then forward to the .jsp. But calling an action to execute a
definition is pretty easy you can use
org.apache.struts.tiles.actions.DefinitionDispatcherAction with a parameter or define
your
Terry Hard to tell from a snippet of an entire site but if the definition page does
not define anything except the page.jsp and if you always have form_wrapper.jsp around
each for then you could move form_wrapper.jsp functionality to page.jsp and simplify
the design. The other way to reduce is
Dir sir,
I'm developing Web Application for Schedule Management in the company by
Struts-1.1 now.
The contents are re-displayed after registering user information.
But, if a new browser is opend, it will not those with a problem.
I think that session information remains, but i don't know how it
the example code comes from the struts-logon application
available from the struts website.
for session information you should use
Httpsession class for getting and setting session information.
i.e.
HttpSession session = request.getSession();
session.setAttribute(Constants.USER_KEY, form);
I have a JSP that contains a list of User bean, and I display that list
with all the attributes of the User bean. I use literate tag to display
it
logic:iterate id=bUser offset=offset length=length
name=vUserList indexId=rowNum scope=request
tr
tdbean:write name=bUser scope=page
Dear struts users,
I have launched a sub-project at the struts sourceforge site which provides
flow functionality for struts. Essentially it is a re-write of the struts
controller and provides a significant set of additional features. I am
currently working on finalizing the struts example and
On Mon, Aug 04,'03 (11:36 AM GMT+0800), Andy wrote:
If I do the data access part in UserDetailAction, how can I retrieve
the UserId parameter that was specified from the link part in
UserList.jsp?
request.getParameter(UserId);
--
Rick
32 matches
Mail list logo