Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have this in my jsp file which di

Status
Not open for further replies.

extempore

Programmer
Jun 1, 2001
71
US
I have this in my jsp file which displays several drops downs(dynamic) when the JSP is opened. The AssetName is Unique Identifier for the dropdowns. I want to capture the changed values in the dropdown (if user changes any) and send it to a servlet code where I need to call a method to update the changed value for the Asset Name. I am newbie to JSP/Servlets. I have here both the JSP code and Servlet code. Can someone correct it and post it here as I have trouble handling the values in the Servlet code. Thanks a bunch.


JsP:

int br = 1;
for (int i = 0; i < size ; i++)
{
ExportAsset extAsset = exportAsset;
if(extAsset!=null)
{
%>
<TR>
<TD align=&quot;center&quot;>
//This is the Unique identifier for the dropdowns which
//should be used by the servlet when update
<%= extAsset.getAssetName()%>
</TD>
</TR>
<SELECT name=&quot;exportType&quot;>
<OPTION value=&quot;NS&quot;><%= extAsset.getExportAssetTypeName()%>
<%
ExportAssetTypeList eatList = (ExportAssetTypeList) session.getAttribute(&quot;ExportAssetTypeList&quot;);
for(int j = 0 ; j < eatList.size(); j ++)
{
%>
<OPTION value=&quot;<%=eat.getId()%>&quot;><%=eat.getName() + &quot; (&quot; + eat.getNumAssignsAllowed() +&quot;)&quot;%>
<%
}
%>
</SELECT>
<%=(br%5 == 0)?&quot;</TR><TR>&quot;:&quot;&quot;%>
<%
br++;
}
}
%>
-------------------------------------------------
Servlet:

protected String finishTypeAssign(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

HttpSession session = request.getSession(false);
ExportAssetManager extAssMgr = new ExportAssetManager();
String selectedMediaType = request.getParameter(&quot;selectedMediaType&quot;);
String uoiIdParent = request.getParameter(&quot;uoiIdParent&quot;);

ExportAsset[] exportAsset = extAssMgr.getSelectedExportAssets(uoiIdParent, selectedMediaType);

for(int i = 0 ; i < exportAsset.length ;i ++)
{
ExportAsset expasst = exportAsset;
//Please let me know how to handle the changed values for the dropdown here
String newDropDownValue = request.getParameter(&quot;exportType&quot;);
if(newExpAssetTypeName!=null)
{
expasst.setName(newDropDownValue);
exportAsset = expasst;
}
}

extAssMgr.updateExportAssets(uoiIdParent, selectedMediaType, exportAsset);

return &quot;SUCCESS&quot;;
}
 
The 4th line in my JSP code was cut off for some reason. It should be:
ExportAsset extAsset = exportAsset;

Thanks
 
I want to capture the changed values in the dropdown (if user changes any)

Where do they change the values?

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top