aspose file tools*
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
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: 61658
    
  67

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: 61658
    
  67

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: 61658
    
  67

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