File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet not able to retrieve the values from jsp form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet not able to retrieve the values from jsp form" Watch "Servlet not able to retrieve the values from jsp form" New topic
Author

Servlet not able to retrieve the values from jsp form

Bhardwaj Shweta
Ranch Hand

Joined: Mar 29, 2011
Posts: 36

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.



Regards,
Shweta Bhardwaj
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

The control with the name projectname is disabled.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bhardwaj Shweta
Ranch Hand

Joined: Mar 29, 2011
Posts: 36

Thanks Bear i have fixed it but even rest of the controls are not working.
Bhardwaj Shweta
Ranch Hand

Joined: Mar 29, 2011
Posts: 36

On Button's click i am enabling these controls
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

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

Joined: Mar 29, 2011
Posts: 36

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

Joined: Jan 10, 2002
Posts: 61761
    
  67

This is a JavaScript issue ... nothing to do with JSP or Servlets.
Bhardwaj Shweta
Ranch Hand

Joined: Mar 29, 2011
Posts: 36

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

Joined: Mar 29, 2011
Posts: 36

Problem is solved by changing the type of input from Button to Submit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet not able to retrieve the values from jsp form