This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Submit from to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Submit from to a servlet" Watch "Submit from to a servlet" New topic
Author

Submit from to a servlet

Vinodh Kaliya
Greenhorn

Joined: Nov 05, 2009
Posts: 2
I have a form that needs to submit its data to a servlet . The servlet has been defined in the web.xml . The form lies in a webpage that is not part of the url-pattern that has been described in the web.xml .

What should i put in my action so that upon pressing the submit button the data will be sent to the servlet ?

<Form Method="Get" Action=" ? ">
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

The context path for the application followed by the mapping for the servlet.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

welcome to javaranch
Vinodh Kaliya
Greenhorn

Joined: Nov 05, 2009
Posts: 2
Thanks for the help Bear-B. It is working now. So to access the servlet (if there are multiple servlets also) then we use their appropriate mapping that pertains to that servlet.

hi Seetharaman.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Yes, that is the whole purpose of the mapping.
Soumya Rout
Ranch Hand

Joined: Aug 06, 2009
Posts: 49

Mention the servlet name name in the form action.

Like if your servlet name is Demo and url-pattern .do then write <form method="GET/POST" action="Demo.do">

Try it ..

If still problem then reply .

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Soumya Rout wrote:Mention the servlet name name in the form action.

He already reported that it's working. Why are you adding more info, and that's not even accurate?
 
 
subject: Submit from to a servlet
 
Similar Threads
Requested Resource Not Found Error
Busy indicator in HTML
debugjsp servlet
multisubmit
disabling submit button not working