• 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

httpunit ampersand problem in javascript

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Has anyone come across this before?

I've got an httpunit test that calls click() on a link whose url is a call to a javascript function with one parameter. (eg "javascript:cancel('123')".

This script then concats the param onto the end of a url string that already contains a param.
(eg

function cancel(id) {
var requestAction = 'myAction.do?method=viewAction&pcnApplicationId=' + id;
...
)

This string is then set as the action of a struts form and submitted.

My problem is that the final parameter is cut off! A getUrl on the resulting WebResponse returns "http://..../'myAction.do?method=viewAction".

It seems to be the ampersand that's the problem!

Any suggestions appreciated.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the ampersand rendered into the HTML as just "&" or "&"?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic