Solved

Java SERVLETS---How to handle multiple forms in same servlet

Posted on 2003-11-27
4
333 Views
Last Modified: 2010-05-18
Hi,
I'm trying to write a web service program,and am invoking a JAX-RPC client and SAAJ client through one servlet at the user interface.Now,i want to split the functionality and have the result of JAX-RPC display its result when the first "submit"  button is hit.When this response is generated , a new form should be created on the same page which will call the SAAJ client when the submit button on the second form is hit.(i.e the same servlet handles calling SAAJ client but it calling the SAAJ depends on the response generated by the JAX-RPC) .

I'm new to the whole web services thing as well as servlets...so any help will be appreciated.
Thanks
S
0
Comment
Question by:srik18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9830886
Your servlet will be able to determine which form was used to call it by checking any parameter from the request that will be unique to the form.

If you don't have something obvious that you can use with the forms you already have, just add a hidden form field to each form that can be used for the identification.
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9831046
I believe jimjack is right but you should not control both forms from the same servlet, just make 2 servlets one for each form it will take some headeaches from you.
0
 
LVL 19

Assisted Solution

by:Kuldeepchaturvedi
Kuldeepchaturvedi earned 125 total points
ID: 9831124
I would go with Jimmack's idea... Because its more in line MVC.... you should not create more controllers( servlets) if you can avoid them...

may be you can attach a hidden field named as origin.... and then servlet can check the value of Origin.. by doing a String origin=request.getParameter("origin"); and then determine the next action as
if(origin!=null && origin.equals("SAAJ"))
{
dothis();
}else
{
doThat();
}
Hope this helps
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9831176
>>I'm new to the whole web services thing as well as servlets...so any help will be appreciated.

Sincerely I don't think for the comments that srick18 is trying to implement MVC but I agree with you if that is what he's doing.

Javier
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
problem with  angularjs dropdwon search at object property (name) level 2 107
parse example 13 95
excpetion with multiple catch 11 133
Java Script nested call 3 88
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question