aspose file tools*
The moose likes Struts and the fly likes Getting Object in a Form instead of Just String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting Object in a Form instead of Just String" Watch "Getting Object in a Form instead of Just String" New topic
Author

Getting Object in a Form instead of Just String

Rohit Prasad
Greenhorn

Joined: Sep 05, 2006
Posts: 12
This is how my JSP page looks like:

<% Expenses expensesBean = (Expenses)session.getAttribute("expensesBean"); %>

<logic:iterate id="expense" indexId="ind" name="expensesBean" property="myExpense">
Amount: <html:text name="expense" property="amount"/>
Location: <html:text name="expense" property="location"/>
....
....
</logic:iterate>

Here is my Expenses Class:




Here is my expense class:



How should I write my Form that can capture the Expenses object containing updated expense? Please let me know if I am not clear in my question.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

HTTP limits the values of request parameters to just strings.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Johnny Gara
Ranch Hand

Joined: Mar 09, 2007
Posts: 43
You can use EL to actually retrieve your information, using the dot operator.

something like this is possible:

Amount: ${expense.amount}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Not all web app frameworks can do this. Stripes can, but I'm not sure about Struts.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Object in a Form instead of Just String
 
Similar Threads
Indexed Properties with List of Strings
displaying data from arrays with html:text
logic iterate tag for Float array
Nested Iterator Tags
how to obtain list object from an actionform