Struts: JSP page renders incomplete!

Discussion in 'Java' started by Tyler Durden, Apr 23, 2008.

  1. Tyler Durden

    Tyler Durden Guest

    Hi everybody,
    I'm using Struts 2.
    I have a simple jsp page that must show this:

    [A small form to add a new user to db]
    [A list of current users (a very small list, around 5 rows in db)]

    I read the list from db and store it as "allUsers" in request. Here's
    my jsp code:

    The code for the small Add User form:
    ------------------------------------------------------
    <html:form action="/addUser" focus="username">
    <TABLE border="0" style="border-style: dotted; border-
    width: 1" title="Enter new user information" width="179">
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Username:</Td>
    <TD align="right"><html:text property="username"
    tabindex="1"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Password:</Td>
    <TD align="right"><html:password property="password1"
    redisplay="false" tabindex="2"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Confirm Password:</
    Td>
    <TD align="right"><html:password property="password2"
    redisplay="false" tabindex="3"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Name:</Td>
    <TD align="right"><html:text property="name"
    tabindex="4"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="130">Surname:</Td>
    <TD align="right"><html:text property="family"
    tabindex="5"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="130">Email:</Td>
    <TD align="right"><html:text property="email"
    tabindex="6"/></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="130">Group:</Td>
    <TD align="right"><html:text property="group"
    tabindex="7"/></TD>

    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <td></td>
    <td><html:submit value="Add User" tabindex="8"/
    ><html:reset value="Clear" tabindex="8"/></td>

    </TR>

    </TABLE>
    </html:form>
    <table>
    <tr>
    <td nowrap="" align="left">
    <html:errors/>
    </td>
    </tr>
    </table>
    --------------------------------------------------------------------------------------

    And the code for populating a table with current users information:

    --------------------------------------------------------------------------------------
    <table border="1">
    <tr>
    <td>Username</td>
    <td>Name</td>
    <td>Surname</td>
    <td>Email</td>
    <td>Group</td>
    <td>Last Login</td>
    </tr>

    <logic:iterate id="userinfo" name="allUsers">
    <tr>
    <td><bean:write name="userinfo" property="username"/></
    td>
    <td><bean:write name="userinfo" property="name"/></td>
    <td><bean:write name="userinfo" property="family"/></
    td>
    <td><bean:write name="userinfo" property="email"/></
    td>
    <td><bean:write name="userinfo" property="group"/></
    td>
    <td><bean:write name="userinfo" property="lastlogin"/
    ></td>

    </tr>
    </logic:iterate>

    </table>
    --------------------------------------------------------------------------------------

    And here's the problem:
    The out put page is not rendered completely and I just get it until
    the second row of my Add User form!!!! I'm confused!

    1. What does my form has to do with a table that is coming after it?
    2. Why the table is not rendered?

    Here's the output html:
    --------------------------------------------------------------------------------------
    <form name="addUserForm" method="post" action="/herb1.0/
    addUser.do">
    <TABLE border="0" style="border-style: dotted; border-
    width: 1" title="Enter new user information" width="179">
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Username:</Td>
    <TD align="right"><input type="text" name="username"
    tabindex="1" value=""></TD>
    </TR>
    <TR style="border-style: dotted; border-width: 0px">
    <Td align="left" nowrap width="80">Password:</Td>

    <TD align="right"><input type="password"
    name="password1" tabindex="2" value=""></TD>
    </TR>
    <
    --------------------------------------------------------------------------------------

    It's just truncated after the second row of the form.
    I'm stuck. I'd greatly appreciate if someone give me a clue.

    Thanks.
     
    Tyler Durden, Apr 23, 2008
    #1
    1. Advertising

  2. Tyler Durden

    Tyler Durden Guest

    Hi

    You mean it will be solved if I use the new tags?



    On Apr 24, 8:01 am, Lew <> wrote:
    > Tyler Durden wrote:
    > > I'm using Struts 2.

    >
    > Are you sure? You show only Struts 1 tags in your example.
    >
    > tag <logic:iterate>
    > <http://struts.apache.org/1.3.8/struts-taglib/tlddoc/logic/iterate.html>
    >
    > tag <s:iterator>
    > <http://struts.apache.org/2.0.11.1/docs/iterator.html>
    >
    > --
    > Lew
     
    Tyler Durden, Apr 24, 2008
    #2
    1. Advertising

  3. Tyler Durden

    Tyler Durden Guest

    On Apr 25, 3:05 am, Lew <> wrote:
    > Please, please, please, please, please do not top-post.
    >
    > TylerDurdenwrote:
    > >>> I'm using Struts 2.

    > Lew wrote:
    > >> Are you sure? You show only Struts 1 tags in your example.

    >
    > >> tag <logic:iterate>
    > >> <http://struts.apache.org/1.3.8/struts-taglib/tlddoc/logic/iterate.html>

    >
    > >> tag <s:iterator>
    > >> <http://struts.apache.org/2.0.11.1/docs/iterator.html>TylerDurdenwrote:

    > > You mean it will be solved if I use the new tags?

    >
    > No, I do not mean that. I mean,
    >
    > > Are you sure? You show only Struts 1 tags in your example.

    >
    > You could check your code and see what the answer is. You could try things to
    > see if they work. I do not know enough if changing the tags will help. For
    > one thing, I don't know the answer to the question I asked, since for some
    > reason you didn't answer it.
    >
    > --
    > Lew


    Oops, sorry for the top-post.
    About the code. The fact is that I'm new to struts, so I really don't
    know how to use those new tags, but I will learn. For now, my problem
    is solved. I just moved my data table to the top of the page and form
    to the bottom and now it works!! :O
    I'll look for the reason.
    Thanks anyway. :)
     
    Tyler Durden, Apr 25, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Honn
    Replies:
    3
    Views:
    3,242
    Teemu Keiski
    Apr 4, 2005
  2. Wayne  Wengert

    Page Renders Wrong in Firefox

    Wayne Wengert, Apr 4, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    1,255
    Wayne Wengert
    Apr 5, 2005
  3. Jurgen
    Replies:
    5
    Views:
    681
    William Brogden
    Aug 19, 2003
  4. Matthias Nietz
    Replies:
    1
    Views:
    3,456
    VisionSet
    Nov 12, 2003
  5. Replies:
    0
    Views:
    601
Loading...

Share This Page