aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes request.getParameter 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 » Engineering » HTML, CSS and JavaScript
Bookmark "request.getParameter" Watch "request.getParameter" New topic


Jim Shapt

Joined: Dec 13, 2004
Posts: 10

I'm using a <%=request.getParameter("nameresults")%> and this lists all the names that I asked for. Is there a way to list the names down the page like this? -


Instead of like this, look below-

RESULTS: Jeff; Becky; Joe; Janice;


[ December 14, 2004: Message edited by: Jim Shapt ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60046

You'll need to break up the string into its components and then it's a simple matter of using the appropriate HTML markup be it <p>'s <div>'s <br/>'s or tables.
[ December 14, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60046

If it is the string parsing that is giving you problems, rather than the HTML markup to achieve your goal, check out the StringTokenizer class, or perhaps the String.split() method. If this is where your problems lie, perhaps this topic would have been better moved to one of the java in general forums (I originally thought it was the markup you were having problems with).

If this is the case, please ask Eric (this forum's bartender) to move the post accordingly.
[ December 15, 2004: Message edited by: Bear Bibeault ]
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Originally posted by Jim Shapt:



Hi Jim,

Well...Am I correct in understanding your requirement? You get the
"nameresult" and wish to display items, one after the other.

How about this?

1. Say, you have a table, from which you query for names.
2. The result is returned, with say 5 names.
3. Now, put these names into an ArrayList.
4. Pass the ArrayList as a request parameter to the JSP
5. Get the passed ArrayList and Iterate it.
6. Write the elements of the ArrayList as table data in new rows of
a table.

This would give display, one below the other.

If it would be in a single line, remove all the <tr>s and have a single <tr>, with many <td>s.

Hope it helps you.

It is sorta covered in the JavaRanch Style Guide.
subject: request.getParameter
Similar Threads
CVS to Subversion Migration
error code when executing BatchUpdate
getParameter and the URLEncoder
Latest From Sun 1.4
Question about Properties