Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request.getparametervalues is giving null in JSp page in portlets

 
Malik Ehsanullah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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

 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • 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
  • 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>
 
saumil baxi
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic