Current location: Hot Scripts Forums » Programming Languages » Everything Java » Urgent Help on logic:iterate


Urgent Help on logic:iterate

Reply
  #1 (permalink)  
Old 01-11-04, 04:03 AM
yymae yymae is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Question Urgent Help on logic:iterate

Hi,

I'm new to struts logic:iterate tag, please help me out on this problem I have.
The problem is I want to list out all the employee listing in the logic:iterate tag. The codes in employeelist.jsp as below :-

Code:
<% taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"/>
<% taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"/>
<% taglib uri="/WEB-INF/struts-html.tld" prefix="html"/>

<logic:iterate id="employee" name="employees">
<bean:write name="employee" property="name" />
<bean:write name="employee" property="email" />
</logic:iterate>
And the code in struts-config.xml as below :-

Code:
<action-mappings type="org.apache.struts.action.ActionMapping">
<action path="/EmployeeList" scope="request" type="com.wrox.EmployssListAction">
<forward name="success" path="/employeelist.jsp">
</action>
</action-mappings>
When I try to load employeelist.jsp it gives me an error "Cannot find bean employees in any scope"
What is the problem here ? I'm new to struts and jsp, please give some examples and advice ASAP

Thanks in advance.


Cheers,
yymae

Last edited by Nico; 12-31-06 at 06:12 AM. Reason: Please use [code] wrappers when posting code.
Reply With Quote
  #2 (permalink)  
Old 01-11-04, 07:51 AM
rik_sherman rik_sherman is offline
New Member
 
Join Date: Jan 2004
Location: UK Manchester
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
First I'm new to these forums so I could be way off track but, it looks like you're post should be directed at the javascript forum.

Rik
Reply With Quote
  #3 (permalink)  
Old 02-11-04, 01:46 PM
test test is offline
Newbie Coder
 
Join Date: Sep 2003
Location: Here
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Hi, I think you need to add a name attribute to your config.xml action path node in order to map the your action form to your action
i.e. - <action path="/EmployeeList" name="com.something.someActionForm" scope="request" type="com.wrox.EmployssListAction">

Othwise struts does not associate that for to that action.

Hope that helps!


I'm new to struts logic:iterate tag, please help me out on this problem I have.
The problem is I want to list out all the employee listing in the logic:iterate tag. The codes in employeelist.jsp as below :-

Code:
<% taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"/>
<% taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"/>
<% taglib uri="/WEB-INF/struts-html.tld" prefix="html"/>

<logic:iterate id="employee" name="employees">
<bean:write name="employee" property="name" />
<bean:write name="employee" property="email" />
</logic:iterate>
And the code in struts-config.xml as below :-
Code:
<action-mappings type="org.apache.struts.action.ActionMapping">
<action path="/EmployeeList" scope="request" type="com.wrox.EmployssListAction">
<forward name="success" path="/employeelist.jsp">
</action>
</action-mappings>
When I try to load employeelist.jsp it gives me an error "Cannot find bean employees in any scope"
What is the problem here ? I'm new to struts and jsp, please give some examples and advice ASAP

Thanks in advance.


Cheers,
yymae[/QUOTE]

Last edited by Nico; 12-31-06 at 06:13 AM. Reason: Please use [code] wrappers when posting code.
Reply With Quote
  #4 (permalink)  
Old 11-17-06, 03:11 AM
java_kishan java_kishan is offline
New Member
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
solve it ...

i thing u didn't set the attribute employees in the request of the action class...
Reply With Quote
  #5 (permalink)  
Old 11-17-06, 03:16 AM
java_kishan java_kishan is offline
New Member
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
before calling that collection we have to set it to the request in the action class..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please review this site Urgent! jesifra Website Reviews 14 05-18-04 10:09 AM
URGENT! Shutdown Server by web URGENT! ironz Script Requests 1 03-07-04 01:29 PM
URGENT ASSISTANCE: Checkedboxes to access ShyLoVe* ASP 2 11-26-03 01:56 AM
Dynamic Button - Urgent kamlesh_nadar ASP.NET 1 11-08-03 12:26 AM
Urgent Help on solution phreak PHP 0 10-20-03 11:31 AM


All times are GMT -5. The time now is 05:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.