Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

can any body tell how to store check box value in session

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have list of pagging 1 to 10.all the pagging have check box.if user check first 2 record and i am storing the value in session.and user click the second page the session value is overwrited can any body tell the solution?

my requirment is i have to store all the checked box value in session from first page and second page so on..the last page checked value only storing in session

my coding is

String id[]=request.getParameterValues("chkbox");
session.setAttribute("chkid",id);

thanks in advance
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vijaykumar,
Is you click on next page link or button going to a servlet where you are getting the parameters and storing them in the session and the forwarding to the same jsp showing next set of records?
If yes the after getting the parameters you have to check if the attribute
chkbox is already bound to the session, if it is bound you have to add the newly checked elements to the originally stored ones, and the save in session scope with same name. Saving the checked elements as a List would be a beter idea then saving it as an array.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am including pagging.jsp in managenewsletter.jsp

<jsp:include page="pagging.jsp">
<jsp:param name="totalRecords" value="${recordcount}"/>
<jsp:param name="currentPage" value="${param.pageNo}"/>
<jsp:param name="recordsPerPage" value="10"/>
<jsp:param name="formname" value="frmnewsletter"/>
<jsp:param name="pageParam" value="pageNo"/>
<jsp:param name="linkSytle" value="button"/>
<jsp:param name="buttonClass" value="button2"/>
</jsp:include>


pagging.jsp
will create link 1 2 3

can anybody tell how to submit the managenewsletter.jsp at the time clicking the link?
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't you just use JavaScript to submit the page when the link is clicked?
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am calling fnsubmit() from pagging.jsp


managenewsletter.jsp

function fnsubmit()
{
url=" managenewsletter.jsp";
document.frmnewsletter.action=url;
document.frmnewsletter.method="post";
document.frmnewsletter.submit();
}

i am not able to get the check box value
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly please make sure you use code tags while posting your code.Unformatted code is difficult to read and results in less response for your post. Read this for more information. You can edit your current post to add code tags by clicking .

I am not getting hold of your problem, you need to tell more details.
On which page is the "chkbox" ? And do you get a null in the id[]?
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic