File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet not able to retrieve the values from jsp form

 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a jsp page and one servlet. I want to retrieve form's(which is in jsp) values and then save in my database through servlet.
But in servlet somehow my request is not getting processed.

//jsp page


// servlet


The value of String str1 = request.getParameter("projectname") is coming out to be NULL,hence i am not able to store the values in my tables.


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The control with the name projectname is disabled.

 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear i have fixed it but even rest of the controls are not working.
 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Button's click i am enabling these controls
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting .disabled to false does not enable the field. You need to remove the attribute. If the attribute exists on the elment, the element is disabled regardless of the value of the attribute.

I recommend using jQuery. It knows how to do the right thing in a cross browser manner:
 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey Bear thanks for the quick reply.I am new to jsp n servlets and alien to Jquery.. i will try to fix is by removing disable option.
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a JavaScript issue ... nothing to do with JSP or Servlets.
 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now i have removed javascript thing and removed "disable".But it's still not working. can you suggest some solution?

Thanks
 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem is solved by changing the type of input from Button to Submit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic