Results 1 to 2 of 2
- 07-13-2011, 04:37 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
Struts: How to display a grid in Struts??
Hi again!
i',m having some problem to display a simple grid in struts,because i can't use java code on the jsp
this is my struts config:
<form-bean name="CreaAreaForm" type="it.tbr.form.CreaAreaForm"/>
<action path="/creaArea"
type="it.tbr.action.CreaAreaAction"
name="CreaAreaForm"
scope="session"
validate="true"
input="/area.jsp">
<forward name="success" path="/area.jsp"/>
</action>
------------------
this is my jsp:(is just a part,only to suggest you how i'm working)
<html:form action="/creaArea" method="post">
<td><html:text name="CreaAreaForm" property="width" /><html:errors property="width" />
<td><html:text name="CreaAreaForm" property="height" /><html:errors property="height"/> </td>
<input type="submit" name="search" class="art-button" value="Creazione "/>
In my CreaGridForm i have
private int height;
private int width;
with all get and set
and my CreaGridAction
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
CreaAreaForm caf=(CreaAreaForm)form;
for(int y=0; y<caf.getWidth(); y++){
for(int x=0; x<caf.getHeight(); x++){
session.setAttribute("x", x);
session.setAttribute("y", y);
caf.setHeight((Integer) session.getAttribute("y"));
caf.setWidth((Integer) session.getAttribute("x"));
but now my problem.. i don't know how to view the grid on my jsp ,because
with <bean:write name="CreaAreaForm" property="height" /> and
<bean:write name="CreaAreaForm" property="width" />
i saw only the number that i submit.
So if in my jsp i submit
h: 2
w:2
i need to view 4 cells
Hope you've understood me and that someone can help me^^"Last edited by fabbero; 07-13-2011 at 04:48 PM.
- 07-13-2011, 05:18 PM #2
Just use html. Struts has not special widgets for build user interface.
Skype: petrarsentev
http://TrackStudio.com
Similar Threads
-
decorator.jsp problem building Struts Menu in JSP when Struts action is used
By dkirvan in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 04-29-2010, 05:33 AM -
how to display a jsp by struts.xml
By kirtichopra2003 in forum Advanced JavaReplies: 1Last Post: 09-14-2009, 10:29 AM -
Struts 2 paging problem using display tag...?
By prabhurangan in forum Web FrameworksReplies: 0Last Post: 07-02-2008, 08:20 AM -
foreach in jstl to display nested colums-struts jsp
By adil7 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 02-11-2008, 06:19 AM -
how to display image in jsp page(Struts)
By rama6262 in forum Advanced JavaReplies: 1Last Post: 12-21-2007, 07:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks