• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Submit data from popup window to servlet

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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() );
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic