Win a copy of Securing DevOps this week in the Security forum!

vineet varghese

Greenhorn
+ Follow
since Aug 16, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vineet varghese

i have posted it above.....userlink is a list variable
and on using the constant value "5" i get the list but not on replacing it with "cusid"
nope it gives a translation error
i am getting the parameter in my function but the query is giving the problem
i am calling the function in the following way



//if i pass a constant value it dosent show any error but on passing the variable cid it gives the following eror







hello the following is my hibernate function....i am passing a string variable as parameter to it but while using cusid in the from clause i am getting the eror

but if i hard code the value as 5 i am getting the correct output.
can someone correct me please ?
thank you
the value of the string user_id i meant ...
6 years ago
hi all
i have a String user_id ..which CHANGES on every request
and i am using PdfWriter.getInstance(document, new FileOutputStream("C:\\hello.pdf"));
to generate my pdf in ..but i the pdf should contain the user_id as a part of its name ........how can i do it ?
6 years ago
hey thank you bhanu chowdary it worked
yes i know its not a good practice but i am not using it in many places ....mostly used servlet
thanks a lot....will get more doubts
6 years ago
but i am using a loop to fetch DB value and display the value on the page.
if i insert the value itself it wont be dynamic...right ?
6 years ago
i intended the same html.
ufo.get(i).getName() gives me the data from the list that i fetched from the DB
6 years ago
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Greefies Css Template</title>
<link rel="stylesheet" type="text/css" href="style/style.css" media="screen" />

<script type="text/javascript">
function show_alert()
{
alert("Created sucessfuly ");
}
</script>
</head>
<body>





<div id="main_container">
<!-- Common Include : start -->
<div id="header">
<div id="logo"><a href="home.html"><img src="images/logo.jpg" alt="" title="" border="0" /></a></div>

<div id="menu">
<ul>
<li><a href="home.jsp" title="">Home</a></li>

<li><a href="shopping.jsp" title="">Shop Now</a></li>
<li><a href="#" title="">Order Status</a></li>
<li><a href="#" title="">Contact Us</a></li>
<li><a href="customerdetails.jsp" title=""></a></li>


</ul>
</div>
</div>
<div class="green_box">
<div class="clock">

<!-- <img src="images/clock.png" alt="" title="" /> -->
</div>
<div class="text_content">
<h1> GreenZone KiranaS </h1>
<p class="green">

</p>
</div>

<!-- <div id="right_nav">
<ul>
<li style="margin-left: 186px;">
<a title="" href="home.html"> Heloo </a>
</li>
<li style="margin-left: 186px;">
<a title="" href="home.html"></a>
</li>
<li style="margin-left: 186px;">
<a title="" href="home.html"></a>
</li>
<li style="margin-left: 186px;">
<a title="" href="home.html"></a>
</li>
<li style="margin-left: 186px;">
<a title="" href="home.html"></a>
</li>
</ul>
</div>
-->

</div><!--end of green box-->
<div id="main_content">

<div id="left_content">
<h2left>Welcome </h2left>
<p>

</p>

<div id="left_nav">
<ul>
<li><a href="productadd.jsp" title="">Add New </a></li>
<li><a href="productdeleter.jsp" title="">Delete</a></li>

<li><a href="productlist.jsp" title="">View All Products</a></li>

</ul>
</div>

<p class="clear">


</p>

</div><!--end of left content-->
<!-- Common Include : end -->
<div id="right_content">
<!-- **********Main Body : Start*********** -->

<h2right>Welcome</h2right>

<div class="products_box">
<!-- Form : start -->
<!-- First part of : start -->
<p>

<form action="purchase" method="post" name="frm">
<input type="submit" size="30" name="sub" value="Create" />
<table border=1 style="margin-left: 82px;">
<th><b>ID </th><th><b>NAME </th><th><b>CATEGORY </th><th><b>PRICE </th><tr><td><b>1</td><td><b>kissan jam</td><td><b>breakfast</td><td><b>89

<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>2</td><td><b>honey</td><td><b>breakfast</td><td><b>33
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>3</td><td><b>katchup</td><td><b>breakfast</td><td><b>34
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>4</td><td><b>cornflakes</td><td><b>breakfast</td><td><b>34
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>5</td><td><b>kellogs</td><td><b>breakfast</td><td><b>77

<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>6</td><td><b>quaker oats</td><td><b>breakfast</td><td><b>100
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>7</td><td><b>kellogs honey</td><td><b>breakfast</td><td><b>29
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>8</td><td><b>kellogs honey</td><td><b>breakfast</td><td><b>44
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>9</td><td><b>dabur honey</td><td><b>breakfast</td><td><b>60

<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>10</td><td><b>rassam powder</td><td><b>cooking</td><td><b>45
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>11</td><td><b>everest garam masala</td><td><b>cooking</td><td><b>66
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>12</td><td><b>chiken masala</td><td><b>cooking</td><td><b>88
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>13</td><td><b>chat masala</td><td><b>cooking</td><td><b>30

<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>14</td><td><b>anjeer</td><td><b>Edibles</td><td><b>100
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>15</td><td><b>butter</td><td><b>Breakfast</td><td><b>30
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>16</td><td><b>butter</td><td><b>Breakfast</td><td><b>30
<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
<tr><td><b>17</td><td><b>butter</td><td><b>Breakfast</td><td><b>30

<td><b><input type="checkbox" name="productname" style="margin-left: 22px;"value=ufo.get(i).getName()<b></b></td>
</table>













</FORM>

</p>
<!-- First part of : End -->
</div>

</p>


</div>
</div><!--end of right content-->
<!-- **********Main Body : End*********** -->


<div style=" clear:both;"></div>
</div><!--end of main content-->


<div id="footer">


<ul>
<li><a href="#"></a> </li>

<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href=></a></li>
</ul>

</div>



</div> <!--end of main container-->
</body>
</html>


HOPE this is what you want
6 years ago
heres my jsp code....purchaseis my servlet where i want the checked box values...it may not be as efficient as i am new to this..thank you



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>

<%@page
import="com.online.vineetkirana.persistence.productsDAO"%>
<%@page
import ="com.online.vineetkirana.persistence.productsHibernateDAO"%>
<%@page
import="com.online.vineetkirana.vo.products"%>




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Greefies Css Template</title>
<link rel="stylesheet" type="text/css" href="style/style.css" media="screen" />

</head>
<body>

<div id="main_container">
<!-- Common Include : start -->
<div id="header">
<div id="logo"><a href="home.html"><img src="images/logo.jpg" alt="" title="" border="0" /></a></div>
<jsp:include page="portal/common/menu.jsp"></jsp:include>
</div>
<jsp:include page="portal/common/header.jsp"></jsp:include>
<div id="main_content">
<jsp:include page="portal/common/productftSideBar.jsp"></jsp:include>
<!-- Common Include : end -->
<div id="right_content">
<!-- **********Main Body : Start*********** -->
<h2right>Welcome</h2right>

<div class="products_box">
<!-- Form : start -->
<!-- First part of : start -->
<p>

<form action="purchase" method="post" name="frm">
<input type="submit" size="30" name="sub" value="Create" />
<%
products us=new products();
productsDAO productdao =new productsHibernateDAO();

List <products> ufo= productdao.getAll_products();



out.println("<table border=1 style=\"margin-left: 82px;\">");
out.print("<th><b>ID </th>");
out.print("<th><b>NAME </th>");
out.print("<th><b>CATEGORY </th>");
out.print("<th><b>PRICE </th>");



for(int i=0;i<ufo.size();i++)
{


out.println("<tr><td><b>" + ufo.get(i).getProductid()+ "</td><td><b>" + ufo.get(i).getName() +"</td><td><b>" + ufo.get(i).getType()+"</td><td><b>"+ufo.get(i).getRate());
out.println("<td><b><input type=\"checkbox\" name=\"productname\" style=\"margin-left: 22px;\"value=ufo.get(i).getName()<b></b>/</td>");
out.println("<td><b><input type=\"checkbox\" name=\"productname\" style=\"margin-left: 22px;\"value=24<b></b></td>");

}

out.print("</table>");

out.println("");
out.println("");
out.println("");
%>

</FORM>

</p>
<!-- First part of : End -->
</div>

</p>

</div>
</div><!--end of right content-->
<!-- **********Main Body : End*********** -->


<div style=" clear:both;"></div>
</div><!--end of main content-->


<jsp:include page="portal/common/footer.jsp"></jsp:include>



</div> <!--end of main container-->
</body>
</html>
6 years ago
thank you replying to my first post paul..
yes you got it right. the first part is working fine.i have all the DB details in my jsp page right now.
i just need to get all the "Checked box" values into my servlet on clicking submit button.this is where i am facing problem
any sample code will be helpful thank you.
6 years ago
hi all.. i am dynamically populating my jsp page table from database values with checkboxes in each row..i am not able to retrieve the checkbox value into my servlet even after using getparametervalues
its just not excuting..any solution ?
the value of the checkbox is dynamic data retrieved from the DB in each loop ...with same name ..help please
6 years ago