Jsp代码中ComboBox的帮助

Jsp代码中ComboBox的帮助,jsp,netbeans,Jsp,Netbeans,以下是填充combobox的.jsp代码: <% { List <String> lststringIncidentIds = new ArrayList <String>(); lststringIncidentIds.clear(); String AllIds; AllIds = ""; for (int i =0; i<wp.size();i++) { AllIds = ""; //1st work produc

以下是填充combobox的.jsp代码:

   <%
  {
  List <String> lststringIncidentIds = new ArrayList <String>();
  lststringIncidentIds.clear();
  String AllIds;
  AllIds = "";

  for (int i =0; i<wp.size();i++)
  {

 AllIds = "";
//1st work product
WorkProduct wpa;
wpa = wp.get(i);

//Metadata of Work Product
PackageMetadataType pms;
pms = wpa.getPackageMetadata();

IdentificationType Elementa;
pms.getPackageMetadataExtensionAbstract().get(0).getValue();

Elementa = (IdentificationType) 
wp.get(i).getPackageMetadata().getPackageMetadataExtensionAbstract().get(0).getValue();
AllIds = Elementa.getIdentifier().getValue();
lststringIncidentIds.add(AllIds);
out.println("Incident ID: " + i + " " +AllIds + "<br>"); 

你好,世界!
组合框不会作为其swing组件显示在浏览器中,但
代码将帮助你理解差异…试试看。。。

您能告诉我上述问题的解决方案吗
<body>
  <h1>Hello World!</h1>
     <%
       JFrame f;
       JComboBox cmbox;
       JPanel panel;


       //ComboBox b= new ComboBox();
       String course[] = {"BCA","MCA","PPC","CIC"};
       cmbox = new JComboBox(course);
       panel = new JPanel();
       panel.add(cmbox);
       //panel.setSize(400,400);
      //panel.setVisible(true);
       f=new JFrame("My Frame");
       f.add(panel);
       f.setSize(400,300);
       f.setVisible(true);
       %>

     </body>
      the combobox will not appear in the browser as its a swing component but this   

      code will help u understand the difference....try it...