Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts: JSP page renders incomplete!

Reply
Thread Tools

Struts: JSP page renders incomplete!

 
 
Tyler Durden
Guest
Posts: n/a
 
      04-23-2008
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"><htmlassword 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"><htmlassword 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.

 
Reply With Quote
 
 
 
 
Tyler Durden
Guest
Posts: n/a
 
      04-24-2008
Hi

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



On Apr 24, 8:01 am, Lew <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
 
Tyler Durden
Guest
Posts: n/a
 
      04-25-2008
On Apr 25, 3:05 am, Lew <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts call renders JSP, but doesn't execute Action class when doing this (short circuit) javaguy@sbcglobal.net Java 0 10-19-2007 07:05 PM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
change an attribute of all controls, before the page renders neilmcguigan@gmail.com ASP .Net 3 03-27-2006 07:51 PM
Page Renders Wrong in Firefox Wayne Wengert ASP .Net 5 04-05-2005 12:02 PM
Firefox renders .aspx page differently than .htm -- Same HTML Jason Honn ASP .Net 3 04-04-2005 01:19 PM



Advertisments