• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

pdk-struts-html:select

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to portal area. My current project needs to use struts framework to design a java application as a portlet. The problem I am facing is, I can't pass the selected value of a dropdown box to the next portal page, it kept giving me null.

My jsp looks like:

<%@page contentType="text/html; charset=windows-1252"%>

<%@ taglib uri="/WEB-INF/pdk-struts-html.tld" prefix="html" %>
<html:form action="/portal/TransferPricingSearch.do">
<table>
<tr>
<td>Products and Services</td>
<td>
<html:select property="productServiceStr" size="1">
<html ptionsCollection property="productServiceList" value="value" label="name"/>
</html:select>
</td>
</tr>
<tr>
<td>LID</td>
<td><html:text property="lid" /></td>
</tr>
</table>
<html:submit/>
</html:form>

And my search action who handles submit looks like:

public class TransferPricingSearchAction extends Action
{
Logger logger = Logger.getLogger(this.getClass().getName());

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
logger.debug("Entering TransferPricingSearchAction");
TransferPricingHomeForm TPHomeForm = (TransferPricingHomeForm)form;
String productServiceStr = TPHomeForm.getProductServiceStr();
String lidStr = TPHomeForm.getLid();
logger.debug("lidStr: " + lidStr);
logger.debug("productServiceStr: " + productServiceStr);
return (mapping.findForward(productServiceStr ));
}
}

Right now, the log file indicates that the value of productServiceStr which is the dropdown always returns null when I try to go to the next portal page. However, the value of lid which uses the html:text tag pass value fine.

Does anyone has similar problems, it seems to me it is the tag problem. But I have no idea how to fix it.


Thanks

Jenni
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic