• 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

Reading parameter from JSP page

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

I want to read the filename from the jsp by pressing the particular button for a particular file...and pass it on to servlet. This is not working. The code given below

JSP page:





Im calling this function on clicking the button




My servlet file reading as

String filename = request.getParameter("param1");


im could not able to read the file name in servlet ...please let me know..No errors, file name is null


Thanks & Regards
shiva
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tag to post your code.and Coming to your question how you submit your form and do you get any error?
 
shivashankar matam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made some correction in my code as above....but its still not working
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


look it in your code above.you should get class cast exception right? . and do you think your javascript function is correct?
 
shivashankar matam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im reading filelist from another servlet. It works if i use a text boxt to enter the file name as below:




but requirement is pass the variable of the button clicked

how could i pass the fileName parameter in my display() function to the servlet "DisplayLog"

function display(fileName) {

//response.sendRedirect("/DisplayLog?param1=fileName");
//return false;
}


Thanks and regards
shiva
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this was my problem I would be carefully examining the actual HTML being written with the browser "view source" capability.

Even better, use Firefox plugin that can show exactly the DOM being constructed.

Bill
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Edit: thread hijack removed. Please ask your own questions in a new topic.]
reply
    Bookmark Topic Watch Topic
  • New Topic