• 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

pass a variable in the URl

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

I want to pass a variable in the URL. I tries the following but its giving me an error:

function abc()
{
var iIndex = par.rowIndex;
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries?rowNumber = iIndex ";
}

Please help.
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Incorrect syntax.

It should be
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries&rowNumber ="+ iIndex;

I am assuming that iIndex is a java script variable. I am right, right?
 
Ranch Hand
Posts: 67
Mac Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Deeps Mistry wrote:Hi,

I want to pass a variable in the URL. I tries the following but its giving me an error:

function abc()
{
var iIndex = par.rowIndex;
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries?rowNumber = iIndex ";
}

Please help.



use:



if this not work then try to take it like a string and then variable and concate
 
Dhruva Mistry
Ranch Hand
Posts: 67
Mac Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam is quite right
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:Incorrect syntax.

It should be
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries&rowNumber ="+ iIndex;

I am assuming that iIndex is a java script variable. I am right, right?



Hey its working fine. I am able to see the value in the URL. But in my Action class i am getting a null value if i do this:
System.out.println("rownumber:"+request.getParameter("rowNumber"));

What should i do?

Thanks.
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Deeps Mistry wrote:Incorrect syntax.

It should be
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries&rowNumber ="+ iIndex;

I am assuming that iIndex is a java script variable. I am right, right?



Hey its working fine. I am able to see the value in the URL. But in my Action class i am getting a null value if i do this:
System.out.println("rownumber:"+request.getParameter("rowNumber"));

*EDIT*
I also tried this:
<html:hidden name="ViewChallanForm" property="iRowNumber" value="0"/>
<html:text name="Challan" property="perbox" styleId='<%="pb" + ids%>' disabled="true" size="5" onchange="calcBBSeries(this);"></html:text>

var iIndex = par.rowIndex;
alert(iIndex)
document.forms[0].iRowNumber.value = iIndex;
alert(document.forms[0].iRowNumber.value)

I am getting both the alerts correct. But when i access the hidden variable in my Action Class i get value = 0

System.out.println("rn:"+objViewChallanForm.getIRowNumber());

What should i do?




Early replies would be highly appreciated. Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a form element is disabled, the value is NOT sent to the server.

Eric
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:When a form element is disabled, the value is NOT sent to the server.

Eric



Hi,

The text box gets enabled first and then the javascript function is called. I really cannot figure out the problem.

Thanks.
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its pretty difficult to say whats going wrong looking at the code that you have posted. Could you please post the entire HTML page and Java Script?
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:Its pretty difficult to say whats going wrong looking at the code that you have posted. Could you please post the entire HTML page and Java Script?



Here is my jsp file:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el"%>
<html>
<head>

<meta name="Description"
content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Erwin Aligam - ealigam@gmail.com" />
<meta name="Robots" content="index,follow" />
<html:base />
<link rel="stylesheet" href="images/Refresh.css" type="text/css" />


<title>PEW // View Challan</title>


<style type="text/css">
<!--
a:hover {
color: #003061;
}

h2 {
color: #044A92;
}

.style1 {
color: #555;
font-size: 150%;
}
-->
</style>
<script type="text/javascript">
var req;
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->



function enableThis(checkedStr)
{
var par=checkedStr.parentNode;

while(par.nodeName.toLowerCase()!='tr')
{
par=par.parentNode;
}
qty = "qty"+ par.rowIndex;
pb = "pb"+ par.rowIndex;
nbl = "nbl"+ par.rowIndex;
dbl = "dbl"+ par.rowIndex;
bbs = "bbs"+ par.rowIndex;
document.getElementById(qty).disabled = !(checkedStr.checked);
document.getElementById(pb).disabled = !(checkedStr.checked);
document.getElementById(nbl).disabled = !(checkedStr.checked);
document.getElementById(dbl).disabled = !(checkedStr.checked);
document.getElementById(bbs).disabled = !(checkedStr.checked);


}
function submitForm()
{
document.forms[0].submit();
}



function calcBBSeries(value)

{
var par=value.parentNode;

while(par.nodeName.toLowerCase()!='tr')
{
par=par.parentNode;
}
var iIndex = par.rowIndex;
alert(iIndex)
document.forms[0].iRowNumber.value = iIndex;
alert(document.forms[0].iRowNumber.value)
//document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries";
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries&rowNumber ="+ iIndex;

document.forms[0].submit();

}
</script>

</head>

<body>
<!-- wrap starts here -->
<div id="wrap"><!--header -->
<div id="header">
<div align="left" class="float-left"></div>
<div align="center"></div>
</div>

<!-- menu -->
<div id="menu">

</div>

<!-- content-wrap starts here -->
<div id="content-wrap">

<div id="sidebar">

<h1>Challans / Invoices</h1>
<div class="left-box">

</div>

<h1>Customers / P.O.</h1>

  • <html:link action="/customer">Add/Show Customer</html:link>

  • <html:link action="/custName.do">Add a P.O.</html:link>

  • Purchase Orders


<div id="sidebar2">
<h1>Print Carton Labels</h1>
<div class="left-box"></div>
</div>
</div>
<div id="main">
<blockquote>
<h2 class="style1">Challan Entry</h2>
</blockquote>
<html:form action="/challan.do?method=getProducts">
<table border="0"
>
<tr>
<td ><label>Challan No:</label></td>
<td ><bean:write name="ViewChallanForm"
property="challanNo" /></td>

<td ><label>  Date:</label></td>
<td></td>

</tr>
<tr>
<td ><label> Customer Name:</label></td>
<td ><bean:write name="ViewChallanForm"
property="custName" /></td>
<td ><label>  A.R.E. No:</label></td>

<logic:equal name="ViewChallanForm" property="areNo" value="0">
<td>NA</td>
</logic:equal>
<logic:notEqual name="ViewChallanForm" property="areNo" value="0">
<td><bean:write name="ViewChallanForm" property="areNo" /></td>
</logic:notEqual>


</tr>
<tr>
<td><label>PONO:</label></td>
<td><bean:write name="ViewChallanForm" property="poNo" /></td>
<td><label>Last Box No.:</label></td>
<td><bean:write name="ViewChallanForm" property="lastboxno" /></td>
</tr>
</table>

<table border="0"
>

<tr>
<html:hidden name="ViewChallanForm" property="iRowNumber" value="0"/>
<td >
<div><strong>S/No.</strong></div>
</td>

<td ><strong> Products</strong></td>
<td ><strong>Quantity </strong></td>
<logic:notEqual name="ViewChallanForm" property="areNo" value="0">
<td>
<div><strong>Per box</strong></div>
</td>
<td >
<div><strong>Nos. of B/L</strong></div>
</td>
<td >
<div><strong>Boxes/Loose  </strong></div>

</td>
<td>
<div><strong>BB Series</strong></div>
</td>
</logic:notEqual>

</tr>
<%
int i = 1;
%>
<%
int ids = 1;
%>
<logic:iterate id="Challan" name="Challan">
<tr>

<td><%=i%>.</td>

<td><html:multibox name="Challan" property="checkedProducts"
styleId="multi_box" onclick="enableThis(this);">
<bean:write name="Challan" property="unit" />
</html:multibox>  <bean:write name="Challan" property="products" /></td>
<td><html:text name="Challan" property="quantity"
styleId='<%="qty" + ids%>' size="6" disabled="true" /></td>
<logic:notEqual name="ViewChallanForm" property="areNo" value="0">
<td>

<html:text name="Challan" property="perbox"
styleId='<%="pb" + ids%>' disabled="true" size="5"
onchange="calcBBSeries(this);"></html:text></td>
<td><html:text name="Challan" property="nos_BL" size="5"
styleId='<%="nbl" + ids%>' disabled="true"></html:text></td>
<td><html:select name="ViewChallanForm" property="BL"
disabled="true" styleId='<%="dbl" + ids%>'>
<html:option value="Select"></html:option>
<html:option value="Boxes"></html:option>
<html:option value="Loose"></html:option>
</html:select></td>

<td><html:text name="Challan" property="bbSeries" size="7"
styleId='<%="bbs" + ids%>' disabled="true" /></td>
</logic:notEqual>
</tr>
<%
i++;
ids++;
%>

</logic:iterate>

</table>

</html:form>

<div align="right"><html:button property="">Save</html:button></div>

 


<div align="center"></div>
</div>

<!-- content-wrap ends here --></div>

<!--footer starts here-->
<div id="footer">

 



</div>

<!-- wrap ends here --></div>

</body>
</html>


I have tried two things:
1) red color: pass a variable in URL
2) blue color: through hidden varibale.

But in both the cases i am not able to retrieve the value in my Action Class.

Thanks
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your code looks correct. At least nothing seems wrong, the second method of using a hidden variable should have worked. However it would be a lot better if you post the generated HTML code, since I can run that in my browser to see whats happening.
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:Your code looks correct. At least nothing seems wrong, the second method of using a hidden variable should have worked. However it would be a lot better if you post the generated HTML code, since I can run that in my browser to see whats happening.



Here is the generated html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>

<meta name="Description"
content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Erwin Aligam - ealigam@gmail.com" />
<meta name="Robots" content="index,follow" />
<base href="http://localhost:8080/struts-blank/pages/viewchallan.jsp">
<link rel="stylesheet" href="images/Refresh.css" type="text/css" />


<title>PEW // View Challan</title>


<style type="text/css">
<!--
a:hover {
color: #003061;
}

h2 {
color: #044A92;
}

.style1 {
color: #555;
font-size: 150%;
}
-->
</style>
<script type="text/javascript">
var req;
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->



function enableThis(checkedStr)
{
var par=checkedStr.parentNode;

while(par.nodeName.toLowerCase()!='tr')
{
par=par.parentNode;
}
qty = "qty"+ par.rowIndex;
pb = "pb"+ par.rowIndex;
nbl = "nbl"+ par.rowIndex;
dbl = "dbl"+ par.rowIndex;
bbs = "bbs"+ par.rowIndex;
document.getElementById(qty).disabled = !(checkedStr.checked);
document.getElementById(pb).disabled = !(checkedStr.checked);
document.getElementById(nbl).disabled = !(checkedStr.checked);
document.getElementById(dbl).disabled = !(checkedStr.checked);
document.getElementById(bbs).disabled = !(checkedStr.checked);


}
function submitForm()
{
document.forms[0].submit();
}

function calcBBSeries(value)

{
var par=value.parentNode;

while(par.nodeName.toLowerCase()!='tr')
{
par=par.parentNode;
}
var iIndex = par.rowIndex;
alert(iIndex)
document.forms[0].iRowNumber.value = iIndex;
alert(document.forms[0].iRowNumber.value)
//document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries";
document.forms[0].action = "http://localhost:8080/struts-blank/challan.do?method=calcBBSeries&rowNumber ="+ iIndex;

document.forms[0].submit();

}


</script>

</head>

<body>
<!-- wrap starts here -->
<div id="wrap"><!--header -->
<div id="header">
<div align="left" class="float-left"></div>
<div align="center"></div>
</div>

<!-- menu -->
<div id="menu">

</div>

<!-- content-wrap starts here -->
<div id="content-wrap">

<div id="sidebar">

<h1>Challans / Invoices</h1>
<div class="left-box">

</div>

<h1>Customers / P.O.</h1>

<div id="sidebar2">
<h1>Print Carton Labels</h1>
<div class="left-box"></div>
</div>
</div>
<div id="main">
<blockquote>
<h2 class="style1">Challan Entry</h2>
</blockquote>
<form name="ViewChallanForm" method="post" action="/struts-blank/challan.do?method=getProducts">
<table border="0"
>
<tr>
<td ><label>Challan No:</label></td>
<td >1</td>

<td ><label>  Date:</label></td>
<td></td>

</tr>
<tr>
<td ><label> Customer Name:</label></td>
<td >Air India Ltd.</td>
<td ><label>  A.R.E. No:</label></td>



<td>1</td>



</tr>
<tr>
<td><label>PONO:</label></td>
<td>40008274</td>
<td><label>Last Box No.:</label></td>
<td>0</td>
</tr>
</table>

<table border="0"
>

<tr>
<input type="hidden" name="iRowNumber" value="0">
<td >
<div><strong>S/No.</strong></div>
</td>

<td ><strong> Products</strong></td>
<td ><strong>Quantity </strong></td>

<td>
<div><strong>Per box</strong></div>
</td>
<td >
<div><strong>Nos. of B/L</strong></div>
</td>
<td >
<div><strong>Boxes/Loose  </strong></div>

</td>
<td>
<div><strong>BB Series</strong></div>
</td>


</tr>



<tr>

<td>1.</td>

<td><input type="checkbox" name="checkedProducts" value="nos." onclick="enableThis(this);" id="multi_box">  ATLAS Drawer</td>
<td><input type="text" name="quantity" size="6" value="50" disabled="disabled" id="qty1"></td>

<td>

<input type="text" name="perbox" size="5" value="0" onchange="calcBBSeries(this);" disabled="disabled" id="pb1"></td>
<td><input type="text" name="nos_BL" size="5" value="0" disabled="disabled" id="nbl1"></td>
<td><select name="BL" disabled="disabled" id="dbl1"><option value="Select" selected="selected">Select</option>
<option value="Boxes">Boxes</option>
<option value="Loose">Loose</option></select></td>

<td><input type="text" name="bbSeries" size="7" value="-" disabled="disabled" id="bbs1"></td>

</tr>



<tr>

<td>2.</td>

<td><input type="checkbox" name="checkedProducts" value="nos." onclick="enableThis(this);" id="multi_box">  Standard Units</td>
<td><input type="text" name="quantity" size="6" value="70" disabled="disabled" id="qty2"></td>

<td>

<input type="text" name="perbox" size="5" value="0" onchange="calcBBSeries(this);" disabled="disabled" id="pb2"></td>
<td><input type="text" name="nos_BL" size="5" value="0" disabled="disabled" id="nbl2"></td>
<td><select name="BL" disabled="disabled" id="dbl2"><option value="Select" selected="selected">Select</option>
<option value="Boxes">Boxes</option>
<option value="Loose">Loose</option></select></td>

<td><input type="text" name="bbSeries" size="7" value="-" disabled="disabled" id="bbs2"></td>

</tr>



<tr>

<td>3.</td>

<td><input type="checkbox" name="checkedProducts" value="nos." onclick="enableThis(this);" id="multi_box">  ATLAS Oven Cage</td>
<td><input type="text" name="quantity" size="6" value="80" disabled="disabled" id="qty3"></td>

<td>

<input type="text" name="perbox" size="5" value="0" onchange="calcBBSeries(this);" disabled="disabled" id="pb3"></td>
<td><input type="text" name="nos_BL" size="5" value="0" disabled="disabled" id="nbl3"></td>
<td><select name="BL" disabled="disabled" id="dbl3"><option value="Select" selected="selected">Select</option>
<option value="Boxes">Boxes</option>
<option value="Loose">Loose</option></select></td>

<td><input type="text" name="bbSeries" size="7" value="-" disabled="disabled" id="bbs3"></td>

</tr>



<tr>

<td>4.</td>

<td><input type="checkbox" name="checkedProducts" value="kg" onclick="enableThis(this);" id="multi_box">  ATLAS Oven Tray</td>
<td><input type="text" name="quantity" size="6" value="100" disabled="disabled" id="qty4"></td>

<td>

<input type="text" name="perbox" size="5" value="0" onchange="calcBBSeries(this);" disabled="disabled" id="pb4"></td>
<td><input type="text" name="nos_BL" size="5" value="0" disabled="disabled" id="nbl4"></td>
<td><select name="BL" disabled="disabled" id="dbl4"><option value="Select" selected="selected">Select</option>
<option value="Boxes">Boxes</option>
<option value="Loose">Loose</option></select></td>

<td><input type="text" name="bbSeries" size="7" value="-" disabled="disabled" id="bbs4"></td>

</tr>




</table>

</form>

<div align="right"><input type="button" name="" value="Save"></div>

 


<div align="center"></div>
</div>

<!-- content-wrap ends here --></div>

<!--footer starts here-->
<div id="footer">

 



</div>

<!-- wrap ends here --></div>

</body>
</html>


 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't get your code at all - however everything is still working.
You change the value of document.forms[0].iRowNumber.value in the function calcBBSeries() which is called when you enter a value for 'Per Box', the value is iRowNumber is updated and the form gets submitted - not sure why the form gets submitted here.

Also the save button is really do nothing. It neither calls a java script function nor submits the form.

You might want to re look all you functions and function calls.
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:I don't get your code at all - however everything is still working.
You change the value of document.forms[0].iRowNumber.value in the function calcBBSeries() which is called when you enter a value for 'Per Box', the value is iRowNumber is updated and the form gets submitted - not sure why the form gets submitted here.

Also the save button is really do nothing. It neither calls a java script function nor submits the form.

You might want to re look all you functions and function calls.



Hey..when i enter a value in perbox i call calcBBSeries() function and call my aciton class--->calculate my bbseries---> return back to the jsp and print it .

I have not implemented the Save functionality yet.

My concern is passing the value in the url and fetching it in my action class.

Thanks
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well when you call the calcBBSeries() the value of iRowNumber is being passed correctly. You can verify this by changing the method to 'get' instead of the default post. So nothing wrong with the value being passed.

For e.g. when I edit the 3rd row, the URL being called is

http://localhost:8080/struts-blank/challan.do?iRowNumber=3&checkedProducts=nos.&quantity=80&perbox=25&nos_BL=0&BL=Select&bbSeries=-

which is correct!
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:Well when you call the calcBBSeries() the value of iRowNumber is being passed correctly. You can verify this by changing the method to 'get' instead of the default post. So nothing wrong with the value being passed.

For e.g. when I edit the 3rd row, the URL being called is

http://localhost:8080/struts-blank/challan.do?iRowNumber=3&checkedProducts=nos.&quantity=80&perbox=25&nos_BL=0&BL=Select&bbSeries=-

which is correct!


Yeah..i am able to pass the correct value in the url but i am not able to fetch it in my java class.
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Deeps Mistry wrote:
Yeah..i am able to pass the correct value in the url but i am not able to fetch it in my java class.



Well then there is simple some thing wrong in the way your Java code is trying to retrieve the value. You might want to have a look at it again - the Java Script part is working fine. If you are still unable to root into the issue you might have to tell us exactly what you Java code is and what it is trying to do.
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Mercs wrote:

Deeps Mistry wrote:
Yeah..i am able to pass the correct value in the url but i am not able to fetch it in my java class.



Well then there is simple some thing wrong in the way your Java code is trying to retrieve the value. You might want to have a look at it again - the Java Script part is working fine. If you are still unable to root into the issue you might have to tell us exactly what you Java code is and what it is trying to do.



here is my java code:

which is getting printed as
rno: 0

Thanks
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be using request.getParameter() and not request.getAttribute()...

Why use request object in a struts application anyways. Use the form bean instead!!

Anyways, changing to request.getParameter() should do the trick!!
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tags!!

Eric
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic