You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Young <mi...@e-mage.com.au> on 2004/08/22 10:38:40 UTC

Creating List Catgeories from a Single Collection

I have a collection that contains the following data:
EmpId	CourseId	Date_Taken	Assessment
1234	1		01/01/2000	PASS
1234	2		01/02/2001	PASS
1234	4		01/05/2002	PASS
1234	1		01/04/2003	PASS
1432	1		01/06/2002	PASS
1432	2		01/08/2004	PASS
1432	1		01/06/2004	PASS

I would like to display the data as follows:
EmpID: 1234
CourseID	Date_Taken	Assessment
1		01/01/2000	PASS
1		01/04/2003	PASS
2		01/02/2001	PASS
4		01/05/2002	PASS
EmpID:1432
1		01/06/2002	PASS
1		01/06/2004	PASS
2		01/08/2004	PASS

I have looked at the display tag library but this will not produce this
output.
I have also looked at the taglibs-iterator library but can't see how I 
would use this with bean collections (without writing lots of jsp)
I have also looked at nested - but all the examples seem to use two
collections to iterate around.

Whats the most efficient / best way of acheiving my end output?  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTTP status 500 - No input attribute for mapping path /login

Posted by Erik Weber <er...@mindspring.com>.
Sounds to me like your action mapping element for the login action (in 
struts-config.xml) is missing the "input" attribute. Struts uses this to 
decide what page to return to if you have a form failure (caused by 
invalid input, for example).

Erik


Chris wrote:

>Howdy , 
>
>I am using Struts 1.1 and TC5, my web app throw an exception:
>
>HTTP status 500 - No input attribute for mapping path /login
>(No more Exception stack printed)
>
>I couldn't find solution by googling. Would you please give me 
>a hint?
>
>Regards.
>Chris
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTTP status 500 - No input attribute for mapping path /login

Posted by Erik Weber <er...@mindspring.com>.
Sounds to me like your action mapping element for the login action (in
struts-config.xml) is missing the "input" attribute. Struts uses this to
decide what page to return to if you have a form failure (caused by
invalid input, for example).

Erik


Chris wrote:

>Howdy , 
>
>I am using Struts 1.1 and TC5, my web app throw an exception:
>
>HTTP status 500 - No input attribute for mapping path /login
>(No more Exception stack printed)
>
>I couldn't find solution by googling. Would you please give me 
>a hint?
>
>Regards.
>Chris
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: HTTP status 500 - No input attribute for mapping path /login

Posted by Robert Taylor <rt...@mulework.com>.
It seems that you have this action path set to validate user input.
When validation fails, Struts looks in its action mapping for the input
attribute value which tells it where to go when validation fails.
Apparently you don't have an input attribute defined for your
/login action mapping.

robert

> -----Original Message-----
> From: Chris [mailto:jakarta-struts-usr@SoftHome.net]
> Sent: Sunday, August 22, 2004 7:24 AM
> To: Struts Users Mailing List
> Subject: HTTP status 500 - No input attribute for mapping path /login
> 
> 
> 
> Howdy , 
> 
> I am using Struts 1.1 and TC5, my web app throw an exception:
> 
> HTTP status 500 - No input attribute for mapping path /login
> (No more Exception stack printed)
> 
> I couldn't find solution by googling. Would you please give me 
> a hint?
> 
> Regards.
> Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


HTTP status 500 - No input attribute for mapping path /login

Posted by Chris <ja...@SoftHome.net>.
Howdy , 

I am using Struts 1.1 and TC5, my web app throw an exception:

HTTP status 500 - No input attribute for mapping path /login
(No more Exception stack printed)

I couldn't find solution by googling. Would you please give me 
a hint?

Regards.
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Creating List Catgeories from a Single Collection

Posted by Kishore Senji <ks...@gmail.com>.
> I have a collection that contains the following data:
> EmpId   CourseId        Date_Taken      Assessment
> 1234    1               01/01/2000      PASS
> 1234    2               01/02/2001      PASS
> 1234    4               01/05/2002      PASS
> 1234    1               01/04/2003      PASS
> 1432    1               01/06/2002      PASS
> 1432    2               01/08/2004      PASS
> 1432    1               01/06/2004      PASS
> 
> I would like to display the data as follows:
> EmpID: 1234
> CourseID        Date_Taken      Assessment
> 1               01/01/2000      PASS
> 1               01/04/2003      PASS
> 2               01/02/2001      PASS
> 4               01/05/2002      PASS
> EmpID:1432
> 1               01/06/2002      PASS
> 1               01/06/2004      PASS
> 2               01/08/2004      PASS
> 

How about <logic:iterate/>
First you have to sort your collection on EmpID, then 

<bean:define id="id" value="0" />
<table border="1" style="border-collapse:collapse;" bordercolor="#336699">
<logic:iterate id="employee" name="employeeCollection">
	<logic:notEqual name="employee" property="id" value="<%=id%>">
	<tr><td colspan="3">
	EmpID: <bean:write name="employee" property="id" />
	</td></tr>
	<tr><td>CourseID</td><td>Date_Taken</td><td>Assessment</td></tr>
	<%id = String.valueOf(((Employee)pageContext.getAttribute("employee")).getId());%>
	</logic:notEqual>
	<logic:equal name="employee" property="id" value="<%=id%>">
		<tr><td><bean:write name="employee" property="courseId" /></td><td>
		<bean:write name="employee" property="dateTaken" /></td><td>
		<bean:write name="employee" property="assessment" /></td></tr>
	</logic:equal>
</logic:iterate>
</table>

Where employeeCollection has the collection of employees,

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org