This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply 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: 56554
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56554
    
  14

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: 56554
    
  14

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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Submit from to a servlet
 
Similar Threads
Busy indicator in HTML
multisubmit
disabling submit button not working
Requested Resource Not Found Error
debugjsp servlet