aspose file tools*
The moose likes Servlets and the fly likes Calling Servlet via URL but want Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Calling Servlet via URL but want "Post" behavior

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1075
I'm passing some stuff from a Microsoft application to a Java Servlet called "dispatcher" (web server extension) like this:
lccmd='run /n7 "C:\Program Files\Internet Explorer\iexplore.exe" ;
http://'+gcWebHost+'/SomeWebApp/dispatcher+ ;
'?txtlogin='+STRTRAN(ALLTRIM(userID),' ','%20')+;
'&txtpassword='+STRTRAN(ALLTRIM(lcPassword),' ','%20')+;
'&fName='+STRTRAN(ALLTRIM(fname),' ','%20')+;
'&lName='+STRTRAN(ALLTRIM(lName),' ','%20')
Naturally, this is coming into the servlet via IE as a "GET".
This works fine, but the fields are visible in IE.
How about if I don't want the fields above to be visible in the URL?
Is there some way to send parameters to IE ... HIDDEN and not visible on the URL line?
Any advice would be greatly appreciated!!!
Thanks.
-- Mike
Ranjeet Athwal
Greenhorn

Joined: Feb 17, 2004
Posts: 1
you'd need to do a post - can do this by setting up a http session.
if this is too much of a pain (it shouldn't be), you can do the get then imediately redirect to the same page without the get parameters
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1075
The problem, I think, is that the way the URL is passed to the Servlet, it's first passed to IE from the MS application.
Is there a way around IE? IOW, can I call the servlet directly from inside a method in some other application?
Look forward to your reply.
Thanks.
-- Jim
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Using the session may not be thread-safe. I tend to use JavaScript to submit a hidden form.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Bear pointed out this is also posted in the HTML forum. Please don't cross post, it wastes the time of the people trying to help you.
I'm going to close this copy. Anyone who wants to help should see this thread.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Servlet via URL but want "Post" behavior