Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Submit data from popup window to servlet  RSS feed

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

From a popup window (popup.jsp) I want to submit some data to a servlet. But it doesn�t seem to work on a Tomcat server, but only on my local Resin server!

Both data (URL parameter called mode) being passed in the URL and the data being submitted from some checkboxes is null when recieving them in the servlet, when using the Tomcat server.

If I log the URL from the Tomcat server it looks like this:
http://www.myDomain.com/myApp/servlet/AddParticipant?null

- and if I log the URL from the local Resin server it looks like this:
http://127.0.0.1:8080/myApp/servlet/AddParticipant?mode=add

What could the reason be?

Here is my javascript function in the popup.jsp:



[ June 21, 2007: Message edited by: Jeppe Fjord ]
[ June 21, 2007: Message edited by: Jeppe Fjord ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A window is just a window. There's no difference whether you are submitting from a popup or not.

Perhaps you could expound a bit on what you mean by "not working"?
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I log the URL from the Tomcat server it looks like this:
http://www.myDomain.com/myApp/servlet/AddParticipant?null

- and if I log the URL from the local Resin server it looks like this:
http://127.0.0.1:8080/myApp/servlet/AddParticipant?mode=add

So it seems that the parameters plus the variables is not being passed to the servlet when running the same code on my Tomcat server?!

************************************************
Here is the code I use in the servlet to generate the logged URL:
StringBuffer str = new StringBuffer();
str.append(( request.getRequestURL() ).toString() );
str.append("?");
str.append( request.getQueryString() );
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you verified (using a packet sniffer or the LiveHttpHeaders plugin for FireFox) that the querystring variable is actually being sent from the browser?
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
Have you verified (using a packet sniffer or the LiveHttpHeaders plugin for FireFox) that the querystring variable is actually being sent from the browser?


No, I haven�t tried a packet sniffer yet, but I will try that later. As a temporary solution I now submit the data from a normal page and not a popup window and that works fine.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!