Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

pdk-struts-html:select  RSS feed

Jenni Hou
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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/">
<td>Products and Services</td>
<html:select property="productServiceStr" size="1">
<html ptionsCollection property="productServiceList" value="value" label="name"/>
<td><html:text property="lid" /></td>

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.


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!