This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading parameter from JSP page

 
shivashankar matam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • 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 Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • 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
 
sima karia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Edit: thread hijack removed. Please ask your own questions in a new topic.]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic