?
Solved

struts dropdown lists

Posted on 2011-02-10
1
Medium Priority
?
902 Views
Last Modified: 2012-05-11
i used to parse xml values and display in the jsp form...
they are displaing well ...

when i change the values I am getting all changed values to my
action class when i use struts...

but problem with dropdown lists...

I had attached my code for drop down list of the jsp page...

let me know whether my syntax is correct or not...


along with this there are many textboxes and radio buttons no problem for
thing I am getting all values in the action form except for this dropdown
lists... I am alwaays getting value "T" even though if I select "F"...

so how should it be solved.....
my jsp code....


<td align="right">apple: </td> 
	<td>
		<% if (request.getAttribute("apple_value").equals("T")) 
		{
		%>
		<select id="apple" name="apple">
		<option value ="T" name="apple" selected ="yes">True</option>
		<option value ="T" name ="apple" >False</option>
		</select>
		</td>
		<%
		}
		else
		{
		%>
		<select id="apple" name="apple">
		<option value ="T" name="apple" >True</option>
		<option value ="T" name ="apple" selected ="yes">False</option>
		</select>
		</td>
		<%
		}
		%>
<td align="right">grape: </td> 
	<td>
		<% if (request.getAttribute("grape_value").equals("T")) 
		{
		%>
			<select id="grape" name="grape">
		<option value ="T" name="grape" selected ="yes">True</option>
		<option value ="T" name ="grape" >False</option>
		</select>
		</td>
		<%
		}
		else
		{
		%>
		<select id="grape" name="grape">
		<option value ="T" name="grape" >True</option>
		<option value ="T" name ="grape" selected ="yes">False</option>
		</select>
		</td>
		<%
		}
		%>

Open in new window

0
Comment
Question by:shragi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
aciuica earned 2000 total points
ID: 34865706
You should change the value of the second option to "F".
Instead of:
<option value ="T" name="apple" selected ="yes">True</option>
<option value ="T" name ="apple" >False</option>
you need:
<option value ="T" name="apple" selected ="yes">True</option>
<option value ="F" name ="apple" >False</option>
0

Featured Post

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question