• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

request.getparametervalues is giving null in JSp page in portlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All I am new to Portlet development

my jsp page is like this

<form action="<portlet:actionURL></portlet:actionURL>"
method="GET">
<input type="button" name="querybutton" value="CE" onclick="fillCEAttribute()"/>

<input type="button" name="querybutton" value="SE" onclick="fillSEAttribute()"/><br><br>

<select multiple="3" size="5" name="attributelist" id="attributelist">
</select><br><br>
<input type="submit" value="Get Attribute" name="name" />
</form>
<%
String list[]=request.getParametervalues("attributelist");
out.print(list[0]);
%>


But it is giving out.print(list[0]) it is giving null please help

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does this one do? Can you post the javascript code for it here?

 
Malik Ehsanullah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html>
<head>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.io.*"%>
<%-- Uncomment below lines to add portlet taglibs to jsp
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>

<portlet:defineObjects />
<%PortletPreferences prefs = renderRequest.getPreferences();%>
--%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:defineObjects />
<script language="JavaScript" type="text/JavaScript" >

var ceattribute= new Array("WorstRespTime","CEAppDir","TotalCPUs","MaxRunningJobs","CE","WaitingJobs","MaxCPUTime","LRMSVersion","MaxTotalJobs","CEStatus","LRMS","CEVOs","AssignedJobSlots","FreeCPUs","RunningJobs","EstRespTime","FreeJobSlots","Cluster","TotalJobs","Priority","CEDefaultSE","JobManager","MaxWCTime","CloseCE","CloseSE","SMPSize","Processor","OSVersion","VMemory","CFP2000","TmpDir","OSRelease","ClockSpeed","LogicalCPU","OutboundIP","OS","Tag","CINT2000","WNTmpDir","CPUVendor","PhysicalCPU","InboundIP","Memory","VORunningJobs","VOTotalJobs","VOWorstRespTime","VOEstRespTime","VOCEVOs","VOFreeJobSlots","VOWaitingJobs");

var seattribute= new Array("AvailableSpace","Path","SEVOs","UsedSpace","SESite","SEType","SEArch","SEName","SE","Protocol");
var buttonselected="ce";
function fillCEAttribute()
{
document.getElementById('attributelist').length = 0;
buttonselected="ce";
for (var i=0; i < ceattribute.length;++i)
{
if(i==0)
addOption(document.getElementById("attributelist"), ceattribute[i], ceattribute[i],true);
else
addOption(document.getElementById("attributelist"), ceattribute[i], ceattribute[i],false);
}
}

function fillSEAttribute()
{
buttonselected="se";
document.getElementById('attributelist').length = 0;
for (var i=0; i < seattribute.length;++i)
{
if(i==0)
addOption(document.getElementById("attributelist"), seattribute[i], seattribute[i],true);
else
addOption(document.getElementById("attributelist"), seattribute[i], seattribute[i],false);
}

}
function addOption(selectbox, value, text,selected)
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
optn.selected=selected;
selectbox.options.add(optn);
}
function showAttribute()
{

}
</script>
</head>

<body onload="fillCEAttribute();">
<!--<form action="<portlet:actionURL><portlet:param name="page" value="Helloworld2.jsp"/></portlet:actionURL>"-->
<form action="<portlet:actionURL></portlet:actionURL>"
method="GET">
<input type="button" name="querybutton" value="CE" onclick="fillCEAttribute()"/>

<input type="button" name="querybutton" value="SE" onclick="fillSEAttribute()"/><br><br>

<select multiple="3" size="5" name="attributelist" id="attributelist">
</select><br><br>
<input type="submit" value="Get Attribute" name="name" />
</form>
<%
String list=request.getParameter("attributelist");
out.print(list);
%>



</body></html>
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as Lifery is concern . Your Form method should be POST . So just try keeping your form method as Post and try . []

Cheers,
Saumil
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic